Commit e557d8c0 authored by Antoine Cellerier's avatar Antoine Cellerier

Add a hotkey to toggle wallpaper mode. Currently only works for directx of course :)

parent 6d032d9e
...@@ -307,3 +307,4 @@ static inline int StringToKey( char *psz_key ) ...@@ -307,3 +307,4 @@ static inline int StringToKey( char *psz_key )
#define ACTIONID_DUMP 80 #define ACTIONID_DUMP 80
#define ACTIONID_RANDOM 81 #define ACTIONID_RANDOM 81
#define ACTIONID_LOOP 82 #define ACTIONID_LOOP 82
#define ACTIONID_WALLPAPER 83
...@@ -298,6 +298,21 @@ static void Run( intf_thread_t *p_intf ) ...@@ -298,6 +298,21 @@ static void Run( intf_thread_t *p_intf )
var_Set( p_playlist, "fullscreen", val ); var_Set( p_playlist, "fullscreen", val );
} }
} }
else if( i_action == ACTIONID_WALLPAPER )
{
if( p_vout )
{
var_Get( p_vout, "directx-wallpaper", &val );
val.b_bool = !val.b_bool;
var_Set( p_vout, "directx-wallpaper", val );
}
else
{
var_Get( p_playlist, "directx-wallpaper", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "directx-wallpaper", val );
}
}
else if( i_action == ACTIONID_LOOP ) else if( i_action == ACTIONID_LOOP )
{ {
/* Toggle Normal -> Loop -> Repeat -> Normal ... */ /* Toggle Normal -> Loop -> Repeat -> Normal ... */
......
...@@ -1208,6 +1208,10 @@ static const char *ppsz_pltree_descriptions[] = { N_("Default"), N_("Always"), N ...@@ -1208,6 +1208,10 @@ static const char *ppsz_pltree_descriptions[] = { N_("Default"), N_("Always"), N
#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")
#define WALLPAPER_KEY_TEXT N_("Toggle wallpaper mode in video output")
#define WALLPAPER_KEY_LONGTEXT N_( \
"Toggle wallpaper mode in video output. Only works with the directx " \
"video output for the time being." )
const char vlc_usage[] = N_( const char vlc_usage[] = N_(
"Usage: %s [options] [stream] ..." "Usage: %s [options] [stream] ..."
...@@ -1885,6 +1889,7 @@ vlc_module_begin(); ...@@ -1885,6 +1889,7 @@ vlc_module_begin();
# define KEY_HISTORY_FORWARD KEY_MODIFIER_COMMAND|']' # define KEY_HISTORY_FORWARD KEY_MODIFIER_COMMAND|']'
# define KEY_RECORD KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'r' # define KEY_RECORD KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'r'
# define KEY_DUMP KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'d' # define KEY_DUMP KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'d'
# define KEY_WALLPAPER KEY_MODIFIER_COMMAND|'w'
#else #else
# define KEY_FULLSCREEN 'f' # define KEY_FULLSCREEN 'f'
...@@ -1970,6 +1975,7 @@ vlc_module_begin(); ...@@ -1970,6 +1975,7 @@ vlc_module_begin();
# define KEY_HISTORY_FORWARD KEY_MODIFIER_CTRL|'b' # define KEY_HISTORY_FORWARD KEY_MODIFIER_CTRL|'b'
# define KEY_RECORD KEY_MODIFIER_CTRL|'r' # define KEY_RECORD KEY_MODIFIER_CTRL|'r'
# define KEY_DUMP KEY_MODIFIER_CTRL|KEY_MODIFIER_SHIFT|'d' # define KEY_DUMP KEY_MODIFIER_CTRL|KEY_MODIFIER_SHIFT|'d'
# define KEY_WALLPAPER 'w'
#endif #endif
add_key( "key-fullscreen", KEY_FULLSCREEN, NULL, FULLSCREEN_KEY_TEXT, add_key( "key-fullscreen", KEY_FULLSCREEN, NULL, FULLSCREEN_KEY_TEXT,
...@@ -2073,6 +2079,8 @@ vlc_module_begin(); ...@@ -2073,6 +2079,8 @@ vlc_module_begin();
ZOOM_KEY_TEXT, ZOOM_KEY_LONGTEXT, VLC_TRUE ); ZOOM_KEY_TEXT, ZOOM_KEY_LONGTEXT, VLC_TRUE );
add_key( "key-unzoom", KEY_UNZOOM, NULL, add_key( "key-unzoom", KEY_UNZOOM, NULL,
UNZOOM_KEY_TEXT, UNZOOM_KEY_LONGTEXT, VLC_TRUE ); UNZOOM_KEY_TEXT, UNZOOM_KEY_LONGTEXT, VLC_TRUE );
add_key( "key-wallpaper", KEY_WALLPAPER, NULL, WALLPAPER_KEY_TEXT,
WALLPAPER_KEY_LONGTEXT, VLC_FALSE );
add_key( "key-crop-top", KEY_CROP_TOP, NULL, add_key( "key-crop-top", KEY_CROP_TOP, NULL,
CROP_TOP_KEY_TEXT, CROP_TOP_KEY_LONGTEXT, VLC_TRUE ); CROP_TOP_KEY_TEXT, CROP_TOP_KEY_LONGTEXT, VLC_TRUE );
...@@ -2339,6 +2347,7 @@ const struct hotkey libvlc_hotkeys[] = ...@@ -2339,6 +2347,7 @@ const struct hotkey libvlc_hotkeys[] =
{ "key-dump", ACTIONID_DUMP, 0, 0, 0, 0 }, { "key-dump", ACTIONID_DUMP, 0, 0, 0, 0 },
{ "key-random", ACTIONID_RANDOM, 0, 0, 0, 0 }, { "key-random", ACTIONID_RANDOM, 0, 0, 0, 0 },
{ "key-loop", ACTIONID_LOOP, 0, 0, 0, 0 }, { "key-loop", ACTIONID_LOOP, 0, 0, 0, 0 },
{ "key-wallpaper", ACTIONID_WALLPAPER, 0, 0, 0, 0 },
{ NULL, 0, 0, 0, 0, 0 } { NULL, 0, 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