Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
f556fb16
Commit
f556fb16
authored
Oct 06, 2009
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: fixed IR Remote HID support
parent
9932d0f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
23 deletions
+44
-23
modules/gui/macosx/AppleRemote.m
modules/gui/macosx/AppleRemote.m
+39
-19
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+5
-4
No files found.
modules/gui/macosx/AppleRemote.m
View file @
f556fb16
...
...
@@ -72,18 +72,39 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
hidDeviceInterface
=
NULL
;
cookieToButtonMapping
=
[[
NSMutableDictionary
alloc
]
init
];
/* we're on Leopard and need to use a different set of cookies then we used to on Tiger and earlier */
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonVolume_Plus
]
forKey
:
@"31_29_28_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonVolume_Minus
]
forKey
:
@"31_30_28_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonMenu
]
forKey
:
@"31_20_18_31_20_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonPlay
]
forKey
:
@"31_21_18_31_21_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonRight
]
forKey
:
@"31_22_18_31_22_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonLeft
]
forKey
:
@"31_23_18_31_23_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonRight_Hold
]
forKey
:
@"31_18_4_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonLeft_Hold
]
forKey
:
@"31_18_3_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonMenu_Hold
]
forKey
:
@"31_18_31_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonPlay_Sleep
]
forKey
:
@"35_31_18_35_31_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteControl_Switched
]
forKey
:
@"19_"
];
if
(
NSAppKitVersionNumber
<
1038
.
13
)
{
/* Leopard and early Snow Leopard Cookies */
msg_Dbg
(
VLCIntf
,
"using Leopard AR cookies"
);
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonVolume_Plus
]
forKey
:
@"31_29_28_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonVolume_Minus
]
forKey
:
@"31_30_28_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonMenu
]
forKey
:
@"31_20_18_31_20_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonPlay
]
forKey
:
@"31_21_18_31_21_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonRight
]
forKey
:
@"31_22_18_31_22_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonLeft
]
forKey
:
@"31_23_18_31_23_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonRight_Hold
]
forKey
:
@"31_18_4_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonLeft_Hold
]
forKey
:
@"31_18_3_2_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonMenu_Hold
]
forKey
:
@"31_18_31_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteButtonPlay_Sleep
]
forKey
:
@"35_31_18_35_31_18_"
];
[
cookieToButtonMapping
setObject
:[
NSNumber
numberWithInt
:
kRemoteControl_Switched
]
forKey
:
@"19_"
];
}
else
{
/* 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
:
@"19_"
];
}
/* defaults */
[
self
setSimulatesPlusMinusHold
:
YES
];
...
...
@@ -451,7 +472,7 @@ static AppleRemote* sharedInstance=nil;
[
self
handleEventWithCookieString
:
lastSubCookieString
sumOfValues
:
0
];
}
if
([
cookieString
length
]
>
0
)
{
NSLog
(
@"Unknown button for cookiestring %@"
,
cookieString
);
msg_Warn
(
VLCIntf
,
"Unknown AR button for cookiestring %s"
,
[
cookieString
UTF8String
]
);
}
}
}
...
...
@@ -504,7 +525,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
ioReturnValue
=
IOObjectGetClass
(
hidDevice
,
className
);
if
(
ioReturnValue
!=
kIOReturnSuccess
)
{
NSLog
(
@"Error: Failed to ge
t class name."
);
msg_Err
(
VLCIntf
,
"Failed to get IOKi
t class name."
);
return
NULL
;
}
...
...
@@ -519,7 +540,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
plugInResult
=
(
*
plugInInterface
)
->
QueryInterface
(
plugInInterface
,
CFUUIDGetUUIDBytes
(
kIOHIDDeviceInterfaceID
),
(
LPVOID
)
&
hidDeviceInterface
);
if
(
plugInResult
!=
S_OK
)
{
NSLog
(
@"Error:
Couldn't create HID class device interface"
);
msg_Err
(
VLCIntf
,
"
Couldn't create HID class device interface"
);
}
// Release
if
(
plugInInterface
)
(
*
plugInInterface
)
->
Release
(
plugInInterface
);
...
...
@@ -633,13 +654,13 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
(
*
queue
)
->
start
(
queue
);
return
YES
;
}
else
{
NSLog
(
@
"Error when setting event callout"
);
msg_Err
(
VLCIntf
,
"Error when setting event callout"
);
}
}
else
{
NSLog
(
@
"Error when creating async event source"
);
msg_Err
(
VLCIntf
,
"Error when creating async event source"
);
}
}
else
{
NSLog
(
@"Error when opening
device"
);
msg_Err
(
VLCIntf
,
"Error when opening HUD
device"
);
}
}
return
NO
;
...
...
@@ -657,7 +678,6 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
}
-
(
void
)
dealloc
{
NSLog
(
@"Dealloc"
);
[
applicationDelegate
release
];
[
super
dealloc
];
}
...
...
modules/gui/macosx/intf.m
View file @
f556fb16
...
...
@@ -361,10 +361,6 @@ static VLCMain *_o_sharedMainInstance = nil;
i_lastShownVolume
=
-
1
;
o_remote
=
[[
AppleRemote
alloc
]
init
];
[
o_remote
setClickCountEnabledButtons
:
kRemoteButtonPlay
];
[
o_remote
setDelegate
:
_o_sharedMainInstance
];
o_eyetv
=
[[
VLCEyeTVController
alloc
]
init
];
/* announce our launch to a potential eyetv plugin */
...
...
@@ -555,6 +551,11 @@ static VLCMain *_o_sharedMainInstance = nil;
name:
NSControlTintDidChangeNotification
object:
nil
];
/* init Apple Remote support */
o_remote
=
[[
AppleRemote
alloc
]
init
];
[
o_remote
setClickCountEnabledButtons
:
kRemoteButtonPlay
];
[
o_remote
setDelegate
:
_o_sharedMainInstance
];
/* yeah, we are done */
nib_main_loaded
=
TRUE
;
}
...
...
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