-# TODO make-cookie
-
-# TODO move
-
-# TODO moveafter
-
-# TODO new
-
-simple_string_command("nop",
- "Do nothing",
- "Used as a keepalive. No authentication required.",
- []);
-
-# TODO part
-
-simple_string_command("pause",
- "Pause the currently playing track",
- "Requires the 'pause' right.",
- []);
-
-# TODO playafter
-
-# TODO playing
-
-simple_string_command("playlist-delete",
- "Delete a playlist",
- "Requires the 'play' right and permission to modify the playlist.",
- [["playlist", "Playlist to delete"]]);
-
-# TODO playlist-get
-
-# TODO playlist-get-share
-
-simple_string_command("playlist-lock",
- "Lock a playlist",
- "Requires the 'play' right and permission to modify the playlist. A given connection may lock at most one playlist.",
- [["playlist", "Playlist to delete"]]);
-
-# TODO playlist-set
-
-simple_string_command("playlist-set-share",
- "Set a playlist's sharing status",
- "Requires the 'play' right and permission to modify the playlist. ",
- [["playlist", "Playlist to modify"],
- ["share", "New sharing status ('public', 'private' or 'shared')"]]);
-
-simple_string_command("playlist-unlock",
- "Unlock the locked playlist playlist",
- "The playlist to unlock is implicit in the connection.",
- []);
-
-# TODO playlists
-
-# TODO prefs
-
-# TODO queue
-
-simple_string_command("random-disable",
- "Disable random play",
- "Requires the 'global prefs' right.",
- []);
-
-simple_string_command("random-enable",
- "Enable random play",
- "Requires the 'global prefs' right.",
- []);
-
-# TODO random-enabled
-
-# TODO recent
-
-simple_string_command("reconfigure",
- "Re-read configuraiton file.",
- "Requires the 'admin' right.",
- []);
-
-# TODO register
-
-simple_string_command("reminder",
- "Send a password reminder.",
- "If the user has no valid email address, or no password, or a reminder has been sent too recently, then no reminder will be sent.",
- [["username", "User to remind"]]);
-
-simple_string_command("remove",
- "Remove a track form the queue.",
- "Requires one of the 'remove mine', 'remove random' or 'remove any' rights depending on how the track came to be added to the queue.",
- [["id", "Track ID"]]);
-
-simple_string_command("rescan",
- "Rescan all collections for new or obsolete tracks.",
- "Requires the 'rescan' right.",
- []); # TODO wait/fresh flags
-
-# TODO resolve
-
-simple_string_command("resume",
- "Resume the currently playing track",
- "Requires the 'pause' right.",
- []);
-
-simple_string_command("revoke",
- "Revoke a cookie.",
- "It will not subsequently be possible to log in with the cookie..",
- [["cookie", "Cookie to revoke"]]);
-
-# TODO rtp-address
-
-simple_string_command("scratch",
- "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.",
- [["id", "Track ID (optional)"]]);
-
-# TODO schedule-add
-
-simple_string_command("schedule-del",
- "Delete a scheduled event.",
- "Users can always delete their own scheduled events; with the admin right you can delete any event.",
- [["event", "ID of event to delete"]]);
-
-# TODO schedule-get
-
-# TODO schedule-list
-
-# TODO search
-
-simple_string_command("set",
- "Set a track preference",
- "Requires the 'prefs' right.",
- [["track", "Track name"],
- ["pref", "Preference name"],
- ["value", "New value"]]);
-
-simple_string_command("set-global",
- "Set a global preference",
- "Requires the 'global prefs' right.",
- [["pref", "Preference name"],
- ["value", "New value"]]);
-
-# TODO stats
-
-# TODO tags
-
-simple_string_command("unset",
- "Unset a track preference",
- "Requires the 'prefs' right.",
- [["track", "Track name"],
- ["pref", "Preference name"]]);
-
-simple_string_command("unset-global",
- "Set a global preference",
- "Requires the 'global prefs' right.",
- [["pref", "Preference name"]]);
-
-# user is only used by connect functions
-
-# TODO userinfo
-
-# TODO users
-
-# TODO version
-
-# TODO volume
+simple("make-cookie",
+ "Create a login cookie for this user",
+ "The cookie may be redeemed via the 'cookie' command",
+ [],
+ [["string", "cookie", "Newly created cookie"]]);
+
+simple("move",
+ "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.",
+ [["string", "track", "Track ID or name"],
+ ["integer", "delta", "How far to move the track towards the head of the queue"]]);
+
+simple("moveafter",
+ "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.",
+ [["string", "target", "Move after this track, or to head if \"\""],
+ ["list", "ids", "List of tracks to move by ID"]]);
+
+simple(["new", "new_tracks"],
+ "List recently added tracks",
+ "",
+ [["integer", "max", "Maximum tracks to fetch, or 0 for all available"]],
+ [["body", "tracks", "Recently added tracks"]]);
+
+simple("nop",
+ "Do nothing",
+ "Used as a keepalive. No authentication required.",
+ []);
+
+simple("part",
+ "Get a track name part",
+ "If the name part cannot be constructed an empty string is returned.",
+ [["string", "track", "Track name"],
+ ["string", "context", "Context (\"sort\" or \"display\")"],
+ ["string", "part", "Name part (\"artist\", \"album\" or \"title\")"]],
+ [["string", "part", "Value of name part"]]);
+
+simple("pause",
+ "Pause the currently playing track",
+ "Requires the 'pause' right.",
+ []);
+
+simple("play",
+ "Play a track",
+ "Requires the 'play' right.",
+ [["string", "track", "Track to play"]],
+ [["string-raw", "id", "Queue ID of new track"]]);
+
+simple("playafter",
+ "Play multiple tracks",
+ "Requires the 'play' right.",
+ [["string", "target", "Insert into queue after this track, or at head if \"\""],
+ ["list", "tracks", "List of track names to play"]]);
+
+simple("playing",
+ "Retrieve the playing track",
+ "",
+ [],
+ [["queue-one", "playing", "Details of the playing track"]]);
+
+simple("playlist-delete",
+ "Delete a playlist",
+ "Requires the 'play' right and permission to modify the playlist.",
+ [["string", "playlist", "Playlist to delete"]]);
+
+simple("playlist-get",
+ "List the contents of a playlist",
+ "Requires the 'read' right and oermission to read the playlist.",
+ [["string", "playlist", "Playlist name"]],
+ [["body", "tracks", "List of tracks in playlist"]]);
+
+simple("playlist-get-share",
+ "Get a playlist's sharing status",
+ "Requires the 'read' right and permission to read the playlist.",
+ [["string", "playlist", "Playlist to read"]],
+ [["string-raw", "share", "Sharing status (\"public\", \"private\" or \"shared\")"]]);
+
+simple("playlist-lock",
+ "Lock a playlist",
+ "Requires the 'play' right and permission to modify the playlist. A given connection may lock at most one playlist.",
+ [["string", "playlist", "Playlist to delete"]]);
+
+simple("playlist-set",
+ "Set the contents of a playlist",
+ "Requires the 'play' right and permission to modify the playlist, which must be locked.",
+ [["string", "playlist", "Playlist to modify"],
+ ["body", "tracks", "New list of tracks for playlist"]]);
+
+simple("playlist-set-share",
+ "Set a playlist's sharing status",
+ "Requires the 'play' right and permission to modify the playlist.",
+ [["string", "playlist", "Playlist to modify"],
+ ["string", "share", "New sharing status (\"public\", \"private\" or \"shared\")"]]);
+
+simple("playlist-unlock",
+ "Unlock the locked playlist playlist",
+ "The playlist to unlock is implicit in the connection.",
+ []);
+
+simple("playlists",
+ "List playlists",
+ "Requires the 'read' right. Only playlists that you have permission to read are returned.",
+ [],
+ [["body", "playlists", "Playlist names"]]);
+
+simple("prefs",
+ "Get all the preferences for a track",
+ "",
+ [["string", "track", "Track name"]],
+ [["pair-list", "prefs", "Track preferences"]]);
+
+simple("queue",
+ "List the queue",
+ "",
+ [],
+ [["queue", "queue", "Current queue contents"]]);
+
+simple("random-disable",
+ "Disable random play",
+ "Requires the 'global prefs' right.",
+ []);
+
+simple("random-enable",
+ "Enable random play",
+ "Requires the 'global prefs' right.",
+ []);
+
+simple("random-enabled",
+ "Detect whether random play is enabled",
+ "Random play counts as enabled even if play is disabled.",
+ [],
+ [["boolean", "enabled", "1 if random play is enabled and 0 otherwise"]]);
+
+simple("recent",
+ "List recently played tracks",
+ "",
+ [],
+ [["queue", "recent", "Recently played tracks"]]);
+
+simple("reconfigure",
+ "Re-read configuraiton file.",
+ "Requires the 'admin' right.",
+ []);
+
+simple("register",
+ "Register a new user",
+ "Requires the 'register' right which is usually only available to the 'guest' user. Redeem the confirmation string via 'confirm' to complete registration.",
+ [["string", "username", "Requested new username"],
+ ["string", "password", "Requested initial password"],
+ ["string", "email", "New user's email address"]],
+ [["string", "confirmation", "Confirmation string"]]);
+
+simple("reminder",
+ "Send a password reminder.",
+ "If the user has no valid email address, or no password, or a reminder has been sent too recently, then no reminder will be sent.",
+ [["string", "username", "User to remind"]]);
+
+simple("remove",
+ "Remove a track form the queue.",
+ "Requires one of the 'remove mine', 'remove random' or 'remove any' rights depending on how the track came to be added to the queue.",
+ [["string", "id", "Track ID"]]);
+
+simple("rescan",
+ "Rescan all collections for new or obsolete tracks.",
+ "Requires the 'rescan' right.",
+ []); # TODO wait/fresh flags
+
+simple("resolve",
+ "Resolve a track name",
+ "Converts aliases to non-alias track names",
+ [["string", "track", "Track name (might be an alias)"]],
+ [["string", "resolved", "Resolve track name (definitely not an alias)"]]);
+
+simple("resume",
+ "Resume the currently playing track",
+ "Requires the 'pause' right.",
+ []);
+
+simple("revoke",
+ "Revoke a cookie.",
+ "It will not subsequently be possible to log in with the cookie.",
+ []);
+
+simple("rtp-address",
+ "Get the server's RTP address information",
+ "",
+ [],
+ [["string", "address", "Where to store hostname or address"],
+ ["string", "port", "Where to store service name or port number"]]);
+
+simple("rtp-cancel",
+ "Cancel RTP stream",
+ "",
+ []);
+
+simple("rtp-request",
+ "Request a unicast RTP stream",
+ "",
+ [["string", "address", "Destination address"],
+ ["string", "port", "Destination port number"]]);
+
+simple("scratch",
+ "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.",
+ [["string", "id", "Track ID (optional)"]]);
+
+simple(["schedule-add", "schedule_add_play"],
+ "Schedule a track to play in the future",
+ "",
+ [["time", "when", "When to play the track"],
+ ["string", "priority", "Event priority (\"normal\" or \"junk\")"],
+ ["literal", "play", ""],
+ ["string", "track", "Track to play"]]);
+
+simple(["schedule-add", "schedule_add_set_global"],
+ "Schedule a global setting to be changed in the future",
+ "",
+ [["time", "when", "When to change the setting"],
+ ["string", "priority", "Event priority (\"normal\" or \"junk\")"],
+ ["literal", "set-global", ""],
+ ["string", "pref", "Global preference to set"],
+ ["string", "value", "New value of global preference"]]);
+
+simple(["schedule-add", "schedule_add_unset_global"],
+ "Schedule a global setting to be unset in the future",
+ "",
+ [["time", "when", "When to change the setting"],
+ ["string", "priority", "Event priority (\"normal\" or \"junk\")"],
+ ["literal", "set-global", ""],
+ ["string", "pref", "Global preference to set"]]);
+
+simple("schedule-del",
+ "Delete a scheduled event.",
+ "Users can always delete their own scheduled events; with the admin right you can delete any event.",
+ [["string", "event", "ID of event to delete"]]);
+
+simple("schedule-get",
+ "Get the details of scheduled event",
+ "",
+ [["string", "id", "Event ID"]],
+ [["pair-list", "actiondata", "Details of event"]]);
+
+simple("schedule-list",
+ "List scheduled events",
+ "This just lists IDs. Use 'schedule-get' to retrieve more detail",
+ [],
+ [["body", "ids", "List of event IDs"]]);
+
+simple("search",
+ "Search for tracks",
+ "Terms are either keywords or tags formatted as 'tag:TAG-NAME'.",
+ [["string", "terms", "List of search terms"]],
+ [["body", "tracks", "List of matching tracks"]]);
+
+simple("set",
+ "Set a track preference",
+ "Requires the 'prefs' right.",
+ [["string", "track", "Track name"],
+ ["string", "pref", "Preference name"],
+ ["string", "value", "New value"]]);
+
+simple("set-global",
+ "Set a global preference",
+ "Requires the 'global prefs' right.",
+ [["string", "pref", "Preference name"],
+ ["string", "value", "New value"]]);
+
+simple("shutdown",
+ "Request server shutdown",
+ "Requires the 'admin' right.",
+ []);
+
+simple("stats",
+ "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.",
+ [],
+ [["body", "stats", "List of server information strings."]]);
+
+simple("tags",
+ "Get a list of known tags",
+ "Only tags which apply to at least one track are returned.",
+ [],
+ [["body", "tags", "List of tags"]]);
+
+simple("unset",
+ "Unset a track preference",
+ "Requires the 'prefs' right.",
+ [["string", "track", "Track name"],
+ ["string", "pref", "Preference name"]]);
+
+simple("unset-global",
+ "Set a global preference",
+ "Requires the 'global prefs' right.",
+ [["string", "pref", "Preference name"]]);
+
+# 'user' only used for authentication
+
+simple("userinfo",
+ "Get a user property.",
+ "If the user does not exist an error is returned, if the user exists but the property does not then a null value is returned.",
+ [["string", "username", "User to read"],
+ ["string", "property", "Property to read"]],
+ [["string", "value", "Value of property"]]);
+
+simple("users",
+ "Get a list of users",
+ "",
+ [],
+ [["body", "users", "List of users"]]);
+
+simple("version",
+ "Get the server version",
+ "",
+ [],
+ [["string", "version", "Server version string"]]);
+
+simple(["volume", "set_volume"],
+ "Set the volume",
+ "",
+ [["integer", "left", "Left channel volume"],
+ ["integer", "right", "Right channel volume"]]);
+
+simple(["volume", "get_volume"],
+ "Get the volume",
+ "",
+ [],
+ [["integer", "left", "Left channel volume"],
+ ["integer", "right", "Right channel volume"]]);