MPD
0.20.15
|
#include <MultipleOutputs.hxx>
Public Member Functions | |
MultipleOutputs (MixerListener &_mixer_listener) | |
Load audio outputs from the configuration file and initialize them. More... | |
~MultipleOutputs () | |
void | Configure (EventLoop &event_loop, const ReplayGainConfig &replay_gain_config, AudioOutputClient &client) |
gcc_pure unsigned | Size () const noexcept |
Returns the total number of audio output devices, including those which are disabled right now. More... | |
const AudioOutput & | Get (unsigned i) const |
Returns the "i"th audio output device. More... | |
AudioOutput & | Get (unsigned i) |
gcc_pure AudioOutput * | FindByName (const char *name) const noexcept |
Returns the audio output device with the specified name. More... | |
void | EnableDisable () |
Checks the "enabled" flag of all audio outputs, and if one has changed, commit the change. More... | |
void | Open (const AudioFormat audio_format, MusicBuffer &_buffer) |
Opens all audio outputs which are not disabled. More... | |
void | Close () |
Closes all audio outputs. More... | |
void | Release () |
Closes all audio outputs. More... | |
void | SetReplayGainMode (ReplayGainMode mode) |
void | Play (MusicChunk *chunk) |
Enqueue a MusicChunk object for playing, i.e. More... | |
unsigned | Check () |
Checks if the output devices have drained their music pipe, and returns the consumed music chunks to the #music_buffer. More... | |
void | Pause () |
Puts all audio outputs into pause mode. More... | |
void | Drain () |
Drain all audio outputs. More... | |
void | Cancel () |
Try to cancel data which may still be in the device's buffers. More... | |
void | SongBorder () |
Indicate that a new song will begin now. More... | |
gcc_pure SignedSongTime | GetElapsedTime () const noexcept |
Returns the "elapsed_time" stamp of the most recently finished chunk. More... | |
gcc_pure int | GetVolume () const noexcept |
Returns the average volume of all available mixers (range 0..100). More... | |
bool | SetVolume (unsigned volume) noexcept |
Sets the volume on all available mixers. More... | |
gcc_pure int | GetSoftwareVolume () const noexcept |
Similar to GetVolume(), but gets the volume only for software mixers. More... | |
void | SetSoftwareVolume (unsigned volume) noexcept |
Similar to SetVolume(), but sets the volume only for software mixers. More... | |
Definition at line 47 of file MultipleOutputs.hxx.
MultipleOutputs::MultipleOutputs | ( | MixerListener & | _mixer_listener | ) |
Load audio outputs from the configuration file and initialize them.
MultipleOutputs::~MultipleOutputs | ( | ) |
void MultipleOutputs::Cancel | ( | ) |
Try to cancel data which may still be in the device's buffers.
unsigned MultipleOutputs::Check | ( | ) |
Checks if the output devices have drained their music pipe, and returns the consumed music chunks to the #music_buffer.
void MultipleOutputs::Close | ( | ) |
Closes all audio outputs.
void MultipleOutputs::Configure | ( | EventLoop & | event_loop, |
const ReplayGainConfig & | replay_gain_config, | ||
AudioOutputClient & | client | ||
) |
void MultipleOutputs::Drain | ( | ) |
Drain all audio outputs.
void MultipleOutputs::EnableDisable | ( | ) |
Checks the "enabled" flag of all audio outputs, and if one has changed, commit the change.
|
noexcept |
Returns the audio output device with the specified name.
Returns nullptr if the name does not exist.
|
inline |
Returns the "i"th audio output device.
Definition at line 95 of file MultipleOutputs.hxx.
|
inline |
Definition at line 101 of file MultipleOutputs.hxx.
|
inlinenoexcept |
Returns the "elapsed_time" stamp of the most recently finished chunk.
A negative value is returned when no chunk has been finished yet.
Definition at line 189 of file MultipleOutputs.hxx.
|
noexcept |
Similar to GetVolume(), but gets the volume only for software mixers.
See software_mixer_plugin. This function fails if no software mixer is configured.
|
noexcept |
Returns the average volume of all available mixers (range 0..100).
Returns -1 if no mixer can be queried.
void MultipleOutputs::Open | ( | const AudioFormat | audio_format, |
MusicBuffer & | _buffer | ||
) |
Opens all audio outputs which are not disabled.
Throws #std::runtime_error on error.
audio_format | the preferred audio format |
_buffer | the #music_buffer where consumed MusicChunk objects should be returned |
void MultipleOutputs::Pause | ( | ) |
Puts all audio outputs into pause mode.
Most implementations will simply close it then.
void MultipleOutputs::Play | ( | MusicChunk * | chunk | ) |
Enqueue a MusicChunk object for playing, i.e.
pushes it to a MusicPipe.
Throws #std::runtime_error on error (all closed then).
chunk | the MusicChunk object to be played |
void MultipleOutputs::Release | ( | ) |
Closes all audio outputs.
Outputs with the "always_on" flag are put into pause mode.
void MultipleOutputs::SetReplayGainMode | ( | ReplayGainMode | mode | ) |
|
noexcept |
Similar to SetVolume(), but sets the volume only for software mixers.
See software_mixer_plugin. This function cannot fail, because the underlying software mixers cannot fail either.
|
noexcept |
Sets the volume on all available mixers.
volume | the volume (range 0..100) |
|
inlinenoexcept |
Returns the total number of audio output devices, including those which are disabled right now.
Definition at line 88 of file MultipleOutputs.hxx.
void MultipleOutputs::SongBorder | ( | ) |
Indicate that a new song will begin now.