-
Notifications
You must be signed in to change notification settings - Fork 602
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
Globalized the song info and song controls, and updated Touch Bar for it. #102
Conversation
… button. Globalized the songinfo and song controls, and changed the pause/play button. The songInfo file should eventually get another location, because it isn't really a plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing job, thanks for the contribution! 👏
As you mentioned in the PR description, song-info
is not really a plugin but more a provider for other plugins, so it should be put in a separate providers
folders with each plugin using it instantiating the songInfo
global (here, if a plugin like notifications
is enabled but not song-info
, we get Uncaught Exception: TypeError: Cannot read property 'onNewData' of undefined
)
If you want to make the follow up to have a separate providers
folder, feel free! Otherwise, I'm fine with merging and doing the follow up, PR is ✅
No problem, I'm glad you liked this 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be enough for a working version
Agreed, I can do the refactoring for provider instantiation in another PR, merging this one! ✅ 🎉
Globalized the song info and song controls.
Now plugins can retrieve the song info.
The plugins don't need to import anything extra to use the song information or controls.
The plugins are able to register a callback for song info changes using
songInfo
is an object, containing the following properties.and the song can be controlled using one of the following functions:
The songInfo plugin should eventually get another location, because it isn't really a plugin.
I've already changed the Touch Bar plugin so that it implements this.