diff --git a/README.md b/README.md new file mode 100644 index 0000000..3fa2f26 --- /dev/null +++ b/README.md @@ -0,0 +1,81 @@ +# PlayerLink +Cross platform, universal discord rich presence for media players. + +## System requirements +- Mac OS 10.15 or later +- Windows 10 1809 or later +- Pretty much any linux distribution with gtk3 and dbus support + +## Showcase +You can add predefined players to the settings.json to customise the name it shows in discord, edit the search button base url, and app icon. By default it will just display as "Music" without a search button or app icon. In the future I want to add an option to the ui to add custom apps. + +
+ +
++ +
++ +
++ +
+ +## Backends +### Windows +The Windows backend is powered by [Windows.Media.Control.GlobalSystemMediaTransportControlsSessionManager](https://learn.microsoft.com/en-us/uwp/api/windows.media.control.globalsystemmediatransportcontrolssessionmanager?view=winrt-26100) (horrible name I know) introduced in Windows 10 1809. It allows to query the system wide media information. + +### Mac OS +The Mac OS backend is powered by the private MediaRemote framework. It provides PlayerLink with the currently playing song information. + +### Linux +The linux backend is powered by [MPRIS](https://specifications.freedesktop.org/mpris-spec/latest/). It allows to query the system wide media information via dbus. + +## Adding custom apps to the settings.json +The config is currently located in the same folder as PlayerLink, this will be changed in a future release. An example on how to add custom apps to the json can be found [here](./settings.example.json). In the future there will be a UI to configure custom apps in a more user friendly way. + +## Building + +### Prerequisites + +#### Windows +- Visual Studio toolchain with CMake that supports C++ 17 and winrt. Clang or MSVC doesn't matter. You might be able to get mingw to work, but I personally had issues using winrt with mingw and therefore its unsupported. +- Git + +#### Linux +- GTK3 developer libraries and includes +- A C++ 17 capable compiler (gcc or clang should both work) +- A C compiler +- CMake +- Git + +#### Mac OS +- Xcode 11 or newer with the Mac OS toolchain installed +- CMake +- Git + +### How to build +1. Open your unix shell or Windows Developer Powershell + +2. Clone the repository recursively to include submodules and enter the directory + ```bash + git clone --recursive https://github.com/EinTim23/PlayerLink.git + cd PlayerLink + ``` +3. Use CMake to configure the project + ```bash + # for a release build + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release + # for a debug build + cmake -S . -B build + ``` +4. Build the project :) + ```bash + # for a release build + cmake --build build --config Release + # for a debug build + cmake --build build + ``` +## Credits +This project was heavily inspired by [Alexandra Aurora's MusicRPC](https://github.com/AlexandraAurora/MusicRPC) and her project may provide a better experience when being on Mac OS only. \ No newline at end of file diff --git a/img/linux.png b/img/linux.png new file mode 100644 index 0000000..365af94 Binary files /dev/null and b/img/linux.png differ diff --git a/img/macos.png b/img/macos.png new file mode 100644 index 0000000..372d7a8 Binary files /dev/null and b/img/macos.png differ diff --git a/img/showcase.png b/img/showcase.png new file mode 100644 index 0000000..cac9a94 Binary files /dev/null and b/img/showcase.png differ diff --git a/img/windows.png b/img/windows.png new file mode 100644 index 0000000..54a7f6c Binary files /dev/null and b/img/windows.png differ diff --git a/settings.example.json b/settings.example.json new file mode 100644 index 0000000..06682b9 --- /dev/null +++ b/settings.example.json @@ -0,0 +1,17 @@ +{ + "any_other": false, + "apps": [ + { + "client_id": "1245257414715113573", + "enabled": true, + "name": "Spotify", + "process_names": [ + "org.mpris.MediaPlayer2.spotify", + "com.spotify.client", + "Spotify.exe" + ], + "search_endpoint": "https://open.spotify.com/search/" + } + ], + "autostart": false +} \ No newline at end of file diff --git a/settings.json b/settings.json deleted file mode 100644 index f2f3790..0000000 --- a/settings.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "any_other": false, - "apps": [ - { - "client_id": "1245257240890310686", - "enabled": true, - "name": "Apple Music", - "process_names": [ - "AppleMusic.exe" - ], - "search_endpoint": "https://music.apple.com/search?term=" - }, - { - "client_id": "1245257414715113573", - "enabled": true, - "name": "Spotify", - "process_names": [ - "Spotify.exe" - ], - "search_endpoint": "https://open.spotify.com/search/" - }, - { - "client_id": "1245257493966225488", - "enabled": true, - "name": "Tidal", - "process_names": [ - "TIDAL.exe" - ], - "search_endpoint": "https://listen.tidal.com/search?q=" - } - ], - "autostart": false -} \ No newline at end of file