Commit a09f68ab authored by David K's avatar David K Committed by Jean-Baptiste Kempf

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

Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
(cherry picked from commit 40f88bb3bf02582b16f7ea4733ccb3ee92ba97a6)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent bf1aac78
...@@ -75,7 +75,7 @@ enum AppleRemoteEventIdentifier ...@@ -75,7 +75,7 @@ enum AppleRemoteEventIdentifier
kRemoteButtonVolume_Plus_Hold =1<<12, kRemoteButtonVolume_Plus_Hold =1<<12,
kRemoteButtonVolume_Minus_Hold =1<<13, kRemoteButtonVolume_Minus_Hold =1<<13,
k2009RemoteButtonPlay =1<<14, k2009RemoteButtonPlay =1<<14,
k2009RemoteButtonMiddlePlay =1<<15 k2009RemoteButtonFullscreen =1<<15
}; };
typedef enum AppleRemoteEventIdentifier AppleRemoteEventIdentifier; typedef enum AppleRemoteEventIdentifier AppleRemoteEventIdentifier;
......
...@@ -104,7 +104,7 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4; ...@@ -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: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:kRemoteControl_Switched] forKey:@"19_"];
[cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonPlay] forKey:@"33_21_20_8_2_33_21_20_8_2_"]; [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; ...@@ -173,7 +173,7 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
} }
- (void) setClickCountingEnabled: (BOOL) value { - (void) setClickCountingEnabled: (BOOL) value {
if (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 { } else {
[self setClickCountEnabledButtons: 0]; [self setClickCountEnabledButtons: 0];
} }
...@@ -454,14 +454,6 @@ static AppleRemote* sharedInstance=nil; ...@@ -454,14 +454,6 @@ static AppleRemote* sharedInstance=nil;
if (cookieString == nil || [cookieString length] == 0) return; if (cookieString == nil || [cookieString length] == 0) return;
NSNumber* buttonId = [[self cookieToButtonMapping] objectForKey: cookieString]; NSNumber* buttonId = [[self cookieToButtonMapping] objectForKey: cookieString];
if (buttonId != nil) { if (buttonId != nil) {
switch ([buttonId intValue]) {
case k2009RemoteButtonPlay:
case k2009RemoteButtonMiddlePlay:
buttonId = [NSNumber numberWithInt:kRemoteButtonPlay];
break;
default:
break;
}
[self sendRemoteButtonEvent: [buttonId intValue] pressedDown: (sumOfValues>0)]; [self sendRemoteButtonEvent: [buttonId intValue] pressedDown: (sumOfValues>0)];
} else { } else {
// let's see if a number of events are stored in the cookie string. this does // let's see if a number of events are stored in the cookie string. this does
......
...@@ -1103,6 +1103,12 @@ static NSString * VLCToolbarMediaControl = @"VLCToolbarMediaControl"; ...@@ -1103,6 +1103,12 @@ static NSString * VLCToolbarMediaControl = @"VLCToolbarMediaControl";
{ {
switch( buttonIdentifier ) switch( buttonIdentifier )
{ {
case k2009RemoteButtonFullscreen:
[o_controls toogleFullscreen:self];
break;
case k2009RemoteButtonPlay:
[o_controls play:self];
break;
case kRemoteButtonPlay: case kRemoteButtonPlay:
if(count >= 2) { if(count >= 2) {
[o_controls toogleFullscreen:self]; [o_controls toogleFullscreen:self];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment