#include <vlc_keys.h>
#include "math.h"
-#define CHANNELS_NUMBER 4
-#define VOLUME_TEXT_CHAN p_intf->p_sys->p_channels[ 0 ]
-#define VOLUME_WIDGET_CHAN p_intf->p_sys->p_channels[ 1 ]
-#define POSITION_TEXT_CHAN p_intf->p_sys->p_channels[ 2 ]
-#define POSITION_WIDGET_CHAN p_intf->p_sys->p_channels[ 3 ]
-
/*****************************************************************************
* intf_sys_t: description and status of FB interface
*****************************************************************************/
struct intf_sys_t
{
vout_thread_t *p_last_vout;
- int p_channels[ CHANNELS_NUMBER ]; /* contains registered
- * channel IDs */
+ int slider_chan;
+
+ /*subtitle_delaybookmarks: placeholder for storing subtitle sync timestamps*/
+ struct
+ {
+ int64_t i_time_subtitle;
+ int64_t i_time_audio;
+ } subtitle_delaybookmarks;
};
/*****************************************************************************
static void Close ( vlc_object_t * );
static int ActionEvent( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
-static int SpecialKeyEvent( vlc_object_t *, char const *,
- vlc_value_t, vlc_value_t, void * );
static void PlayBookmark( intf_thread_t *, int );
static void SetBookmark ( intf_thread_t *, int );
static void DisplayPosition( intf_thread_t *, vout_thread_t *, input_thread_t * );
static float AdjustRateFine( vlc_object_t *, const int );
static void ClearChannels ( intf_thread_t *, vout_thread_t * );
-#define DisplayMessage(vout, ch, fmt, ...) \
- do { if(vout) vout_OSDMessage(vout, ch, fmt, __VA_ARGS__); } while(0)
+#define DisplayMessage(vout, ...) \
+ do { \
+ if (vout) \
+ vout_OSDMessage(vout, SPU_DEFAULT_CHANNEL, __VA_ARGS__); \
+ } while(0)
#define DisplayIcon(vout, icon) \
do { if(vout) vout_OSDIcon(vout, SPU_DEFAULT_CHANNEL, icon); } while(0)
p_intf->p_sys = p_sys;
p_sys->p_last_vout = NULL;
+ p_sys->subtitle_delaybookmarks.i_time_audio = 0;
+ p_sys->subtitle_delaybookmarks.i_time_subtitle = 0;
- var_AddCallback( p_intf->p_libvlc, "key-pressed", SpecialKeyEvent, p_intf );
var_AddCallback( p_intf->p_libvlc, "key-action", ActionEvent, p_intf );
return VLC_SUCCESS;
}
intf_sys_t *p_sys = p_intf->p_sys;
var_DelCallback( p_intf->p_libvlc, "key-action", ActionEvent, p_intf );
- var_DelCallback( p_intf->p_libvlc, "key-pressed", SpecialKeyEvent, p_intf );
/* Destroy structure */
free( p_sys );
* address as the old one... We should rather listen to vout events.
* Alternatively, we should keep a reference to the vout thread. */
if( p_vout && p_vout != p_sys->p_last_vout )
- for( unsigned i = 0; i < CHANNELS_NUMBER; i++ )
- p_intf->p_sys->p_channels[i] = vout_RegisterSubpictureChannel( p_vout );
+ p_sys->slider_chan = vout_RegisterSubpictureChannel( p_vout );
p_sys->p_last_vout = p_vout;
/* Quit */
libvlc_Quit( p_intf->p_libvlc );
ClearChannels( p_intf, p_vout );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, "%s", _( "Quit" ) );
+ DisplayMessage( p_vout, _( "Quit" ) );
break;
case ACTIONID_INTF_TOGGLE_FSC:
/* Playlist actions (including audio) */
case ACTIONID_LOOP:
+ {
/* Toggle Normal -> Loop -> Repeat -> Normal ... */
+ const char *mode;
if( var_GetBool( p_playlist, "repeat" ) )
+ {
var_SetBool( p_playlist, "repeat", false );
+ mode = N_("Off");
+ }
else
if( var_GetBool( p_playlist, "loop" ) )
{ /* FIXME: this is not atomic, we should use a real tristate */
var_SetBool( p_playlist, "loop", false );
var_SetBool( p_playlist, "repeat", true );
+ mode = N_("One");
}
else
+ {
var_SetBool( p_playlist, "loop", true );
+ mode = N_("All");
+ }
+ DisplayMessage( p_vout, _("Loop: %s"), vlc_gettext(mode) );
break;
+ }
case ACTIONID_RANDOM:
- var_ToggleBool( p_playlist, "random" );
+ {
+ const bool state = var_ToggleBool( p_playlist, "random" );
+ DisplayMessage( p_vout, _("Random: %s"),
+ vlc_gettext( state ? N_("On") : N_("Off") ) );
break;
+ }
case ACTIONID_NEXT:
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, "%s", _("Next") );
+ DisplayMessage( p_vout, _("Next") );
playlist_Next( p_playlist );
break;
case ACTIONID_PREV:
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, "%s", _("Previous") );
+ DisplayMessage( p_vout, _("Previous") );
playlist_Prev( p_playlist );
break;
case ACTIONID_SET_BOOKMARK10:
SetBookmark( p_intf, i_action - ACTIONID_SET_BOOKMARK1 + 1 );
break;
-
+ case ACTIONID_PLAY_CLEAR:
+ {
+ playlist_t *p_playlist = pl_Get( p_intf );
+ playlist_Clear( p_playlist, pl_Unlocked );
+ break;
+ }
case ACTIONID_VOL_UP:
{
float vol;
break;
}
case ACTIONID_VOL_MUTE:
- if( playlist_MuteToggle( p_playlist ) == 0 )
+ {
+ int mute = playlist_MuteGet( p_playlist );
+ if( mute < 0 )
+ break;
+ mute = !mute;
+ if( playlist_MuteSet( p_playlist, mute ) )
+ break;
+
+ float vol = playlist_VolumeGet( p_playlist );
+ if( mute || vol == 0.f )
{
- float vol = playlist_VolumeGet( p_playlist );
- if( playlist_MuteGet( p_playlist ) > 0 || vol == 0.f )
- {
- ClearChannels( p_intf, p_vout );
- DisplayIcon( p_vout, OSD_MUTE_ICON );
- }
- else
- DisplayVolume( p_intf, p_vout, vol );
+ ClearChannels( p_intf, p_vout );
+ DisplayIcon( p_vout, OSD_MUTE_ICON );
}
+ else
+ DisplayVolume( p_intf, p_vout, vol );
break;
+ }
case ACTIONID_AUDIODEVICE_CYCLE:
{
free( dev );
if( !aout_DeviceSet( p_aout, ids[idx] ) )
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _("Audio Device: %s"), names[idx] );
+ DisplayMessage( p_vout, _("Audio Device: %s"), names[idx] );
vlc_object_release( p_aout );
for( int i = 0; i < n; i++ )
/* Playlist + video output actions */
case ACTIONID_WALLPAPER:
- { /* FIXME: this is invalid if not using DirectX output!!! */
- vlc_object_t *obj = p_vout ? VLC_OBJECT(p_vout)
- : VLC_OBJECT(p_playlist);
- var_ToggleBool( obj, "video-wallpaper" );
+ {
+ bool wp = var_ToggleBool( p_playlist, "video-wallpaper" );
+ if( p_vout )
+ var_SetBool( p_vout, "video-wallpaper", wp );
break;
}
if( p_input && var_GetBool( p_input, "can-record" ) )
{
const bool on = var_ToggleBool( p_input, "record" );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, "%s",
- vlc_gettext(on ? N_("Recording") : N_("Recording done")) );
+ DisplayMessage( p_vout, vlc_gettext(on
+ ? N_("Recording") : N_("Recording done")) );
}
break;
if( p_input )
{
var_TriggerCallback( p_input, "frame-next" );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- "%s", _("Next frame") );
+ DisplayMessage( p_vout, _("Next frame") );
}
break;
+ case ACTIONID_SUBSYNC_MARKAUDIO:
+ {
+ p_sys->subtitle_delaybookmarks.i_time_audio = mdate();
+ DisplayMessage( p_vout, _("Sub sync: bookmarked audio time"));
+ break;
+ }
+ case ACTIONID_SUBSYNC_MARKSUB:
+ if( p_input )
+ {
+ vlc_value_t val, list, list2;
+ int i_count;
+ var_Get( p_input, "spu-es", &val );
+
+ var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
+ &list, &list2 );
+ i_count = list.p_list->i_count;
+ if( i_count < 1 || val.i_int < 0 )
+ {
+ DisplayMessage( p_vout, _("No active subtitle") );
+ var_FreeList( &list, &list2 );
+ break;
+ }
+ p_sys->subtitle_delaybookmarks.i_time_subtitle = mdate();
+ DisplayMessage( p_vout,
+ _("Sub sync: bookmarked subtitle time"));
+ var_FreeList( &list, &list2 );
+ }
+ break;
+ case ACTIONID_SUBSYNC_APPLY:
+ {
+ /* Warning! Can yield a pause in the playback.
+ * For example, the following succession of actions will yield a 5 second delay :
+ * - Pressing Shift-H (ACTIONID_SUBSYNC_MARKAUDIO)
+ * - wait 5 second
+ * - Press Shift-J (ACTIONID_SUBSYNC_MARKSUB)
+ * - Press Shift-K (ACTIONID_SUBSYNC_APPLY)
+ * --> 5 seconds pause
+ * This is due to var_SetTime() (and ultimately UpdatePtsDelay())
+ * which causes the video to pause for an equivalent duration
+ * (This problem is also present in the "Track synchronization" window) */
+ if ( p_input )
+ {
+ if ( (p_sys->subtitle_delaybookmarks.i_time_audio == 0) || (p_sys->subtitle_delaybookmarks.i_time_subtitle == 0) )
+ {
+ DisplayMessage( p_vout, _( "Sub sync: set bookmarks first!" ) );
+ }
+ else
+ {
+ int64_t i_current_subdelay = var_GetTime( p_input, "spu-delay" );
+ int64_t i_additional_subdelay = p_sys->subtitle_delaybookmarks.i_time_audio - p_sys->subtitle_delaybookmarks.i_time_subtitle;
+ int64_t i_total_subdelay = i_current_subdelay + i_additional_subdelay;
+ var_SetTime( p_input, "spu-delay", i_total_subdelay);
+ ClearChannels( p_intf, p_vout );
+ DisplayMessage( p_vout, _( "Sub sync: corrected %i ms (total delay = %i ms)" ),
+ (int)(i_additional_subdelay / 1000),
+ (int)(i_total_subdelay / 1000) );
+ p_sys->subtitle_delaybookmarks.i_time_audio = 0;
+ p_sys->subtitle_delaybookmarks.i_time_subtitle = 0;
+ }
+ }
+ break;
+ }
+ case ACTIONID_SUBSYNC_RESET:
+ {
+ var_SetTime( p_input, "spu-delay", 0);
+ ClearChannels( p_intf, p_vout );
+ DisplayMessage( p_vout, _( "Sub sync: delay reset" ) );
+ p_sys->subtitle_delaybookmarks.i_time_audio = 0;
+ p_sys->subtitle_delaybookmarks.i_time_subtitle = 0;
+ break;
+ }
+
case ACTIONID_SUBDELAY_DOWN:
case ACTIONID_SUBDELAY_UP:
{
int diff = (i_action == ACTIONID_SUBDELAY_UP) ? 50000 : -50000;
if( p_input )
{
+ vlc_value_t val, list, list2;
+ int i_count;
+ var_Get( p_input, "spu-es", &val );
+
+ var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
+ &list, &list2 );
+ i_count = list.p_list->i_count;
+ if( i_count < 1 || val.i_int < 0 )
+ {
+ DisplayMessage( p_vout, _("No active subtitle") );
+ var_FreeList( &list, &list2 );
+ break;
+ }
int64_t i_delay = var_GetTime( p_input, "spu-delay" ) + diff;
var_SetTime( p_input, "spu-delay", i_delay );
ClearChannels( p_intf, p_vout );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _( "Subtitle delay %i ms" ),
+ DisplayMessage( p_vout, _( "Subtitle delay %i ms" ),
(int)(i_delay/1000) );
+ var_FreeList( &list, &list2 );
}
break;
}
var_SetTime( p_input, "audio-delay", i_delay );
ClearChannels( p_intf, p_vout );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _( "Audio delay %i ms" ),
+ DisplayMessage( p_vout, _( "Audio delay %i ms" ),
(int)(i_delay/1000) );
}
break;
else
i++;
var_Set( p_input, "audio-es", list.p_list->p_values[i] );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _("Audio track: %s"),
+ DisplayMessage( p_vout, _("Audio track: %s"),
list2.p_list->p_values[i].psz_string );
}
var_FreeList( &list, &list2 );
i_count = list.p_list->i_count;
if( i_count <= 1 )
{
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _("Subtitle track: %s"), _("N/A") );
+ DisplayMessage( p_vout, _("Subtitle track: %s"),
+ _("N/A") );
var_FreeList( &list, &list2 );
break;
}
i = 0;
else
i++;
- var_Set( p_input, "spu-es", list.p_list->p_values[i] );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _("Subtitle track: %s"),
+ var_SetInteger( p_input, "spu-es", list.p_list->p_values[i].i_int );
+ var_SetInteger( p_input, "spu-choice", list.p_list->p_values[i].i_int );
+ DisplayMessage( p_vout, _("Subtitle track: %s"),
list2.p_list->p_values[i].psz_string );
var_FreeList( &list, &list2 );
}
break;
- case ACTIONID_PROGRAM_SID:
+ case ACTIONID_SUBTITLE_TOGGLE:
+ if( p_input )
+ {
+ vlc_value_t list, list2;
+ int i_count, i_sel_index, i_sel_id, i_old_id, i_new_index;
+ i_old_id = var_GetInteger( p_input, "spu-es" );
+ i_sel_id = var_GetInteger( p_input, "spu-choice" );
+
+ var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
+ &list, &list2 );
+ i_count = list.p_list->i_count;
+ if( i_count <= 1 )
+ {
+ DisplayMessage( p_vout, _("Subtitle track: %s"),
+ _("N/A") );
+ var_FreeList( &list, &list2 );
+ break;
+ }
+ for( i_sel_index = 0; i_sel_index < i_count; i_sel_index++ )
+ {
+ if( i_sel_id == list.p_list->p_values[i_sel_index].i_int )
+ {
+ break;
+ }
+ }
+ /* if there is nothing to toggle choose the first track */
+ if( !i_sel_index ) {
+ i_sel_index = 1;
+ i_sel_id = list.p_list->p_values[1].i_int;
+ var_SetInteger( p_input, "spu-choice", i_sel_id );
+ }
+
+ i_new_index = 0;
+ if( i_old_id != i_sel_id )
+ {
+ if( i_sel_index >= i_count )
+ {
+ var_SetInteger( p_input, "spu-choice", list.p_list->p_values[0].i_int );
+ }
+ else
+ {
+ i_new_index = i_sel_index;
+ }
+ }
+ var_SetInteger( p_input, "spu-es", list.p_list->p_values[i_new_index].i_int );
+ DisplayMessage( p_vout, _("Subtitle track: %s"),
+ list2.p_list->p_values[i_new_index].psz_string );
+ var_FreeList( &list, &list2 );
+ }
+ break;
+ case ACTIONID_PROGRAM_SID_NEXT:
+ case ACTIONID_PROGRAM_SID_PREV:
if( p_input )
{
vlc_value_t val, 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") );
+ DisplayMessage( p_vout, _("Program Service ID: %s"),
+ _("N/A") );
var_FreeList( &list, &list2 );
break;
}
break;
}
}
- /* value of program was not in choices list */
+ /* value of program sid 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++;
+ else if( i_action == ACTIONID_PROGRAM_SID_NEXT ) {
+ if( i == i_count - 1 )
+ i = 0;
+ else
+ 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] );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _("Program Service ID: %s"),
+ DisplayMessage( p_vout, _("Program Service ID: %s"),
list2.p_list->p_values[i].psz_string );
var_FreeList( &list, &list2 );
}
break;
}
- /* Input navigation (DVD & MKV) */
+ /* Input navigation */
case ACTIONID_TITLE_PREV:
if( p_input )
var_TriggerCallback( p_input, "prev-title" );
if( p_input )
var_SetInteger( p_input, "title 0", 2 );
break;
+ case ACTIONID_NAV_ACTIVATE:
+ case ACTIONID_NAV_UP:
+ case ACTIONID_NAV_DOWN:
+ case ACTIONID_NAV_LEFT:
+ case ACTIONID_NAV_RIGHT:
+ if( p_input )
+ input_Control( p_input, i_action - ACTIONID_NAV_ACTIVATE
+ + INPUT_NAV_ACTIVATE, NULL );
+ break;
/* Video Output actions */
case ACTIONID_SNAPSHOT:
case ACTIONID_TOGGLE_FULLSCREEN:
{
- bool fs = var_ToggleBool( p_playlist, "fullscreen" );
if( p_vout )
- var_SetBool( p_vout, "fullscreen", fs );
+ {
+ bool fs = var_ToggleBool( p_vout, "fullscreen" );
+ var_SetBool( p_playlist, "fullscreen", fs );
+ }
+ else
+ var_ToggleBool( p_playlist, "fullscreen" );
break;
}
if( i == val_list.p_list->i_count ) i = 0;
var_SetString( p_vout, "aspect-ratio",
val_list.p_list->p_values[i].psz_string );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _("Aspect ratio: %s"),
+ DisplayMessage( p_vout, _("Aspect ratio: %s"),
text_list.p_list->p_values[i].psz_string );
var_FreeList( &val_list, &text_list );
if( i == val_list.p_list->i_count ) i = 0;
var_SetString( p_vout, "crop",
val_list.p_list->p_values[i].psz_string );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _("Crop: %s"),
+ DisplayMessage( p_vout, _("Crop: %s"),
text_list.p_list->p_values[i].psz_string );
var_FreeList( &val_list, &text_list );
if ( f_scalefactor != 1.f )
{
var_SetFloat( p_vout, "scale", 1.f );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- "%s", _("Zooming reset") );
+ DisplayMessage( p_vout, _("Zooming reset") );
}
else
{
bool b_autoscale = !var_GetBool( p_vout, "autoscale" );
var_SetBool( p_vout, "autoscale", b_autoscale );
if( b_autoscale )
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- "%s", _("Scaled to screen") );
+ DisplayMessage( p_vout, _("Scaled to screen") );
else
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- "%s", _("Original Size") );
+ DisplayMessage( p_vout, _("Original Size") );
}
}
break;
if( i == -1 ) i = val_list.p_list->i_count-1;
var_SetFloat( p_vout, "zoom",
val_list.p_list->p_values[i].f_float );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _("Zoom mode: %s"),
+ DisplayMessage( p_vout, _("Zoom mode: %s"),
text_list.p_list->p_values[i].psz_string );
var_FreeList( &val_list, &text_list );
if( i_deinterlace != 0 )
{
var_SetInteger( p_vout, "deinterlace", 0 );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- "%s", _("Deinterlace off") );
+ DisplayMessage( p_vout, _("Deinterlace off") );
}
else
{
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 )
+ if( psz_mode && !var_Change( p_vout, "deinterlace-mode", VLC_VAR_GETCHOICES, &vlist, &tlist ) )
{
const char *psz_text = NULL;
for( int i = 0; i < vlist.p_list->i_count; i++ )
break;
}
}
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- "%s (%s)", _("Deinterlace on"), psz_text ? psz_text : psz_mode );
+ DisplayMessage( p_vout, "%s (%s)", _("Deinterlace on"),
+ psz_text ? psz_text : psz_mode );
var_FreeList( &vlist, &tlist );
}
{
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 )
+ if( psz_mode && !var_Change( p_vout, "deinterlace-mode", VLC_VAR_GETCHOICES, &vlist, &tlist ))
{
const char *psz_text = NULL;
int i;
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 );
+ DisplayMessage( p_vout, "%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 );
+ DisplayMessage( p_vout, "%s (%s)", _("Deinterlace off"),
+ psz_text ? psz_text : psz_mode );
}
var_FreeList( &vlist, &tlist );
case ACTIONID_SUBPOS_DOWN:
case ACTIONID_SUBPOS_UP:
{
- int i_pos;
- if( i_action == ACTIONID_SUBPOS_DOWN )
- i_pos = var_DecInteger( p_vout, "sub-margin" );
- else
- i_pos = var_IncInteger( p_vout, "sub-margin" );
+ if( p_input )
+ {
+ vlc_value_t val, list, list2;
+ int i_count;
+ var_Get( p_input, "spu-es", &val );
- ClearChannels( p_intf, p_vout );
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
- _( "Subtitle position %d px" ), i_pos );
+ var_Change( p_input, "spu-es", VLC_VAR_GETCHOICES,
+ &list, &list2 );
+ i_count = list.p_list->i_count;
+ if( i_count < 1 || val.i_int < 0 )
+ {
+ DisplayMessage( p_vout,
+ _("Subtitle position: no active subtitle") );
+ var_FreeList( &list, &list2 );
+ break;
+ }
+
+ int i_pos;
+ if( i_action == ACTIONID_SUBPOS_DOWN )
+ i_pos = var_DecInteger( p_vout, "sub-margin" );
+ else
+ i_pos = var_IncInteger( p_vout, "sub-margin" );
+
+ ClearChannels( p_intf, p_vout );
+ DisplayMessage( p_vout, _( "Subtitle position %d px" ), i_pos );
+ var_FreeList( &list, &list2 );
+ }
break;
}
return VLC_SUCCESS;
}
-/*****************************************************************************
- * SpecialKeyEvent: callback for mouse events
- *****************************************************************************/
-static int SpecialKeyEvent( vlc_object_t *libvlc, char const *psz_var,
- vlc_value_t oldval, vlc_value_t newval,
- void *p_data )
-{
- (void)p_data;
- (void)psz_var;
- (void)oldval;
-
- /* Special action for mouse event */
- /* FIXME: rework hotkeys handling to allow more than 1 event
- * to trigger one same action */
- switch (newval.i_int & ~KEY_MODIFIER)
- {
- case KEY_MENU:
- var_SetBool( libvlc, "intf-popupmenu", true );
- break;
- }
-
- return VLC_SUCCESS;
-}
-
/*****************************************************************************
* ActionEvent: callback for hotkey actions
*****************************************************************************/
if( time.i_time > 0 )
{
secstotimestr( psz_duration, time.i_time / 1000000 );
- DisplayMessage( p_vout, POSITION_TEXT_CHAN, "%s / %s",
- psz_time, psz_duration );
+ DisplayMessage( p_vout, "%s / %s", psz_time, psz_duration );
}
else if( i_seconds > 0 )
{
- DisplayMessage( p_vout, POSITION_TEXT_CHAN, "%s", psz_time );
+ DisplayMessage( p_vout, "%s", psz_time );
}
if( var_GetBool( p_vout, "fullscreen" ) )
{
var_Get( p_input, "position", &pos );
- vout_OSDSlider( p_vout, POSITION_WIDGET_CHAN,
+ vout_OSDSlider( p_vout, p_intf->p_sys->slider_chan,
pos.f_float * 100, OSD_HOR_SLIDER );
}
}
ClearChannels( p_intf, p_vout );
if( var_GetBool( p_vout, "fullscreen" ) )
- vout_OSDSlider( p_vout, VOLUME_WIDGET_CHAN, lround(vol * 100.),
- OSD_VERT_SLIDER );
- DisplayMessage( p_vout, VOLUME_TEXT_CHAN, _( "Volume %ld%%" ),
- lround(vol * 100.) );
+ vout_OSDSlider( p_vout, p_intf->p_sys->slider_chan,
+ lroundf(vol * 100.f), OSD_VERT_SLIDER );
+ DisplayMessage( p_vout, _( "Volume %ld%%" ), lroundf(vol * 100.f) );
}
static void DisplayRate( vout_thread_t *p_vout, float f_rate )
{
- DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL, _("Speed: %.2fx"), f_rate );
+ DisplayMessage( p_vout, _("Speed: %.2fx"), f_rate );
}
static float AdjustRateFine( vlc_object_t *p_obj, const int i_dir )
if( p_vout )
{
vout_FlushSubpictureChannel( p_vout, SPU_DEFAULT_CHANNEL );
- for( int i = 0; i < CHANNELS_NUMBER; i++ )
- vout_FlushSubpictureChannel( p_vout, p_intf->p_sys->p_channels[i] );
+ vout_FlushSubpictureChannel( p_vout, p_intf->p_sys->slider_chan );
}
}