The output contains the playlist position, the path
and information provided by the audio format handler.
[/description]
+
+[subcommand play]
+ purpose = start or resume playback
+ non-opts-name = [num]
+ [description]
+ If no argument is given, playback starts at the current
+ position. Otherwise, the corresponding file is loaded
+ and playback is started at the beginning of the file.
+ [/description]
}
EXPORT_PLAY_CMD_HANDLER(ls);
-static int com_play(struct play_task *pt, int argc, char **argv)
+static int com_play(struct play_task *pt, struct lls_parse_result *lpr)
{
int32_t x;
int ret;
- char state;
+ char state, *errctx;
- if (argc > 2)
- return -E_PLAY_SYNTAX;
+ ret = lls(lls_check_arg_count(lpr, 0, 1, &errctx));
+ if (ret < 0) {
+ if (errctx)
+ PARA_ERROR_LOG("%s\n", errctx);
+ free(errctx);
+ return ret;
+ }
state = get_playback_state(pt);
- if (argc == 1) {
+ if (lls_num_inputs(lpr) == 0) {
if (state == 'P')
return 0;
pt->next_file = pt->current_file;
pt->playing = true;
return 0;
}
- ret = para_atoi32(argv[1], &x);
+ ret = para_atoi32(lls_input(0, lpr), &x);
if (ret < 0)
return ret;
if (x < 0 || x >= conf.inputs_num)
pt->rq = CRT_FILE_CHANGE;
return 0;
}
+EXPORT_PLAY_CMD_HANDLER(play);
static int com_pause(struct play_task *pt, int argc, __a_unused char **argv)
{
SF: play.c
SN: list of commands
---
-N: play
-D: Start or resume playing.
-U: play [<num>]
-H: Without <num>, starts playing at the current position. Otherwise, the
-H: corresponding file is loaded and playback is started.
----
N: pause
D: Stop playing.
U: pause