diff options
author | Max Kellermann <max@duempel.org> | 2016-03-10 09:27:07 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-03-10 20:32:43 +0100 |
commit | 5ffb82993ecf27ea1493771281d19f90fa73c46c (patch) | |
tree | 15dc9db438216f6c1f4b355b0127f783074845cb /src/Main.cxx | |
parent | 07add0bd91b4f772f2895cd201edc615101a7fc3 (diff) |
IdleMonitor: new class to replace GlobalEvents::IDLE
Use MaskMonitor to eliminate duplicate code.
Diffstat (limited to 'src/Main.cxx')
-rw-r--r-- | src/Main.cxx | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index 39b48be80..7bbcd59d7 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -365,21 +365,16 @@ initialize_decoder_and_player(void) buffered_before_play); } -/** - * Handler for GlobalEvents::IDLE. - */ -static void -idle_event_emitted(void) +void +Instance::OnIdle(unsigned flags) { /* send "idle" notifications to all subscribed clients */ - unsigned flags = idle_get(); - if (flags != 0) - instance->client_list->IdleAdd(flags); + client_list->IdleAdd(flags); if (flags & (IDLE_PLAYLIST|IDLE_PLAYER|IDLE_MIXER|IDLE_OUTPUT) && - instance->state_file != nullptr) - instance->state_file->CheckModified(); + state_file != nullptr) + state_file->CheckModified(); } #ifndef ANDROID @@ -517,8 +512,6 @@ static int mpd_main_after_fork(struct options options) try { Error error; - instance->global_events.Register(GlobalEvents::IDLE, idle_event_emitted); - if (!ConfigureFS(error)) { LogError(error); return EXIT_FAILURE; |