diff options
Diffstat (limited to 'src/libsoundmanager.hpp')
-rw-r--r-- | src/libsoundmanager.hpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/libsoundmanager.hpp b/src/libsoundmanager.hpp index 2632f94..96346e8 100644 --- a/src/libsoundmanager.hpp +++ b/src/libsoundmanager.hpp @@ -19,7 +19,6 @@ #include <vector> #include <map> #include <string> -#include <functional> #include <json-c/json.h> #include <systemd/sd-event.h> extern "C" @@ -36,12 +35,10 @@ public: Soundmanager(const Soundmanager &) = delete; Soundmanager &operator=(const Soundmanager &) = delete; int init(int port, const std::string& token); - - using handler_fun = std::function<void(struct json_object*)>; - - enum EventType_SM { - Event_AsyncSetSourceState = 1 /*arg key: {sourceID, handle, sourceState}*/ - }; + void registerCallback( + void (*event_cb)(const std::string& event, struct json_object* event_contents), + void (*reply_cb)(struct json_object* reply_contents), + void (*hangup_cb)(void) = nullptr); /* Method */ int registerSource(const std::string& sourceName); @@ -54,10 +51,6 @@ public: int call(const char* verb, struct json_object* arg); int subscribe(const std::string& event_name); int unsubscribe(const std::string& event_name); - void registerCallback( - void (*event_cb)(const std::string& event, struct json_object* event_contents), - void (*reply_cb)(struct json_object* reply_contents), - void (*hangup_cb)(void) = nullptr); private: int init_event(); @@ -73,8 +66,6 @@ private: int mport; std::string mtoken; std::vector<int> msourceIDs; - std::map<EventType_SM, handler_fun> handlers; - EventType_SM const NumItems = (EventType_SM)(Event_AsyncSetSourceState + 1); public: /* Don't use/ Internal only */ |