1
mirror of https://code.videolan.org/videolan/vlc synced 2024-07-21 07:24:15 +02:00

hotkeys: new hotkeys to change the viewpoint in 360° videos

yaw: Left/Right (same a DVD/BR nav)
pitch: Up/Down (same a DVD/BR nav)
fov: Page Up/Page Down

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
This commit is contained in:
Steve Lhomme 2016-11-15 15:21:43 +01:00 committed by Thomas Guillem
parent e23cb34d2c
commit 1e4c227201
4 changed files with 74 additions and 10 deletions

View File

@ -227,6 +227,9 @@ typedef enum vlc_action {
ACTIONID_PROGRAM_SID_NEXT, ACTIONID_PROGRAM_SID_NEXT,
ACTIONID_PROGRAM_SID_PREV, ACTIONID_PROGRAM_SID_PREV,
ACTIONID_INTF_POPUP_MENU, ACTIONID_INTF_POPUP_MENU,
/* Viewpoint */
ACTIONID_FOV_IN,
ACTIONID_FOV_OUT,
} vlc_action_t; } vlc_action_t;

View File

@ -767,13 +767,40 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
var_SetInteger( p_input, "title 0", 2 ); var_SetInteger( p_input, "title 0", 2 );
break; break;
case ACTIONID_NAV_ACTIVATE: case ACTIONID_NAV_ACTIVATE:
case ACTIONID_NAV_UP:
case ACTIONID_NAV_DOWN:
case ACTIONID_NAV_LEFT:
case ACTIONID_NAV_RIGHT:
if( p_input ) if( p_input )
input_Control( p_input, i_action - ACTIONID_NAV_ACTIVATE input_Control( p_input, INPUT_NAV_ACTIVATE, NULL );
+ INPUT_NAV_ACTIVATE, NULL ); break;
case ACTIONID_NAV_UP:
if( p_vout )
input_UpdateViewpoint( p_input,
&(vlc_viewpoint_t) { .pitch = -1.f },
false );
if( p_input )
input_Control( p_input, INPUT_NAV_UP, NULL );
break;
case ACTIONID_NAV_DOWN:
if( p_vout )
input_UpdateViewpoint( p_input,
&(vlc_viewpoint_t) { .pitch = 1.f },
false );
if( p_input )
input_Control( p_input, INPUT_NAV_DOWN, NULL );
break;
case ACTIONID_NAV_LEFT:
if( p_vout )
input_UpdateViewpoint( p_input,
&(vlc_viewpoint_t) { .yaw = -1.f },
false );
if( p_input )
input_Control( p_input, INPUT_NAV_LEFT, NULL );
break;
case ACTIONID_NAV_RIGHT:
if( p_vout )
input_UpdateViewpoint( p_input,
&(vlc_viewpoint_t) { .yaw = 1.f },
false );
if( p_input )
input_Control( p_input, INPUT_NAV_RIGHT, NULL );
break; break;
/* Video Output actions */ /* Video Output actions */
@ -892,6 +919,19 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
var_DecInteger( p_vout, "crop-right" ); var_DecInteger( p_vout, "crop-right" );
break; break;
case ACTIONID_FOV_IN:
if( p_vout )
input_UpdateViewpoint( p_input,
&(vlc_viewpoint_t) { .fov = -1.f },
false );
break;
case ACTIONID_FOV_OUT:
if( p_vout )
input_UpdateViewpoint( p_input,
&(vlc_viewpoint_t) { .fov = 1.f },
false );
break;
case ACTIONID_TOGGLE_AUTOSCALE: case ACTIONID_TOGGLE_AUTOSCALE:
if( p_vout ) if( p_vout )
{ {

View File

@ -368,6 +368,8 @@ static const struct action actions[] =
{ "uncrop-right", ACTIONID_UNCROP_RIGHT, }, { "uncrop-right", ACTIONID_UNCROP_RIGHT, },
{ "uncrop-top", ACTIONID_UNCROP_TOP, }, { "uncrop-top", ACTIONID_UNCROP_TOP, },
{ "unzoom", ACTIONID_UNZOOM, }, { "unzoom", ACTIONID_UNZOOM, },
{ "viewpoint-fov-in", ACTIONID_FOV_IN, },
{ "viewpoint-fov-out", ACTIONID_FOV_OUT, },
{ "vol-down", ACTIONID_VOL_DOWN, }, { "vol-down", ACTIONID_VOL_DOWN, },
{ "vol-mute", ACTIONID_VOL_MUTE, }, { "vol-mute", ACTIONID_VOL_MUTE, },
{ "vol-up", ACTIONID_VOL_UP, }, { "vol-up", ACTIONID_VOL_UP, },

View File

@ -1262,13 +1262,13 @@ static const char *const mouse_wheel_texts[] = {
#define QUIT_KEY_TEXT N_("Quit") #define QUIT_KEY_TEXT N_("Quit")
#define QUIT_KEY_LONGTEXT N_("Select the hotkey to quit the application.") #define QUIT_KEY_LONGTEXT N_("Select the hotkey to quit the application.")
#define NAV_UP_KEY_TEXT N_("Navigate up") #define NAV_UP_KEY_TEXT N_("Navigate up")
#define NAV_UP_KEY_LONGTEXT N_("Select the key to move the selector up in DVD menus.") #define NAV_UP_KEY_LONGTEXT N_("Select the key to move the selector up in DVD menus / Move viewpoint to up (pitch).")
#define NAV_DOWN_KEY_TEXT N_("Navigate down") #define NAV_DOWN_KEY_TEXT N_("Navigate down")
#define NAV_DOWN_KEY_LONGTEXT N_("Select the key to move the selector down in DVD menus.") #define NAV_DOWN_KEY_LONGTEXT N_("Select the key to move the selector down in DVD menus / Move viewpoint to down (pitch).")
#define NAV_LEFT_KEY_TEXT N_("Navigate left") #define NAV_LEFT_KEY_TEXT N_("Navigate left")
#define NAV_LEFT_KEY_LONGTEXT N_("Select the key to move the selector left in DVD menus.") #define NAV_LEFT_KEY_LONGTEXT N_("Select the key to move the selector left in DVD menus / Move viewpoint to left (yaw).")
#define NAV_RIGHT_KEY_TEXT N_("Navigate right") #define NAV_RIGHT_KEY_TEXT N_("Navigate right")
#define NAV_RIGHT_KEY_LONGTEXT N_("Select the key to move the selector right in DVD menus.") #define NAV_RIGHT_KEY_LONGTEXT N_("Select the key to move the selector right in DVD menus / Move viewpoint to right (yaw).")
#define NAV_ACTIVATE_KEY_TEXT N_("Activate") #define NAV_ACTIVATE_KEY_TEXT N_("Activate")
#define NAV_ACTIVATE_KEY_LONGTEXT N_("Select the key to activate selected item in DVD menus.") #define NAV_ACTIVATE_KEY_LONGTEXT N_("Select the key to activate selected item in DVD menus.")
#define DISC_MENU_TEXT N_("Go to the DVD menu") #define DISC_MENU_TEXT N_("Go to the DVD menu")
@ -1422,6 +1422,12 @@ static const char *const mouse_wheel_texts[] = {
#define UNCROP_RIGHT_KEY_TEXT N_("Uncrop one pixel from the right of the video") #define UNCROP_RIGHT_KEY_TEXT N_("Uncrop one pixel from the right of the video")
#define UNCROP_RIGHT_KEY_LONGTEXT N_("Uncrop one pixel from the right of the video") #define UNCROP_RIGHT_KEY_LONGTEXT N_("Uncrop one pixel from the right of the video")
/* 360° Viewpoint */
#define VIEWPOINT_FOV_IN_KEY_TEXT N_("Shrink field of view")
#define VIEWPOINT_FOV_IN_KEY_LONGTEXT N_("Shrink the viewpoint field of view")
#define VIEWPOINT_FOV_OUT_KEY_TEXT N_("Expand field of view")
#define VIEWPOINT_FOV_OUT_KEY_LONGTEXT N_("Expand the viewpoint field of view")
#define WALLPAPER_KEY_TEXT N_("Toggle wallpaper mode in video output") #define WALLPAPER_KEY_TEXT N_("Toggle wallpaper mode in video output")
#define WALLPAPER_KEY_LONGTEXT N_( \ #define WALLPAPER_KEY_LONGTEXT N_( \
"Toggle wallpaper mode in video output." ) "Toggle wallpaper mode in video output." )
@ -2226,6 +2232,10 @@ vlc_module_begin ()
# define KEY_CROP_RIGHT "Alt+l" # define KEY_CROP_RIGHT "Alt+l"
# define KEY_UNCROP_RIGHT "Alt+Shift+l" # define KEY_UNCROP_RIGHT "Alt+Shift+l"
/* 360° Viewpoint */
# define KEY_VIEWPOINT_FOV_IN "Page Up"
# define KEY_VIEWPOINT_FOV_OUT "Page Down"
/* the macosx-interface already has bindings */ /* the macosx-interface already has bindings */
# define KEY_ZOOM_QUARTER NULL # define KEY_ZOOM_QUARTER NULL
# define KEY_ZOOM_HALF "Command+0" # define KEY_ZOOM_HALF "Command+0"
@ -2369,6 +2379,10 @@ vlc_module_begin ()
# define KEY_CROP_RIGHT "Alt+f" # define KEY_CROP_RIGHT "Alt+f"
# define KEY_UNCROP_RIGHT "Alt+Shift+f" # define KEY_UNCROP_RIGHT "Alt+Shift+f"
/* 360° Viewpoint */
# define KEY_VIEWPOINT_FOV_IN "Page Up"
# define KEY_VIEWPOINT_FOV_OUT "Page Down"
/* Zooming */ /* Zooming */
# define KEY_ZOOM_QUARTER "Alt+1" # define KEY_ZOOM_QUARTER "Alt+1"
# define KEY_ZOOM_HALF "Alt+2" # define KEY_ZOOM_HALF "Alt+2"
@ -2562,6 +2576,11 @@ vlc_module_begin ()
add_key( "key-loop", KEY_LOOP, add_key( "key-loop", KEY_LOOP,
LOOP_KEY_TEXT, LOOP_KEY_LONGTEXT, false ) LOOP_KEY_TEXT, LOOP_KEY_LONGTEXT, false )
add_key( "key-viewpoint-fov-in", KEY_VIEWPOINT_FOV_IN,
VIEWPOINT_FOV_IN_KEY_TEXT, VIEWPOINT_FOV_IN_KEY_LONGTEXT, true )
add_key( "key-viewpoint-fov-out", KEY_VIEWPOINT_FOV_OUT,
VIEWPOINT_FOV_OUT_KEY_TEXT, VIEWPOINT_FOV_OUT_KEY_LONGTEXT, true )
set_section ( N_("Zoom" ), NULL ) set_section ( N_("Zoom" ), NULL )
add_key( "key-zoom-quarter", KEY_ZOOM_QUARTER, add_key( "key-zoom-quarter", KEY_ZOOM_QUARTER,
ZOOM_QUARTER_KEY_TEXT, NULL, false ) ZOOM_QUARTER_KEY_TEXT, NULL, false )