Commit 3527f69d authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

libvlccore: "intf-show" is now a libvlc var instead of a playlist var. This...

libvlccore: "intf-show" is now a libvlc var instead of a playlist var. This removes a vout->playlist dependency.
parent 65f35e28
......@@ -226,9 +226,9 @@ static void Run( intf_thread_t *p_intf )
}
/* Interface showing */
else if( i_action == ACTIONID_INTF_SHOW )
var_SetBool( p_playlist, "intf-show", true );
var_SetBool( p_intf->p_libvlc, "intf-show", true );
else if( i_action == ACTIONID_INTF_HIDE )
var_SetBool( p_playlist, "intf-show", false );
var_SetBool( p_intf->p_libvlc, "intf-show", false );
/* Video Output actions */
else if( i_action == ACTIONID_SNAPSHOT )
{
......
......@@ -127,9 +127,7 @@ static void RunIntf( intf_thread_t *p_intf )
/* Notify the interfaces */
if( p_intf->p_sys->b_triggered )
{
playlist_t *p_playlist = pl_Yield( p_intf );
var_SetBool( p_playlist, "intf-show", true );
vlc_object_release( p_playlist );
var_SetBool( p_intf->p_libvlc, "intf-show", true );
p_intf->p_sys->b_triggered = false;
}
......
......@@ -569,7 +569,7 @@ static VLCMain *_o_sharedMainInstance = nil;
val.b_bool = false;
var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self);
var_AddCallback( p_playlist, "intf-show", ShowController, self);
var_AddCallback( p_intf->p_libvlc, "intf-show", ShowController, self);
vlc_object_release( p_playlist );
......
......@@ -222,10 +222,11 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
var_AddCallback( p_intf, "interaction", InteractCallback, this );
p_intf->b_interaction = true;
var_AddCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Register callback for the intf-popupmenu variable */
playlist_t *p_playlist = pl_Yield( p_intf );
var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
var_AddCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
pl_Release( p_intf );
/* VideoWidget connect mess to avoid different threads speaking to each other */
......@@ -284,10 +285,11 @@ MainInterface::~MainInterface()
settings->endGroup();
delete settings;
var_DelCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Unregister callback for the intf-popupmenu variable */
playlist_t *p_playlist = pl_Yield( p_intf );
var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
var_DelCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
pl_Release( p_intf );
p_intf->b_interaction = false;
......@@ -1211,7 +1213,7 @@ static int PopupMenuCB( vlc_object_t *p_this, const char *psz_variable,
}
/*****************************************************************************
* IntfShowCB: callback triggered by the intf-show playlist variable.
* IntfShowCB: callback triggered by the intf-show libvlc variable.
*****************************************************************************/
static int IntfShowCB( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
......
......@@ -148,7 +148,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
var_AddCallback( pIntf->p_sys->p_playlist, "item-deleted",
onItemDelete, this );
// Called when the "interface shower" wants us to show the skin
var_AddCallback( pIntf->p_sys->p_playlist, "intf-show",
var_AddCallback( pIntf->p_libvlc, "intf-show",
onIntfShow, this );
// Called when the current played item changes
var_AddCallback( pIntf->p_sys->p_playlist, "playlist-current",
......@@ -193,7 +193,7 @@ VlcProc::~VlcProc()
onItemAppend, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted",
onItemDelete, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "intf-show",
var_DelCallback( getIntf()->p_libvlc, "intf-show",
onIntfShow, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-current",
onPlaylistChange, this );
......
......@@ -46,6 +46,8 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface )
p_main_interface = _p_main_interface;
b_init = 0;
var_AddCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Register callback for the intf-popupmenu variable */
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
......@@ -53,7 +55,6 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface )
if( p_playlist != NULL )
{
var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
var_AddCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
vlc_object_release( p_playlist );
}
......@@ -62,6 +63,8 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface )
Timer::~Timer()
{
var_DelCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Unregister callback */
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
......@@ -69,7 +72,6 @@ Timer::~Timer()
if( p_playlist != NULL )
{
var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
var_DelCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
vlc_object_release( p_playlist );
}
}
......
......@@ -459,15 +459,10 @@ static int Manage( vout_thread_t *p_vout )
val.i_int &= ~2;
var_Set( p_vout, "mouse-button-down", val );
p_playlist = pl_Yield( p_vout );
if( p_playlist != NULL )
{
vlc_value_t val;
var_Get( p_playlist, "intf-show", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "intf-show", val );
pl_Release( p_playlist );
}
vlc_value_t val;
var_Get( p_vout->p_libvlc, "intf-show", &val );
val.b_bool = !val.b_bool;
var_Set( p_vout->p_libvlc, "intf-show", val );
}
break;
......
......@@ -1318,15 +1318,9 @@ static int ManageVideo( vout_thread_t *p_vout )
val.i_int &= ~2;
var_Set( p_vout, "mouse-button-down", val );
p_playlist = pl_Yield( p_vout );
if( p_playlist != NULL )
{
vlc_value_t val;
var_Get( p_playlist, "intf-show", &val );
val.b_bool = !val.b_bool;
var_Set( p_playlist, "intf-show", val );
pl_Release( p_playlist );
}
var_Get( p_vout->p_libvlc, "intf-show", &val );
val.b_bool = !val.b_bool;
var_Set( p_vout->p_libvlc, "intf-show", val );
}
break;
......
......@@ -896,6 +896,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
/* Create volume callback system. */
var_Create( p_libvlc, "volume-change", VLC_VAR_BOOL );
/* Create a variable for showing the interface (moved from playlist). */
var_Create( p_playlist, "intf-show", VLC_VAR_BOOL );
var_SetBool( p_playlist, "intf-show", true );
/*
* Get input filenames given as commandline arguments
*/
......
......@@ -664,10 +664,6 @@ static void VariablesInit( playlist_t *p_playlist )
var_Create( p_playlist, "intf-popupmenu", VLC_VAR_BOOL );
var_Create( p_playlist, "intf-show", VLC_VAR_BOOL );
val.b_bool = true;
var_Set( p_playlist, "intf-show", val );
var_Create( p_playlist, "activity", VLC_VAR_INTEGER );
var_SetInteger( p_playlist, "activity", 0 );
......
......@@ -493,10 +493,6 @@ static void vout_Destructor( vlc_object_t * p_this )
#ifndef __APPLE__
vout_thread_t *p_another_vout;
playlist_t *p_playlist = pl_Yield( p_this );
if( !p_playlist )
return;
/* This is a dirty hack mostly for Linux, where there is no way to get the
* GUI back if you closed it while playing video. This is solved in
* Mac OS X, where we have this novelty called menubar, that will always
......@@ -505,10 +501,9 @@ static void vout_Destructor( vlc_object_t * p_this )
p_another_vout = vlc_object_find( p_this->p_libvlc,
VLC_OBJECT_VOUT, FIND_ANYWHERE );
if( p_another_vout == NULL )
var_SetBool( p_playlist, "intf-show", true );
var_SetBool( p_this->p_libvlc, "intf-show", true );
else
vlc_object_release( p_another_vout );
pl_Release( p_playlist );
#endif
}
......
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