Browse Source

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

pull/2/head
Pierre d'Herbemont 18 years ago
parent
commit
3527f69d9f
  1. 4
      modules/control/hotkeys.c
  2. 4
      modules/control/showintf.c
  3. 2
      modules/gui/macosx/intf.m
  4. 8
      modules/gui/qt4/main_interface.cpp
  5. 4
      modules/gui/skins2/src/vlcproc.cpp
  6. 6
      modules/gui/wxwidgets/timer.cpp
  7. 13
      modules/video_output/sdl.c
  8. 12
      modules/video_output/x11/xcommon.c
  9. 4
      src/libvlc.c
  10. 4
      src/playlist/engine.c
  11. 7
      src/video_output/video_output.c

4
modules/control/hotkeys.c

@ -226,9 +226,9 @@ static void Run( intf_thread_t *p_intf )
} }
/* Interface showing */ /* Interface showing */
else if( i_action == ACTIONID_INTF_SHOW ) 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 ) 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 */ /* Video Output actions */
else if( i_action == ACTIONID_SNAPSHOT ) else if( i_action == ACTIONID_SNAPSHOT )
{ {

4
modules/control/showintf.c

@ -127,9 +127,7 @@ static void RunIntf( intf_thread_t *p_intf )
/* Notify the interfaces */ /* Notify the interfaces */
if( p_intf->p_sys->b_triggered ) if( p_intf->p_sys->b_triggered )
{ {
playlist_t *p_playlist = pl_Yield( p_intf ); var_SetBool( p_intf->p_libvlc, "intf-show", true );
var_SetBool( p_playlist, "intf-show", true );
vlc_object_release( p_playlist );
p_intf->p_sys->b_triggered = false; p_intf->p_sys->b_triggered = false;
} }

2
modules/gui/macosx/intf.m

@ -569,7 +569,7 @@ static VLCMain *_o_sharedMainInstance = nil;
val.b_bool = false; val.b_bool = false;
var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self); 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 ); vlc_object_release( p_playlist );

8
modules/gui/qt4/main_interface.cpp

@ -222,10 +222,11 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
var_AddCallback( p_intf, "interaction", InteractCallback, this ); var_AddCallback( p_intf, "interaction", InteractCallback, this );
p_intf->b_interaction = true; p_intf->b_interaction = true;
var_AddCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Register callback for the intf-popupmenu variable */ /* Register callback for the intf-popupmenu variable */
playlist_t *p_playlist = pl_Yield( p_intf ); playlist_t *p_playlist = pl_Yield( p_intf );
var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf ); var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
var_AddCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
pl_Release( p_intf ); pl_Release( p_intf );
/* VideoWidget connect mess to avoid different threads speaking to each other */ /* VideoWidget connect mess to avoid different threads speaking to each other */
@ -284,10 +285,11 @@ MainInterface::~MainInterface()
settings->endGroup(); settings->endGroup();
delete settings; delete settings;
var_DelCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Unregister callback for the intf-popupmenu variable */ /* Unregister callback for the intf-popupmenu variable */
playlist_t *p_playlist = pl_Yield( p_intf ); playlist_t *p_playlist = pl_Yield( p_intf );
var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf ); var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
var_DelCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
pl_Release( p_intf ); pl_Release( p_intf );
p_intf->b_interaction = false; 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, static int IntfShowCB( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param ) vlc_value_t old_val, vlc_value_t new_val, void *param )

4
modules/gui/skins2/src/vlcproc.cpp

@ -148,7 +148,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
var_AddCallback( pIntf->p_sys->p_playlist, "item-deleted", var_AddCallback( pIntf->p_sys->p_playlist, "item-deleted",
onItemDelete, this ); onItemDelete, this );
// Called when the "interface shower" wants us to show the skin // 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 ); onIntfShow, this );
// Called when the current played item changes // Called when the current played item changes
var_AddCallback( pIntf->p_sys->p_playlist, "playlist-current", var_AddCallback( pIntf->p_sys->p_playlist, "playlist-current",
@ -193,7 +193,7 @@ VlcProc::~VlcProc()
onItemAppend, this ); onItemAppend, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted", var_DelCallback( getIntf()->p_sys->p_playlist, "item-deleted",
onItemDelete, this ); onItemDelete, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "intf-show", var_DelCallback( getIntf()->p_libvlc, "intf-show",
onIntfShow, this ); onIntfShow, this );
var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-current", var_DelCallback( getIntf()->p_sys->p_playlist, "playlist-current",
onPlaylistChange, this ); onPlaylistChange, this );

6
modules/gui/wxwidgets/timer.cpp

@ -46,6 +46,8 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface )
p_main_interface = _p_main_interface; p_main_interface = _p_main_interface;
b_init = 0; b_init = 0;
var_AddCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Register callback for the intf-popupmenu variable */ /* Register callback for the intf-popupmenu variable */
playlist_t *p_playlist = playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_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 ) if( p_playlist != NULL )
{ {
var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf ); var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
var_AddCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
@ -62,6 +63,8 @@ Timer::Timer( intf_thread_t *_p_intf, Interface *_p_main_interface )
Timer::~Timer() Timer::~Timer()
{ {
var_DelCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
/* Unregister callback */ /* Unregister callback */
playlist_t *p_playlist = playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
@ -69,7 +72,6 @@ Timer::~Timer()
if( p_playlist != NULL ) if( p_playlist != NULL )
{ {
var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf ); var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
var_DelCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
} }

13
modules/video_output/sdl.c

@ -459,15 +459,10 @@ static int Manage( vout_thread_t *p_vout )
val.i_int &= ~2; val.i_int &= ~2;
var_Set( p_vout, "mouse-button-down", val ); var_Set( p_vout, "mouse-button-down", val );
p_playlist = pl_Yield( p_vout ); vlc_value_t val;
if( p_playlist != NULL ) var_Get( p_vout->p_libvlc, "intf-show", &val );
{ val.b_bool = !val.b_bool;
vlc_value_t val; var_Set( p_vout->p_libvlc, "intf-show", 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 );
}
} }
break; break;

12
modules/video_output/x11/xcommon.c

@ -1318,15 +1318,9 @@ static int ManageVideo( vout_thread_t *p_vout )
val.i_int &= ~2; val.i_int &= ~2;
var_Set( p_vout, "mouse-button-down", val ); var_Set( p_vout, "mouse-button-down", val );
p_playlist = pl_Yield( p_vout ); var_Get( p_vout->p_libvlc, "intf-show", &val );
if( p_playlist != NULL ) val.b_bool = !val.b_bool;
{ var_Set( p_vout->p_libvlc, "intf-show", val );
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 );
}
} }
break; break;

4
src/libvlc.c

@ -896,6 +896,10 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
/* Create volume callback system. */ /* Create volume callback system. */
var_Create( p_libvlc, "volume-change", VLC_VAR_BOOL ); 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 * Get input filenames given as commandline arguments
*/ */

4
src/playlist/engine.c

@ -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-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_Create( p_playlist, "activity", VLC_VAR_INTEGER );
var_SetInteger( p_playlist, "activity", 0 ); var_SetInteger( p_playlist, "activity", 0 );

7
src/video_output/video_output.c

@ -493,10 +493,6 @@ static void vout_Destructor( vlc_object_t * p_this )
#ifndef __APPLE__ #ifndef __APPLE__
vout_thread_t *p_another_vout; 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 /* 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 * 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 * 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, p_another_vout = vlc_object_find( p_this->p_libvlc,
VLC_OBJECT_VOUT, FIND_ANYWHERE ); VLC_OBJECT_VOUT, FIND_ANYWHERE );
if( p_another_vout == NULL ) if( p_another_vout == NULL )
var_SetBool( p_playlist, "intf-show", true ); var_SetBool( p_this->p_libvlc, "intf-show", true );
else else
vlc_object_release( p_another_vout ); vlc_object_release( p_another_vout );
pl_Release( p_playlist );
#endif #endif
} }

Loading…
Cancel
Save