diff options
-rw-r--r-- | src/qlibsoundmanager.cpp | 30 | ||||
-rw-r--r-- | src/qlibsoundmanager.h | 11 |
2 files changed, 37 insertions, 4 deletions
diff --git a/src/qlibsoundmanager.cpp b/src/qlibsoundmanager.cpp index c9e002c..a7722d9 100644 --- a/src/qlibsoundmanager.cpp +++ b/src/qlibsoundmanager.cpp @@ -95,10 +95,36 @@ int QSoundmanager::disconnect(int connectionID){ int QSoundmanager::ackSetSourceState(int handle, int errorcode){ return Soundmanager::ackSetSourceState(handle, errorcode); } -int QSoundmanager::registerSource(const QString& name){ - string str = name.toStdString(); +int QSoundmanager::registerSource(const QString& audio_role){ + string str = audio_role.toStdString(); return Soundmanager::registerSource(str); } +int QSoundmanager::getListMainSources(){ + return Soundmanager::getListMainSources(); +} +int QSoundmanager::getListMainSinks(){ + return Soundmanager::getListMainSinks(); +} +int QSoundmanager::getListMainConnections(){ + return Soundmanager::getListMainConnections(); +} +int QSoundmanager::stream_open(const QString& audio_role, int endpoint_id){ + string arole = audio_role.toStdString(); + return Soundmanager::stream_open(arole, endpoint_id); +} +int QSoundmanager::stream_open(const QString& audio_role, const QString& endpoint_id){ + string arole = audio_role.toStdString(); + string eid = endpoint_id.toStdString(); + return Soundmanager::stream_open(arole, eid); +} + +int QSoundmanager::stream_close(int stream_id){ + return Soundmanager::stream_close(stream_id); +} +int QSoundmanager::set_stream_state(int stream_id, int mute){ + return Soundmanager::set_stream_state(stream_id, mute); +} + static int create_json_object(const QJsonObject& obj, struct json_object* jobj) { diff --git a/src/qlibsoundmanager.h b/src/qlibsoundmanager.h index 36b477b..4c17002 100644 --- a/src/qlibsoundmanager.h +++ b/src/qlibsoundmanager.h @@ -38,11 +38,18 @@ public: // method public: Q_INVOKABLE int call(const QString &verb, const QJsonObject &arg); - Q_INVOKABLE int connect(int sourceID, const QString& sinkName); + Q_INVOKABLE int connect(int sourceID, const QString& sinkName = "default"); Q_INVOKABLE int connect(int sourceID, int sinkID); Q_INVOKABLE int disconnect(int connectionID); Q_INVOKABLE int ackSetSourceState(int handle, int errorcode); - Q_INVOKABLE int registerSource(const QString& name); + Q_INVOKABLE int registerSource(const QString& audio_role); + Q_INVOKABLE int getListMainSinks(); + Q_INVOKABLE int getListMainSources(); + Q_INVOKABLE int getListMainConnections(); + Q_INVOKABLE int stream_open(const QString& audio_role, int endpoint_id); + Q_INVOKABLE int stream_open(const QString& audio_role, const QString& endpoint_id = "default"); + Q_INVOKABLE int stream_close(int stream_id); + Q_INVOKABLE int set_stream_state(int stream_id, int mute = 0); // 0 is unmute , 1 is mute signals: void reply(const QVariant &msg); |