play: Convert com_prev() to lopsub.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 7 Sep 2015 20:30:31 +0000 (22:30 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 26 Mar 2017 09:02:28 +0000 (11:02 +0200)
The arg count check can be removed from the command handler, and the
pointless help text of the commit has been removed because it said
more or less the same as the summary text.

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

index e62bb0000d736a87ff4bf2513e3ae53593716be3..adb7e12e51c9af00b63188893e917e33cd151226 100644 (file)
@@ -22,3 +22,6 @@ caption = list of commands
        [/description]
 [subcommand next]
        purpose = load the next file of the playlist
        [/description]
 [subcommand next]
        purpose = load the next file of the playlist
+
+[subcommand prev]
+       purpose = load the previous file of the playlist
diff --git a/play.c b/play.c
index ce10a56bb9001f6675c18d06ce60323bbfeccf7e..e0ff240514fd1a575ac762acbb965cf9bdf0add9 100644 (file)
--- a/play.c
+++ b/play.c
@@ -907,13 +907,11 @@ static int com_pause(struct play_task *pt, int argc, __a_unused char **argv)
        return 0;
 }
 
        return 0;
 }
 
-static int com_prev(struct play_task *pt, int argc, __a_unused char **argv)
-
+static int com_prev(struct play_task *pt,
+       __a_unused struct lls_parse_result *lpr)
 {
        int ret;
 
 {
        int ret;
 
-       if (argc != 1)
-               return -E_PLAY_SYNTAX;
        ret = previous_valid_file(pt);
        if (ret < 0)
                return ret;
        ret = previous_valid_file(pt);
        if (ret < 0)
                return ret;
@@ -923,6 +921,7 @@ static int com_prev(struct play_task *pt, int argc, __a_unused char **argv)
        pt->start_chunk = 0;
        return 0;
 }
        pt->start_chunk = 0;
        return 0;
 }
+EXPORT_PLAY_CMD_HANDLER(prev);
 
 static int com_next(struct play_task *pt,
                __a_unused struct lls_parse_result *lpr)
 
 static int com_next(struct play_task *pt,
                __a_unused struct lls_parse_result *lpr)
index 5e090b705c016ee85e4313822aa6c230b26a5ece..0cc94f95f8dcc6b0aa87893375ecbf722b229075 100644 (file)
--- a/play.cmd
+++ b/play.cmd
@@ -2,11 +2,6 @@ BN: play
 SF: play.c
 SN: list of commands
 ---
 SF: play.c
 SN: list of commands
 ---
-N: prev
-D: Load previous file.
-U: prev
-H: Closes the current file and loads the previous file of the playlist.
----
 N: bg
 D: Enter input mode.
 U: bg
 N: bg
 D: Enter input mode.
 U: bg