diff --git a/plugins/channeltx/udpsink/udpsink.cpp b/plugins/channeltx/udpsink/udpsink.cpp index 4d44ef98b..62596b562 100644 --- a/plugins/channeltx/udpsink/udpsink.cpp +++ b/plugins/channeltx/udpsink/udpsink.cpp @@ -150,7 +150,7 @@ bool UDPSink::handleMessage(const Message& cmd) m_config.m_udpPort = cfg.getUDPPort(); m_config.m_channelMute = cfg.getChannelMute(); - apply(false); + apply(cfg.getForce()); m_settingsMutex.unlock(); @@ -183,7 +183,8 @@ void UDPSink::configure(MessageQueue* messageQueue, int fmDeviation, QString& udpAddress, int udpPort, - bool channelMute) + bool channelMute, + bool force) { Message* cmd = MsgUDPSinkConfigure::create(sampleFormat, outputSampleRate, @@ -191,7 +192,8 @@ void UDPSink::configure(MessageQueue* messageQueue, fmDeviation, udpAddress, udpPort, - channelMute); + channelMute, + force); messageQueue->push(cmd); } diff --git a/plugins/channeltx/udpsink/udpsink.h b/plugins/channeltx/udpsink/udpsink.h index 9fef2ee96..d3e4adcc2 100644 --- a/plugins/channeltx/udpsink/udpsink.h +++ b/plugins/channeltx/udpsink/udpsink.h @@ -64,7 +64,8 @@ public: int fmDeviation, QString& udpAddress, int udpPort, - bool channelMute); + bool channelMute, + bool force = false); void setSpectrum(MessageQueue* messageQueue, bool enabled); private: @@ -79,6 +80,7 @@ private: const QString& getUDPAddress() const { return m_udpAddress; } int getUDPPort() const { return m_udpPort; } bool getChannelMute() const { return m_channelMute; } + bool getForce() const { return m_force; } static MsgUDPSinkConfigure* create(SampleFormat sampleFormat, @@ -87,7 +89,8 @@ private: int fmDeviation, QString& udpAddress, int udpPort, - bool channelMute) + bool channelMute, + bool force) { return new MsgUDPSinkConfigure(sampleFormat, inputSampleRate, @@ -95,7 +98,8 @@ private: fmDeviation, udpAddress, udpPort, - channelMute); + channelMute, + force); } private: @@ -106,6 +110,7 @@ private: QString m_udpAddress; int m_udpPort; bool m_channelMute; + bool m_force; MsgUDPSinkConfigure(SampleFormat sampleFormat, Real inputSampleRate, @@ -113,7 +118,8 @@ private: int fmDeviation, QString& udpAddress, int udpPort, - bool channelMute) : + bool channelMute, + bool force) : Message(), m_sampleFormat(sampleFormat), m_inputSampleRate(inputSampleRate), @@ -121,7 +127,8 @@ private: m_fmDeviation(fmDeviation), m_udpAddress(udpAddress), m_udpPort(udpPort), - m_channelMute(channelMute) + m_channelMute(channelMute), + m_force(force) { } }; diff --git a/plugins/channeltx/udpsink/udpsinkgui.cpp b/plugins/channeltx/udpsink/udpsinkgui.cpp index fa2f3f160..10a0b5622 100644 --- a/plugins/channeltx/udpsink/udpsinkgui.cpp +++ b/plugins/channeltx/udpsink/udpsinkgui.cpp @@ -178,7 +178,7 @@ bool UDPSinkGUI::deserialize(const QByteArray& data) blockApplySettings(false); m_channelMarker.blockSignals(false); - applySettings(); + applySettings(true); return true; } else @@ -257,7 +257,7 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceSinkAPI *deviceAPI, QWidget* ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum); - applySettings(); + applySettings(true); connect(m_udpSink->getOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages())); } @@ -278,7 +278,7 @@ void UDPSinkGUI::blockApplySettings(bool block) m_doApplySettings = !block; } -void UDPSinkGUI::applySettings() +void UDPSinkGUI::applySettings(bool force) { if (m_doApplySettings) { @@ -385,7 +385,8 @@ void UDPSinkGUI::applySettings() fmDeviation, m_udpAddress, udpPort, - ui->channelMute->isChecked()); + ui->channelMute->isChecked(), + force); ui->applyBtn->setEnabled(false); } diff --git a/plugins/channeltx/udpsink/udpsinkgui.h b/plugins/channeltx/udpsink/udpsinkgui.h index a564b8964..378efff55 100644 --- a/plugins/channeltx/udpsink/udpsinkgui.h +++ b/plugins/channeltx/udpsink/udpsinkgui.h @@ -97,7 +97,7 @@ private: virtual ~UDPSinkGUI(); void blockApplySettings(bool block); - void applySettings(); + void applySettings(bool force = false); void leaveEvent(QEvent*); void enterEvent(QEvent*);