Commit 97732ebb authored by Laurent Aimar's avatar Laurent Aimar

Added a "key-rate-normal" to reset input playback rate to 1x

It is related to #1122 and #1848.
parent 366ec46f
......@@ -342,6 +342,9 @@ typedef enum vlc_key {
/* scaling */
ACTIONID_TOGGLE_AUTOSCALE,
ACTIONID_SCALE_UP,
ACTIONID_SCALE_DOWN
ACTIONID_SCALE_DOWN,
/* */
ACTIONID_RATE_NORMAL,
} vlc_key_t;
#endif
......@@ -757,6 +757,12 @@ static void Run( intf_thread_t *p_intf )
vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN,
_("Slower") );
}
else if( i_action == ACTIONID_RATE_NORMAL )
{
var_SetInteger( p_input, "rate", INPUT_RATE_DEFAULT );
vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN,
_("1x") );
}
else if( i_action == ACTIONID_POSITION && b_seekable )
{
DisplayPosition( p_intf, p_vout, p_input );
......
......@@ -1215,6 +1215,8 @@ static const char *const ppsz_albumart_descriptions[] =
#define FASTER_KEY_LONGTEXT N_("Select the hotkey to use for fast forward playback.")
#define SLOWER_KEY_TEXT N_("Slower")
#define SLOWER_KEY_LONGTEXT N_("Select the hotkey to use for slow motion playback.")
#define RATE_NORMAL_KEY_TEXT N_("Normal rate")
#define RATE_NORMAL_KEY_LONGTEXT N_("Select the hotkey to set the playback rate back to normal.")
#define NEXT_KEY_TEXT N_("Next")
#define NEXT_KEY_LONGTEXT N_("Select the hotkey to use to skip to the next item in the playlist.")
#define PREV_KEY_TEXT N_("Previous")
......@@ -2114,6 +2116,7 @@ vlc_module_begin ()
# define KEY_PLAY KEY_UNSET
# define KEY_FASTER KEY_MODIFIER_COMMAND|'='
# define KEY_SLOWER KEY_MODIFIER_COMMAND|'-'
# define KEY_RATE_NORMAL KEY_UNSET
# define KEY_NEXT KEY_MODIFIER_COMMAND|KEY_RIGHT
# define KEY_PREV KEY_MODIFIER_COMMAND|KEY_LEFT
# define KEY_STOP KEY_MODIFIER_COMMAND|'.'
......@@ -2225,6 +2228,7 @@ vlc_module_begin ()
# define KEY_PLAY KEY_UNSET
# define KEY_FASTER '+'
# define KEY_SLOWER '-'
# define KEY_RATE_NORMAL KEY_UNSET
# define KEY_NEXT 'n'
# define KEY_PREV 'p'
# define KEY_STOP 's'
......@@ -2345,6 +2349,8 @@ vlc_module_begin ()
FASTER_KEY_LONGTEXT, false )
add_key( "key-slower", KEY_SLOWER, NULL, SLOWER_KEY_TEXT,
SLOWER_KEY_LONGTEXT, false )
add_key( "key-rate-normal", KEY_RATE_NORMAL, NULL, RATE_NORMAL_KEY_TEXT,
RATE_NORMAL_KEY_LONGTEXT, false )
add_key( "key-next", KEY_NEXT, NULL, NEXT_KEY_TEXT,
NEXT_KEY_LONGTEXT, false )
add_key( "key-prev", KEY_PREV, NULL, PREV_KEY_TEXT,
......@@ -2687,6 +2693,7 @@ const struct hotkey libvlc_hotkeys[] =
{ "key-next", ACTIONID_NEXT, 0, },
{ "key-faster", ACTIONID_FASTER, 0, },
{ "key-slower", ACTIONID_SLOWER, 0, },
{ "key-rate-normal", ACTIONID_RATE_NORMAL, 0, },
{ "key-toggle-fullscreen", ACTIONID_TOGGLE_FULLSCREEN, 0, },
{ "key-leave-fullscreen", ACTIONID_LEAVE_FULLSCREEN, 0, },
{ "key-vol-up", ACTIONID_VOL_UP, 0, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment