Commit 4b13c40d authored by Yoann Peronneau's avatar Yoann Peronneau

* modules/control/hotkeys.c: check if there is a vout before writing some OSD,...

* modules/control/hotkeys.c: check if there is a vout before writing some OSD, since hotkeys can also be called from an interface now.
* modules/gui/ncurses/ncurses.c: don't add empty ('') entry, in the open function
parent 9998197a
...@@ -239,30 +239,36 @@ static void Run( intf_thread_t *p_intf ) ...@@ -239,30 +239,36 @@ 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 );
if( !p_vout->p_parent_intf || p_vout->b_fullscreen ) if( p_vout )
{ {
vout_OSDSlider( VLC_OBJECT( p_intf ), if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
i_newvol*100/AOUT_VOLUME_MAX, 1 ); {
} vout_OSDSlider( VLC_OBJECT( p_intf ),
else i_newvol*100/AOUT_VOLUME_MAX, 1 );
{ }
vout_OSDMessage( p_intf, "Vol %d%%", else
2*i_newvol*100/AOUT_VOLUME_MAX ); {
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 );
if( !p_vout->p_parent_intf || p_vout->b_fullscreen ) if( p_vout )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
i_newvol*100/AOUT_VOLUME_MAX, 1 );
}
else
{ {
vout_OSDMessage( p_intf, "Vol %d%%", if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
2*i_newvol*100/AOUT_VOLUME_MAX ); {
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 );
}
} }
} }
...@@ -370,42 +376,51 @@ static void Run( intf_thread_t *p_intf ) ...@@ -370,42 +376,51 @@ static void Run( intf_thread_t *p_intf )
{ {
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->p_parent_intf || p_vout->b_fullscreen ) if( p_vout )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
GetPosition( p_intf ), 0 );
}
else
{ {
vout_OSDMessage( p_intf, _( "Jump +10 seconds" ) ); if( !p_vout->p_parent_intf || 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 && b_seekable ) else if( i_action == ACTIONID_JUMP_BACKWARD_1MIN && b_seekable )
{ {
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->p_parent_intf || p_vout->b_fullscreen ) if( p_vout )
{ {
vout_OSDSlider( VLC_OBJECT( p_intf ), if( !p_vout->p_parent_intf || p_vout->b_fullscreen )
GetPosition( p_intf ), 0 ); {
} vout_OSDSlider( VLC_OBJECT( p_intf ),
else GetPosition( p_intf ), 0 );
{ }
vout_OSDMessage( p_intf, _( "Jump -1 minute" ) ); else
{
vout_OSDMessage( p_intf, _( "Jump -1 minute" ) );
}
} }
} }
else if( i_action == ACTIONID_JUMP_FORWARD_1MIN && b_seekable ) else if( i_action == ACTIONID_JUMP_FORWARD_1MIN && b_seekable )
{ {
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->p_parent_intf || p_vout->b_fullscreen ) if( p_vout )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
GetPosition( p_intf ), 0 );
}
else
{ {
vout_OSDMessage( p_intf, _( "Jump +1 minute" ) ); if( !p_vout->p_parent_intf || 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 && b_seekable ) else if( i_action == ACTIONID_JUMP_BACKWARD_5MIN && b_seekable )
...@@ -413,28 +428,34 @@ static void Run( intf_thread_t *p_intf ) ...@@ -413,28 +428,34 @@ static void Run( intf_thread_t *p_intf )
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->p_parent_intf || p_vout->b_fullscreen ) if( p_vout )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
GetPosition( p_intf ), 0 );
}
else
{ {
vout_OSDMessage( p_intf, _( "Jump -5 minutes" ) ); if( !p_vout->p_parent_intf || 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 && b_seekable ) else if( i_action == ACTIONID_JUMP_FORWARD_5MIN && b_seekable )
{ {
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->p_parent_intf || p_vout->b_fullscreen ) if( p_vout )
{
vout_OSDSlider( VLC_OBJECT( p_intf ),
GetPosition( p_intf ), 0 );
}
else
{ {
vout_OSDMessage( p_intf, _( "Jump +5 minutes" ) ); if( !p_vout->p_parent_intf || 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 )
......
...@@ -491,7 +491,7 @@ static int HandleKey( intf_thread_t *p_intf, int i_key ) ...@@ -491,7 +491,7 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
return 1; return 1;
case KEY_ENTER: case KEY_ENTER:
case 0x0d: case 0x0d:
if( p_playlist ) if( p_playlist && i_chain_len > 0 )
{ {
playlist_Add( p_playlist, p_sys->psz_open_chain, playlist_Add( p_playlist, p_sys->psz_open_chain,
p_sys->psz_open_chain, p_sys->psz_open_chain,
......
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