diff --git a/doc/img/NFMdemod_plugin.png b/doc/img/NFMdemod_plugin.png index 4ff267df3..fbacd4b8b 100644 Binary files a/doc/img/NFMdemod_plugin.png and b/doc/img/NFMdemod_plugin.png differ diff --git a/doc/img/NFMdemod_plugin.xcf b/doc/img/NFMdemod_plugin.xcf index c121a648c..17fa30289 100644 Binary files a/doc/img/NFMdemod_plugin.xcf and b/doc/img/NFMdemod_plugin.xcf differ diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index 7db6e998f..0a0caa1cc 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -82,8 +82,6 @@ NFMDemod::NFMDemod(DeviceSourceAPI *devieAPI) : DSPEngine::instance()->getAudioDeviceManager()->addAudioSink(&m_audioFifo, getInputMessageQueue()); m_audioSampleRate = DSPEngine::instance()->getAudioDeviceManager()->getOutputSampleRate(); - m_audioNetSink = new AudioNetSink(0); // parent thread allocated dynamically - no RTP - m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort); applyChannelSettings(m_inputSampleRate, m_inputFrequencyOffset, true); applySettings(m_settings, true); @@ -97,7 +95,6 @@ NFMDemod::NFMDemod(DeviceSourceAPI *devieAPI) : NFMDemod::~NFMDemod() { DSPEngine::instance()->getAudioDeviceManager()->removeAudioSink(&m_audioFifo); - delete m_audioNetSink; m_deviceAPI->removeChannelAPI(this); m_deviceAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; @@ -257,18 +254,12 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto if (m_settings.m_ctcssOn && m_ctcssIndexSelected && (m_ctcssIndexSelected != m_ctcssIndex)) { sample = 0; - if (m_settings.m_copyAudioToUDP) { - m_audioNetSink->write(0); - } } else { demod = m_bandpass.filter(demod); Real squelchFactor = StepFunctions::smootherstep((Real) (m_squelchCount - m_squelchGate) / 480.0f); sample = demod * m_settings.m_volume * squelchFactor; - if (m_settings.m_copyAudioToUDP) { - m_audioNetSink->write(demod * 5.0f * squelchFactor); - } } } else @@ -284,9 +275,6 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto } sample = 0; - if (m_settings.m_copyAudioToUDP) { - m_audioNetSink->write(0); - } } m_audioBuffer[m_audioBufferFill].l = sample; @@ -379,7 +367,6 @@ bool NFMDemod::handleMessage(const Message& cmd) BasebandSampleSink::MsgThreadedSink& cfg = (BasebandSampleSink::MsgThreadedSink&) cmd; const QThread *thread = cfg.getThread(); qDebug("NFMDemod::handleMessage: BasebandSampleSink::MsgThreadedSink: %p", thread); - m_audioNetSink->moveToThread(const_cast(thread)); // use the thread for udp sinks return true; } else if (DSPConfigureAudio::match(cmd)) @@ -464,9 +451,6 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force) << " m_ctcssIndex: " << settings.m_ctcssIndex << " m_ctcssOn: " << settings.m_ctcssOn << " m_audioMute: " << settings.m_audioMute - << " m_copyAudioToUDP: " << settings.m_copyAudioToUDP - << " m_udpAddress: " << settings.m_udpAddress - << " m_udpPort: " << settings.m_udpPort << " m_audioDeviceName: " << settings.m_audioDeviceName << " force: " << force; @@ -516,12 +500,6 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force) m_squelchCount = 0; // reset squelch open counter } - if ((settings.m_udpAddress != m_settings.m_udpAddress) - || (settings.m_udpPort != m_settings.m_udpPort) || force) - { - m_audioNetSink->setDestination(settings.m_udpAddress, settings.m_udpPort); - } - if ((settings.m_ctcssIndex != m_settings.m_ctcssIndex) || force) { setSelectedCtcssIndex(settings.m_ctcssIndex); @@ -593,9 +571,6 @@ int NFMDemod::webapiSettingsPutPatch( if (channelSettingsKeys.contains("audioMute")) { settings.m_audioMute = response.getNfmDemodSettings()->getAudioMute() != 0; } - if (channelSettingsKeys.contains("copyAudioToUDP")) { - settings.m_copyAudioToUDP = response.getNfmDemodSettings()->getCopyAudioToUdp() != 0; - } if (channelSettingsKeys.contains("ctcssIndex")) { settings.m_ctcssIndex = response.getNfmDemodSettings()->getCtcssIndex(); } @@ -628,12 +603,6 @@ int NFMDemod::webapiSettingsPutPatch( if (channelSettingsKeys.contains("title")) { settings.m_title = *response.getNfmDemodSettings()->getTitle(); } - if (channelSettingsKeys.contains("udpAddress")) { - settings.m_udpAddress = *response.getNfmDemodSettings()->getUdpAddress(); - } - if (channelSettingsKeys.contains("udpPort")) { - settings.m_udpPort = response.getNfmDemodSettings()->getUdpPort(); - } if (channelSettingsKeys.contains("volume")) { settings.m_volume = response.getNfmDemodSettings()->getVolume(); } @@ -673,7 +642,6 @@ void NFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp { response.getNfmDemodSettings()->setAfBandwidth(settings.m_afBandwidth); response.getNfmDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0); - response.getNfmDemodSettings()->setCopyAudioToUdp(settings.m_copyAudioToUDP ? 1 : 0); response.getNfmDemodSettings()->setCtcssIndex(settings.m_ctcssIndex); response.getNfmDemodSettings()->setCtcssOn(settings.m_ctcssOn ? 1 : 0); response.getNfmDemodSettings()->setDeltaSquelch(settings.m_deltaSquelch ? 1 : 0); @@ -683,7 +651,6 @@ void NFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp response.getNfmDemodSettings()->setRgbColor(settings.m_rgbColor); response.getNfmDemodSettings()->setSquelch(settings.m_squelch); response.getNfmDemodSettings()->setSquelchGate(settings.m_squelchGate); - response.getNfmDemodSettings()->setUdpPort(settings.m_udpPort); response.getNfmDemodSettings()->setVolume(settings.m_volume); if (response.getNfmDemodSettings()->getTitle()) { @@ -691,12 +658,6 @@ void NFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp } else { response.getNfmDemodSettings()->setTitle(new QString(settings.m_title)); } - - if (response.getNfmDemodSettings()->getUdpAddress()) { - *response.getNfmDemodSettings()->getUdpAddress() = settings.m_udpAddress; - } else { - response.getNfmDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress)); - } } void NFMDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index 06b73283e..5d2562a27 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -209,9 +209,7 @@ private: AudioVector m_audioBuffer; uint m_audioBufferFill; - AudioFifo m_audioFifo; - AudioNetSink *m_audioNetSink; QMutex m_settingsMutex; diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.cpp b/plugins/channelrx/demodnfm/nfmdemodgui.cpp index 12b2d6a23..ed0dc3a6e 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodgui.cpp @@ -206,12 +206,6 @@ void NFMDemodGUI::on_audioMute_toggled(bool checked) applySettings(); } -void NFMDemodGUI::on_copyAudioToUDP_toggled(bool checked) -{ - m_settings.m_copyAudioToUDP = checked; - applySettings(); -} - void NFMDemodGUI::on_ctcss_currentIndexChanged(int index) { m_settings.m_ctcssIndex = index; @@ -233,14 +227,11 @@ void NFMDemodGUI::onMenuDialogCalled(const QPoint &p) dialog.exec(); m_settings.m_inputFrequencyOffset = m_channelMarker.getCenterFrequency(); - m_settings.m_udpAddress = m_channelMarker.getUDPAddress(), - m_settings.m_udpPort = m_channelMarker.getUDPSendPort(), m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); m_settings.m_title = m_channelMarker.getTitle(); setWindowTitle(m_settings.m_title); setTitleColor(m_settings.m_rgbColor); - displayUDPAddress(); applySettings(); } @@ -358,7 +349,6 @@ void NFMDemodGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); - displayUDPAddress(); blockApplySettings(true); @@ -393,18 +383,12 @@ void NFMDemodGUI::displaySettings() ui->ctcssOn->setChecked(m_settings.m_ctcssOn); ui->audioMute->setChecked(m_settings.m_audioMute); - ui->copyAudioToUDP->setChecked(m_settings.m_copyAudioToUDP); ui->ctcss->setCurrentIndex(m_settings.m_ctcssIndex); blockApplySettings(false); } -void NFMDemodGUI::displayUDPAddress() -{ - ui->copyAudioToUDP->setToolTip(QString("Copy audio output to UDP %1:%2").arg(m_settings.m_udpAddress).arg(m_settings.m_udpPort)); -} - void NFMDemodGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.h b/plugins/channelrx/demodnfm/nfmdemodgui.h index c76a7b791..5dd19ede4 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.h +++ b/plugins/channelrx/demodnfm/nfmdemodgui.h @@ -62,7 +62,6 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); - void displayUDPAddress(); void leaveEvent(QEvent*); void enterEvent(QEvent*); @@ -78,7 +77,6 @@ private slots: void on_ctcss_currentIndexChanged(int index); void on_ctcssOn_toggled(bool checked); void on_audioMute_toggled(bool checked); - void on_copyAudioToUDP_toggled(bool checked); void onWidgetRolled(QWidget* widget, bool rollDown); void onMenuDialogCalled(const QPoint& p); void handleInputMessages(); diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.ui b/plugins/channelrx/demodnfm/nfmdemodgui.ui index b59c3e9f4..379ec2059 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.ui +++ b/plugins/channelrx/demodnfm/nfmdemodgui.ui @@ -589,19 +589,6 @@ - - - - Copy audio to UDP - - - U - - - true - - - diff --git a/plugins/channelrx/demodnfm/nfmdemodsettings.cpp b/plugins/channelrx/demodnfm/nfmdemodsettings.cpp index 16914fe91..cceb0540d 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsettings.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodsettings.cpp @@ -49,9 +49,6 @@ void NFMDemodSettings::resetToDefaults() m_ctcssOn = false; m_audioMute = false; m_ctcssIndex = 0; - m_copyAudioToUDP = false; - m_udpAddress = "127.0.0.1"; - m_udpPort = 9998; m_rgbColor = QColor(255, 0, 0).rgb(); m_title = "NFM Demodulator"; m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName; diff --git a/plugins/channelrx/demodnfm/nfmdemodsettings.h b/plugins/channelrx/demodnfm/nfmdemodsettings.h index 3b211da5e..6fef3d3ee 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsettings.h +++ b/plugins/channelrx/demodnfm/nfmdemodsettings.h @@ -38,9 +38,6 @@ struct NFMDemodSettings bool m_ctcssOn; bool m_audioMute; int m_ctcssIndex; - bool m_copyAudioToUDP; - QString m_udpAddress; - uint16_t m_udpPort; quint32 m_rgbColor; QString m_title; QString m_audioDeviceName; diff --git a/plugins/channelrx/demodnfm/readme.md b/plugins/channelrx/demodnfm/readme.md index f160f5800..38c63ba6d 100644 --- a/plugins/channelrx/demodnfm/readme.md +++ b/plugins/channelrx/demodnfm/readme.md @@ -58,12 +58,8 @@ This is the tone squelch in Hz. It can be selected using the toolbox among the u This is the value of the tone squelch received when the CTCSS is activated. It displays `--` if the CTCSS system is de-activated. -

13: Audio mute

+

13: Audio mute and audio output select

-Use this button to toggle audio mute for this channel. The button will light up in green if the squelch is open. This helps identifying which channels are active in a multi-channel configuration. +Left click on this button to toggle audio mute for this channel. The button will light up in green if the squelch is open. This helps identifying which channels are active in a multi-channel configuration. -

14: UDP output

- -Copies audio output to UDP. Audio is set at fixed level and is muted by the mute button (13) and squelch is also applied. Output is mono S16LE samples. Note that fixed volume apart this is the exact same audio that is sent to the audio device in particular it is highpass filtered at 300 Hz and thus is not suitable for digital communications. For this purpose you have to use the UDP source plugin instead. - -UDP address and send port are specified in the basic channel settings. See: [here](https://github.com/f4exb/sdrangel/blob/master/sdrgui/readme.md#6-channels) \ No newline at end of file +If you right click on it it will open a dialog to select the audio output device. \ No newline at end of file diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 78fbe3b88..84711b135 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1539,15 +1539,6 @@ margin-bottom: 20px; "ctcssIndex" : { "type" : "integer" }, - "copyAudioToUDP" : { - "type" : "integer" - }, - "udpAddress" : { - "type" : "string" - }, - "udpPort" : { - "type" : "integer" - }, "rgbColor" : { "type" : "integer" }, @@ -18063,7 +18054,7 @@ except ApiException as e:
- Generated 2018-03-27T12:01:24.051+02:00 + Generated 2018-03-28T09:34:59.109+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml b/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml index f42bbbf0e..7d18d0cc2 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml @@ -33,12 +33,6 @@ NFMDemodSettings: type: integer ctcssIndex: type: integer - copyAudioToUDP: - type: integer - udpAddress: - type: string - udpPort: - type: integer rgbColor: type: integer title: diff --git a/swagger/sdrangel/api/swagger/include/NFMDemod.yaml b/swagger/sdrangel/api/swagger/include/NFMDemod.yaml index f42bbbf0e..7d18d0cc2 100644 --- a/swagger/sdrangel/api/swagger/include/NFMDemod.yaml +++ b/swagger/sdrangel/api/swagger/include/NFMDemod.yaml @@ -33,12 +33,6 @@ NFMDemodSettings: type: integer ctcssIndex: type: integer - copyAudioToUDP: - type: integer - udpAddress: - type: string - udpPort: - type: integer rgbColor: type: integer title: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 78fbe3b88..84711b135 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1539,15 +1539,6 @@ margin-bottom: 20px; "ctcssIndex" : { "type" : "integer" }, - "copyAudioToUDP" : { - "type" : "integer" - }, - "udpAddress" : { - "type" : "string" - }, - "udpPort" : { - "type" : "integer" - }, "rgbColor" : { "type" : "integer" }, @@ -18063,7 +18054,7 @@ except ApiException as e:
- Generated 2018-03-27T12:01:24.051+02:00 + Generated 2018-03-28T09:34:59.109+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp index bace31f21..7f142b703 100644 --- a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp @@ -50,12 +50,6 @@ SWGNFMDemodSettings::SWGNFMDemodSettings() { m_audio_mute_isSet = false; ctcss_index = 0; m_ctcss_index_isSet = false; - copy_audio_to_udp = 0; - m_copy_audio_to_udp_isSet = false; - udp_address = nullptr; - m_udp_address_isSet = false; - udp_port = 0; - m_udp_port_isSet = false; rgb_color = 0; m_rgb_color_isSet = false; title = nullptr; @@ -90,12 +84,6 @@ SWGNFMDemodSettings::init() { m_audio_mute_isSet = false; ctcss_index = 0; m_ctcss_index_isSet = false; - copy_audio_to_udp = 0; - m_copy_audio_to_udp_isSet = false; - udp_address = new QString(""); - m_udp_address_isSet = false; - udp_port = 0; - m_udp_port_isSet = false; rgb_color = 0; m_rgb_color_isSet = false; title = new QString(""); @@ -116,11 +104,6 @@ SWGNFMDemodSettings::cleanup() { - if(udp_address != nullptr) { - delete udp_address; - } - - if(title != nullptr) { delete title; } @@ -159,12 +142,6 @@ SWGNFMDemodSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&ctcss_index, pJson["ctcssIndex"], "qint32", ""); - ::SWGSDRangel::setValue(©_audio_to_udp, pJson["copyAudioToUDP"], "qint32", ""); - - ::SWGSDRangel::setValue(&udp_address, pJson["udpAddress"], "QString", "QString"); - - ::SWGSDRangel::setValue(&udp_port, pJson["udpPort"], "qint32", ""); - ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", ""); ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); @@ -218,15 +195,6 @@ SWGNFMDemodSettings::asJsonObject() { if(m_ctcss_index_isSet){ obj->insert("ctcssIndex", QJsonValue(ctcss_index)); } - if(m_copy_audio_to_udp_isSet){ - obj->insert("copyAudioToUDP", QJsonValue(copy_audio_to_udp)); - } - if(udp_address != nullptr && *udp_address != QString("")){ - toJsonValue(QString("udpAddress"), udp_address, obj, QString("QString")); - } - if(m_udp_port_isSet){ - obj->insert("udpPort", QJsonValue(udp_port)); - } if(m_rgb_color_isSet){ obj->insert("rgbColor", QJsonValue(rgb_color)); } @@ -347,36 +315,6 @@ SWGNFMDemodSettings::setCtcssIndex(qint32 ctcss_index) { this->m_ctcss_index_isSet = true; } -qint32 -SWGNFMDemodSettings::getCopyAudioToUdp() { - return copy_audio_to_udp; -} -void -SWGNFMDemodSettings::setCopyAudioToUdp(qint32 copy_audio_to_udp) { - this->copy_audio_to_udp = copy_audio_to_udp; - this->m_copy_audio_to_udp_isSet = true; -} - -QString* -SWGNFMDemodSettings::getUdpAddress() { - return udp_address; -} -void -SWGNFMDemodSettings::setUdpAddress(QString* udp_address) { - this->udp_address = udp_address; - this->m_udp_address_isSet = true; -} - -qint32 -SWGNFMDemodSettings::getUdpPort() { - return udp_port; -} -void -SWGNFMDemodSettings::setUdpPort(qint32 udp_port) { - this->udp_port = udp_port; - this->m_udp_port_isSet = true; -} - qint32 SWGNFMDemodSettings::getRgbColor() { return rgb_color; @@ -413,9 +351,6 @@ SWGNFMDemodSettings::isSet(){ if(m_ctcss_on_isSet){ isObjectUpdated = true; break;} if(m_audio_mute_isSet){ isObjectUpdated = true; break;} if(m_ctcss_index_isSet){ isObjectUpdated = true; break;} - if(m_copy_audio_to_udp_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;} if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;} }while(false); diff --git a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h index b4b689a66..8ec59c048 100644 --- a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h @@ -75,15 +75,6 @@ public: qint32 getCtcssIndex(); void setCtcssIndex(qint32 ctcss_index); - qint32 getCopyAudioToUdp(); - void setCopyAudioToUdp(qint32 copy_audio_to_udp); - - QString* getUdpAddress(); - void setUdpAddress(QString* udp_address); - - qint32 getUdpPort(); - void setUdpPort(qint32 udp_port); - qint32 getRgbColor(); void setRgbColor(qint32 rgb_color); @@ -127,15 +118,6 @@ private: qint32 ctcss_index; bool m_ctcss_index_isSet; - qint32 copy_audio_to_udp; - bool m_copy_audio_to_udp_isSet; - - QString* udp_address; - bool m_udp_address_isSet; - - qint32 udp_port; - bool m_udp_port_isSet; - qint32 rgb_color; bool m_rgb_color_isSet;