Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
d848d8fd
Commit
d848d8fd
authored
Dec 11, 2009
by
David K
Committed by
Felix Paul Kühne
Dec 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for the new Apple Remote introduced in 2009
Signed-off-by:
Felix Paul Kühne
<
fkuehne@videolan.org
>
parent
ddb9216b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
14 deletions
+26
-14
modules/gui/macosx/AppleRemote.h
modules/gui/macosx/AppleRemote.h
+3
-1
modules/gui/macosx/AppleRemote.m
modules/gui/macosx/AppleRemote.m
+23
-13
No files found.
modules/gui/macosx/AppleRemote.h
View file @
d848d8fd
...
...
@@ -73,7 +73,9 @@ enum AppleRemoteEventIdentifier
kRemoteButtonPlay_Sleep
=
1
<<
10
,
kRemoteControl_Switched
=
1
<<
11
,
kRemoteButtonVolume_Plus_Hold
=
1
<<
12
,
kRemoteButtonVolume_Minus_Hold
=
1
<<
13
kRemoteButtonVolume_Minus_Hold
=
1
<<
13
,
k2009RemoteButtonPlay
=
1
<<
14
,
k2009RemoteButtonMiddlePlay
=
1
<<
15
};
typedef
enum
AppleRemoteEventIdentifier
AppleRemoteEventIdentifier
;
...
...
modules/gui/macosx/AppleRemote.m
View file @
d848d8fd
...
...
@@ -92,17 +92,19 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
{
/* current Snow Leopard cookies */
msg_Dbg
(
VLCIntf
,
"using Snow Leopard AR cookies"
);
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonVolume_Plus
]
forKey
:
@"33_31_30_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonVolume_Minus
]
forKey
:
@"33_32_30_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonMenu
]
forKey
:
@"33_22_21_20_2_33_22_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonPlay
]
forKey
:
@"33_23_21_20_2_33_23_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonRight
]
forKey
:
@"33_24_21_20_2_33_24_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonLeft
]
forKey
:
@"33_25_21_20_2_33_25_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonRight_Hold
]
forKey
:
@"33_21_20_14_12_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonLeft_Hold
]
forKey
:
@"33_21_20_13_12_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonMenu_Hold
]
forKey
:
@"33_21_20_2_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
:
@"42_33_21_20_14_12_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonVolume_Plus
]
forKey
:
@"33_31_30_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonVolume_Minus
]
forKey
:
@"33_32_30_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonMenu
]
forKey
:
@"33_22_21_20_2_33_22_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonPlay
]
forKey
:
@"33_23_21_20_2_33_23_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonRight
]
forKey
:
@"33_24_21_20_2_33_24_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonLeft
]
forKey
:
@"33_25_21_20_2_33_25_21_20_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonRight_Hold
]
forKey
:
@"33_21_20_14_12_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonLeft_Hold
]
forKey
:
@"33_21_20_13_12_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonMenu_Hold
]
forKey
:
@"33_21_20_2_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
:
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_"
];
}
}
...
...
@@ -171,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
];
[
self
setClickCountEnabledButtons
:
kRemoteButtonVolume_Plus
|
kRemoteButtonVolume_Minus
|
kRemoteButtonPlay
|
kRemoteButtonLeft
|
kRemoteButtonRight
|
kRemoteButtonMenu
|
k2009RemoteButtonPlay
|
k2009RemoteButtonMiddlePlay
];
}
else
{
[
self
setClickCountEnabledButtons
:
0
];
}
...
...
@@ -448,10 +450,18 @@ static AppleRemote* sharedInstance=nil;
cookieString = [previousRemainingCookieString stringByAppendingString: cookieString];
NSLog(@"New cookie string is %@", cookieString);
[previousRemainingCookieString release], previousRemainingCookieString=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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment