return "const char *$name";
} elsif($type eq 'integer') {
return "long $name";
- } elsif($type eq 'list') {
+ } elsif($type eq 'list' or $type eq 'body') {
return ("char **$name",
"int n$name");
} else {
my $args = shift;
my @d = ();
for my $arg (@$args) {
- if($arg->[0] eq 'list') {
+ if($arg->[0] eq 'body' or $arg->[0] eq 'list') {
push(@d,
" * \@param $arg->[1] $arg->[2]\n",
" * \@param n$arg->[1] Length of $arg->[1]\n");
if(!defined $return) {
my @cargs = ();
for my $arg (@$args) {
- if($arg->[0] eq 'list') {
- push(@cargs, "disorder_body", $arg->[1], "n$arg->[1]");
- } else {
+ if($arg->[0] eq 'body' or $arg->[0] eq 'list') {
+ push(@cargs, "disorder_$arg->[0]", $arg->[1], "n$arg->[1]");
+ } elsif($arg->[0] eq 'string') {
push(@cargs, $arg->[1]);
+ } elsif($arg->[0] eq 'integer') {
+ push(@cargs, "buf_$arg->[1]");
+ push(@c, " char buf_$arg->[1]\[16];\n",
+ " byte_snprintf(buf_$arg->[1], sizeof buf_$arg->[1], \"%ld\", $arg->[1]);\n");
+ } else {
+ die "$0: unsupported arg type '$arg->[0]' for '$cmd'\n";
}
}
push(@c, " return disorder_simple(",
[],
["string", "cookie", "Newly created cookie"]);
-# TODO move
+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"]]);
-# TODO moveafter
+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"]]);
# TODO new
[["string", "track", "Track to play"]],
["string", "id", "Queue ID of new track"]);
-# TODO playafter
+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"]]);
# TODO playing
"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"],
- ["list", "tracks", "New list of tracks for playlist"]]);
+ ["body", "tracks", "New list of tracks for playlist"]]);
simple("playlist-set-share",
"Set a playlist's sharing status",