[vlc-commits] macosx: added support for the Boss Key (close #7243)

Felix Paul Kühne git at videolan.org
Mon Apr 22 23:22:11 CEST 2013


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Apr 22 23:21:56 2013 +0200| [508958eb55ca62f3fcb78ea89ca4a786d89a1caf] | committer: Felix Paul Kühne

macosx: added support for the Boss Key (close #7243)

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

 NEWS                      |    1 +
 modules/gui/macosx/intf.m |   20 ++++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index fbe0755..bde6ba4 100644
--- a/NEWS
+++ b/NEWS
@@ -164,6 +164,7 @@ OS X Interface:
    handler for ftp, mms, rtmp, rtp, rtsp, sftp, smb and udp streams
    (system-wide settings)
  * add support for the Video Title option
+ * add support for the Boss Key
  * The Streaming/Transcoding wizard and the open dialog's output panel are
    deprecated now and will be removed in a future release.
 
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index a56fe9a..2d278c9 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -94,6 +94,8 @@ static int PlaybackModeUpdated(vlc_object_t *, const char *,
                                vlc_value_t, vlc_value_t, void *);
 static int VolumeUpdated(vlc_object_t *, const char *,
                          vlc_value_t, vlc_value_t, void *);
+static int BossCallback(vlc_object_t *, const char *,
+                         vlc_value_t, vlc_value_t, void *);
 
 #pragma mark -
 #pragma mark VLC Interface Object Callbacks
@@ -453,6 +455,18 @@ static int VolumeUpdated(vlc_object_t *p_this, const char *psz_var,
     return VLC_SUCCESS;
 }
 
+static int BossCallback(vlc_object_t *p_this, const char *psz_var,
+                        vlc_value_t oldval, vlc_value_t new_val, void *param)
+{
+    NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
+
+    [[VLCCoreInteraction sharedInstance] performSelectorOnMainThread:@selector(pause) withObject:nil waitUntilDone:NO];
+    [[VLCApplication sharedApplication] hide:nil];
+
+    [o_pool release];
+    return VLC_SUCCESS;
+}
+
 /*****************************************************************************
  * ShowController: Callback triggered by the show-intf playlist variable
  * through the ShowIntf-control-intf, to let us show the controller-win;
@@ -678,6 +692,7 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     var_AddCallback(p_intf->p_libvlc, "intf-toggle-fscontrol", ShowController, self);
     var_AddCallback(p_intf->p_libvlc, "intf-show", ShowController, self);
+    var_AddCallback(p_intf->p_libvlc, "intf-boss", BossCallback, self);
     //    var_AddCallback(p_playlist, "item-change", PLItemChanged, self);
     var_AddCallback(p_playlist, "activity", PLItemChanged, self);
     var_AddCallback(p_playlist, "leaf-to-parent", PlaylistUpdated, self);
@@ -861,6 +876,7 @@ static VLCMain *_o_sharedMainInstance = nil;
     var_DelCallback(p_playlist, "mute", VolumeUpdated, self);
     var_DelCallback(p_intf->p_libvlc, "intf-toggle-fscontrol", ShowController, self);
     var_DelCallback(p_intf->p_libvlc, "intf-show", ShowController, self);
+    var_DelCallback(p_intf->p_libvlc, "intf-boss", BossCallback, self);
 
     if (p_current_input) {
         var_DelCallback(p_current_input, "intf-event", InputEvent, [VLCMain sharedInstance]);
@@ -1385,7 +1401,7 @@ static VLCMain *_o_sharedMainInstance = nil;
                 [iTunesApp playpause];
             }
         }
-        
+
     }
 
     b_has_itunes_paused = NO;
@@ -1421,7 +1437,7 @@ static VLCMain *_o_sharedMainInstance = nil;
             }
         }
 
-        
+
         /* Declare user activity.
          This wakes the display if it is off, and postpones display sleep according to the users system preferences
          Available from 10.7.3 */



More information about the vlc-commits mailing list