chiark / gitweb /
protogen: a bit more generated docs tidying
[disorder] / lib / client-stubs.h
index 231238a06c04bcdbd259940d52f79dd7c752fe43..1962df2799ddfa5163ac0acd19121158c980788c 100644 (file)
@@ -1,6 +1,11 @@
+/*
+ * Automatically generated file, see scripts/protocol
+ *
+ * DO NOT EDIT.
+ */
 /*
  * This file is part of DisOrder.
- * Copyright (C) 2010 Richard Kettlewell
+ * Copyright (C) 2010-11 Richard Kettlewell
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  */
 #ifndef CLIENT_STUBS_H
 #define CLIENT_STUBS_H
+/** @file lib/client-stubs.h
+ * @brief Generated client API
+ *
+ * Don't include this file directly - use @ref client.h instead.
+ */
 
 /** @brief Adopt a track
  *
@@ -57,18 +67,22 @@ int disorder_allfiles(disorder_client *c, const char *dir, const char *re, char
  *
  * The confirmation string must have been created with 'register'.  The username is returned so the caller knows who they are.
  *
+ * @param c Client
  * @param confirmation Confirmation string
  * @return 0 on success, non-0 on error
  */
 int disorder_confirm(disorder_client *c, const char *confirmation);
+
 /** @brief Log in with a cookie
  *
  * The cookie must have been created with 'make-cookie'.  The username is returned so the caller knows who they are.
  *
+ * @param c Client
  * @param cookie Cookie string
  * @return 0 on success, non-0 on error
  */
 int disorder_cookie(disorder_client *c, const char *cookie);
+
 /** @brief Delete user
  *
  * Requires the 'admin' right.
@@ -200,6 +214,41 @@ int disorder_length(disorder_client *c, const char *track, long *lengthp);
  */
 int disorder_make_cookie(disorder_client *c, char **cookiep);
 
+/** @brief Move a track
+ *
+ * Requires one of the 'move mine', 'move random' or 'move any' rights depending on how the track came to be added to the queue.
+ *
+ * @param c Client
+ * @param track Track ID or name
+ * @param delta How far to move the track towards the head of the queue
+ * @return 0 on success, non-0 on error
+ */
+int disorder_move(disorder_client *c, const char *track, long delta);
+
+/** @brief Move multiple tracks
+ *
+ * Requires one of the 'move mine', 'move random' or 'move any' rights depending on how the track came to be added to the queue.
+ *
+ * @param c Client
+ * @param target Move after this track, or to head if ""
+ * @param ids List of tracks to move by ID
+ * @param nids Length of ids
+ * @return 0 on success, non-0 on error
+ */
+int disorder_moveafter(disorder_client *c, const char *target, char **ids, int nids);
+
+/** @brief List recently added tracks
+ *
+ * 
+ *
+ * @param c Client
+ * @param max Maximum tracks to fetch, or 0 for all available
+ * @param tracksp Recently added tracks
+ * @param ntracksp Number of elements in tracksp
+ * @return 0 on success, non-0 on error
+ */
+int disorder_new_tracks(disorder_client *c, long max, char ***tracksp, int *ntracksp);
+
 /** @brief Do nothing
  *
  * Used as a keepalive.  No authentication required.
@@ -242,6 +291,28 @@ int disorder_pause(disorder_client *c);
  */
 int disorder_play(disorder_client *c, const char *track, char **idp);
 
+/** @brief Play multiple tracks
+ *
+ * Requires the 'play' right.
+ *
+ * @param c Client
+ * @param target Insert into queue after this track, or at head if ""
+ * @param tracks List of track names to play
+ * @param ntracks Length of tracks
+ * @return 0 on success, non-0 on error
+ */
+int disorder_playafter(disorder_client *c, const char *target, char **tracks, int ntracks);
+
+/** @brief Retrieve the playing track
+ *
+ * 
+ *
+ * @param c Client
+ * @param playingp Details of the playing track
+ * @return 0 on success, non-0 on error
+ */
+int disorder_playing(disorder_client *c, struct queue_entry **playingp);
+
 /** @brief Delete a playlist
  *
  * Requires the 'play' right and permission to modify the playlist.
@@ -328,6 +399,17 @@ int disorder_playlist_unlock(disorder_client *c);
  */
 int disorder_playlists(disorder_client *c, char ***playlistsp, int *nplaylistsp);
 
+/** @brief Get all the preferences for a track
+ *
+ * 
+ *
+ * @param c Client
+ * @param track Track name
+ * @param prefsp Track preferences
+ * @return 0 on success, non-0 on error
+ */
+int disorder_prefs(disorder_client *c, const char *track, struct kvp **prefsp);
+
 /** @brief List the queue
  *
  * 
@@ -456,6 +538,17 @@ int disorder_resume(disorder_client *c);
  */
 int disorder_revoke(disorder_client *c);
 
+/** @brief Get the server's RTP address information
+ *
+ * 
+ *
+ * @param c Client
+ * @param addressp Where to store hostname or address
+ * @param portp Where to store service name or port number
+ * @return 0 on success, non-0 on error
+ */
+int disorder_rtp_address(disorder_client *c, char **addressp, char **portp);
+
 /** @brief Terminate the playing track.
  *
  * Requires one of the 'scratch mine', 'scratch random' or 'scratch any' rights depending on how the track came to be added to the queue.
@@ -466,6 +559,43 @@ int disorder_revoke(disorder_client *c);
  */
 int disorder_scratch(disorder_client *c, const char *id);
 
+/** @brief Schedule a track to play in the future
+ *
+ * 
+ *
+ * @param c Client
+ * @param when When to play the track
+ * @param priority Event priority ("normal" or "junk")
+ * @param track Track to play
+ * @return 0 on success, non-0 on error
+ */
+int disorder_schedule_add_play(disorder_client *c, time_t when, const char *priority, const char *track);
+
+/** @brief Schedule a global setting to be changed in the future
+ *
+ * 
+ *
+ * @param c Client
+ * @param when When to change the setting
+ * @param priority Event priority ("normal" or "junk")
+ * @param pref Global preference to set
+ * @param value New value of global preference
+ * @return 0 on success, non-0 on error
+ */
+int disorder_schedule_add_set_global(disorder_client *c, time_t when, const char *priority, const char *pref, const char *value);
+
+/** @brief Schedule a global setting to be unset in the future
+ *
+ * 
+ *
+ * @param c Client
+ * @param when When to change the setting
+ * @param priority Event priority ("normal" or "junk")
+ * @param pref Global preference to set
+ * @return 0 on success, non-0 on error
+ */
+int disorder_schedule_add_unset_global(disorder_client *c, time_t when, const char *priority, const char *pref);
+
 /** @brief Delete a scheduled event.
  *
  * Users can always delete their own scheduled events; with the admin right you can delete any event.
@@ -476,6 +606,17 @@ int disorder_scratch(disorder_client *c, const char *id);
  */
 int disorder_schedule_del(disorder_client *c, const char *event);
 
+/** @brief Get the details of scheduled event
+ *
+ * 
+ *
+ * @param c Client
+ * @param id Event ID
+ * @param actiondatap Details of event
+ * @return 0 on success, non-0 on error
+ */
+int disorder_schedule_get(disorder_client *c, const char *id, struct kvp **actiondatap);
+
 /** @brief List scheduled events
  *
  * This just lists IDs.  Use 'schedule-get' to retrieve more detail
@@ -533,7 +674,7 @@ int disorder_shutdown(disorder_client *c);
 
 /** @brief Get server statistics
  *
- * The details of what the server reports are not really defined.  The returned strings are intended to be printed out one to a line..
+ * The details of what the server reports are not really defined.  The returned strings are intended to be printed out one to a line.
  *
  * @param c Client
  * @param statsp List of server information strings.
@@ -607,4 +748,26 @@ int disorder_users(disorder_client *c, char ***usersp, int *nusersp);
  */
 int disorder_version(disorder_client *c, char **versionp);
 
+/** @brief Set the volume
+ *
+ * 
+ *
+ * @param c Client
+ * @param left Left channel volume
+ * @param right Right channel volume
+ * @return 0 on success, non-0 on error
+ */
+int disorder_set_volume(disorder_client *c, long left, long right);
+
+/** @brief Get the volume
+ *
+ * 
+ *
+ * @param c Client
+ * @param leftp Left channel volume
+ * @param rightp Right channel volume
+ * @return 0 on success, non-0 on error
+ */
+int disorder_get_volume(disorder_client *c, long *leftp, long *rightp);
+
 #endif