Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 998ad0d5 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

LKT: Command and doc update

- lkt queue delete now deletes by position in the queue
- lkt queue remove now deletes by id in the queue
parent 726a725f
Branches
Étiquettes
1 requête de fusion!141Improve MPD compatibility
......@@ -16,6 +16,8 @@
- Add MPD commands: seek, seekid, seekcur, delete (partial), playlistid
- Alias list\* commands as find
- lkt handle the playlistid (queue id) and \_\_flat (queue flatten), pause, unpause commands
- lkt `queue delete` is now `queue remove` to delete by id
- lkt `queue delete` now deletes a kara in the queue by their position
- lkt shuffle works the same way as klkt, it doens't force the 'play' command but unpause, i.e it doesn't replay the kara
- Remove archlinux package support (replaced by AppImage)
- Fix dl process with the repo module
......
......@@ -87,38 +87,42 @@ List all the available playlists
.TP
.PD
\fBqueue\fP [count]
Prints the names and ids of the next karas in the queue
Prints the names and ids of the next karas in the queue.
.TP
\fBqueue pos\fP <pos | from:to>
Prints the names and ids of karas in the queue. Karas can be designated by
their position or with a range
their position or with a range.
.TP
\fBqueue pop\fP
Delete the currently playing kara from the queue and pass to the next one.
This can work only if the currently playong kara is not the last
This can work only if the currently playong kara is not the last.
.TP
\fBqueue add\fP <query>
Add karas to the queue at the end of it with a valid query
Add karas to the queue at the end of it with a valid query.
.TP
\fBqueue insert\fP <query>
Add karas to the queue just after the currently playing kara
Add karas to the queue just after the currently playing kara.
.TP
\fBqueue seek\fP <id>
Goto to the kara with the specified id in the queue
Goto to the kara with the specified id in the queue.
.TP
\fBqueue delete\fP <id>
Delete karas from the playlist with their id. You can't delete the currently
playing kara, for that use the \fBpop\fP queue command
\fBqueue delete\fP <pos>
Delete a kara from the playlist with their position. You can delete the
currently playing kara, use the \fBqueue pop\fP command for that.
.TP
\fBqueue remove\fP <id>
Delete karas from the playlist with their id. You can't remove the currently
playing kara, for that use the \fBqueue pop\fP queue command.
.TP
\fBqueue clear\fP
Clear the queue and set the state to \fIstopped\fP
Clear the queue and set the state to \fIstopped\fP.
.TP
\fBqueue crop\fP
Crop the queue, delete every kara from it appart from the currently
playing one
playing one.
.TP
\fBqueue replace\fP <plt-name>
Replace the queue with the content of a playlist. Keep the playling state
Replace the queue with the content of a playlist. Keep the playling state.
.TP
\fBqueue swap\fP <pos1> <pos2>
Swaps two karas in the queue by their position.
......
......@@ -736,13 +736,33 @@ error:
exit(ret);
}
noreturn void
queue_remove__(struct cmd_args *args)
{
if (args->argc != 1)
fail("Invalid argument, need onlt one argument: queue id <id>");
static const char *cmd__ = "deleteid %d\n";
int dumy = 0;
FILE *sock = lkt_connect();
char buff[3];
sscanf(args->argv[0], "%d", &dumy);
if (dumy != 0) {
write_socket(sock, cmd__, dumy);
exit_with_status(sock, buff);
}
fail("Invalid argument");
}
noreturn void
queue_delete__(struct cmd_args *args)
{
if (args->argc != 1)
fail("Invalid argument, need onlt one argument: queue delete <id>");
fail("Invalid argument, need onlt one argument: queue delete <pos>");
static const char *cmd_id__ = "deleteid %d\n";
static const char *cmd_id__ = "delete %d\n";
int dumy = 0;
FILE *sock = lkt_connect();
char buff[3];
......@@ -1157,6 +1177,7 @@ static struct cmd_opt options_queue[] = {
{ .name = "add", .call = queue_add__ },
{ .name = "seek", .call = queue_seek__ },
{ .name = "delete", .call = queue_delete__ },
{ .name = "remove", .call = queue_remove__ },
{ .name = "clear", .call = queue_clear__ },
{ .name = "crop", .call = queue_crop__ },
{ .name = "replace", .call = queue_replace__ },
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter