47 float volume()
const override;
Enums::ElementType ElementType
Abstract base class for all graphical circuit elements.
bool isMuted() const
Returns true if audio output is muted.
virtual void startAudio()=0
Starts hardware playback (called from play() when m_hasOutputDevice is true).
static constexpr float kDefaultVolume
float volume() const override
Returns the audio playback volume (0.0–1.0).
void mute(const bool mute=true)
Mutes or unmutes audio according to mute.
void refresh() override
Refreshes the visual appearance based on the current input state.
bool isPlaying() const
Returns true if audio is currently playing.
void setVolume(float vol) override
Sets the audio playback volume to vol (0.0–1.0).
virtual void applyVolume()=0
Applies the current m_volume to the hardware backend.
AudioOutputElement(ElementType type, QGraphicsItem *parent=nullptr, float initialVolume=kDefaultVolume)
virtual void stopAudio()=0
Stops hardware playback (called from stop() when m_hasOutputDevice is true).
virtual void applyMute()=0
Applies the current m_muted state to the hardware backend.
GraphicElement(ElementType type, QGraphicsItem *parent=nullptr)
Constructs a graphic element of the given type, fetching all properties from the metadata registry.
int type() const override
Returns the custom type identifier for this item.