libvlccore: "intf-show" is now a libvlc var instead of a playlist var. This removes...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 1 Jun 2008 19:17:16 +0000 (21:17 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 1 Jun 2008 19:19:23 +0000 (21:19 +0200)
modules/control/hotkeys.c
modules/control/showintf.c
modules/gui/macosx/intf.m
modules/gui/qt4/main_interface.cpp
modules/gui/skins2/src/vlcproc.cpp
modules/gui/wxwidgets/timer.cpp
modules/video_output/sdl.c
modules/video_output/x11/xcommon.c
src/libvlc.c
src/playlist/engine.c
src/video_output/video_output.c

index fe22dba..f2d80d4 100644 (file)
@@ -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 )
         {
index 73dfe90..a9ad8ee 100644 (file)
@@ -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;
         }
 
index 49d5613..29ab5a0 100644 (file)
@@ -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 );
  
index 6a98a24..676637c 100644 (file)
@@ -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 )
index a9eada9..31da185 100644 (file)
@@ -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 );
index 95d7a71..8974765 100644 (file)
@@ -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 );
     }
 }
index 08bc5d6..b2b3bc1 100644 (file)
@@ -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;
 
index bf8c565..4bf5a8a 100644 (file)
@@ -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;
 
index 4871e2a..871dcac 100644 (file)
@@ -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
      */
index 1f195f5..9c0475c 100644 (file)
@@ -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 );
 
index afc82a3..375efa5 100644 (file)
@@ -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
 }