Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac-remote and mac-mediakey extension updates #366

Open
wants to merge 7 commits into
base: sb-trunk-oldxul
Choose a base branch
from

Conversation

zjays
Copy link
Contributor

@zjays zjays commented Oct 26, 2015

Update min/max version of the extensions to equal SB_MILESTONE, since
they are now bundled with Nightingale
Allows apple remote to be used on Mac OS X 10.8+ (in addition to 10.6
and 10.7 as before), and also allows apple remote to be used without the
Candelair driver installed on Mac OS X 10.6.1+

Note: Nightingale build system doesn't seem to recognize .m files, so
HIDRemote.m extension was changed to .mm

More info on HIDRemote: https://www.iospirit.com/developers/hidremote/
Not sure if this was necessary because of the extension change from .m
to .mm, or because Nightingale build system uses an older XCode version
or older compiler.

For reference, below is the error output when trying to build
Nightingale with the original HIDRemote.mm code (ie. before patching):

/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/sbAppleRemoteService.mm:
In function ‘void -[AppleRemoteDelegate
onButtonPressed:isHold:](AppleRemoteDelegate*, objc_selector*,
EAppleRemoteButton,
BOOL)’:
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/sbAppleRemoteService.mm:88:
warning: enumeration value ‘eUnknownButton’ not handled in
switch
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/sbAppleRemoteService.mm:
At global
scope:
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/sbAppleRemoteService.mm:118:
warning: incomplete implementation of class
‘AppleRemoteDelegate’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/sbAppleRemoteService.mm:118:
warning: method definition for
‘-hidRemote:eventWithButton:isPressed:fromHardwareWithAttributes:’ not
found
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/sbAppleRemoteService.mm:118:
warning: class ‘AppleRemoteDelegate’ does not fully implement the
‘HIDRemoteDelegate’ protocol
       CXX
sbAppleRemoteModule.o
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/sbAppleRemoteModule.mm:39:47:
warning: backslash and newline separated by space
       CXX
HIDRemote.o
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:253:
warning: ignoring #pragma clang
diagnostic
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:254:
warning: ignoring #pragma clang
diagnostic
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:256:
warning: ignoring #pragma clang
diagnostic
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:
In function ‘HIDRemoteAluminumRemoteSupportLevel -[HIDRemote
aluminiumRemoteSystemSupportLevel](HIDRemote*,
objc_selector*)’:
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:280:
error: invalid conversion from ‘int’ to
‘HIDRemoteAluminumRemoteSupportLevel’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:
In function ‘HIDRemoteButtonCode -[HIDRemote
buttonCodeForUsage:usagePage:](HIDRemote*, objc_selector*, unsigned int,
unsigned
int)’:
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:996:
error: invalid conversion from ‘int’ to
‘HIDRemoteButtonCode’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1001:
error: invalid conversion from ‘int’ to
‘HIDRemoteButtonCode’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1006:
error: invalid conversion from ‘int’ to
‘HIDRemoteButtonCode’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:
In function ‘BOOL -[HIDRemote _setupService:](HIDRemote*,
objc_selector*,
io_object_t)’:
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1122:
error: invalid conversion from ‘void*’ to
‘void**’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1223:
error: invalid conversion from ‘const void*’ to ‘const
__CFDictionary*’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1363:
error: invalid conversion from ‘const void*’ to ‘const
__CFString*’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1376:
error: invalid conversion from ‘const void*’ to ‘const
__CFString*’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1389:
error: invalid conversion from ‘const void*’ to ‘const
__CFString*’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1411:
error: invalid conversion from ‘const void*’ to ‘const
__CFNumber*’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1438:
error: invalid conversion from ‘const void*’ to ‘const
__CFNumber*’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1454:
error: invalid conversion from ‘const void*’ to ‘const
__CFString*’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:
In function ‘void -[HIDRemote _simulateHoldEvent:](HIDRemote*,
objc_selector*,
NSTimer*)’:
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1696:
error: invalid conversion from ‘int’ to
‘HIDRemoteButtonCode’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:
In function ‘void -[HIDRemote
_handleButtonCode:isPressed:hidAttribsDict:](HIDRemote*, objc_selector*,
HIDRemoteButtonCode, BOOL,
NSMutableDictionary*)’:
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1750:
error: invalid conversion from ‘int’ to
‘HIDRemoteButtonCode’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:
In function ‘void -[HIDRemote
_sendButtonCode:isPressed:hidAttribsDict:](HIDRemote*, objc_selector*,
HIDRemoteButtonCode, BOOL,
NSMutableDictionary*)’:
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1810:
error: invalid conversion from ‘int’ to
‘HIDRemoteButtonCode’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:
In function ‘void -[HIDRemote _hidEventFor:from:withResult:](HIDRemote*,
objc_selector*, io_service_t, IOHIDQueueInterface**,
IOReturn)’:
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1822:
error: invalid conversion from ‘void*’ to
‘IOHIDQueueInterface**’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1834:
error: invalid conversion from ‘unsigned int’ to
‘HIDRemoteButtonCode’
/Users/Zach-Mac/github/nightingale-hacking/extensions/apple-remote/components/macremote/src/HIDRemote.mm:1860:
error: invalid conversion from ‘unsigned int’ to ‘HIDRemoteButtonCode’
firstrun : function() {
var welcomeTitle = this._strings.getString("WelcomeTitle");
var welcomeMsg = this._strings.getString("WelcomeMessage");
var promptService = Cc['@mozilla.org/embedcomp/prompt-service;1']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentiation seems to have gotten messed up here. Generally it's two spaces, irrc.

@zjays
Copy link
Contributor Author

zjays commented Nov 7, 2015

I fixed the indentation and removed the unneeded HIDRemote licence.

Not sure how to answer "Can't you do this by changing the pref type? Or is this because the extension is hidden by default?". To be honest I just followed the example of the Mac Remote add-on, which already had it's own pane in the preferences window (written from the previous author). I don't think the extension being hidden from the add-on manager matters.

@freaktechnik
Copy link
Member

@zjays for example the unity integration extension (https://github.com/nightingale-media-player/nightingale-hacking/tree/sb-trunk-oldxul/extensions/unity-integration) creates the pref pane without the need for an overlay in the prefs window. However I recall hidden extensions not being able to add a pref pane, which is why I added the prefs for libnotify directly to core (now I should move libnotify to core too...)

@zjays
Copy link
Contributor Author

zjays commented Dec 24, 2015

@freaktechnik: I don't have access to a Linux machine at the moment, so I can't see what the Unity integration pref pane looks like in Nightingale. But from what I can see in the source code, it should be the same as how MLyrics handles options, right?
(https://github.com/FreeleX/MLyrics/blob/master/chrome/content/xul/options.xul
vs.
https://github.com/nightingale-media-player/nightingale-hacking/blob/sb-trunk-oldxul/extensions/unity-integration/chrome/content/options.xul)

MLyrics does not create a pref pane in Nightingale's main options window, in the way that the macremote/macmediakeys currently are designed (see https://cloud.githubusercontent.com/assets/3302572/9577543/eb78f16e-4faf-11e5-8825-9e0518070c5c.png). MLyrics, and I presume the Unity integration extension, creates an Options Window that pops up when clicking Options within the respective extension in the Add-on Manager. This method wouldn't work for the macremote/macmediakeys extensions since they are hidden from the add-on manager.

So is there another method to create the prefpanes within Nightingale's main options window, as they are shown in the above screenshot, without using overlays?

@freaktechnik
Copy link
Member

Huh, I thought there was code to redirect the popups to the prefpanes. But that might've been broken with the vendor deps folder "upgrade", like the privacy dialog broke.

@zjays
Copy link
Contributor Author

zjays commented Dec 25, 2015

@freaktechnik Happy holidays! :)

Well as a test, I just tried installing the oldest version of Nightingale I could find on Sourceforge for Windows, 1.11.0a-2214 (2012-02-20). After installing MLyrics there is still no prefpane in the Nightingale Options window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add info screen about drivers needed for remote and media key extensions
2 participants