rc: add "record" command

This commit is contained in:
Thomas Guillem 2019-07-11 12:44:33 +02:00
parent b31c27f6c2
commit 11e6645313
1 changed files with 21 additions and 0 deletions

View File

@ -278,6 +278,7 @@ static void Help( intf_thread_t *p_intf)
msg_rc("%s", _("| vcrop [X] . . . . . . . . . . . set/get video crop"));
msg_rc("%s", _("| vzoom [X] . . . . . . . . . . . set/get video zoom"));
msg_rc("%s", _("| snapshot . . . . . . . . . . . . take video snapshot"));
msg_rc("%s", _("| record [on|off] . . . . . . . . . . toggle recording"));
msg_rc("%s", _("| strack [X] . . . . . . . . . set/get subtitle track"));
msg_rc("%s", _("| key [hotkey name] . . . . . . simulate hotkey press"));
msg_rc( "| ");
@ -568,6 +569,25 @@ static void Input(intf_thread_t *intf, char const *psz_cmd,
msg_print(intf, "+----[ end of %s ]", name);
}
}
else if( !strcmp( psz_cmd, "record" ) )
{
bool b_update = true;
bool b_value = vlc_player_IsRecording(player);
if( newval.psz_string[0] != '\0' )
{
if ( ( !strncmp( newval.psz_string, "on", 2 ) && b_value ) ||
( !strncmp( newval.psz_string, "off", 3 ) && !b_value ) )
{
b_update = false;
}
}
if( b_update )
{
b_value = !b_value;
vlc_player_SetRecordingEnabled( player, b_value );
}
}
out:
vlc_player_Unlock(player);
}
@ -1302,6 +1322,7 @@ static const struct
{ "atrack", Input },
{ "vtrack", Input },
{ "strack", Input },
{ "record", Input },
/* video commands */
{ "vratio", VideoConfig },