From c39cef35d2b96b224a5071ffa2dbb30e31cae5a0 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 28 Mar 2016 03:50:36 +0000 Subject: [PATCH] play: Convert com_pause() to lopsub. 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 | 7 +++++++ play.c | 6 +++--- play.cmd | 6 ------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/m4/lls/play_cmd.suite.m4 b/m4/lls/play_cmd.suite.m4 index 3632b184..d0d82f15 100644 --- a/m4/lls/play_cmd.suite.m4 +++ b/m4/lls/play_cmd.suite.m4 @@ -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 6ca97e6b..cab2504d 100644 --- 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) diff --git a/play.cmd b/play.cmd index fa6dd584..2d1999aa 100644 --- 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 -- 2.39.5