Commit 61e310a3 authored by Zoran Turalija's avatar Zoran Turalija Committed by Jean-Baptiste Kempf

Deinterlace: Add hotkey to cycle through deinterlace modes.

Allow easier cycling through available deinterlace modes
instead of painfully going through menus.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 189c715a
......@@ -164,6 +164,7 @@ typedef enum vlc_action {
ACTIONID_ASPECT_RATIO,
ACTIONID_CROP,
ACTIONID_DEINTERLACE,
ACTIONID_DEINTERLACE_MODE,
ACTIONID_ZOOM,
ACTIONID_UNZOOM,
ACTIONID_CROP_TOP,
......
......@@ -670,6 +670,42 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
free( psz_mode );
}
}
else if( i_action == ACTIONID_DEINTERLACE_MODE && p_vout )
{
char *psz_mode = var_GetString( p_vout, "deinterlace-mode" );
vlc_value_t vlist, tlist;
if( psz_mode && !var_Change( p_vout, "deinterlace-mode", VLC_VAR_GETCHOICES, &vlist, &tlist ) >= 0 )
{
const char *psz_text = NULL;
int i;
for( i = 0; i < vlist.p_list->i_count; i++ )
{
if( !strcmp( vlist.p_list->p_values[i].psz_string, psz_mode ) )
{
i++;
break;
}
}
if( i == vlist.p_list->i_count ) i = 0;
psz_text = tlist.p_list->p_values[i].psz_string;
var_SetString( p_vout, "deinterlace-mode", vlist.p_list->p_values[i].psz_string );
int i_deinterlace = var_GetInteger( p_vout, "deinterlace" );
if( i_deinterlace != 0 )
{
DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
"%s (%s)", _("Deinterlace on"), psz_text ? psz_text : psz_mode );
}
else
{
DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
"%s (%s)", _("Deinterlace off"), psz_text ? psz_text : psz_mode );
}
var_FreeList( &vlist, &tlist );
}
free( psz_mode );
}
else if( ( i_action == ACTIONID_ZOOM ||
i_action == ACTIONID_UNZOOM ) && p_vout )
{
......
......@@ -263,6 +263,7 @@ static const struct action actions[] =
{ "crop-top", ACTIONID_CROP_TOP, },
{ "decr-scalefactor", ACTIONID_SCALE_DOWN, },
{ "deinterlace", ACTIONID_DEINTERLACE, },
{ "deinterlace-mode", ACTIONID_DEINTERLACE_MODE, },
{ "disc-menu", ACTIONID_DISC_MENU, },
{ "faster", ACTIONID_FASTER, },
{ "frame-next", ACTIONID_FRAME_NEXT, },
......
......@@ -1379,6 +1379,8 @@ static const char *const ppsz_albumart_descriptions[] =
#define SCALE_DOWN_KEY_LONGTEXT N_("Decrease scale factor.")
#define DEINTERLACE_KEY_TEXT N_("Toggle deinterlacing")
#define DEINTERLACE_KEY_LONGTEXT N_("Activate or deactivate deinterlacing.")
#define DEINTERLACE_MODE_KEY_TEXT N_("Cycle deinterlace modes")
#define DEINTERLACE_MODE_KEY_LONGTEXT N_("Cycle through available deinterlace modes.")
#define INTF_TOGGLE_FSC_KEY_TEXT N_("Show controller in fullscreen")
#define INTF_SHOW_KEY_TEXT N_("Show interface")
#define INTF_SHOW_KEY_LONGTEXT N_("Raise the interface above all other windows.")
......@@ -2211,6 +2213,7 @@ vlc_module_begin ()
# define KEY_SCALE_UP "Alt+o"
# define KEY_SCALE_DOWN "Shift+Alt+o"
# define KEY_DEINTERLACE "d"
# define KEY_DEINTERLACE_MODE "Shift+d"
# define KEY_INTF_TOGGLE_FSC "i"
# define KEY_INTF_BOSS NULL
# define KEY_DISC_MENU "Ctrl+m"
......@@ -2329,6 +2332,7 @@ vlc_module_begin ()
# define KEY_SCALE_UP "Alt+o"
# define KEY_SCALE_DOWN "Alt+Shift+o"
# define KEY_DEINTERLACE "d"
# define KEY_DEINTERLACE_MODE "Shift+d"
# define KEY_INTF_TOGGLE_FSC "i"
# define KEY_INTF_BOSS NULL
# define KEY_DISC_MENU "Shift+m"
......@@ -2501,6 +2505,8 @@ vlc_module_begin ()
SCALE_DOWN_KEY_TEXT, SCALE_DOWN_KEY_LONGTEXT, false )
add_key( "key-deinterlace", KEY_DEINTERLACE,
DEINTERLACE_KEY_TEXT, DEINTERLACE_KEY_LONGTEXT, false )
add_key( "key-deinterlace-mode", KEY_DEINTERLACE_MODE,
DEINTERLACE_MODE_KEY_TEXT, DEINTERLACE_MODE_KEY_LONGTEXT, false )
add_key( "key-intf-show", KEY_INTF_TOGGLE_FSC,
INTF_TOGGLE_FSC_KEY_TEXT, INTF_TOGGLE_FSC_KEY_TEXT, false )
add_obsolete_inner( "key-intf-hide", CONFIG_ITEM_KEY )
......
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