]> git.tue.mpg.de Git - paraslash.git/commitdiff
play: Convert com_pause() to lopsub.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 28 Mar 2016 03:50:36 +0000 (03:50 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2017 09:02:28 +0000 (11:02 +0200)
The argc check can be removed from the command handler of this
subcommand. Other than that no changes to (the body of) com_pause()
are necessary.

m4/lls/play_cmd.suite.m4
play.c
play.cmd

index 3632b184c1e0ef72990fb646070719cfd5a74358..d0d82f1504ddb0c2378ec3567c65fce82206eaa7 100644 (file)
@@ -70,3 +70,10 @@ caption = list of commands
                position. Otherwise, the corresponding file is loaded
                and playback is started at the beginning of the file.
        [/description]
+
+[subcommand pause]
+       purpose = suspend playback
+       [description]
+               When paused, it is still possible to jump around in
+               the file via the jmp and ff commands.
+       [/description]
diff --git a/play.c b/play.c
index 6ca97e6bef58a3bb7c71d3af4137507d0eabb202..cab2504d263629f78c2703556d5f23331779cc5e 100644 (file)
--- a/play.c
+++ b/play.c
@@ -881,13 +881,12 @@ static int com_play(struct play_task *pt, struct lls_parse_result *lpr)
 }
 EXPORT_PLAY_CMD_HANDLER(play);
 
-static int com_pause(struct play_task *pt, int argc, __a_unused char **argv)
+static int com_pause(struct play_task *pt,
+               __a_unused struct lls_parse_result *lpr)
 {
        char state;
        long unsigned seconds, ss;
 
-       if (argc != 1)
-               return -E_PLAY_SYNTAX;
        state = get_playback_state(pt);
        pt->playing = false;
        if (state != 'P')
@@ -903,6 +902,7 @@ static int com_pause(struct play_task *pt, int argc, __a_unused char **argv)
        kill_stream(pt);
        return 0;
 }
+EXPORT_PLAY_CMD_HANDLER(pause);
 
 static int com_prev(struct play_task *pt,
        __a_unused struct lls_parse_result *lpr)
index fa6dd58415a1e54d2940fced33fb4a9e338c6fda..2d1999aa35a940ed01d1e2a7c56e74275b96168b 100644 (file)
--- a/play.cmd
+++ b/play.cmd
@@ -2,12 +2,6 @@ BN: play
 SF: play.c
 SN: list of commands
 ---
-N: pause
-D: Stop playing.
-U: pause
-H: When paused, it is still possible to jump around in the file via the jmp and ff
-H: comands.
----
 N: tasks
 D: Print list of active tasks.
 U: tasks