mirror of
https://github.com/onyx-and-iris/vmrcli.git
synced 2026-09-16 16:02:29 +00:00
implements a short list of quickcommands
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
"\ts: Launch the StreamerView application"
|
||||
#define OPTSTR ":hk:msc:iID:v"
|
||||
#define MAX_LINE 512
|
||||
#define COUNT_OF(x) (sizeof(x) / sizeof(x[0]))
|
||||
|
||||
/**
|
||||
* @enum The kind of values a get call may return.
|
||||
@@ -56,6 +57,13 @@ struct result
|
||||
} val;
|
||||
};
|
||||
|
||||
struct quickcommand quickcommands[] = {
|
||||
{.name = "lock", .fullcommand = "command.lock=1"},
|
||||
{.name = "unlock", .fullcommand = "command.lock=0"},
|
||||
{.name = "show", .fullcommand = "command.show=1"},
|
||||
{.name = "hide", .fullcommand = "command.show=0"},
|
||||
{.name = "restart", .fullcommand = "command.restart=1"}};
|
||||
|
||||
static bool vflag = false;
|
||||
|
||||
static void usage(void);
|
||||
@@ -290,6 +298,17 @@ void parse_command(PT_VMR vmr, char *command)
|
||||
{
|
||||
log_debug("Parsing %s", command);
|
||||
|
||||
struct quickcommand *qc_ptr = command_in_quickcommands(command, quickcommands, (int)COUNT_OF(quickcommands));
|
||||
if (qc_ptr != NULL)
|
||||
{
|
||||
set_parameters(vmr, qc_ptr->fullcommand);
|
||||
if (vflag)
|
||||
{
|
||||
printf("Setting %s\n", qc_ptr->fullcommand);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (command[0] == '!') /* toggle */
|
||||
{
|
||||
command++;
|
||||
|
||||
Reference in New Issue
Block a user