[vlc-commits] playlist: move FSC trigger and make it void

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


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 31 20:59:18 2018 +0300| [4cedca07144141ceeac1b2a80f85ca1388dc7d9d] | committer: Rémi Denis-Courmont

playlist: move FSC trigger and make it void

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

 modules/control/hotkeys.c          | 4 ++--
 modules/gui/macosx/VLCMain.m       | 4 ++--
 modules/gui/qt/main_interface.cpp  | 4 ++--
 modules/gui/skins2/src/vlcproc.cpp | 4 ++--
 src/libvlc.c                       | 4 ----
 src/playlist/engine.c              | 3 +++
 6 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index fe062ca8a6..c7faa28b4b 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -170,7 +170,7 @@ static int ButtonEvent( vlc_object_t *p_this, char const *psz_var,
 
     if ((newval.i_int & (1 << MOUSE_BUTTON_CENTER))
      && !(oldval.i_int & (1 << MOUSE_BUTTON_CENTER)))
-        var_ToggleBool(p_intf->obj.libvlc, "intf-toggle-fscontrol");
+        var_TriggerCallback(pl_Get(p_intf), "intf-toggle-fscontrol");
 
     return VLC_SUCCESS;
 }
@@ -368,7 +368,7 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
 
         case ACTIONID_INTF_TOGGLE_FSC:
         case ACTIONID_INTF_HIDE:
-            var_TriggerCallback( p_intf->obj.libvlc, "intf-toggle-fscontrol" );
+            var_TriggerCallback( p_playlist, "intf-toggle-fscontrol" );
             break;
         case ACTIONID_INTF_BOSS:
             var_TriggerCallback( p_playlist, "intf-boss" );
diff --git a/modules/gui/macosx/VLCMain.m b/modules/gui/macosx/VLCMain.m
index 3e85430bcc..443076ffaa 100644
--- a/modules/gui/macosx/VLCMain.m
+++ b/modules/gui/macosx/VLCMain.m
@@ -236,7 +236,7 @@ static VLCMain *sharedInstance = nil;
 
         _mainWindowController = [[NSWindowController alloc] initWithWindowNibName:@"MainWindow"];
 
-        var_AddCallback(p_intf->obj.libvlc, "intf-toggle-fscontrol", ShowController, (__bridge void *)self);
+        var_AddCallback(pl_Get(p_intf), "intf-toggle-fscontrol", ShowController, (__bridge void *)self);
         var_AddCallback(pl_Get(p_intf), "intf-show", ShowController, (__bridge void *)self);
 
         // Load them here already to apply stored profiles
@@ -344,7 +344,7 @@ static VLCMain *sharedInstance = nil;
     config_PutInt("loop", var_GetBool(p_playlist, "loop"));
     config_PutInt("repeat", var_GetBool(p_playlist, "repeat"));
 
-    var_DelCallback(p_intf->obj.libvlc, "intf-toggle-fscontrol", ShowController, (__bridge void *)self);
+    var_DelCallback(pl_Get(p_intf), "intf-toggle-fscontrol", ShowController, (__bridge void *)self);
     var_DelCallback(pl_Get(p_intf), "intf-show", ShowController, (__bridge void *)self);
 
     [[NSNotificationCenter defaultCenter] removeObserver: self];
diff --git a/modules/gui/qt/main_interface.cpp b/modules/gui/qt/main_interface.cpp
index 951922ab86..c49333391f 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -240,7 +240,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( pl_Get(p_intf), "intf-toggle-fscontrol", IntfShowCB, p_intf );
     var_AddCallback( pl_Get(p_intf), "intf-boss", IntfBossCB, p_intf );
     var_AddCallback( pl_Get(p_intf), "intf-show", IntfRaiseMainCB, p_intf );
 
@@ -303,7 +303,7 @@ MainInterface::~MainInterface()
     /* Unregister callbacks */
     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( pl_Get(p_intf), "intf-toggle-fscontrol", IntfShowCB, p_intf );
     var_DelCallback( p_intf->obj.libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
 
     p_intf->p_sys->p_mi = NULL;
diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index e10240bb7b..84ffc9c462 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -156,7 +156,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
 
     ADD_CALLBACK( getPL(), "volume" )
     ADD_CALLBACK( getPL(), "mute" )
-    ADD_CALLBACK( pIntf->obj.libvlc, "intf-toggle-fscontrol" )
+    ADD_CALLBACK( getPL(), "intf-toggle-fscontrol" )
 
     ADD_CALLBACK( getPL(), "random" )
     ADD_CALLBACK( getPL(), "loop" )
@@ -193,7 +193,7 @@ VlcProc::~VlcProc()
 
     var_DelCallback( getPL(), "volume", onGenericCallback, this );
     var_DelCallback( getPL(), "mute",onGenericCallback, this );
-    var_DelCallback( getIntf()->obj.libvlc, "intf-toggle-fscontrol",
+    var_DelCallback( getPL(), "intf-toggle-fscontrol",
                      onGenericCallback, this );
 
     var_DelCallback( getPL(), "random", onGenericCallback, this );
diff --git a/src/libvlc.c b/src/libvlc.c
index 7d31a92857..deb0ae3586 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -235,10 +235,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
     if( !priv->parser )
         goto error;
 
-    /* Create a variable for showing the fullscreen interface */
-    var_Create( p_libvlc, "intf-toggle-fscontrol", VLC_VAR_BOOL );
-    var_SetBool( p_libvlc, "intf-toggle-fscontrol", true );
-
     /* 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 70584864f5..dcbea205a2 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -472,6 +472,9 @@ static void VariablesInit( playlist_t *p_playlist )
 
     /* Callbacks between interfaces */
 
+    /* Create a variable for showing the fullscreen interface */
+    var_Create( p_playlist, "intf-toggle-fscontrol", VLC_VAR_VOID );
+
     /* Create a variable for the Boss Key */
     var_Create( p_playlist, "intf-boss", VLC_VAR_VOID );
 



More information about the vlc-commits mailing list