From de2f47dd8536ac9addb13b10c66174ece8006b80 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 20 Feb 2018 20:07:23 +0100 Subject: [PATCH] Web API: NFM demod: implemented use RTP indicator --- plugins/channelrx/demodnfm/nfmdemod.cpp | 8 +++---- sdrbase/resources/webapi/doc/html2/index.html | 5 ++++- .../webapi/doc/swagger/include/NFMDemod.yaml | 2 ++ swagger/sdrangel/code/html2/index.html | 5 ++++- .../code/qt5/client/SWGNFMDemodSettings.cpp | 21 +++++++++++++++++++ .../code/qt5/client/SWGNFMDemodSettings.h | 6 ++++++ 6 files changed, 41 insertions(+), 6 deletions(-) diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index d2b449c4a..00991efad 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -568,9 +568,9 @@ int NFMDemod::webapiSettingsPutPatch( if (channelSettingsKeys.contains("copyAudioToUDP")) { settings.m_copyAudioToUDP = response.getNfmDemodSettings()->getCopyAudioToUdp() != 0; } -// if (channelSettingsKeys.contains("copyAudioUseRTP")) { -// settings.m_copyAudioUseRTP = response.getNfmDemodSettings()->getCopyAudioUseRtp() != 0; -// } + if (channelSettingsKeys.contains("copyAudioUseRTP")) { + settings.m_copyAudioUseRTP = response.getNfmDemodSettings()->getCopyAudioUseRtp() != 0; + } if (channelSettingsKeys.contains("ctcssIndex")) { settings.m_ctcssIndex = response.getNfmDemodSettings()->getCtcssIndex(); } @@ -640,7 +640,7 @@ void NFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp response.getNfmDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0); response.getNfmDemodSettings()->setAudioSampleRate(settings.m_audioSampleRate); response.getNfmDemodSettings()->setCopyAudioToUdp(settings.m_copyAudioToUDP ? 1 : 0); -// response.getNfmDemodSettings()->setCopyAudioUseRtp(settings.m_copyAudioUseRTP ? 1 : 0); + response.getNfmDemodSettings()->setCopyAudioUseRtp(settings.m_copyAudioUseRTP ? 1 : 0); response.getNfmDemodSettings()->setCtcssIndex(settings.m_ctcssIndex); response.getNfmDemodSettings()->setCtcssOn(settings.m_ctcssOn ? 1 : 0); response.getNfmDemodSettings()->setDeltaSquelch(settings.m_deltaSquelch ? 1 : 0); diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index af996b92d..0c50ca5ef 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1372,6 +1372,9 @@ margin-bottom: 20px; "copyAudioToUDP" : { "type" : "integer" }, + "copyAudioUseRTP" : { + "type" : "integer" + }, "udpAddress" : { "type" : "string" }, @@ -16922,7 +16925,7 @@ except ApiException as e:
- Generated 2018-02-14T00:45:07.183+01:00 + Generated 2018-02-20T20:02:08.315+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml b/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml index e644936fe..c83d72e4e 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml @@ -32,6 +32,8 @@ NFMDemodSettings: type: integer copyAudioToUDP: type: integer + copyAudioUseRTP: + type: integer udpAddress: type: string udpPort: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index af996b92d..0c50ca5ef 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1372,6 +1372,9 @@ margin-bottom: 20px; "copyAudioToUDP" : { "type" : "integer" }, + "copyAudioUseRTP" : { + "type" : "integer" + }, "udpAddress" : { "type" : "string" }, @@ -16922,7 +16925,7 @@ except ApiException as e:
- Generated 2018-02-14T00:45:07.183+01:00 + Generated 2018-02-20T20:02:08.315+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp index f7f786b16..9f96cea64 100644 --- a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp @@ -54,6 +54,8 @@ SWGNFMDemodSettings::SWGNFMDemodSettings() { m_audio_sample_rate_isSet = false; copy_audio_to_udp = 0; m_copy_audio_to_udp_isSet = false; + copy_audio_use_rtp = 0; + m_copy_audio_use_rtp_isSet = false; udp_address = nullptr; m_udp_address_isSet = false; udp_port = 0; @@ -96,6 +98,8 @@ SWGNFMDemodSettings::init() { m_audio_sample_rate_isSet = false; copy_audio_to_udp = 0; m_copy_audio_to_udp_isSet = false; + copy_audio_use_rtp = 0; + m_copy_audio_use_rtp_isSet = false; udp_address = new QString(""); m_udp_address_isSet = false; udp_port = 0; @@ -121,6 +125,7 @@ SWGNFMDemodSettings::cleanup() { + if(udp_address != nullptr) { delete udp_address; } @@ -168,6 +173,8 @@ SWGNFMDemodSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(©_audio_to_udp, pJson["copyAudioToUDP"], "qint32", ""); + ::SWGSDRangel::setValue(©_audio_use_rtp, pJson["copyAudioUseRTP"], "qint32", ""); + ::SWGSDRangel::setValue(&udp_address, pJson["udpAddress"], "QString", "QString"); ::SWGSDRangel::setValue(&udp_port, pJson["udpPort"], "qint32", ""); @@ -231,6 +238,9 @@ SWGNFMDemodSettings::asJsonObject() { if(m_copy_audio_to_udp_isSet){ obj->insert("copyAudioToUDP", QJsonValue(copy_audio_to_udp)); } + if(m_copy_audio_use_rtp_isSet){ + obj->insert("copyAudioUseRTP", QJsonValue(copy_audio_use_rtp)); + } if(udp_address != nullptr && *udp_address != QString("")){ toJsonValue(QString("udpAddress"), udp_address, obj, QString("QString")); } @@ -377,6 +387,16 @@ SWGNFMDemodSettings::setCopyAudioToUdp(qint32 copy_audio_to_udp) { this->m_copy_audio_to_udp_isSet = true; } +qint32 +SWGNFMDemodSettings::getCopyAudioUseRtp() { + return copy_audio_use_rtp; +} +void +SWGNFMDemodSettings::setCopyAudioUseRtp(qint32 copy_audio_use_rtp) { + this->copy_audio_use_rtp = copy_audio_use_rtp; + this->m_copy_audio_use_rtp_isSet = true; +} + QString* SWGNFMDemodSettings::getUdpAddress() { return udp_address; @@ -435,6 +455,7 @@ SWGNFMDemodSettings::isSet(){ if(m_ctcss_index_isSet){ isObjectUpdated = true; break;} if(m_audio_sample_rate_isSet){ isObjectUpdated = true; break;} if(m_copy_audio_to_udp_isSet){ isObjectUpdated = true; break;} + if(m_copy_audio_use_rtp_isSet){ isObjectUpdated = true; break;} if(udp_address != nullptr && *udp_address != QString("")){ isObjectUpdated = true; break;} if(m_udp_port_isSet){ isObjectUpdated = true; break;} if(m_rgb_color_isSet){ isObjectUpdated = true; break;} diff --git a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h index 97efd93d5..879cd04db 100644 --- a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h @@ -80,6 +80,9 @@ public: qint32 getCopyAudioToUdp(); void setCopyAudioToUdp(qint32 copy_audio_to_udp); + qint32 getCopyAudioUseRtp(); + void setCopyAudioUseRtp(qint32 copy_audio_use_rtp); + QString* getUdpAddress(); void setUdpAddress(QString* udp_address); @@ -135,6 +138,9 @@ private: qint32 copy_audio_to_udp; bool m_copy_audio_to_udp_isSet; + qint32 copy_audio_use_rtp; + bool m_copy_audio_use_rtp_isSet; + QString* udp_address; bool m_udp_address_isSet;