Commit da380a41 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: updated cookie for the 2009 Apple Remote and fixed a minor issue when...

macosx: updated cookie for the 2009 Apple Remote and fixed a minor issue when switching between multiple remotes
parent 302e7eb5
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
* or (at your option) any later version. * or (at your option) any later version.
* Thus, the following statements apply to our changes: * Thus, the following statements apply to our changes:
* *
* Copyright (C) 2006-2007 the VideoLAN team * Copyright (C) 2006-2011 the VideoLAN team
* Authors: Eric Petit <titer@m0k.org> * Authors: Eric Petit <titer@m0k.org>
* Felix Kühne <fkuehne at videolan dot org> * Felix Kühne <fkuehne at videolan dot org>
* *
...@@ -74,38 +74,40 @@ enum AppleRemoteEventIdentifier ...@@ -74,38 +74,40 @@ enum AppleRemoteEventIdentifier
kRemoteControl_Switched =1<<11, kRemoteControl_Switched =1<<11,
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,
k2009RemoteButtonFullscreen =1<<15 k2009RemoteButtonFullscreen =1<<15,
k2009RemoteButtonSwitched =1<<16
}; };
typedef enum AppleRemoteEventIdentifier AppleRemoteEventIdentifier; typedef enum AppleRemoteEventIdentifier AppleRemoteEventIdentifier;
/* Encapsulates usage of the apple remote control /* Encapsulates usage of the apple remote control
This class is implemented as a singleton as there is exactly one remote per machine (until now) This class is implemented as a singleton as there is exactly one remote per machine (until now)
The class is not thread safe The class is not thread safe
*/ */
@interface AppleRemote : NSObject { @interface AppleRemote : NSObject {
IOHIDDeviceInterface** hidDeviceInterface; IOHIDDeviceInterface** hidDeviceInterface;
IOHIDQueueInterface** queue; IOHIDQueueInterface** queue;
NSMutableArray* allCookies; NSMutableArray* allCookies;
NSMutableDictionary* cookieToButtonMapping; NSMutableDictionary* cookieToButtonMapping;
NSString* switchCookie;
CFRunLoopSourceRef eventSource; CFRunLoopSourceRef eventSource;
BOOL openInExclusiveMode; BOOL openInExclusiveMode;
BOOL simulatePlusMinusHold; BOOL simulatePlusMinusHold;
BOOL processesBacklog; BOOL processesBacklog;
/* state for simulating plus/minus hold */ /* state for simulating plus/minus hold */
BOOL lastEventSimulatedHold; BOOL lastEventSimulatedHold;
AppleRemoteEventIdentifier lastPlusMinusEvent; AppleRemoteEventIdentifier lastPlusMinusEvent;
NSTimeInterval lastPlusMinusEventTime; NSTimeInterval lastPlusMinusEventTime;
int remoteId; int remoteId;
unsigned int clickCountEnabledButtons; unsigned int clickCountEnabledButtons;
NSTimeInterval maxClickTimeDifference; NSTimeInterval maxClickTimeDifference;
NSTimeInterval lastClickCountEventTime; NSTimeInterval lastClickCountEventTime;
AppleRemoteEventIdentifier lastClickCountEvent; AppleRemoteEventIdentifier lastClickCountEvent;
unsigned int eventClickCount; unsigned int eventClickCount;
IBOutlet id delegate; IBOutlet id delegate;
} }
...@@ -178,6 +180,7 @@ The class is not thread safe ...@@ -178,6 +180,7 @@ The class is not thread safe
@interface AppleRemote (PrivateMethods) @interface AppleRemote (PrivateMethods)
- (void) setRemoteId: (int) aValue; - (void) setRemoteId: (int) aValue;
- (NSDictionary*) cookieToButtonMapping; - (NSDictionary*) cookieToButtonMapping;
- (NSString *) switchCookie;
- (IOHIDQueueInterface**) queue; - (IOHIDQueueInterface**) queue;
- (IOHIDDeviceInterface**) hidDeviceInterface; - (IOHIDDeviceInterface**) hidDeviceInterface;
- (void) handleEventWithCookieString: (NSString*) cookieString sumOfValues: (SInt32) sumOfValues; - (void) handleEventWithCookieString: (NSString*) cookieString sumOfValues: (SInt32) sumOfValues;
......
This diff is collapsed.
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