MPD: AudioOutputSource Class Reference

MPD 0.20.15

Public Member Functions
AudioOutputSource Class Reference

Source of audio data to be played by an AudioOutput. More...

`#include <Source.hxx>`

## Public Member Functions
void | SetReplayGainMode (ReplayGainMode _mode)
bool | IsOpen () const
const AudioFormat & | GetInputAudioFormat () const
AudioFormat | Open (AudioFormat audio_format, const MusicPipe &_pipe, PreparedFilter *prepared_replay_gain_filter, PreparedFilter *prepared_other_replay_gain_filter, PreparedFilter *prepared_filter)
void | Close () noexcept
void | Cancel () noexcept
bool | Fill (Mutex &mutex)
| Ensure that ReadTag() or PeekData() return any input. More...
const Tag * | ReadTag () noexcept
| Reads the Tag to be processed. More...
ConstBuffer< void > | PeekData () const noexcept
| Returns the remaining filtered PCM data be played. More...
void | ConsumeData (size_t nbytes) noexcept
| Mark portions of the PeekData() return value as "consumed". More...
bool | IsChunkConsumed (const MusicChunk &chunk) const noexcept
void | ClearTailChunk (const MusicChunk &chunk) noexcept

## Detailed Description

Source of audio data to be played by an AudioOutput.

It receives MusicChunk instances from a MusicPipe (via SharedPipeConsumer). It applies configured filters, ReplayGain and returns plain PCM data.

Definition at line 49 of file Source.hxx.

## Member Function Documentation

## ◆ Cancel()

void AudioOutputSource::Cancel | ( |  | ) |
| noexcept

## ◆ ClearTailChunk()

void AudioOutputSource::ClearTailChunk | ( | const MusicChunk & | chunk | ) |
| inlinenoexcept

Definition at line 190 of file Source.hxx.

## ◆ Close()

void AudioOutputSource::Close | ( |  | ) |
| noexcept

## ◆ ConsumeData()

void AudioOutputSource::ConsumeData | ( | size_t | nbytes | ) |
| noexcept

Mark portions of the PeekData() return value as "consumed".

## ◆ Fill()

bool AudioOutputSource::Fill | ( | Mutex & | mutex | ) |

Ensure that ReadTag() or PeekData() return any input.

Throws std::runtime_error on error

Parameters

  mutex | the Mutex which protects the SharedPipeConsumer; it is locked by the caller, and may be unlocked temporarily by this method

Returns
  true if any input is available, false if the source has (temporarily?) run empty

## ◆ GetInputAudioFormat()

const AudioFormat& AudioOutputSource::GetInputAudioFormat | ( |  | ) | const
| inline

Definition at line 130 of file Source.hxx.

## ◆ IsChunkConsumed()

bool AudioOutputSource::IsChunkConsumed | ( | const MusicChunk & | chunk | ) | const
| inlinenoexcept

Definition at line 184 of file Source.hxx.

## ◆ IsOpen()

bool AudioOutputSource::IsOpen | ( |  | ) | const
| inline

Definition at line 126 of file Source.hxx.

## ◆ Open()

AudioFormat AudioOutputSource::Open | ( | AudioFormat | audio_format,
|  | const MusicPipe & | _pipe,
|  | PreparedFilter * | prepared_replay_gain_filter,
|  | PreparedFilter * | prepared_other_replay_gain_filter,
|  | PreparedFilter * | prepared_filter
| ) |  |

## ◆ PeekData()

ConstBuffer<void> AudioOutputSource::PeekData | ( |  | ) | const
| inlinenoexcept

Returns the remaining filtered PCM data be played.

The caller shall use ConsumeData() to mark portions of the return value as "consumed".

Be sure to call Fill() successfully before calling this metohd.

Definition at line 175 of file Source.hxx.

## ◆ ReadTag()

const Tag* AudioOutputSource::ReadTag | ( |  | ) |
| inlinenoexcept

Reads the Tag to be processed.

Be sure to call Fill() successfully before calling this metohd.

Definition at line 161 of file Source.hxx.

## ◆ SetReplayGainMode()

void AudioOutputSource::SetReplayGainMode | ( | ReplayGainMode | _mode | ) |
| inline

Definition at line 122 of file Source.hxx.

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

- output/Source.hxx