summaryrefslogtreecommitdiffstats
path: root/src/libsoundmanager.hpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-27 15:47:56 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-29 11:27:37 +0900
commitfafad52781050c8660bd41886627e50045c54740 (patch)
tree1e8a73bc9dfbd8173eccf0ebf39416324ebef76a /src/libsoundmanager.hpp
parentc88c23da5b126577a24ac1fa4a0ff69ca24501d9 (diff)
High level API * stream_open * stream_close * set_stream_state Get functions * getListMainSinks * getListMainSources * getListMainConnections New event * stream_state_event Related Change: https://gerrit.automotivelinux.org/gerrit/gitweb?p=apps/agl-service-soundmanager-2017.git;a=commit;h=a5da9bcbc5b3eb9a23cb97c8d3ef711c713e6c83 v2: Consolidate the coding style into camelCase. Change-Id: I65b6159ffce57d71588c6edd7bed9d5b0a17d19a Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
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 */