Commit 637278c0 authored by Zoran Turalija's avatar Zoran Turalija Committed by Jean-Baptiste Kempf

Add hotkey to cycle through program SIDs.

Allow far more easier cycling through program Service IDs in multi-program
stream eg. DVB streams.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent cafb8e30
......@@ -200,6 +200,8 @@ typedef enum vlc_action {
ACTIONID_RATE_NORMAL,
ACTIONID_RATE_SLOWER_FINE,
ACTIONID_RATE_FASTER_FINE,
/* Cycle Through Program Service IDs */
ACTIONID_PROGRAM_SID,
} vlc_action_t;
......
......@@ -501,6 +501,46 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
list2.p_list->p_values[i].psz_string );
var_FreeList( &list, &list2 );
}
else if( i_action == ACTIONID_PROGRAM_SID )
{
vlc_value_t val, list, list2;
int i_count, i;
var_Get( p_input, "program", &val );
var_Change( p_input, "program", VLC_VAR_GETCHOICES,
&list, &list2 );
i_count = list.p_list->i_count;
if( i_count <= 1 )
{
DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_("Program Service ID: %s"), _("N/A") );
var_FreeList( &list, &list2 );
goto cleanup_and_continue;
}
for( i = 0; i < i_count; i++ )
{
if( val.i_int == list.p_list->p_values[i].i_int )
{
break;
}
}
/* value of program was not in choices list */
if( i == i_count )
{
msg_Warn( p_input,
"invalid current program SID, selecting 0" );
i = 0;
}
else if( i == i_count - 1 )
i = 0;
else
i++;
var_Set( p_input, "program", list.p_list->p_values[i] );
DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
_("Program Service ID: %s"),
list2.p_list->p_values[i].psz_string );
var_FreeList( &list, &list2 );
}
else if( i_action == ACTIONID_ASPECT_RATIO && p_vout )
{
vlc_value_t val={0}, val_list, text_list;
......
......@@ -307,6 +307,7 @@ static const struct action actions[] =
{ "play-pause", ACTIONID_PLAY_PAUSE, },
{ "position", ACTIONID_POSITION, },
{ "prev", ACTIONID_PREV, },
{ "program-sid", ACTIONID_PROGRAM_SID, },
{ "quit", ACTIONID_QUIT, },
{ "random", ACTIONID_RANDOM, },
{ "rate-faster-fine", ACTIONID_RATE_FASTER_FINE, },
......
......@@ -1365,6 +1365,8 @@ static const char *const ppsz_albumart_descriptions[] =
#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_LONGTEXT N_("Cycle through the available subtitle tracks.")
#define PROGRAM_SID_KEY_TEXT N_("Cycle program Service ID")
#define PROGRAM_SID_KEY_LONGTEXT N_("Cycle through the available program Service IDs (SIDs).")
#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 CROP_KEY_TEXT N_("Cycle video crop")
......@@ -2319,6 +2321,7 @@ vlc_module_begin ()
# define KEY_AUDIO_TRACK "b"
# define KEY_SUBTITLE_TRACK "v"
# define KEY_PROGRAM_SID "x"
# define KEY_ASPECT_RATIO "a"
# define KEY_CROP "c"
# define KEY_TOGGLE_AUTOSCALE "o"
......@@ -2483,6 +2486,8 @@ vlc_module_begin ()
AUDI_DEVICE_CYCLE_KEY_LONGTEXT, false )
add_key( "key-subtitle-track", KEY_SUBTITLE_TRACK,
SUBTITLE_TRACK_KEY_TEXT, SUBTITLE_TRACK_KEY_LONGTEXT, false )
add_key( "key-program-sid", KEY_PROGRAM_SID,
PROGRAM_SID_KEY_TEXT, PROGRAM_SID_KEY_LONGTEXT, false )
add_key( "key-aspect-ratio", KEY_ASPECT_RATIO,
ASPECT_RATIO_KEY_TEXT, ASPECT_RATIO_KEY_LONGTEXT, false )
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