MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
MultipleOutputs Class Reference

`#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
| 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
| 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
| Returns the "elapsed_time" stamp of the most recently finished chunk. More...
gcc_pure int | GetVolume () const
| Returns the average volume of all available mixers (range 0..100). More...
bool | SetVolume (unsigned volume)
| Sets the volume on all available mixers. More...
gcc_pure int | GetSoftwareVolume () const
| Similar to GetVolume(), but gets the volume only for software mixers. More...
void | SetSoftwareVolume (unsigned volume)
| Similar to SetVolume(), but sets the volume only for software mixers. More...

## Detailed Description

Definition at line 47 of file MultipleOutputs.hxx.

## Constructor & Destructor Documentation

MultipleOutputs::MultipleOutputs | ( | MixerListener & | _mixer_listener | ) |

Load audio outputs from the configuration file and initialize them.

MultipleOutputs::~MultipleOutputs | ( |  | ) |

## Member Function Documentation

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.

Returns
  the number of chunks to play left in the MusicPipe

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.

gcc_pure AudioOutput* MultipleOutputs::FindByName | ( | const char * | name | ) | const

Returns the audio output device with the specified name.

Returns nullptr if the name does not exist.

const AudioOutput& MultipleOutputs::Get | ( | unsigned | i | ) | const
| inline

Returns the "i"th audio output device.

Definition at line 95 of file MultipleOutputs.hxx.

AudioOutput& MultipleOutputs::Get | ( | unsigned | i | ) |
| inline

Definition at line 101 of file MultipleOutputs.hxx.

gcc_pure SignedSongTime MultipleOutputs::GetElapsedTime | ( |  | ) | const
| inline

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.

gcc_pure int MultipleOutputs::GetSoftwareVolume | ( |  | ) | const

Similar to GetVolume(), but gets the volume only for software mixers.

See software_mixer_plugin. This function fails if no software mixer is configured.

gcc_pure int MultipleOutputs::GetVolume | ( |  | ) | const

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.

Parameters

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

Parameters

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

void MultipleOutputs::SetSoftwareVolume | ( | unsigned | volume | ) |

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.

bool MultipleOutputs::SetVolume | ( | unsigned | volume | ) |

Sets the volume on all available mixers.

Parameters

  volume | the volume (range 0..100)

Returns
  true on success, false on failure

gcc_pure unsigned MultipleOutputs::Size | ( |  | ) | const
| inline

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.

The documentation for this class was generated from the following file:

- output/MultipleOutputs.hxx