summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-05-02 22:15:52 +0200
committerGravatar waker <wakeroid@gmail.com>2011-05-02 22:15:52 +0200
commit02af089e33fd4422185bfeb01b05ed76f7f05713 (patch)
tree0d36ea7f52f4f24204aeb266a8fb90ed30b1b85a /main.c
parentc36ddf5f4b45f2853cbeb048e3b8ca80b81a2f44 (diff)
added --play-pause cmdline option
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/main.c b/main.c
index 554c7459..709790b0 100644
--- a/main.c
+++ b/main.c
@@ -96,6 +96,7 @@ client_exec_command_line (const char *cmdline, int len) {
fprintf (stdout, _(" --stop Stop playback\n"));
fprintf (stdout, _(" --pause Pause playback\n"));
fprintf (stdout, _(" --toggle-pause Toggle pause\n"));
+ fprintf (stdout, _(" --play-pause Start playback if stopped, toggle pause otherwise\n"));
fprintf (stdout, _(" --next Next song in playlist\n"));
fprintf (stdout, _(" --prev Previous song in playlist\n"));
fprintf (stdout, _(" --random Random song in playlist\n"));
@@ -105,6 +106,7 @@ client_exec_command_line (const char *cmdline, int len) {
" [l]ength, track[n]umber, [y]ear, [c]omment,\n"
" copy[r]ight, [e]lapsed\n"));
fprintf (stdout, _(" e.g.: --nowplaying \"%%a - %%t\" should print \"artist - title\"\n"));
+ fprintf (stdout, _(" for more info, see http://sourceforge.net/apps/mediawiki/deadbeef/index.php?title=Title_Formatting\n"));
return 1;
}
else if (!strcmp (parg, "--version")) {
@@ -202,6 +204,16 @@ server_exec_command_line (const char *cmdline, int len, char *sendback, int sbsi
messagepump_push (DB_EV_TOGGLE_PAUSE, 0, 0, 0);
return 0;
}
+ else if (!strcmp (parg, "--play-pause")) {
+ int state = deadbeef->get_output ()->state ();
+ if (state == OUTPUT_STATE_PLAYING) {
+ deadbeef->sendmessage (DB_EV_PAUSE, 0, 0, 0);
+ }
+ else {
+ deadbeef->sendmessage (DB_EV_PLAY_CURRENT, 0, 0, 0);
+ }
+ return 0;
+ }
else if (!strcmp (parg, "--random")) {
messagepump_push (DB_EV_PLAY_RANDOM, 0, 0, 0);
return 0;