[vlc-devel] commit: Added a "key-rate-normal" to reset input playback rate to 1x ( Laurent Aimar )
git version control
git at videolan.org
Wed Feb 18 21:15:07 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Feb 18 21:11:52 2009 +0100| [97732ebb5fb41073093f74c8167bea0895550f63] | committer: Laurent Aimar
Added a "key-rate-normal" to reset input playback rate to 1x
It is related to #1122 and #1848.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=97732ebb5fb41073093f74c8167bea0895550f63
---
include/vlc_keys.h | 5 ++++-
modules/control/hotkeys.c | 6 ++++++
src/libvlc-module.c | 7 +++++++
3 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/include/vlc_keys.h b/include/vlc_keys.h
index bfd2672..60a3075 100644
--- a/include/vlc_keys.h
+++ b/include/vlc_keys.h
@@ -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
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index 74cf5a1..490bae9 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -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 );
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index e719b60..4ee70fc 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -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, },
More information about the vlc-devel
mailing list