Partition: use CallbackMaskMonitor, replacing class GlobalEvents::Monitor

This commit is contained in:
Max Kellermann
2016-03-10 22:44:34 +01:00
parent 483daa5882
commit 5ca6026787
10 changed files with 30 additions and 191 deletions

View File

@@ -20,6 +20,7 @@
#ifndef MPD_PARTITION_HXX
#define MPD_PARTITION_HXX
#include "event/MaskMonitor.hxx"
#include "GlobalEvents.hxx"
#include "queue/Playlist.hxx"
#include "queue/Listener.hxx"
@@ -41,7 +42,7 @@ class SongLoader;
struct Partition final : QueueListener, PlayerListener, MixerListener {
Instance &instance;
GlobalEvents::Monitor global_events;
CallbackMaskMonitor<Partition> global_events;
struct playlist playlist;
@@ -54,6 +55,8 @@ struct Partition final : QueueListener, PlayerListener, MixerListener {
unsigned buffer_chunks,
unsigned buffered_before_play);
void EmitGlobalEvent(GlobalEvents::Event event);
void EmitIdle(unsigned mask);
void ClearQueue() {
@@ -215,6 +218,9 @@ private:
/* virtual methods from class MixerListener */
virtual void OnMixerVolumeChanged(Mixer &mixer, int volume) override;
/* callback for #global_events */
void OnGlobalEvent(unsigned mask);
};
#endif