Commit 9cfa6038 authored by Yoann Peronneau's avatar Yoann Peronneau

* src/video_output/video_widgets.c: Added OSD sliders when changing volume or...

* src/video_output/video_widgets.c: Added OSD sliders when changing volume or position with hotkeys.
Those sliders are graphical (ie not written with characters) and we can now add others OSD "widgets".

parent a3bd6ef2
...@@ -337,6 +337,7 @@ SOURCES_libvlc_common = \ ...@@ -337,6 +337,7 @@ SOURCES_libvlc_common = \
src/video_output/vout_pictures.c \ src/video_output/vout_pictures.c \
src/video_output/vout_pictures.h \ src/video_output/vout_pictures.h \
src/video_output/video_text.c \ src/video_output/video_text.c \
src/video_output/video_widgets.c \
src/video_output/vout_subpictures.c \ src/video_output/vout_subpictures.c \
src/video_output/vout_synchro.c \ src/video_output/vout_synchro.c \
src/video_output/vout_intf.c \ src/video_output/vout_intf.c \
......
...@@ -56,3 +56,4 @@ VLC_EXPORT( void, __vout_OSDMessage, ( vlc_object_t *, char *, ... ) ); ...@@ -56,3 +56,4 @@ VLC_EXPORT( void, __vout_OSDMessage, ( vlc_object_t *, char *, ... ) );
#else #else
# define vout_OSDMessage __vout_OSDMessage # define vout_OSDMessage __vout_OSDMessage
#endif #endif
VLC_EXPORT( void, vout_OSDSlider, ( vlc_object_t *, int , short ) );
...@@ -65,6 +65,7 @@ static int ActionKeyCB( vlc_object_t *, char const *, ...@@ -65,6 +65,7 @@ static int ActionKeyCB( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * ); vlc_value_t, vlc_value_t, void * );
static void PlayBookmark( intf_thread_t *, int ); static void PlayBookmark( intf_thread_t *, int );
static void SetBookmark ( intf_thread_t *, int ); static void SetBookmark ( intf_thread_t *, int );
static int GetPosition ( intf_thread_t * );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
...@@ -238,13 +239,32 @@ static void Run( intf_thread_t *p_intf ) ...@@ -238,13 +239,32 @@ static void Run( intf_thread_t *p_intf )
{ {
audio_volume_t i_newvol; audio_volume_t i_newvol;
aout_VolumeUp( p_intf, 1, &i_newvol ); aout_VolumeUp( p_intf, 1, &i_newvol );
vout_OSDMessage( p_intf, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX ); if( p_vout->b_fullscreen )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
i_newvol*100/AOUT_VOLUME_MAX, 1 );
}
else
{
vout_OSDMessage( p_intf, "Vol %d%%",
2*i_newvol*100/AOUT_VOLUME_MAX );
}
} }
else if( i_action == ACTIONID_VOL_DOWN ) else if( i_action == ACTIONID_VOL_DOWN )
{ {
audio_volume_t i_newvol; audio_volume_t i_newvol;
aout_VolumeDown( p_intf, 1, &i_newvol ); aout_VolumeDown( p_intf, 1, &i_newvol );
vout_OSDMessage( p_intf, "Vol %d%%", i_newvol*100/AOUT_VOLUME_MAX); if( p_vout->b_fullscreen )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
i_newvol*100/AOUT_VOLUME_MAX, 1 );
}
else
{
vout_OSDMessage( p_intf, "Vol %d%%",
2*i_newvol*100/AOUT_VOLUME_MAX );
}
} }
else if( i_action == ACTIONID_SUBDELAY_DOWN ) else if( i_action == ACTIONID_SUBDELAY_DOWN )
{ {
...@@ -324,47 +344,98 @@ static void Run( intf_thread_t *p_intf ) ...@@ -324,47 +344,98 @@ static void Run( intf_thread_t *p_intf )
} }
else if( p_input ) else if( p_input )
{ {
vlc_bool_t b_seekable = p_input->stream.b_seekable;
if( i_action == ACTIONID_PAUSE ) if( i_action == ACTIONID_PAUSE )
{ {
vout_OSDMessage( p_intf, _( "Pause" ) ); vout_OSDMessage( p_intf, _( "Pause" ) );
val.i_int = PAUSE_S; val.i_int = PAUSE_S;
var_Set( p_input, "state", val ); var_Set( p_input, "state", val );
} }
else if( i_action == ACTIONID_JUMP_BACKWARD_10SEC ) else if( i_action == ACTIONID_JUMP_BACKWARD_10SEC && b_seekable )
{ {
vout_OSDMessage( p_intf, _( "Jump -10 seconds" ) );
val.i_time = -10000000; val.i_time = -10000000;
var_Set( p_input, "time-offset", val ); var_Set( p_input, "time-offset", val );
if( p_vout->b_fullscreen )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
GetPosition( p_intf ), 0 );
}
else
{
vout_OSDMessage( p_intf, _( "Jump -10 seconds" ) );
}
} }
else if( i_action == ACTIONID_JUMP_FORWARD_10SEC ) else if( i_action == ACTIONID_JUMP_FORWARD_10SEC && b_seekable )
{ {
vout_OSDMessage( p_intf, _( "Jump +10 seconds" ) );
val.i_time = 10000000; val.i_time = 10000000;
var_Set( p_input, "time-offset", val ); var_Set( p_input, "time-offset", val );
if( p_vout->b_fullscreen )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
GetPosition( p_intf ), 0 );
}
else
{
vout_OSDMessage( p_intf, _( "Jump +10 seconds" ) );
}
} }
else if( i_action == ACTIONID_JUMP_BACKWARD_1MIN ) else if( i_action == ACTIONID_JUMP_BACKWARD_1MIN && b_seekable )
{ {
vout_OSDMessage( p_intf, _( "Jump -1 minute" ) );
val.i_time = -60000000; val.i_time = -60000000;
var_Set( p_input, "time-offset", val ); var_Set( p_input, "time-offset", val );
if( p_vout->b_fullscreen )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
GetPosition( p_intf ), 0 );
}
else
{
vout_OSDMessage( p_intf, _( "Jump -1 minute" ) );
}
} }
else if( i_action == ACTIONID_JUMP_FORWARD_1MIN ) else if( i_action == ACTIONID_JUMP_FORWARD_1MIN && b_seekable )
{ {
vout_OSDMessage( p_intf, _( "Jump +1 minute" ) );
val.i_time = 60000000; val.i_time = 60000000;
var_Set( p_input, "time-offset", val ); var_Set( p_input, "time-offset", val );
if( p_vout->b_fullscreen )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
GetPosition( p_intf ), 0 );
}
else
{
vout_OSDMessage( p_intf, _( "Jump +1 minute" ) );
}
} }
else if( i_action == ACTIONID_JUMP_BACKWARD_5MIN ) else if( i_action == ACTIONID_JUMP_BACKWARD_5MIN && b_seekable )
{ {
vout_OSDMessage( p_intf, _( "Jump -5 minutes" ) ); vout_OSDMessage( p_intf, _( "Jump -5 minutes" ) );
val.i_time = -300000000; val.i_time = -300000000;
var_Set( p_input, "time-offset", val ); var_Set( p_input, "time-offset", val );
if( p_vout->b_fullscreen )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
GetPosition( p_intf ), 0 );
}
else
{
vout_OSDMessage( p_intf, _( "Jump -5 minutes" ) );
}
} }
else if( i_action == ACTIONID_JUMP_FORWARD_5MIN ) else if( i_action == ACTIONID_JUMP_FORWARD_5MIN && b_seekable )
{ {
vout_OSDMessage( p_intf, _( "Jump +5 minutes" ) );
val.i_time = 300000000; val.i_time = 300000000;
var_Set( p_input, "time-offset", val ); var_Set( p_input, "time-offset", val );
if( p_vout->b_fullscreen )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
GetPosition( p_intf ), 0 );
}
else
{
vout_OSDMessage( p_intf, _( "Jump +5 minutes" ) );
}
} }
else if( i_action == ACTIONID_NEXT ) else if( i_action == ACTIONID_NEXT )
{ {
...@@ -553,3 +624,18 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num ) ...@@ -553,3 +624,18 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num )
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
} }
static int GetPosition( intf_thread_t *p_intf )
{
input_thread_t *p_input =
(input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
if( p_input )
{
vlc_value_t pos;
var_Get( p_input, "position", &pos );
vlc_object_release( p_input );
return pos.f_float * 100;
}
return -1;
}
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_subpictures.c : subpicture management functions * vout_subpictures.c : subpicture management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2004 VideoLAN * Copyright (C) 2000-2004 VideoLAN
* $Id: vout_subpictures.c,v 1.24 2004/01/06 12:02:06 zorglub Exp $ * $Id$
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -272,7 +272,8 @@ subpicture_t *vout_SortSubPictures( vout_thread_t *p_vout, ...@@ -272,7 +272,8 @@ subpicture_t *vout_SortSubPictures( vout_thread_t *p_vout,
p_vout->p_subpicture[i_index].p_next = p_subpic; p_vout->p_subpicture[i_index].p_next = p_subpic;
p_subpic = &p_vout->p_subpicture[i_index]; p_subpic = &p_vout->p_subpicture[i_index];
/* If it's the 2nd youngest subpicture, register its date */ if( !ephemer_date || ephemer_date > p_subpic->i_start ) /* If it's the 2nd youngest subpicture, register its date */
if( !ephemer_date || ephemer_date > p_subpic->i_start )
{ {
ephemer_date = p_subpic->i_start; ephemer_date = p_subpic->i_start;
} }
......
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