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)

Public Types

enum class Backend { Auto, PipeWire, PulseAudio, SDL }

Properties

Public Functions

DragonAudioOutput::Backend backend() const
bool muted() const
qreal volume() const

Public Slots

void setMuted(bool muted)
void setVolume(qreal linearGain)

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 linear gain in the range 0.0 to 1.0. Applications using a logarithmic volume scale should convert before setting it, as DragonPlayer does for its QMediaPlayer-compatible API.

See also DragonPlayer::audioOutput().

Member Type Documentation

enum class DragonAudioOutput::Backend

The audio backend used for output.

ConstantValueDescription
DragonAudioOutput::Backend::Auto0Probe the available backends and select the best one.
DragonAudioOutput::Backend::PipeWire1Output through a PipeWire stream.
DragonAudioOutput::Backend::PulseAudio2Output through PulseAudio.
DragonAudioOutput::Backend::SDL3Output through an SDL3 audio device.

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:

bool muted() const
void setMuted(bool muted)

Notifier signal:

void mutedChanged(bool muted)

volume : qreal

The linear output gain, from 0.0 (silent) to 1.0 (full volume).

Access functions:

qreal volume() const
void setVolume(qreal linearGain)

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 linearGain)

Sets the output gain to linearGain, in the range 0.0 to 1.0.

Note: Setter function for property volume.

See also volume().

qreal DragonAudioOutput::volume() const

Returns the linear output gain, 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.