miscellaneous cleanup

This commit is contained in:
Bruno Morais 2019-09-06 16:10:58 -04:00
parent bca0d259b7
commit a3176118cd

View File

@ -10,38 +10,34 @@ extern "C" {
#include <unistd.h>
}
thread_local char localBuffer[4096];
thread_local char localBuffer[1024];
static MPRISRemote remote;
static const std::map<MPRISProperty, std::vector<const char*>> MPRISPropertyNames =
static const std::map<MPRISProperty, const std::vector<const char*>> MPRISPropertyNames =
{{MPRISProperty::Volume, {"Volume", NULL}},
{MPRISProperty::PlaybackStatus, {"PlaybackStatus", NULL}},
{MPRISProperty::LoopStatus, {"LoopStatus", NULL}},
{MPRISProperty::Shuffle, {"Shuffle", NULL}},
{MPRISProperty::Metadata, {"Metadata", NULL}}};
static std::string GetMetadataString(ITrack* track, const char* key)
{
track->GetString(key, localBuffer, sizeof(localBuffer));
return std::string(localBuffer);
}
static class MPRISPlugin : public IPlugin {
public:
MPRISPlugin() {
}
void Release() { }
const char* Name() { return "MPRIS interface"; }
const char* Version() { return "0.1.0"; }
const char* Author() { return "brunosmmm"; }
const char* Guid() { return "457df67f-f489-415f-975e-282f470b1c10"; }
bool Configurable() { return false; }
void Configure() { }
void Reload() { }
int SdkVersion() { return musik::core::sdk::SdkVersion; }
public:
MPRISPlugin() { }
void Release() { }
const char* Name() { return "MPRIS interface"; }
const char* Version() { return "0.1.0"; }
const char* Author() { return "brunosmmm"; }
const char* Guid() { return "457df67f-f489-415f-975e-282f470b1c10"; }
bool Configurable() { return false; }
void Configure() { }
void Reload() { }
int SdkVersion() { return musik::core::sdk::SdkVersion; }
} plugin;
extern "C" IPlugin* GetPlugin() {
@ -328,7 +324,6 @@ void MPRISRemote::MPRISSetVolume(double vol) {
}
}
MPRISMetadataValues::MPRISMetadataValues() {
trackid = "";
length = 0;