output/Internal: move the AudioOutputSource to struct AudioOutputControl

This commit is contained in:
Max Kellermann
2017-05-23 00:03:06 +02:00
parent 58683f02ec
commit 613dd67784
7 changed files with 41 additions and 82 deletions
+20 -2
View File
@@ -20,6 +20,7 @@
#ifndef MPD_OUTPUT_CONTROL_HXX
#define MPD_OUTPUT_CONTROL_HXX
#include "Source.hxx"
#include "AudioFormat.hxx"
#include "thread/Thread.hxx"
#include "thread/Cond.hxx"
@@ -56,6 +57,11 @@ class AudioOutputControl {
*/
AudioOutputClient &client;
/**
* Source of audio data.
*/
AudioOutputSource source;
/**
* The error that occurred in the output thread. It is
* cleared whenever the output is opened successfully.
@@ -327,7 +333,9 @@ public:
*/
void LockRelease() noexcept;
void SetReplayGainMode(ReplayGainMode _mode) noexcept;
void SetReplayGainMode(ReplayGainMode _mode) noexcept {
source.SetReplayGainMode(_mode);
}
/**
* Caller must lock the mutex.
@@ -345,10 +353,20 @@ public:
const MusicPipe &mp,
bool force) noexcept;
/**
* Did we already consumed this chunk?
*
* Caller must lock the mutex.
*/
gcc_pure
bool IsChunkConsumed(const MusicChunk &chunk) const noexcept;
gcc_pure
bool LockIsChunkConsumed(const MusicChunk &chunk) const noexcept;
void ClearTailChunk(const MusicChunk &chunk) noexcept;
void ClearTailChunk(const MusicChunk &chunk) {
source.ClearTailChunk(chunk);
}
void LockPlay() noexcept;
void LockDrainAsync() noexcept;