DragonAudioOutput Class
Audio output controls, wrapping the active audio backend. More...
| Header: | #include <DragonAudioOutput> |
| CMake: | find_package(DragonMediaBackend REQUIRED COMPONENTS DragonMediaBackend)target_link_libraries(mytarget PRIVATE DragonMediaBackend::DragonMediaBackend) |
| In QML: | DragonAudioOutput |
Public Types
| enum class | Backend { Auto, PipeWire, PulseAudio, SDL, Null } |
Properties
Public Functions
Public Slots
Signals
| void | mutedChanged(bool muted) |
| void | volumeChanged() |
Detailed Description
DragonAudioOutput exposes volume and mute controls for the audio pipeline, together with the backend that was selected at runtime. It is created by DragonPlayer and accessed through DragonPlayer::audioOutput.
volume() takes a perceptual volume value in the range 0.0 to 1.0. It is mapped logarithmically to the linear gain applied by the audio backend, so mid-range values yield a much lower linear gain (0.5 maps to roughly 15% amplitude).
See also DragonPlayer::audioOutput.
Member Type Documentation
enum class DragonAudioOutput::Backend
The audio backend used for output.
| Constant | Value | Description |
|---|---|---|
DragonAudioOutput::Backend::Auto | 0 | Probe the available backends and select the best one. |
DragonAudioOutput::Backend::PipeWire | 1 | Output through a PipeWire stream. |
DragonAudioOutput::Backend::PulseAudio | 2 | Output through PulseAudio. |
DragonAudioOutput::Backend::SDL | 3 | Output through an SDL3 audio device. |
DragonAudioOutput::Backend::Null | 4 | A null audio sink that produces no sound (fallback). |
Property Documentation
[read-only] backend : const Backend
The audio backend this output uses. This property is constant.
Access functions:
| DragonAudioOutput::Backend | backend() const |
muted : bool
Whether audio output is muted. Muting is independent of volume().
Access functions:
Notifier signal:
| void | mutedChanged(bool muted) |
volume : qreal
The perceptual volume, from 0.0 (silent) to 1.0 (full volume). Mapped logarithmically to the linear gain applied by the audio backend.
Access functions:
Notifier signal:
| void | volumeChanged() |
Member Function Documentation
DragonAudioOutput::Backend DragonAudioOutput::backend() const
Returns the audio backend in use. If Auto was requested, this is the backend that was selected after probing.
Note: Getter function for property backend.
bool DragonAudioOutput::muted() const
Returns true if audio output is muted.
Note: Getter function for property muted.
See also setMuted().
[signal] void DragonAudioOutput::mutedChanged(bool muted)
Emitted when the output is muted or unmuted, with the new state in muted.
Note: Notifier signal for property muted.
[slot] void DragonAudioOutput::setMuted(bool muted)
Mutes the output if muted is true, otherwise unmutes it.
Note: Setter function for property muted.
See also muted().
[slot] void DragonAudioOutput::setVolume(qreal volume)
Sets the volume to volume, in the range 0.0 to 1.0. The value is mapped logarithmically to the linear gain applied by the audio backend.
Note: Setter function for property volume.
See also volume().
qreal DragonAudioOutput::volume() const
Returns the perceptual volume, from 0.0 to 1.0.
Note: Getter function for property volume.
See also setVolume().
[signal] void DragonAudioOutput::volumeChanged()
Emitted when the output volume changes.
Note: Notifier signal for property volume.