command: allow clients to subscribe to specific idle events

The client may provide the names of idle events as arguments to the
"idle" command to inform MPD that it is only interested in these
events.
This commit is contained in:
Marc Pavot
2008-11-22 13:26:21 +01:00
committed by Max Kellermann
parent 976d5045c6
commit 0bad84066b
5 changed files with 60 additions and 20 deletions

View File

@@ -30,6 +30,18 @@
static unsigned idle_flags;
static pthread_mutex_t idle_mutex = PTHREAD_MUTEX_INITIALIZER;
static const char *const idle_names[] = {
"database",
"stored_playlist",
"playlist",
"player",
"mixer",
"output",
"options",
"elapsed",
NULL
};
void
idle_add(unsigned flags)
{
@@ -54,3 +66,9 @@ idle_get(void)
return flags;
}
const char*const*
idle_get_names(void)
{
return idle_names;
}