mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-05 21:55:24 +00:00
musikcube allows multiple instances, so append to name requested for player
This commit is contained in:
parent
a485965fcf
commit
1d73e5ed0e
@ -5,6 +5,10 @@
|
||||
#include <chrono>
|
||||
#include <functional>
|
||||
|
||||
extern "C" {
|
||||
#include <unistd.h>
|
||||
}
|
||||
|
||||
thread_local char localBuffer[4096];
|
||||
static MPRISRemote remote;
|
||||
|
||||
@ -54,6 +58,7 @@ extern "C" IPlaybackRemote* GetPlaybackRemote() {
|
||||
|
||||
bool MPRISRemote::MPRISInit() {
|
||||
int ret = 0;
|
||||
std::string requested_name;
|
||||
|
||||
if (this->mpris_initialized) {
|
||||
return true;
|
||||
@ -79,7 +84,8 @@ bool MPRISRemote::MPRISInit() {
|
||||
return false;
|
||||
}
|
||||
|
||||
ret = sd_bus_request_name(this->bus, "org.mpris.MediaPlayer2.musikcube", 0);
|
||||
requested_name = std::string("org.mpris.MediaPlayer2.musikcube.instance") + std::to_string(getpid());
|
||||
ret = sd_bus_request_name(this->bus, requested_name.c_str(), 0);
|
||||
if (ret < 0) {
|
||||
MPRISDeinit();
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user