cleanup ugly initialization trick

This commit is contained in:
Bruno Morais 2019-09-06 16:05:56 -04:00
parent 1d73e5ed0e
commit bca0d259b7

View File

@ -2,6 +2,7 @@
#include "mpris.h" #include "mpris.h"
#include "dbus.h" #include "dbus.h"
#include <map> #include <map>
#include <vector>
#include <chrono> #include <chrono>
#include <functional> #include <functional>
@ -12,12 +13,7 @@ extern "C" {
thread_local char localBuffer[4096]; thread_local char localBuffer[4096];
static MPRISRemote remote; static MPRISRemote remote;
struct sd_null_term_str { static const std::map<MPRISProperty, std::vector<const char*>> MPRISPropertyNames =
const char* string;
const char* terminator;
};
static const std::map<MPRISProperty, struct sd_null_term_str> MPRISPropertyNames =
{{MPRISProperty::Volume, {"Volume", NULL}}, {{MPRISProperty::Volume, {"Volume", NULL}},
{MPRISProperty::PlaybackStatus, {"PlaybackStatus", NULL}}, {MPRISProperty::PlaybackStatus, {"PlaybackStatus", NULL}},
{MPRISProperty::LoopStatus, {"LoopStatus", NULL}}, {MPRISProperty::LoopStatus, {"LoopStatus", NULL}},