diff --git a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.cpp b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.cpp index 331bc8144..698e2bf9a 100644 --- a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.cpp +++ b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.cpp @@ -140,10 +140,11 @@ void BeamSteeringCWMod::applySettings(const BeamSteeringCWModSettings& settings, BeamSteeringCWModBaseband::MsgConfigureBeamSteeringCWModBaseband *msg = BeamSteeringCWModBaseband::MsgConfigureBeamSteeringCWModBaseband::create(settings, force); m_basebandSource->getInputMessageQueue()->push(msg); - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -412,24 +413,27 @@ void BeamSteeringCWMod::webapiReverseSendSettings(QList& channelSetting } void BeamSteeringCWMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const BeamSteeringCWModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.h b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.h index 7efd968b7..486cdac83 100644 --- a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.h +++ b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.h @@ -34,6 +34,7 @@ class BeamSteeringCWModBaseband; class QNetworkReply; class QNetworkAccessManager; class BasebandSampleSink; +class ObjectPipe; class BeamSteeringCWMod: public MIMOChannel, public ChannelAPI { @@ -166,7 +167,7 @@ private: void calculateFrequencyOffset(); void webapiReverseSendSettings(QList& channelSettingsKeys, const BeamSteeringCWModSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const BeamSteeringCWModSettings& settings, bool force diff --git a/plugins/channelmimo/interferometer/interferometer.cpp b/plugins/channelmimo/interferometer/interferometer.cpp index 7cd5afc6c..b96357bfe 100644 --- a/plugins/channelmimo/interferometer/interferometer.cpp +++ b/plugins/channelmimo/interferometer/interferometer.cpp @@ -155,10 +155,11 @@ void Interferometer::applySettings(const InterferometerSettings& settings, bool m_basebandSink->setPhase(settings.m_phase); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -463,24 +464,27 @@ void Interferometer::webapiReverseSendSettings(QList& channelSettingsKe } void Interferometer::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const InterferometerSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelmimo/interferometer/interferometer.h b/plugins/channelmimo/interferometer/interferometer.h index 43a1f7817..6dd9f3663 100644 --- a/plugins/channelmimo/interferometer/interferometer.h +++ b/plugins/channelmimo/interferometer/interferometer.h @@ -35,7 +35,7 @@ class DeviceAPI; class InterferometerBaseband; class QNetworkReply; class QNetworkAccessManager; - +class ObjectPipe; class Interferometer: public MIMOChannel, public ChannelAPI { public: @@ -171,7 +171,7 @@ private: void calculateFrequencyOffset(); void webapiReverseSendSettings(QList& channelSettingsKeys, const InterferometerSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const InterferometerSettings& settings, bool force diff --git a/plugins/channelrx/chanalyzer/chanalyzer.cpp b/plugins/channelrx/chanalyzer/chanalyzer.cpp index fc6541d42..f346c1250 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzer.cpp @@ -280,6 +280,13 @@ void ChannelAnalyzer::applySettings(const ChannelAnalyzerSettings& settings, boo webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); + + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); + } + m_settings = settings; } @@ -543,24 +550,27 @@ void ChannelAnalyzer::webapiReverseSendSettings( } void ChannelAnalyzer::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const ChannelAnalyzerSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/chanalyzer/chanalyzer.h b/plugins/channelrx/chanalyzer/chanalyzer.h index cdb1a67ba..0cbe884d0 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.h +++ b/plugins/channelrx/chanalyzer/chanalyzer.h @@ -36,7 +36,7 @@ class DownChannelizer; class QNetworkReply; class QNetworkAccessManager; - +class ObjectPipe; class ChannelAnalyzer : public BasebandSampleSink, public ChannelAPI { public: class MsgConfigureChannelAnalyzer : public Message { @@ -140,7 +140,7 @@ private: void applySettings(const ChannelAnalyzerSettings& settings, bool force = false); void webapiReverseSendSettings(QList& channelSettingsKeys, const ChannelAnalyzerSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const ChannelAnalyzerSettings& settings, bool force diff --git a/plugins/channelrx/demodam/amdemod.cpp b/plugins/channelrx/demodam/amdemod.cpp index b43fac231..92e702b7f 100644 --- a/plugins/channelrx/demodam/amdemod.cpp +++ b/plugins/channelrx/demodam/amdemod.cpp @@ -249,10 +249,11 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -520,24 +521,27 @@ void AMDemod::webapiReverseSendSettings(QList& channelSettingsKeys, con } void AMDemod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const AMDemodSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/demodam/amdemod.h b/plugins/channelrx/demodam/amdemod.h index b61b863ec..b73641222 100644 --- a/plugins/channelrx/demodam/amdemod.h +++ b/plugins/channelrx/demodam/amdemod.h @@ -34,6 +34,7 @@ class QNetworkAccessManager; class QNetworkReply; class QThread; class DeviceAPI; +class ObjectPipe; class AMDemod : public BasebandSampleSink, public ChannelAPI { public: @@ -146,7 +147,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const AMDemodSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const AMDemodSettings& settings, bool force diff --git a/plugins/channelrx/demodbfm/bfmdemod.cpp b/plugins/channelrx/demodbfm/bfmdemod.cpp index 457cbc69d..7d95a8fa0 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.cpp +++ b/plugins/channelrx/demodbfm/bfmdemod.cpp @@ -232,10 +232,11 @@ void BFMDemod::applySettings(const BFMDemodSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -539,24 +540,27 @@ void BFMDemod::webapiReverseSendSettings(QList& channelSettingsKeys, co } void BFMDemod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const BFMDemodSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/demodbfm/bfmdemod.h b/plugins/channelrx/demodbfm/bfmdemod.h index 2e8371cda..8838afb39 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.h +++ b/plugins/channelrx/demodbfm/bfmdemod.h @@ -36,6 +36,7 @@ class QNetworkAccessManager; class QNetworkReply; class QThread; class DeviceAPI; +class ObjectPipe; namespace SWGSDRangel { class SWGRDSReport; @@ -161,7 +162,7 @@ private: void webapiFormatRDSReport(SWGSDRangel::SWGRDSReport *report); void webapiReverseSendSettings(QList& channelSettingsKeys, const BFMDemodSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const BFMDemodSettings& settings, bool force diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp index 95c2a62de..cd6ce3b86 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp +++ b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp @@ -473,10 +473,11 @@ void ChirpChatDemod::applySettings(const ChirpChatDemodSettings& settings, bool webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -769,24 +770,27 @@ void ChirpChatDemod::webapiReverseSendSettings(QList& channelSettingsKe } void ChirpChatDemod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const ChirpChatDemodSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemod.h b/plugins/channelrx/demodchirpchat/chirpchatdemod.h index 5af8d2d34..d9113f8b3 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemod.h +++ b/plugins/channelrx/demodchirpchat/chirpchatdemod.h @@ -37,6 +37,7 @@ class QNetworkAccessManager; class QNetworkReply; class DeviceAPI; class QThread; +class ObjectPipe; class ChirpChatDemod : public BasebandSampleSink, public ChannelAPI { public: @@ -294,7 +295,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const ChirpChatDemodSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const ChirpChatDemodSettings& settings, bool force diff --git a/plugins/channelrx/demoddatv/datvdemod.cpp b/plugins/channelrx/demoddatv/datvdemod.cpp index 94c029a4e..4e6233f3b 100644 --- a/plugins/channelrx/demoddatv/datvdemod.cpp +++ b/plugins/channelrx/demoddatv/datvdemod.cpp @@ -248,6 +248,13 @@ void DATVDemod::applySettings(const DATVDemodSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); + + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); + } + m_settings = settings; } @@ -532,24 +539,27 @@ void DATVDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& respons } void DATVDemod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const DATVDemodSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/demoddatv/datvdemod.h b/plugins/channelrx/demoddatv/datvdemod.h index 18e793ce5..87ed3c64c 100644 --- a/plugins/channelrx/demoddatv/datvdemod.h +++ b/plugins/channelrx/demoddatv/datvdemod.h @@ -35,6 +35,7 @@ class DeviceAPI; class QNetworkAccessManager; class QNetworkReply; +class ObjectPipe; class DATVDemod : public BasebandSampleSink, public ChannelAPI { @@ -165,7 +166,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const DATVDemodSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const DATVDemodSettings& settings, bool force diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index 10061d958..0fe0148d3 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -275,10 +275,11 @@ void DSDDemod::applySettings(const DSDDemodSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -593,24 +594,27 @@ void DSDDemod::webapiReverseSendSettings(QList& channelSettingsKeys, co } void DSDDemod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const DSDDemodSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index e69d5a6d1..648b8b437 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -35,6 +35,7 @@ class QNetworkAccessManager; class QNetworkReply; class QThread; class DownChannelizer; +class ObjectPipe; class DSDDemod : public BasebandSampleSink, public ChannelAPI { public: @@ -144,7 +145,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const DSDDemodSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const DSDDemodSettings& settings, bool force diff --git a/plugins/channelrx/demodfreedv/freedvdemod.cpp b/plugins/channelrx/demodfreedv/freedvdemod.cpp index 6982c0823..7e4ca8b35 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemod.cpp @@ -234,10 +234,11 @@ void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -494,24 +495,27 @@ void FreeDVDemod::webapiReverseSendSettings(QList& channelSettingsKeys, } void FreeDVDemod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const FreeDVDemodSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/demodfreedv/freedvdemod.h b/plugins/channelrx/demodfreedv/freedvdemod.h index 7282e5714..179539945 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.h +++ b/plugins/channelrx/demodfreedv/freedvdemod.h @@ -34,6 +34,7 @@ class QNetworkAccessManager; class QNetworkReply; class DeviceAPI; class QThread; +class ObjectPipe; class FreeDVDemod : public BasebandSampleSink, public ChannelAPI { public: @@ -162,7 +163,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const FreeDVDemodSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const FreeDVDemodSettings& settings, bool force diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index 5ea986a2b..85792dfff 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -261,10 +261,11 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -551,24 +552,27 @@ void NFMDemod::webapiReverseSendSettings(QList& channelSettingsKeys, co } void NFMDemod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const NFMDemodSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index 874eb1497..bb389c0cb 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -34,6 +34,7 @@ class QNetworkAccessManager; class QNetworkReply; class QThread; class DeviceAPI; +class ObjectPipe; class NFMDemod : public BasebandSampleSink, public ChannelAPI { public: @@ -144,7 +145,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const NFMDemodSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const NFMDemodSettings& settings, bool force diff --git a/plugins/channelrx/demodvor/vordemod.cpp b/plugins/channelrx/demodvor/vordemod.cpp index 219e96974..efce63409 100644 --- a/plugins/channelrx/demodvor/vordemod.cpp +++ b/plugins/channelrx/demodvor/vordemod.cpp @@ -214,10 +214,11 @@ void VORDemod::applySettings(const VORDemodSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -449,24 +450,27 @@ void VORDemod::webapiReverseSendSettings(QList& channelSettingsKeys, co } void VORDemod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const VORDemodSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/demodvor/vordemod.h b/plugins/channelrx/demodvor/vordemod.h index 46847a2cd..2f454a825 100644 --- a/plugins/channelrx/demodvor/vordemod.h +++ b/plugins/channelrx/demodvor/vordemod.h @@ -35,6 +35,7 @@ class QNetworkAccessManager; class QNetworkReply; class QThread; class DeviceAPI; +class ObjectPipe; class VORDemod : public BasebandSampleSink, public ChannelAPI { public: @@ -147,7 +148,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const VORDemodSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const VORDemodSettings& settings, bool force diff --git a/plugins/channelrx/demodvorsc/vordemodsc.cpp b/plugins/channelrx/demodvorsc/vordemodsc.cpp index f3cb284d7..a848a6ae4 100644 --- a/plugins/channelrx/demodvorsc/vordemodsc.cpp +++ b/plugins/channelrx/demodvorsc/vordemodsc.cpp @@ -277,10 +277,11 @@ void VORDemodSC::applySettings(const VORDemodSCSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -531,24 +532,27 @@ void VORDemodSC::webapiReverseSendSettings(QList& channelSettingsKeys, } void VORDemodSC::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const VORDemodSCSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/demodvorsc/vordemodsc.h b/plugins/channelrx/demodvorsc/vordemodsc.h index 042c5592c..0b6bd4e72 100644 --- a/plugins/channelrx/demodvorsc/vordemodsc.h +++ b/plugins/channelrx/demodvorsc/vordemodsc.h @@ -149,7 +149,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const VORDemodSCSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const VORDemodSCSettings& settings, bool force diff --git a/plugins/channelrx/demodwfm/wfmdemod.cpp b/plugins/channelrx/demodwfm/wfmdemod.cpp index dbc1286a1..d475d9cec 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.cpp +++ b/plugins/channelrx/demodwfm/wfmdemod.cpp @@ -236,10 +236,11 @@ void WFMDemod::applySettings(const WFMDemodSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -494,24 +495,27 @@ void WFMDemod::webapiReverseSendSettings(QList& channelSettingsKeys, co } void WFMDemod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const WFMDemodSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/demodwfm/wfmdemod.h b/plugins/channelrx/demodwfm/wfmdemod.h index 3e9331c4d..6d38b0c63 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.h +++ b/plugins/channelrx/demodwfm/wfmdemod.h @@ -33,6 +33,7 @@ class QNetworkAccessManager; class QNetworkReply; class DeviceAPI; +class ObjectPipe; class WFMDemod : public BasebandSampleSink, public ChannelAPI { public: @@ -140,7 +141,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const WFMDemodSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const WFMDemodSettings& settings, bool force diff --git a/plugins/channelrx/filesink/filesink.cpp b/plugins/channelrx/filesink/filesink.cpp index 331afed7f..bc34a8d8b 100644 --- a/plugins/channelrx/filesink/filesink.cpp +++ b/plugins/channelrx/filesink/filesink.cpp @@ -314,10 +314,11 @@ void FileSink::applySettings(const FileSinkSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -623,24 +624,27 @@ void FileSink::webapiReverseSendSettings(QList& channelSettingsKeys, co } void FileSink::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const FileSinkSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/filesink/filesink.h b/plugins/channelrx/filesink/filesink.h index 421907bf8..969c6f424 100644 --- a/plugins/channelrx/filesink/filesink.h +++ b/plugins/channelrx/filesink/filesink.h @@ -35,6 +35,7 @@ class QNetworkReply; class DeviceAPI; class DeviceSampleSource; class FileSinkBaseband; +class ObjectPipe; class FileSink : public BasebandSampleSink, public ChannelAPI { public: @@ -171,7 +172,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const FileSinkSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const FileSinkSettings& settings, bool force diff --git a/plugins/channelrx/localsink/localsink.cpp b/plugins/channelrx/localsink/localsink.cpp index da4c919ed..ca298d958 100644 --- a/plugins/channelrx/localsink/localsink.cpp +++ b/plugins/channelrx/localsink/localsink.cpp @@ -305,10 +305,11 @@ void LocalSink::applySettings(const LocalSinkSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -502,24 +503,27 @@ void LocalSink::webapiReverseSendSettings(QList& channelSettingsKeys, c } void LocalSink::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const LocalSinkSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/localsink/localsink.h b/plugins/channelrx/localsink/localsink.h index d14d118a6..e7b64bfa5 100644 --- a/plugins/channelrx/localsink/localsink.h +++ b/plugins/channelrx/localsink/localsink.h @@ -34,6 +34,7 @@ class QThread; class DeviceAPI; class DeviceSampleSource; class LocalSinkBaseband; +class ObjectPipe; class LocalSink : public BasebandSampleSink, public ChannelAPI { public: @@ -156,7 +157,7 @@ private: void webapiReverseSendSettings(QList& channelSettingsKeys, const LocalSinkSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const LocalSinkSettings& settings, bool force diff --git a/plugins/channelrx/remotesink/remotesink.cpp b/plugins/channelrx/remotesink/remotesink.cpp index 073c2cb69..4764dc18a 100644 --- a/plugins/channelrx/remotesink/remotesink.cpp +++ b/plugins/channelrx/remotesink/remotesink.cpp @@ -261,10 +261,11 @@ void RemoteSink::applySettings(const RemoteSinkSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -510,24 +511,27 @@ void RemoteSink::webapiReverseSendSettings(QList& channelSettingsKeys, } void RemoteSink::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const RemoteSinkSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/remotesink/remotesink.h b/plugins/channelrx/remotesink/remotesink.h index c4679155b..8621953da 100644 --- a/plugins/channelrx/remotesink/remotesink.h +++ b/plugins/channelrx/remotesink/remotesink.h @@ -35,6 +35,7 @@ class QNetworkAccessManager; class QNetworkReply; class DeviceAPI; +class ObjectPipe; class RemoteSink : public BasebandSampleSink, public ChannelAPI { public: @@ -135,7 +136,7 @@ private: void updateWithDeviceData(); void webapiReverseSendSettings(QList& channelSettingsKeys, const RemoteSinkSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const RemoteSinkSettings& settings, bool force diff --git a/plugins/channelrx/sigmffilesink/sigmffilesink.cpp b/plugins/channelrx/sigmffilesink/sigmffilesink.cpp index eb5e53716..2ba4e2d63 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesink.cpp +++ b/plugins/channelrx/sigmffilesink/sigmffilesink.cpp @@ -314,10 +314,11 @@ void SigMFFileSink::applySettings(const SigMFFileSinkSettings& settings, bool fo webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -623,24 +624,27 @@ void SigMFFileSink::webapiReverseSendSettings(QList& channelSettingsKey } void SigMFFileSink::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const SigMFFileSinkSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/sigmffilesink/sigmffilesink.h b/plugins/channelrx/sigmffilesink/sigmffilesink.h index 79fb2bd27..ef8a05ed2 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesink.h +++ b/plugins/channelrx/sigmffilesink/sigmffilesink.h @@ -35,6 +35,7 @@ class QNetworkReply; class DeviceAPI; class DeviceSampleSource; class SigMFFileSinkBaseband; +class ObjectPipe; class SigMFFileSink : public BasebandSampleSink, public ChannelAPI { public: @@ -171,7 +172,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const SigMFFileSinkSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const SigMFFileSinkSettings& settings, bool force diff --git a/plugins/channelrx/udpsink/udpsink.cpp b/plugins/channelrx/udpsink/udpsink.cpp index 3863bb8a7..904cf4d58 100644 --- a/plugins/channelrx/udpsink/udpsink.cpp +++ b/plugins/channelrx/udpsink/udpsink.cpp @@ -251,10 +251,11 @@ void UDPSink::applySettings(const UDPSinkSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -543,24 +544,27 @@ void UDPSink::webapiReverseSendSettings(QList& channelSettingsKeys, con } void UDPSink::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const UDPSinkSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channelrx/udpsink/udpsink.h b/plugins/channelrx/udpsink/udpsink.h index c94a1bf3c..9ce6da587 100644 --- a/plugins/channelrx/udpsink/udpsink.h +++ b/plugins/channelrx/udpsink/udpsink.h @@ -32,6 +32,7 @@ class QNetworkAccessManager; class QNetworkReply; class DeviceAPI; +class ObjectPipe; class UDPSink : public BasebandSampleSink, public ChannelAPI { public: @@ -147,7 +148,7 @@ protected: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const UDPSinkSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const UDPSinkSettings& settings, bool force diff --git a/plugins/channeltx/filesource/filesource.cpp b/plugins/channeltx/filesource/filesource.cpp index af031b1b5..c7f117f72 100644 --- a/plugins/channeltx/filesource/filesource.cpp +++ b/plugins/channeltx/filesource/filesource.cpp @@ -264,10 +264,11 @@ void FileSource::applySettings(const FileSourceSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -564,24 +565,27 @@ void FileSource::webapiReverseSendSettings(QList& channelSettingsKeys, } void FileSource::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const FileSourceSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/filesource/filesource.h b/plugins/channeltx/filesource/filesource.h index 302be7661..60087a161 100644 --- a/plugins/channeltx/filesource/filesource.h +++ b/plugins/channeltx/filesource/filesource.h @@ -40,6 +40,7 @@ class QNetworkReply; class DeviceAPI; class FileSourceBaseband; +class ObjectPipe; class FileSource : public BasebandSampleSource, public ChannelAPI { public: @@ -255,7 +256,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const FileSourceSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const FileSourceSettings& settings, bool force diff --git a/plugins/channeltx/localsource/localsource.cpp b/plugins/channeltx/localsource/localsource.cpp index 6cb3881ab..23b5e0efc 100644 --- a/plugins/channeltx/localsource/localsource.cpp +++ b/plugins/channeltx/localsource/localsource.cpp @@ -308,10 +308,11 @@ void LocalSource::applySettings(const LocalSourceSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -504,24 +505,27 @@ void LocalSource::webapiReverseSendSettings(QList& channelSettingsKeys, } void LocalSource::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const LocalSourceSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/localsource/localsource.h b/plugins/channeltx/localsource/localsource.h index 8d1bd4314..4cab3544f 100644 --- a/plugins/channeltx/localsource/localsource.h +++ b/plugins/channeltx/localsource/localsource.h @@ -33,6 +33,7 @@ class QThread; class DeviceAPI; class DeviceSampleSink; class LocalSourceBaseband; +class ObjectPipe; class LocalSource : public BasebandSampleSource, public ChannelAPI { public: @@ -154,7 +155,7 @@ private: void webapiReverseSendSettings(QList& channelSettingsKeys, const LocalSourceSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const LocalSourceSettings& settings, bool force diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp index f60be43e4..0d4483ef0 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp @@ -375,10 +375,11 @@ void IEEE_802_15_4_Mod::applySettings(const IEEE_802_15_4_ModSettings& settings, webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -736,24 +737,27 @@ void IEEE_802_15_4_Mod::webapiReverseSendSettings(QList& channelSetting } void IEEE_802_15_4_Mod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const IEEE_802_15_4_ModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.h b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.h index c78cf54c9..d873878e1 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.h +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.h @@ -40,6 +40,7 @@ class QUdpSocket; class DeviceAPI; class IEEE_802_15_4_ModBaseband; class ScopeVis; +class ObjectPipe; class IEEE_802_15_4_Mod : public BasebandSampleSource, public ChannelAPI { public: @@ -172,7 +173,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const IEEE_802_15_4_ModSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const IEEE_802_15_4_ModSettings& settings, bool force diff --git a/plugins/channeltx/modais/aismod.cpp b/plugins/channeltx/modais/aismod.cpp index d96e42f4e..c8cc5a316 100644 --- a/plugins/channeltx/modais/aismod.cpp +++ b/plugins/channeltx/modais/aismod.cpp @@ -456,10 +456,11 @@ void AISMod::applySettings(const AISModSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -847,24 +848,27 @@ void AISMod::webapiReverseSendSettings(QList& channelSettingsKeys, cons } void AISMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const AISModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/modais/aismod.h b/plugins/channeltx/modais/aismod.h index 511258d9b..91b426469 100644 --- a/plugins/channeltx/modais/aismod.h +++ b/plugins/channeltx/modais/aismod.h @@ -38,6 +38,7 @@ class QUdpSocket; class DeviceAPI; class AISModBaseband; class ScopeVis; +class ObjectPipe; class AISMod : public BasebandSampleSource, public ChannelAPI { public: @@ -234,7 +235,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const AISModSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const AISModSettings& settings, bool force diff --git a/plugins/channeltx/modam/ammod.cpp b/plugins/channeltx/modam/ammod.cpp index f6f2717a3..9c6610941 100644 --- a/plugins/channeltx/modam/ammod.cpp +++ b/plugins/channeltx/modam/ammod.cpp @@ -324,10 +324,11 @@ void AMMod::applySettings(const AMModSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -640,24 +641,27 @@ void AMMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings) } void AMMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const AMModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/modam/ammod.h b/plugins/channeltx/modam/ammod.h index 142e0d4ca..24bfd6966 100644 --- a/plugins/channeltx/modam/ammod.h +++ b/plugins/channeltx/modam/ammod.h @@ -37,6 +37,7 @@ class QThread; class AMModBaseband; class DeviceAPI; class CWKeyer; +class ObjectPipe; class AMMod : public BasebandSampleSource, public ChannelAPI { public: @@ -263,7 +264,7 @@ private: void webapiReverseSendSettings(QList& channelSettingsKeys, const AMModSettings& settings, bool force); void webapiReverseSendCWSettings(const CWKeyerSettings& settings); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const AMModSettings& settings, bool force diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index 6fd487281..ad2397531 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -337,10 +337,11 @@ void ATVMod::applySettings(const ATVModSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -663,24 +664,27 @@ void ATVMod::webapiReverseSendSettings(QList& channelSettingsKeys, cons } void ATVMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const ATVModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h index c59fa161e..ab11e488d 100644 --- a/plugins/channeltx/modatv/atvmod.h +++ b/plugins/channeltx/modatv/atvmod.h @@ -36,6 +36,7 @@ class QNetworkReply; class QThread; class ATVModBaseband; class DeviceAPI; +class ObjectPipe; class ATVMod : public BasebandSampleSource, public ChannelAPI { public: @@ -318,7 +319,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const ATVModSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const ATVModSettings& settings, bool force diff --git a/plugins/channeltx/modchirpchat/chirpchatmod.cpp b/plugins/channeltx/modchirpchat/chirpchatmod.cpp index 24c33004f..b605969c8 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmod.cpp +++ b/plugins/channeltx/modchirpchat/chirpchatmod.cpp @@ -395,10 +395,11 @@ void ChirpChatMod::applySettings(const ChirpChatModSettings& settings, bool forc webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -813,24 +814,27 @@ void ChirpChatMod::webapiReverseSendSettings(QList& channelSettingsKeys } void ChirpChatMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const ChirpChatModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/modchirpchat/chirpchatmod.h b/plugins/channeltx/modchirpchat/chirpchatmod.h index e1100f6f3..a1cc7eca6 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmod.h +++ b/plugins/channeltx/modchirpchat/chirpchatmod.h @@ -39,6 +39,7 @@ class QUdpSocket; class DeviceAPI; class CWKeyer; class ChirpChatModBaseband; +class ObjectPipe; class ChirpChatMod : public BasebandSampleSource, public ChannelAPI { public: @@ -167,7 +168,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const ChirpChatModSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const ChirpChatModSettings& settings, bool force diff --git a/plugins/channeltx/moddatv/datvmod.cpp b/plugins/channeltx/moddatv/datvmod.cpp index c51a8d3ac..8b8cbdae5 100644 --- a/plugins/channeltx/moddatv/datvmod.cpp +++ b/plugins/channeltx/moddatv/datvmod.cpp @@ -303,10 +303,11 @@ void DATVMod::applySettings(const DATVModSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -589,24 +590,27 @@ void DATVMod::webapiReverseSendSettings(QList& channelSettingsKeys, con } void DATVMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const DATVModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/moddatv/datvmod.h b/plugins/channeltx/moddatv/datvmod.h index 9105d93d7..82a294412 100644 --- a/plugins/channeltx/moddatv/datvmod.h +++ b/plugins/channeltx/moddatv/datvmod.h @@ -37,6 +37,7 @@ class QNetworkReply; class QThread; class DATVModBaseband; class DeviceAPI; +class ObjectPipe; class DATVMod : public BasebandSampleSource, public ChannelAPI { public: @@ -272,7 +273,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const DATVModSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const DATVModSettings& settings, bool force diff --git a/plugins/channeltx/modfreedv/freedvmod.cpp b/plugins/channeltx/modfreedv/freedvmod.cpp index 2e692d12e..72ab1ad28 100644 --- a/plugins/channeltx/modfreedv/freedvmod.cpp +++ b/plugins/channeltx/modfreedv/freedvmod.cpp @@ -317,10 +317,11 @@ void FreeDVMod::applySettings(const FreeDVModSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -635,24 +636,27 @@ void FreeDVMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettin } void FreeDVMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const FreeDVModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/modfreedv/freedvmod.h b/plugins/channeltx/modfreedv/freedvmod.h index 417f290f4..58b10611f 100644 --- a/plugins/channeltx/modfreedv/freedvmod.h +++ b/plugins/channeltx/modfreedv/freedvmod.h @@ -39,6 +39,7 @@ class QThread; class DeviceAPI; class CWKeyer; class FreeDVModBaseband; +class ObjectPipe; struct freedv; @@ -270,7 +271,7 @@ private: void webapiReverseSendSettings(QList& channelSettingsKeys, const FreeDVModSettings& settings, bool force); void webapiReverseSendCWSettings(const CWKeyerSettings& settings); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const FreeDVModSettings& settings, bool force diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index 2036f1ca2..a983dcab6 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -372,10 +372,11 @@ void NFMMod::applySettings(const NFMModSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -708,24 +709,27 @@ void NFMMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings) } void NFMMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const NFMModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/modnfm/nfmmod.h b/plugins/channeltx/modnfm/nfmmod.h index 02e391b2a..bf5999b6f 100644 --- a/plugins/channeltx/modnfm/nfmmod.h +++ b/plugins/channeltx/modnfm/nfmmod.h @@ -37,6 +37,7 @@ class QThread; class DeviceAPI; class CWKeyer; class NFMModBaseband; +class ObjectPipe; class NFMMod : public BasebandSampleSource, public ChannelAPI { public: @@ -263,7 +264,7 @@ private: void webapiReverseSendSettings(QList& channelSettingsKeys, const NFMModSettings& settings, bool force); void webapiReverseSendCWSettings(const CWKeyerSettings& settings); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const NFMModSettings& settings, bool force diff --git a/plugins/channeltx/modpacket/packetmod.cpp b/plugins/channeltx/modpacket/packetmod.cpp index 0122f18b7..9dc095c79 100644 --- a/plugins/channeltx/modpacket/packetmod.cpp +++ b/plugins/channeltx/modpacket/packetmod.cpp @@ -406,10 +406,11 @@ void PacketMod::applySettings(const PacketModSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -877,24 +878,27 @@ void PacketMod::webapiReverseSendSettings(QList& channelSettingsKeys, c } void PacketMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const PacketModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/modpacket/packetmod.h b/plugins/channeltx/modpacket/packetmod.h index 399f61de0..a4a667641 100644 --- a/plugins/channeltx/modpacket/packetmod.h +++ b/plugins/channeltx/modpacket/packetmod.h @@ -39,6 +39,7 @@ class QThread; class QUdpSocket; class DeviceAPI; class PacketModBaseband; +class ObjectPipe; class PacketMod : public BasebandSampleSource, public ChannelAPI { public: @@ -230,7 +231,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const PacketModSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const PacketModSettings& settings, bool force diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index 0f6efb080..4f078e20b 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -345,10 +345,11 @@ void SSBMod::applySettings(const SSBModSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -713,24 +714,27 @@ void SSBMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings) } void SSBMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const SSBModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/modssb/ssbmod.h b/plugins/channeltx/modssb/ssbmod.h index 62d7cae51..87dc19793 100644 --- a/plugins/channeltx/modssb/ssbmod.h +++ b/plugins/channeltx/modssb/ssbmod.h @@ -39,6 +39,7 @@ class QThread; class DeviceAPI; class CWKeyer; class SSBModBaseband; +class ObjectPipe; class SSBMod : public BasebandSampleSource, public ChannelAPI { public: @@ -267,7 +268,7 @@ private: void webapiReverseSendSettings(QList& channelSettingsKeys, const SSBModSettings& settings, bool force); void webapiReverseSendCWSettings(const CWKeyerSettings& settings); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const SSBModSettings& settings, bool force diff --git a/plugins/channeltx/modwfm/wfmmod.cpp b/plugins/channeltx/modwfm/wfmmod.cpp index 93d5b630f..41d330034 100644 --- a/plugins/channeltx/modwfm/wfmmod.cpp +++ b/plugins/channeltx/modwfm/wfmmod.cpp @@ -310,10 +310,11 @@ void WFMMod::applySettings(const WFMModSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -627,24 +628,27 @@ void WFMMod::webapiReverseSendCWSettings(const CWKeyerSettings& cwKeyerSettings) } void WFMMod::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const WFMModSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/modwfm/wfmmod.h b/plugins/channeltx/modwfm/wfmmod.h index d0df647c8..8677a331a 100644 --- a/plugins/channeltx/modwfm/wfmmod.h +++ b/plugins/channeltx/modwfm/wfmmod.h @@ -37,6 +37,7 @@ class QThread; class DeviceAPI; class CWKeyer; class WFMModBaseband; +class ObjectPipe; class WFMMod : public BasebandSampleSource, public ChannelAPI { public: @@ -275,7 +276,7 @@ private: void webapiReverseSendSettings(QList& channelSettingsKeys, const WFMModSettings& settings, bool force); void webapiReverseSendCWSettings(const CWKeyerSettings& settings); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const WFMModSettings& settings, bool force diff --git a/plugins/channeltx/remotesource/remotesource.cpp b/plugins/channeltx/remotesource/remotesource.cpp index f48a9ad38..b29974291 100644 --- a/plugins/channeltx/remotesource/remotesource.cpp +++ b/plugins/channeltx/remotesource/remotesource.cpp @@ -243,10 +243,11 @@ void RemoteSource::applySettings(const RemoteSourceSettings& settings, bool forc webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -480,24 +481,27 @@ void RemoteSource::webapiReverseSendSettings(QList& channelSettingsKeys } void RemoteSource::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const RemoteSourceSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/remotesource/remotesource.h b/plugins/channeltx/remotesource/remotesource.h index ef883ab5c..0ba285133 100644 --- a/plugins/channeltx/remotesource/remotesource.h +++ b/plugins/channeltx/remotesource/remotesource.h @@ -33,6 +33,7 @@ class QThread; class DeviceAPI; class RemoteSourceBaseband; +class ObjectPipe; class RemoteSource : public BasebandSampleSource, public ChannelAPI { public: @@ -250,7 +251,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const RemoteSourceSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const RemoteSourceSettings& settings, bool force diff --git a/plugins/channeltx/udpsource/udpsource.cpp b/plugins/channeltx/udpsource/udpsource.cpp index 574dccc12..0506d9ae7 100644 --- a/plugins/channeltx/udpsource/udpsource.cpp +++ b/plugins/channeltx/udpsource/udpsource.cpp @@ -271,10 +271,11 @@ void UDPSource::applySettings(const UDPSourceSettings& settings, bool force) webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); } - QList *messageQueues = MainCore::instance()->getMessagePipes().getMessageQueues(this, "settings"); + QList pipes; + MainCore::instance()->getMessagePipes2().getMessagePipes(this, "settings", pipes); - if (messageQueues) { - sendChannelSettings(messageQueues, reverseAPIKeys, settings, force); + if (pipes.size() > 0) { + sendChannelSettings(pipes, reverseAPIKeys, settings, force); } m_settings = settings; @@ -584,24 +585,27 @@ void UDPSource::webapiReverseSendSettings(QList& channelSettingsKeys, c } void UDPSource::sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const UDPSourceSettings& settings, bool force) { - QList::iterator it = messageQueues->begin(); - - for (; it != messageQueues->end(); ++it) + for (const auto& pipe : pipes) { - SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); - webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); - MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( - this, - channelSettingsKeys, - swgChannelSettings, - force - ); - (*it)->push(msg); + MessageQueue *messageQueue = qobject_cast(pipe->m_element); + + if (messageQueue) + { + SWGSDRangel::SWGChannelSettings *swgChannelSettings = new SWGSDRangel::SWGChannelSettings(); + webapiFormatChannelSettings(channelSettingsKeys, swgChannelSettings, settings, force); + MainCore::MsgChannelSettings *msg = MainCore::MsgChannelSettings::create( + this, + channelSettingsKeys, + swgChannelSettings, + force + ); + messageQueue->push(msg); + } } } diff --git a/plugins/channeltx/udpsource/udpsource.h b/plugins/channeltx/udpsource/udpsource.h index ab5ba231b..c236f64a2 100644 --- a/plugins/channeltx/udpsource/udpsource.h +++ b/plugins/channeltx/udpsource/udpsource.h @@ -34,6 +34,7 @@ class QNetworkReply; class QThread; class DeviceAPI; class UDPSourceBaseband; +class ObjectPipe; class UDPSource : public BasebandSampleSource, public ChannelAPI { public: @@ -177,7 +178,7 @@ private: void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response); void webapiReverseSendSettings(QList& channelSettingsKeys, const UDPSourceSettings& settings, bool force); void sendChannelSettings( - QList *messageQueues, + const QList& pipes, QList& channelSettingsKeys, const UDPSourceSettings& settings, bool force