From a3e3d2c9506d17b3e19e205535ec263ee75178c9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 14 Oct 2008 22:38:14 +0200 Subject: command: added command "idle" "idle" waits until something noteworthy happens on the server, e.g. song change, playlist modified, database updated. This allows clients to keep up to date without polling. --- src/client.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/client.h') diff --git a/src/client.h b/src/client.h index 0d9f2e76a..50238d9f0 100644 --- a/src/client.h +++ b/src/client.h @@ -21,6 +21,7 @@ #include "gcc.h" +#include #include #include #include @@ -60,4 +61,17 @@ void client_vprintf(struct client *client, const char *fmt, va_list args); */ mpd_fprintf void client_printf(struct client *client, const char *fmt, ...); +/** + * Adds the specified idle flags to all clients and immediately sends + * notifications to all waiting clients. + */ +void client_manager_idle_add(unsigned flags); + +/** + * Checks whether the client has pending idle flags. If yes, they are + * sent immediately and "true" is returned". If no, it puts the + * client into waiting mode and returns false. + */ +bool client_idle_wait(struct client *client); + #endif -- cgit v1.2.3