This program first initializes itself as a client discoverable through MPRIS, then launches spcplay.exe through Wine with the given spc file. Why? Since SPCPlay isn't natively recognized as a media player (mainly because it is a windows executable), it cannot be controlled by media keys on a keyboard without such a bridge to MPRIS.
Included here is the mpris_server.hpp header-only C++ library, which itself has only one dependency: sdbus-c++. Building sdbus-c++ requires cmake.
TL;DR Copy-paste this in a terminal
git clone https://github.com/Kistler-Group/sdbus-cpp.git && \
cd sdbus-cpp && mkdir build && cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
sudo cmake --build . --target install && \
cd ../.. && rm -rf sdbus-cpp/
And that's it.
This program also uses a (tiny) homemade header-only c library to read the Super NES's music files metadata.
Addendum
Spcplay must be version 2.21 or higher, such as this release.
- Clone this repo
- In spcplay-mpris.cpp, replace the SPCPLAY_EXE macro with your path to spcplay.exe (then save)
- Run the
makecommand in the root folder!
The executable will be in the newly created "build" folder.
(Optional) Giving the program a desktop entry and icon:
- Fill the missing fields from spcplayer.desktop (then save)
- Move spcplayer.desktop to ~/.local/share/applications/
- Move spcplayer.png to </your/path/to/spcplayer.png>
spcplay-mpris <path/to/file.spc>