chiark / gitweb /
update control buttons directly from state bits
[disorder] / lib / eclient.h
index dd8d9bad0f4b5bb204cd1f9d10477e2d293661d5..ba813759e5680e4c624e72e2b4a50cdd2f3f5689 100644 (file)
@@ -106,9 +106,29 @@ typedef struct disorder_eclient_log_callbacks {
 /** @brief Random play is enabled */
 #define DISORDER_RANDOM_ENABLED   0x00000002
 
-/** @brief Track is paused */
+/** @brief Track is paused
+ *
+ * This is only meaningful if @ref DISORDER_PLAYING is set
+ */
 #define DISORDER_TRACK_PAUSED     0x00000004
 
+/** @brief Track is playing
+ *
+ * This can be set even if the current track is paused (in which case @ref
+ * DISORDER_TRACK_PAUSED) will also be set.
+ */
+#define DISORDER_PLAYING    0x00000008
+
+/** @brief Connected to server
+ *
+ * By connected it is meant that commands have a reasonable chance of being
+ * processed soon, not merely that a TCP connection exists - for instance if
+ * the client is still authenticating then that does not count as connected.
+ */
+#define DISORDER_CONNECTED        0x00000010
+
+char *disorder_eclient_interpret_state(unsigned long statebits);
+
 struct queue_entry;
 struct kvp;
 struct sink;
@@ -142,6 +162,8 @@ disorder_eclient *disorder_eclient_new(const disorder_eclient_callbacks *cb,
 void disorder_eclient_close(disorder_eclient *c);
 /* Close C */
 
+unsigned long disorder_eclient_state(const disorder_eclient *c);
+
 void disorder_eclient_polled(disorder_eclient *c, unsigned mode);
 /* Should be called when c's FD is readable and/or writable, and in any case
  * from time to time (so that retries work). */
@@ -290,6 +312,10 @@ int disorder_eclient_search(disorder_eclient *c,
                             const char *terms,
                             void *v);
 
+int disorder_eclient_nop(disorder_eclient *c,
+                         disorder_eclient_no_response *completed,
+                         void *v);
+
 #endif
 
 /*