]> git.sesse.net Git - vlc/commitdiff
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 fe22dba2832378faa59b9d7c595c3a61e06a0db5..f2d80d424a74a9457376cd450ee98b443b249d34 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 73dfe908fd7986d9eeec8602bf1a57fa9e88a263..a9ad8ee5c7800c0b2174b60db08297d015493776 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 49d56132556190ff95b665770859dfbe23181666..29ab5a046a7cdf3a70b328804d68e4ce01b7bb45 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 6a98a24831e5b5c1c5a76f57d970f52225024ece..676637ca901336ad05324c391c16f6928bbc282f 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 a9eada9a976cf018372f4941a7ca9227ecf45648..31da18587bc06ed124367a9c44dbb82e35b0dcc8 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 95d7a7127f9396bf687d5f9713ef3d0da1af8912..897476536f4adf0ebaa8a8ad76a01ce77d917594 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 08bc5d6d92cd95c5a488749f00a1f9bbaa953e58..b2b3bc1ae2a29367006c3c55d0e8e8acc163cfb6 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 bf8c56527125c6bae569b3c8bc77bb4cabec3c18..4bf5a8a008e186f0bd858fbd3e07bd40e7abfdae 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 4871e2a93bab14d0e2c9c005b4e97cfad47e1944..871dcac3827a9f75dace9fb20669c9dbf3a13efd 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 1f195f5b971ae21798adc103a46ad1354059b6d4..9c0475c2461104db7b2ae1cfa88c3bfb2d078822 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 afc82a331100ba80e1e136eabb9bafd51fb16dc6..375efa5fd7c8338da34571e0f3dcc4ef4f344e75 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
 }