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

Integrate with Mac OS media player APIs #233

Closed
dweymouth opened this issue Jul 28, 2023 · 5 comments · Fixed by #258
Closed

Integrate with Mac OS media player APIs #233

dweymouth opened this issue Jul 28, 2023 · 5 comments · Fixed by #258
Labels
enhancement New feature or request help wanted Extra attention is needed os:mac

Comments

@dweymouth
Copy link
Owner

Add integrations with MPRemoteCommandCenter and MPNowPlayingInfoCenter to receive media key events and export playback info to the Mac OS desktop.

@dweymouth dweymouth added the enhancement New feature or request label Jul 28, 2023
@dweymouth dweymouth added os:mac help wanted Extra attention is needed labels Jul 28, 2023
@ghost
Copy link

ghost commented Sep 28, 2023

Has any progress been made on integrating this feature? I know it's hard to implement the feature cross platform without writing specific logic for each one but I'd love to be able to use media key on OS X.

@dweymouth
Copy link
Owner Author

There hasn't been any progress on this other than my investigation into figuring out what the name of the MacOS APIs we need to use are. I have the "help wanted" on this issue as I am not a Mac/iOS developer and have never used Objective-C. Eventually I would get around to trying to learn enough to implement this feature but if you know of any Mac/iOS developers who would be open to contributing please send them this way! :)

@dweymouth
Copy link
Owner Author

dweymouth commented Sep 28, 2023

Or if you feel like helping out I'd gladly review a PR - or even just incorporate a code snippet. What we will need is a C API (ie all the obj-c hidden as an internal implementation detail) to set the metadata and poll for media key events. That can then be wrapped with CGo and integrated into Supersonic. (The Go compiler can compile Obj-C on Mac just fine, it's just that the external API presented to Go must be C). Something like:

void set_metadata(char *title, char *artist, char *album, char *art_url)

// blocks until an external play, pause, prev, next is requested, return event code
int wait_event()

@ghost
Copy link

ghost commented Sep 29, 2023

@dweymouth Hey I'd love to help but I'm not a Mac dev either. I tried to look into possible snippets of code I could find online for a C implementation of MPNowPlayingInfoCenter and stumbled across this: https://stackoverflow.com/questions/40258701/how-to-implementing-mpnowplayinginfocenter-using-avaudioplayer.

I agree that the project could benefit from the goodness of one or multiple developer skilled in IOS/mac dev. The app is really nice but having to use the mouse to control playing is a bit of a dealbreaker.

I will try to look into what I can do but like you I'd need to do a deep dive into the matter and learn quite a few things in the process

@dweymouth
Copy link
Owner Author

Will be added in the upcoming release - thanks @zackslash!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed os:mac
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant