17 #ifndef LIBSOUNDMANAGER_H 18 #define LIBSOUNDMANAGER_H 19 #include <audiomanagertypes.h> 23 #include <json-c/json.h> 24 #include <systemd/sd-event.h> 27 #include <afb/afb-binding.h> 28 #include <afb/afb-wsj1.h> 29 #include <afb/afb-ws-client.h> 35 std::string(
"connect"),
36 std::string(
"disconnect"),
37 std::string(
"setVolume"),
38 std::string(
"volumeStep"),
39 std::string(
"setSinkMuteState"),
40 std::string(
"getListMainConnections"),
41 std::string(
"ackConnect"),
42 std::string(
"ackDisconnect"),
43 std::string(
"ackSetSourceState"),
44 std::string(
"registerSource"),
45 std::string(
"deregisterSource"),
46 std::string(
"subscribe"),
47 std::string(
"unsubscribe")
51 std::string(
"newMainConnection"),
52 std::string(
"volumeChanged"),
53 std::string(
"removedMainConnection"),
54 std::string(
"sinkMuteStateChanged"),
55 std::string(
"mainConnectionStateChanged"),
56 std::string(
"setRoutingReady"),
57 std::string(
"setRoutingRundown"),
58 std::string(
"asyncConnect"),
59 std::string(
"ackSetSourceState")
72 void register_callback(
73 void (*event_cb)(
const std::string&
event,
struct json_object* event_contents),
74 void (*reply_cb)(
struct json_object* reply_contents)
77 int call(
const std::string& verb,
struct json_object* arg);
78 int call_sync(
const std::string& verb,
struct json_object* arg,
struct json_object* ret);
79 int subscribe(
const std::string& event_name);
80 int unsubscribe(
const std::string& event_name);
85 int initialize_websocket();
86 void (*onEvent)(
const std::string& event,
struct json_object* event_contents);
87 void (*onReply)(
struct json_object* reply);
89 struct afb_wsj1* sp_websock;
90 struct afb_wsj1_itf minterface;
94 std::string mtoken =
"123456";
96 am_Error_e connect(
const am_sourceID_t sourceID,
const am_sinkID_t sinkID, am::am_mainConnectionID_t& mainConnectionID);
97 am_Error_e disconnect(
const am_mainConnectionID_t mainConnectionID);
101 void on_hangup(
void *closure,
struct afb_wsj1 *wsj);
102 void on_call(
void *closure,
const char *api,
const char *verb,
struct afb_wsj1_msg *msg);
103 void on_event(
void *closure,
const char *event,
struct afb_wsj1_msg *msg);
104 void on_reply(
void *closure,
struct afb_wsj1_msg *msg);
const std::vector< std::string > api_list
const std::vector< std::string > event_list