diff --git a/CHANGELOG.md b/CHANGELOG.md index 3abafaa25ffa66d0585e767dfc64449ba072af6b..ac6a90177080aa515f7b0a4256b65dbe88036f48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Assert and abort will trigger a SEGV to try to display the backtrace - Check if downloaded karas are matroska files (only the magic number) - In case of restart get the klkt instance launched by the previous lektord +- The 'pause' command may take one argument to force the 'paused' state of lektord - Add window icon - Add the Klkt client (notification for desktops) to the lektor project - Add AppImage builds for lektord, lkt and klkt @@ -14,7 +15,7 @@ - Add the \_\_flat command to set all priorities to 1 in the queue - Add MPD commands: seek, seekid, seekcur, delete (partial), playlistid - Alias list\* commands as find -- lkt handle the playlistid (queue id) and \_\_flat (queue flatten) commands +- lkt handle the playlistid (queue id) and \_\_flat (queue flatten), pause, unpause commands - 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 diff --git a/README.md b/README.md index 915d9f5e7a1741a2994179951758b537b15ff164..43209ff4cab96583a017132c489bac612736d8b6 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ For the compatibility column, the possible values are the following: | `replay_gain_mode {mode}` | | | not implemented | | `replay_gain_status` | | | not implemented | | `next` | `next` | + | | -| `pause {state}` | `pause {state}` | CHECK | check compat state | +| `pause {state}` | `pause {state}` | + | | | `play [songpos]` | `play [songpos]` | + | if no `songpos` passed, defaults to `0` | | `playid [songid]` | `playid {songid}` | + | get the first found `songid` in the queue | | `previous` | `previous` | + | | diff --git a/man/lkt.template b/man/lkt.template index 3c3073f304c40b16837344931cf6ebcc26134035..07ff2e42353a84e0ac9ba3a10ab25c3f8daf7c0f 100644 --- a/man/lkt.template +++ b/man/lkt.template @@ -28,26 +28,32 @@ Here are the \fBlkt\fP commands: \fBcurrent\fP Prints informations about the currently playing kara. Can be used to display the current kara in a status bar like \fBxmobar\fP or in the -\fBi3 panel\fP +\fBi3 panel\fP. .TP \fBplay\fP [index] Toggle play/pause state. If the playback is stopped, start at a possibly -specified index +specified index. +.TP +\fBpause\fP +For lektord to be paused, don't do anything is lektord is already paused. +.TP +\fBunpause\fP +Unpause lektord, don't do anything if lektord is already playing or if it is +stopped. In that case use the \fBplay\fP command. .TP \fBnext\fP -Play next kara in the queue +Play next kara in the queue. .TP \fBprevious\fP -Play the previous kara in the queue +Play the previous kara in the queue. .TP \fBshuffle\fP -Shuffle the queue. If the state was stoppped, play from the first kara -in the queue. If lektor was already playing a kara, it will play it -from the begening. The current kara will be placed in first position -in the queue. +Shuffle the queue. If lektord was paused it will unpause but if it was stopped +it won't start. If it exists, the current kara will be placed in the first +place in the queue. .TP \fBstatus\fP -Prints information about the state of lektor and the currently playing kara +Prints information about the state of lektor and the currently playing kara. .TP \fBstop\fP Stop the playback and reading the queue, the state is now \fIstopped\fP. diff --git a/src/main/lkt.c b/src/main/lkt.c index 8f9ada2a1006104b9737bc4843423544073ec15f..67cf1a8b51388d2b1c16f62834519e00be188dfe 100644 --- a/src/main/lkt.c +++ b/src/main/lkt.c @@ -309,6 +309,8 @@ just_send(queue_crop__, "crop\n") just_send(next__, "next\n") just_send(prev__, "previous\n") just_send(stop__, "stop\n") +just_send(pause__, "pause 1\n") +just_send(unpause__, "pause 0\n") just_send(shuffle__, "shuffle\npause 0\n") just_send(queue_flatten__, "__flat\n") #undef just_send @@ -1212,6 +1214,8 @@ queue__(struct cmd_args *args) static struct cmd_opt options_[] = { { .name = "current", .call = current__ }, { .name = "play", .call = play__ }, + { .name = "pause", .call = pause__ }, + { .name = "unpause", .call = unpause__ }, { .name = "next", .call = next__ }, { .name = "previous", .call = prev__ }, { .name = "queue", .call = queue__ },