Commit e8dc8779 authored by Zoran Turalija's avatar Zoran Turalija Committed by Rémi Denis-Courmont

Add hotkeys to cycle through previous/next program SIDs.

Change "cycle through program SIDs" to support cycle both ways (prev/next).
With this commit, it is possible e.g. to quickly change between neighbor
program SIDs back and forth in multi-program stream like DVB streams using
default x/Shift+x keys.
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent ec1f64f8
...@@ -213,7 +213,8 @@ typedef enum vlc_action { ...@@ -213,7 +213,8 @@ typedef enum vlc_action {
ACTIONID_RATE_SLOWER_FINE, ACTIONID_RATE_SLOWER_FINE,
ACTIONID_RATE_FASTER_FINE, ACTIONID_RATE_FASTER_FINE,
/* Cycle Through Program Service IDs */ /* Cycle Through Program Service IDs */
ACTIONID_PROGRAM_SID, ACTIONID_PROGRAM_SID_NEXT,
ACTIONID_PROGRAM_SID_PREV,
ACTIONID_INTF_POPUP_MENU, ACTIONID_INTF_POPUP_MENU,
} vlc_action_t; } vlc_action_t;
......
...@@ -476,7 +476,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -476,7 +476,8 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
var_FreeList( &list, &list2 ); var_FreeList( &list, &list2 );
} }
break; break;
case ACTIONID_PROGRAM_SID: case ACTIONID_PROGRAM_SID_NEXT:
case ACTIONID_PROGRAM_SID_PREV:
if( p_input ) if( p_input )
{ {
vlc_value_t val, list, list2; vlc_value_t val, list, list2;
...@@ -500,17 +501,25 @@ static int PutAction( intf_thread_t *p_intf, int i_action ) ...@@ -500,17 +501,25 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
break; break;
} }
} }
/* value of program was not in choices list */ /* value of program sid was not in choices list */
if( i == i_count ) if( i == i_count )
{ {
msg_Warn( p_input, msg_Warn( p_input,
"invalid current program SID, selecting 0" ); "invalid current program SID, selecting 0" );
i = 0; i = 0;
} }
else if( i == i_count - 1 ) else if( i_action == ACTIONID_PROGRAM_SID_NEXT ) {
if( i == i_count - 1 )
i = 0; i = 0;
else else
i++; i++;
}
else { /* ACTIONID_PROGRAM_SID_PREV */
if( i == 0 )
i = i_count - 1;
else
i--;
}
var_Set( p_input, "program", list.p_list->p_values[i] ); var_Set( p_input, "program", list.p_list->p_values[i] );
DisplayMessage( p_vout, _("Program Service ID: %s"), DisplayMessage( p_vout, _("Program Service ID: %s"),
list2.p_list->p_values[i].psz_string ); list2.p_list->p_values[i].psz_string );
......
...@@ -321,7 +321,8 @@ static const struct action actions[] = ...@@ -321,7 +321,8 @@ static const struct action actions[] =
{ "play-pause", ACTIONID_PLAY_PAUSE, }, { "play-pause", ACTIONID_PLAY_PAUSE, },
{ "position", ACTIONID_POSITION, }, { "position", ACTIONID_POSITION, },
{ "prev", ACTIONID_PREV, }, { "prev", ACTIONID_PREV, },
{ "program-sid", ACTIONID_PROGRAM_SID, }, { "program-sid-next", ACTIONID_PROGRAM_SID_NEXT, },
{ "program-sid-prev", ACTIONID_PROGRAM_SID_PREV, },
{ "quit", ACTIONID_QUIT, }, { "quit", ACTIONID_QUIT, },
{ "random", ACTIONID_RANDOM, }, { "random", ACTIONID_RANDOM, },
{ "rate-faster-fine", ACTIONID_RATE_FASTER_FINE, }, { "rate-faster-fine", ACTIONID_RATE_FASTER_FINE, },
......
...@@ -1364,8 +1364,10 @@ static const char *const mouse_wheel_texts[] = ...@@ -1364,8 +1364,10 @@ static const char *const mouse_wheel_texts[] =
#define AUDIO_TRACK_KEY_LONGTEXT N_("Cycle through the available audio tracks(languages).") #define AUDIO_TRACK_KEY_LONGTEXT N_("Cycle through the available audio tracks(languages).")
#define SUBTITLE_TRACK_KEY_TEXT N_("Cycle subtitle track") #define SUBTITLE_TRACK_KEY_TEXT N_("Cycle subtitle track")
#define SUBTITLE_TRACK_KEY_LONGTEXT N_("Cycle through the available subtitle tracks.") #define SUBTITLE_TRACK_KEY_LONGTEXT N_("Cycle through the available subtitle tracks.")
#define PROGRAM_SID_KEY_TEXT N_("Cycle program Service ID") #define PROGRAM_SID_NEXT_KEY_TEXT N_("Cycle next program Service ID")
#define PROGRAM_SID_KEY_LONGTEXT N_("Cycle through the available program Service IDs (SIDs).") #define PROGRAM_SID_NEXT_KEY_LONGTEXT N_("Cycle through the available next program Service IDs (SIDs).")
#define PROGRAM_SID_PREV_KEY_TEXT N_("Cycle previous program Service ID")
#define PROGRAM_SID_PREV_KEY_LONGTEXT N_("Cycle through the available previous program Service IDs (SIDs).")
#define ASPECT_RATIO_KEY_TEXT N_("Cycle source aspect ratio") #define ASPECT_RATIO_KEY_TEXT N_("Cycle source aspect ratio")
#define ASPECT_RATIO_KEY_LONGTEXT N_("Cycle through a predefined list of source aspect ratios.") #define ASPECT_RATIO_KEY_LONGTEXT N_("Cycle through a predefined list of source aspect ratios.")
#define CROP_KEY_TEXT N_("Cycle video crop") #define CROP_KEY_TEXT N_("Cycle video crop")
...@@ -2182,7 +2184,8 @@ vlc_module_begin () ...@@ -2182,7 +2184,8 @@ vlc_module_begin ()
# define KEY_AUDIODELAY_DOWN "f" # define KEY_AUDIODELAY_DOWN "f"
# define KEY_AUDIO_TRACK "l" # define KEY_AUDIO_TRACK "l"
# define KEY_SUBTITLE_TRACK "s" # define KEY_SUBTITLE_TRACK "s"
# define KEY_PROGRAM_SID "x" # define KEY_PROGRAM_SID_NEXT "x"
# define KEY_PROGRAM_SID_PREV "Shift+x"
# define KEY_ASPECT_RATIO "a" # define KEY_ASPECT_RATIO "a"
# define KEY_CROP "c" # define KEY_CROP "c"
# define KEY_TOGGLE_AUTOSCALE "o" # define KEY_TOGGLE_AUTOSCALE "o"
...@@ -2294,7 +2297,8 @@ vlc_module_begin () ...@@ -2294,7 +2297,8 @@ vlc_module_begin ()
# define KEY_AUDIO_TRACK "b" # define KEY_AUDIO_TRACK "b"
# define KEY_SUBTITLE_TRACK "v" # define KEY_SUBTITLE_TRACK "v"
# define KEY_PROGRAM_SID "x" # define KEY_PROGRAM_SID_NEXT "x"
# define KEY_PROGRAM_SID_PREV "Shift+x"
# define KEY_ASPECT_RATIO "a" # define KEY_ASPECT_RATIO "a"
# define KEY_CROP "c" # define KEY_CROP "c"
# define KEY_TOGGLE_AUTOSCALE "o" # define KEY_TOGGLE_AUTOSCALE "o"
...@@ -2452,8 +2456,10 @@ vlc_module_begin () ...@@ -2452,8 +2456,10 @@ vlc_module_begin ()
AUDI_DEVICE_CYCLE_KEY_LONGTEXT, false ) AUDI_DEVICE_CYCLE_KEY_LONGTEXT, false )
add_key( "key-subtitle-track", KEY_SUBTITLE_TRACK, add_key( "key-subtitle-track", KEY_SUBTITLE_TRACK,
SUBTITLE_TRACK_KEY_TEXT, SUBTITLE_TRACK_KEY_LONGTEXT, false ) SUBTITLE_TRACK_KEY_TEXT, SUBTITLE_TRACK_KEY_LONGTEXT, false )
add_key( "key-program-sid", KEY_PROGRAM_SID, add_key( "key-program-sid-next", KEY_PROGRAM_SID_NEXT,
PROGRAM_SID_KEY_TEXT, PROGRAM_SID_KEY_LONGTEXT, false ) PROGRAM_SID_NEXT_KEY_TEXT, PROGRAM_SID_NEXT_KEY_LONGTEXT, false )
add_key( "key-program-sid-prev", KEY_PROGRAM_SID_PREV,
PROGRAM_SID_PREV_KEY_TEXT, PROGRAM_SID_PREV_KEY_LONGTEXT, false )
add_key( "key-aspect-ratio", KEY_ASPECT_RATIO, add_key( "key-aspect-ratio", KEY_ASPECT_RATIO,
ASPECT_RATIO_KEY_TEXT, ASPECT_RATIO_KEY_LONGTEXT, false ) ASPECT_RATIO_KEY_TEXT, ASPECT_RATIO_KEY_LONGTEXT, false )
add_key( "key-crop", KEY_CROP, add_key( "key-crop", KEY_CROP,
......
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