Commit 40f88bb3 authored by David K's avatar David K Committed by Felix Paul Kühne

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>
parent 1e035179
......@@ -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;
......
......@@ -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
......
......@@ -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];
......
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