[vlc-commits] commit: Use the additional middle button on the new Apple Remote introduced in 2009 to toggle fullscreen (David K )

git at videolan.org git at videolan.org
Tue Apr 13 14:40:17 CEST 2010


vlc | branch: master | David K <coding at rotinaj.org> | Tue Feb  2 14:04:52 2010 +0100| [40f88bb3bf02582b16f7ea4733ccb3ee92ba97a6] | committer: Felix Paul Kühne 

Use the additional middle button on the new Apple Remote introduced in 2009 to toggle fullscreen

Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>

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

 modules/gui/macosx/AppleRemote.h |    2 +-
 modules/gui/macosx/AppleRemote.m |   12 ++----------
 modules/gui/macosx/intf.m        |    6 ++++++
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/modules/gui/macosx/AppleRemote.h b/modules/gui/macosx/AppleRemote.h
index 7e9c84c..12e8ca3 100644
--- a/modules/gui/macosx/AppleRemote.h
+++ b/modules/gui/macosx/AppleRemote.h
@@ -75,7 +75,7 @@ enum AppleRemoteEventIdentifier
     kRemoteButtonVolume_Plus_Hold   =1<<12,
     kRemoteButtonVolume_Minus_Hold  =1<<13,
     k2009RemoteButtonPlay			=1<<14,
-    k2009RemoteButtonMiddlePlay		=1<<15
+    k2009RemoteButtonFullscreen		=1<<15
 };
 typedef enum AppleRemoteEventIdentifier AppleRemoteEventIdentifier;
 
diff --git a/modules/gui/macosx/AppleRemote.m b/modules/gui/macosx/AppleRemote.m
index 623b16e..6f41bae 100644
--- a/modules/gui/macosx/AppleRemote.m
+++ b/modules/gui/macosx/AppleRemote.m
@@ -104,7 +104,7 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
             [cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Sleep]     forKey:@"37_33_21_20_2_37_33_21_20_2_"];
             [cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched]     forKey:@"19_"];
             [cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonPlay]       forKey:@"33_21_20_8_2_33_21_20_8_2_"];
-            [cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonMiddlePlay] forKey:@"33_21_20_3_2_33_21_20_3_2_"];
+            [cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonFullscreen] forKey:@"33_21_20_3_2_33_21_20_3_2_"];
         }
     }
 
@@ -173,7 +173,7 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
 }
 - (void) setClickCountingEnabled: (BOOL) value {
     if (value) {
-        [self setClickCountEnabledButtons: kRemoteButtonVolume_Plus | kRemoteButtonVolume_Minus | kRemoteButtonPlay | kRemoteButtonLeft | kRemoteButtonRight | kRemoteButtonMenu | k2009RemoteButtonPlay | k2009RemoteButtonMiddlePlay];
+        [self setClickCountEnabledButtons: kRemoteButtonVolume_Plus | kRemoteButtonVolume_Minus | kRemoteButtonPlay | kRemoteButtonLeft | kRemoteButtonRight | kRemoteButtonMenu | k2009RemoteButtonPlay | k2009RemoteButtonFullscreen];
     } else {
         [self setClickCountEnabledButtons: 0];
     }
@@ -454,14 +454,6 @@ static AppleRemote* sharedInstance=nil;
     if (cookieString == nil || [cookieString length] == 0) return;
     NSNumber* buttonId = [[self cookieToButtonMapping] objectForKey: cookieString];
     if (buttonId != nil) {
-        switch ([buttonId intValue]) {
-            case k2009RemoteButtonPlay:
-            case k2009RemoteButtonMiddlePlay:
-                buttonId = [NSNumber numberWithInt:kRemoteButtonPlay];
-                break;
-            default:
-                break;
-		}
         [self sendRemoteButtonEvent: [buttonId intValue] pressedDown: (sumOfValues>0)];
     } else {
         // let's see if a number of events are stored in the cookie string. this does
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index e29a6b2..6a06c05 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -1103,6 +1103,12 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
 {
     switch( buttonIdentifier )
     {
+        case k2009RemoteButtonFullscreen:
+            [o_controls toogleFullscreen:self];
+            break;
+        case k2009RemoteButtonPlay:
+            [o_controls play:self];
+            break;
         case kRemoteButtonPlay:
             if(count >= 2) {
                 [o_controls toogleFullscreen:self];



More information about the vlc-commits mailing list