dweymouth / supersonic

A lightweight and full-featured cross-platform desktop client for self-hosted music servers
GNU General Public License v3.0
675 stars 26 forks source link

Adds integration with MacOS native media APIs #258

Closed zackslash closed 8 months ago

zackslash commented 8 months ago

Overview:

Integrates Supersonic with native MacOS APIs making Supersonic the system 'NowPlaying' app, enabling native media controls and system display of 'now playing' media info.

Reasoning:

Feature requested & discussed via Discord.

Additional notes:

Build has only been tested on MacOS (Specifically Sonoma 14.0 on an M2 device). It would be a good idea to ensure that this implementation does not break the build for any other platforms. Note: Updated to exclude C files from non-darwin platforms. This should mean that the build does not break other platforms.

Resolves #233

dweymouth commented 8 months ago

I realized when clicking on the bigger view that the back button is present - interesting - but we are not setting the playback time metadata. Is it possible to set this as well?

zackslash commented 8 months ago

I realized when clicking on the bigger view that the back button is present - interesting - but we are not setting the playback time metadata. Is it possible to set this as well?

I saw this after my other comments so addressed this there (with the question on the back button).

But yes, this is a fair observation. Scrubber syncronisation and callbacks are considerably more involved if an app wants to sync real-time playback (Additional callbacks need to be implemented to maintain the sync state between the app player and the OS). They are optional to become the 'now playing' app, so omitted here. It's totally possible to implement though, I would suggest tackling it as a separate PR / feature (we can assign the task to me).