Mixer: add class MixerListener

Use a listener interface instead of GlobalEvents.
This commit is contained in:
Max Kellermann
2014-02-05 23:20:33 +01:00
parent f4f8fa7c94
commit 8d6fedf817
24 changed files with 144 additions and 74 deletions

View File

@@ -22,6 +22,7 @@
#include "Playlist.hxx"
#include "output/MultipleOutputs.hxx"
#include "mixer/Listener.hxx"
#include "PlayerControl.hxx"
struct Instance;
@@ -32,7 +33,7 @@ class SongLoader;
* A partition of the Music Player Daemon. It is a separate unit with
* a playlist, a player, outputs etc.
*/
struct Partition {
struct Partition final : private MixerListener {
Instance &instance;
struct playlist playlist;
@@ -46,6 +47,7 @@ struct Partition {
unsigned buffer_chunks,
unsigned buffered_before_play)
:instance(_instance), playlist(max_length),
outputs(*this),
pc(outputs, buffer_chunks, buffered_before_play) {}
void ClearQueue() {
@@ -188,6 +190,10 @@ struct Partition {
* Synchronize the player with the play queue.
*/
void SyncWithPlayer();
private:
/* virtual methods from class MixerListener */
virtual void OnMixerVolumeChanged(Mixer &mixer, int volume) override;
};
#endif