[vlc-commits] playlist: move intf-boss variable

Rémi Denis-Courmont git at videolan.org
Thu May 31 20:45:37 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 31 19:15:08 2018 +0300| [6f485a389ba28438c28a6af76cd95864cded530e] | committer: Rémi Denis-Courmont

playlist: move intf-boss variable

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6f485a389ba28438c28a6af76cd95864cded530e
---

 modules/control/hotkeys.c               | 2 +-
 modules/gui/macosx/VLCCoreInteraction.m | 4 ++--
 modules/gui/qt/main_interface.cpp       | 4 ++--
 src/libvlc.c                            | 3 ---
 src/playlist/engine.c                   | 4 ++++
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index e5fee3f5b3..b0734e1811 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -366,7 +366,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
             var_TriggerCallback( p_intf->obj.libvlc, "intf-toggle-fscontrol" );
             break;
         case ACTIONID_INTF_BOSS:
-            var_TriggerCallback( p_intf->obj.libvlc, "intf-boss" );
+            var_TriggerCallback( p_playlist, "intf-boss" );
             break;
         case ACTIONID_INTF_POPUP_MENU:
             var_TriggerCallback( p_intf->obj.libvlc, "intf-popupmenu" );
diff --git a/modules/gui/macosx/VLCCoreInteraction.m b/modules/gui/macosx/VLCCoreInteraction.m
index 976dfa799c..1f13283938 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -114,7 +114,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
         [_remote setClickCountEnabledButtons: kRemoteButtonPlay];
         [_remote setDelegate: self];
 
-        var_AddCallback(p_intf->obj.libvlc, "intf-boss", BossCallback, (__bridge void *)self);
+        var_AddCallback(pl_Get(p_intf), "intf-boss", BossCallback, (__bridge void *)self);
     }
     return self;
 }
@@ -122,7 +122,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
 - (void)dealloc
 {
     intf_thread_t *p_intf = getIntf();
-    var_DelCallback(p_intf->obj.libvlc, "intf-boss", BossCallback, (__bridge void *)self);
+    var_DelCallback(pl_Get(p_intf), "intf-boss", BossCallback, (__bridge void *)self);
     [[NSNotificationCenter defaultCenter] removeObserver: self];
 }
 
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index 536549da5e..951922ab86 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -241,7 +241,7 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
      * Callbacks
      ************/
     var_AddCallback( p_intf->obj.libvlc, "intf-toggle-fscontrol", IntfShowCB, p_intf );
-    var_AddCallback( p_intf->obj.libvlc, "intf-boss", IntfBossCB, p_intf );
+    var_AddCallback( pl_Get(p_intf), "intf-boss", IntfBossCB, p_intf );
     var_AddCallback( pl_Get(p_intf), "intf-show", IntfRaiseMainCB, p_intf );
 
     /* Register callback for the intf-popupmenu variable */
@@ -301,7 +301,7 @@ MainInterface::~MainInterface()
     QVLCTools::saveWidgetPosition(settings, this);
 
     /* Unregister callbacks */
-    var_DelCallback( p_intf->obj.libvlc, "intf-boss", IntfBossCB, p_intf );
+    var_DelCallback( pl_Get(p_intf), "intf-boss", IntfBossCB, p_intf );
     var_DelCallback( pl_Get(p_intf), "intf-show", IntfRaiseMainCB, p_intf );
     var_DelCallback( p_intf->obj.libvlc, "intf-toggle-fscontrol", IntfShowCB, p_intf );
     var_DelCallback( p_intf->obj.libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
diff --git a/src/libvlc.c b/src/libvlc.c
index 3641280117..7d31a92857 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -239,9 +239,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     var_Create( p_libvlc, "intf-toggle-fscontrol", VLC_VAR_BOOL );
     var_SetBool( p_libvlc, "intf-toggle-fscontrol", true );
 
-    /* Create a variable for the Boss Key */
-    var_Create( p_libvlc, "intf-boss", VLC_VAR_VOID );
-
     /* Create a variable for showing the right click menu */
     var_Create( p_libvlc, "intf-popupmenu", VLC_VAR_BOOL );
 
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index 8ed3d55393..70584864f5 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -471,6 +471,10 @@ static void VariablesInit( playlist_t *p_playlist )
                VLC_VAR_INTEGER | VLC_VAR_DOINHERIT | VLC_VAR_ISCOMMAND );
 
     /* Callbacks between interfaces */
+
+    /* Create a variable for the Boss Key */
+    var_Create( p_playlist, "intf-boss", VLC_VAR_VOID );
+
     /* Create a variable for showing the main interface */
     var_Create( p_playlist, "intf-show", VLC_VAR_VOID );
 }



More information about the vlc-commits mailing list