output/Client: new interface to replace direct access to class PlayerControl

This commit is contained in:
Max Kellermann
2016-12-14 12:14:57 +01:00
parent d2e47e014a
commit ccb45b6f6e
9 changed files with 93 additions and 42 deletions

View File

@@ -20,6 +20,7 @@
#ifndef MPD_PLAYER_CONTROL_HXX
#define MPD_PLAYER_CONTROL_HXX
#include "output/Client.hxx"
#include "AudioFormat.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
@@ -96,7 +97,7 @@ struct player_status {
SongTime elapsed_time;
};
struct PlayerControl {
struct PlayerControl final : AudioOutputClient {
PlayerListener &listener;
MultipleOutputs &outputs;
@@ -527,6 +528,15 @@ public:
double GetTotalPlayTime() const {
return total_play_time;
}
/* virtual methods from AudioOutputClient */
void ChunksConsumed() override {
LockSignal();
}
void ApplyEnabled() override {
LockUpdateAudio();
}
};
#endif