summaryrefslogtreecommitdiffstats
path: root/src/libsoundmanager.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsoundmanager.hpp')
-rw-r--r--src/libsoundmanager.hpp33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/libsoundmanager.hpp b/src/libsoundmanager.hpp
index 96346e8..7a20f57 100644
--- a/src/libsoundmanager.hpp
+++ b/src/libsoundmanager.hpp
@@ -39,13 +39,22 @@ public:
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);
+ struct sd_event* getEventLoop();
/* Method */
- int registerSource(const std::string& sourceName);
- int connect(int sourceID, int sinkID);
- int connect(int sourceID, const std::string& sinkName);
- int disconnect(int connectionID);
- int ackSetSourceState(int handle, int error);
+ int registerSource(const std::string& audio_role);
+ int connect(int source_id, int sink_id);
+ int connect(int source_id, const std::string& sink_name);
+ int disconnect(int connection_id);
+ int ackSetSourceState(int handle, int error = 0);
+ int getListMainSources();
+ int getListMainSinks();
+ int getListMainConnections();
+
+ int streamOpen(const std::string& audio_role, int endpoint_id);
+ int streamOpen(const std::string& audio_role, const std::string& endpoint_id = "default");
+ int streamClose(int stream_id);
+ int setStreamState(int stream_id, int mute_state = 0); // 0 is unmute, 1 is mute
int call(const std::string& verb, struct json_object* arg);
int call(const char* verb, struct json_object* arg);
@@ -53,8 +62,8 @@ public:
int unsubscribe(const std::string& event_name);
private:
- int init_event();
- int initialize_websocket();
+ int initEvent();
+ int initializeWebsocket();
void (*onEvent)(const std::string& event, struct json_object* event_contents);
void (*onReply)(struct json_object* reply);
@@ -68,11 +77,11 @@ private:
std::vector<int> msourceIDs;
public:
- /* Don't use/ Internal only */
- void on_hangup(void *closure, struct afb_wsj1 *wsj);
- void on_call(void *closure, const char *api, const char *verb, struct afb_wsj1_msg *msg);
- void on_event(void *closure, const char *event, struct afb_wsj1_msg *msg);
- void on_reply(void *closure, struct afb_wsj1_msg *msg);
+ /* Don't use. Internal only */
+ void _onHangup(void *closure, struct afb_wsj1 *wsj);
+ void _onCall(void *closure, const char *api, const char *verb, struct afb_wsj1_msg *msg);
+ void _onEvent(void *closure, const char *event, struct afb_wsj1_msg *msg);
+ void _onReply(void *closure, struct afb_wsj1_msg *msg);
};
#endif /* LIBSOUNDMANAGER_H */