Commit 90de252b authored by Antoine Cellerier's avatar Antoine Cellerier

Add zoom (z) and unzoom (shift+z) hotkeys

parent 1cf7350b
......@@ -256,3 +256,5 @@ static inline int StringToKey( char *psz_key )
#define ACTIONID_ASPECT_RATIO 67
#define ACTIONID_CROP 68
#define ACTIONID_DEINTERLACE 69
#define ACTIONID_ZOOM 70
#define ACTIONID_UNZOOM 71
......@@ -589,6 +589,35 @@ static void Run( intf_thread_t *p_intf )
}
free( val.psz_string );
}
else if( ( i_action == ACTIONID_ZOOM || i_action == ACTIONID_UNZOOM ) && p_vout )
{
vlc_value_t val={0}, val_list, text_list;
var_Get( p_vout, "zoom", &val );
if( var_Change( p_vout, "zoom", VLC_VAR_GETLIST,
&val_list, &text_list ) >= 0 )
{
int i;
for( i = 0; i < val_list.p_list->i_count; i++ )
{
if( val_list.p_list->p_values[i].f_float
== val.f_float )
{
if( i_action == ACTIONID_ZOOM )
i++;
else /* ACTIONID_UNZOOM */
i--;
break;
}
}
if( i == val_list.p_list->i_count ) i = 0;
if( i == -1 ) i = val_list.p_list->i_count-1;
var_SetFloat( p_vout, "zoom",
val_list.p_list->p_values[i].f_float );
vout_OSDMessage( VLC_OBJECT(p_input), DEFAULT_CHAN,
_("Zoom mode: %s"),
text_list.p_list->p_values[i].var.psz_name );
}
}
else if( i_action == ACTIONID_NEXT )
{
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
......
......@@ -1072,6 +1072,12 @@ static char *ppsz_clock_descriptions[] =
#define RECORD_KEY_TEXT N_("Record")
#define RECORD_KEY_LONGTEXT N_("Record access filter start/stop.")
#define ZOOM_KEY_TEXT N_("Zoom")
#define ZOOM_KEY_LONGTEXT N_("Zoom")
#define UNZOOM_KEY_TEXT N_("Un-Zoom")
#define UNZOOM_KEY_LONGTEXT N_("Un-Zoom")
#define VLC_USAGE N_( \
"Usage: %s [options] [stream] ..." \
......@@ -1638,6 +1644,8 @@ vlc_module_begin();
# define KEY_CHAPTER_PREV KEY_MODIFIER_CTRL|'u'
# define KEY_CHAPTER_NEXT KEY_MODIFIER_CTRL|'d'
# define KEY_SNAPSHOT KEY_MODIFIER_COMMAND|KEY_MODIFIER_ALT|'s'
# define KEY_ZOOM 'z'
# define KEY_UNZOOM KEY_MODIFIER_SHIFT|'z'
# define KEY_SET_BOOKMARK1 KEY_MODIFIER_COMMAND|KEY_F1
# define KEY_SET_BOOKMARK2 KEY_MODIFIER_COMMAND|KEY_F2
......@@ -1709,6 +1717,8 @@ vlc_module_begin();
# define KEY_CHAPTER_PREV KEY_MODIFIER_CTRL|'u'
# define KEY_CHAPTER_NEXT KEY_MODIFIER_CTRL|'d'
# define KEY_SNAPSHOT KEY_MODIFIER_CTRL|KEY_MODIFIER_ALT|'s'
# define KEY_ZOOM 'z'
# define KEY_UNZOOM KEY_MODIFIER_SHIFT|'z'
# define KEY_SET_BOOKMARK1 KEY_MODIFIER_CTRL|KEY_F1
# define KEY_SET_BOOKMARK2 KEY_MODIFIER_CTRL|KEY_F2
......@@ -1830,6 +1840,10 @@ vlc_module_begin();
HISTORY_FORWARD_TEXT, HISTORY_FORWARD_LONGTEXT, VLC_TRUE );
add_key( "key-record", KEY_RECORD, NULL,
RECORD_KEY_TEXT, RECORD_KEY_LONGTEXT, VLC_TRUE );
add_key( "key-zoom", KEY_ZOOM, NULL,
ZOOM_KEY_TEXT, ZOOM_KEY_LONGTEXT, VLC_TRUE );
add_key( "key-unzoom", KEY_UNZOOM, NULL,
UNZOOM_KEY_TEXT, UNZOOM_KEY_LONGTEXT, VLC_TRUE );
set_section ( N_("Jump sizes" ), NULL );
add_integer( "extrashort-jump-size", 3, NULL, JIEXTRASHORT_TEXT,
......@@ -1984,6 +1998,8 @@ static struct hotkey p_hotkeys[] =
{ "key-intf-show", ACTIONID_INTF_SHOW, 0, 0, 0, 0 },
{ "key-intf-hide", ACTIONID_INTF_HIDE, 0, 0, 0, 0 },
{ "key-snapshot", ACTIONID_SNAPSHOT, 0, 0, 0, 0 },
{ "key-zoom", ACTIONID_ZOOM, 0, 0, 0, 0 },
{ "key-unzoom", ACTIONID_UNZOOM, 0, 0, 0, 0 },
{ "key-nav-activate", ACTIONID_NAV_ACTIVATE, 0, 0, 0, 0 },
{ "key-nav-up", ACTIONID_NAV_UP, 0, 0, 0, 0 },
{ "key-nav-down", ACTIONID_NAV_DOWN, 0, 0, 0, 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