From 60d4b2f126f1f36b5323e43d044b50168e1605e6 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 18 Mar 2022 17:08:04 +0100 Subject: [PATCH] Set label in AudioFifo to identify the controlling component in error messages. Use a signal to retrieve the channel index in device set appropriately --- plugins/channelrx/chanalyzer/chanalyzer.cpp | 24 ++++++++++++++---- plugins/channelrx/chanalyzer/chanalyzer.h | 1 + plugins/channelrx/chanalyzer/chanalyzersink.h | 1 - plugins/channelrx/demodadsb/adsbdemod.cpp | 24 ++++++++++++++---- plugins/channelrx/demodadsb/adsbdemod.h | 1 + plugins/channelrx/demodais/aisdemod.cpp | 24 ++++++++++++++---- plugins/channelrx/demodais/aisdemod.h | 1 + plugins/channelrx/demodam/amdemod.cpp | 25 +++++++++++++++---- plugins/channelrx/demodam/amdemod.h | 1 + plugins/channelrx/demodam/amdemodbaseband.h | 1 + plugins/channelrx/demodam/amdemodsink.h | 1 + plugins/channelrx/demodapt/aptdemod.cpp | 24 ++++++++++++++---- plugins/channelrx/demodapt/aptdemod.h | 2 +- plugins/channelrx/demodatv/atvdemod.cpp | 20 +++++++++++++++ plugins/channelrx/demodatv/atvdemod.h | 3 +++ plugins/channelrx/demodatv/atvdemodsink.h | 1 - plugins/channelrx/demodbfm/bfmdemod.cpp | 25 +++++++++++++++---- plugins/channelrx/demodbfm/bfmdemod.h | 1 + plugins/channelrx/demodbfm/bfmdemodbaseband.h | 1 + plugins/channelrx/demodbfm/bfmdemodsink.h | 1 + .../demodchirpchat/chirpchatdemod.cpp | 25 +++++++++++++++---- .../channelrx/demodchirpchat/chirpchatdemod.h | 1 + plugins/channelrx/demoddab/dabdemod.cpp | 25 +++++++++++++++---- plugins/channelrx/demoddab/dabdemod.h | 1 + plugins/channelrx/demoddab/dabdemodbaseband.h | 1 + plugins/channelrx/demoddab/dabdemodsink.h | 1 + plugins/channelrx/demoddatv/datvdemod.cpp | 25 +++++++++++++++---- plugins/channelrx/demoddatv/datvdemod.h | 1 + .../channelrx/demoddatv/datvdemodbaseband.h | 1 + plugins/channelrx/demoddatv/datvdemodsink.h | 1 + plugins/channelrx/demoddsd/dsddemod.cpp | 25 +++++++++++++++---- plugins/channelrx/demoddsd/dsddemod.h | 1 + plugins/channelrx/demoddsd/dsddemodbaseband.h | 1 + plugins/channelrx/demoddsd/dsddemodsink.h | 4 +++ plugins/channelrx/demodfreedv/freedvdemod.cpp | 25 +++++++++++++++---- plugins/channelrx/demodfreedv/freedvdemod.h | 1 + .../demodfreedv/freedvdemodbaseband.h | 1 + .../channelrx/demodfreedv/freedvdemodsink.h | 1 + plugins/channelrx/demodnfm/nfmdemod.cpp | 20 +++++++++++++++ plugins/channelrx/demodnfm/nfmdemod.h | 1 + plugins/channelrx/demodnfm/nfmdemodbaseband.h | 1 + plugins/channelrx/demodnfm/nfmdemodsink.h | 1 + plugins/channelrx/demodpacket/packetdemod.cpp | 24 ++++++++++++++---- plugins/channelrx/demodpacket/packetdemod.h | 1 + plugins/channelrx/demodpager/pagerdemod.cpp | 24 ++++++++++++++---- plugins/channelrx/demodpager/pagerdemod.h | 1 + .../demodradiosonde/radiosondedemod.cpp | 24 ++++++++++++++---- .../demodradiosonde/radiosondedemod.h | 1 + plugins/channelrx/demodssb/ssbdemod.cpp | 25 +++++++++++++++---- plugins/channelrx/demodssb/ssbdemod.h | 1 + plugins/channelrx/demodssb/ssbdemodbaseband.h | 1 + plugins/channelrx/demodssb/ssbdemodsink.h | 1 + plugins/channelrx/demodvor/vordemod.cpp | 24 ++++++++++++++---- plugins/channelrx/demodvor/vordemod.h | 2 +- plugins/channelrx/demodvorsc/vordemodsc.cpp | 25 +++++++++++++++---- plugins/channelrx/demodvorsc/vordemodsc.h | 2 +- .../channelrx/demodvorsc/vordemodscbaseband.h | 1 + plugins/channelrx/demodvorsc/vordemodscsink.h | 1 + plugins/channelrx/demodwfm/wfmdemod.cpp | 25 +++++++++++++++---- plugins/channelrx/demodwfm/wfmdemod.h | 1 + plugins/channelrx/demodwfm/wfmdemodbaseband.h | 1 + plugins/channelrx/demodwfm/wfmdemodsink.h | 1 + plugins/channelrx/filesink/filesink.cpp | 24 ++++++++++++++---- plugins/channelrx/filesink/filesink.h | 1 + plugins/channelrx/freqtracker/freqtracker.cpp | 24 ++++++++++++++---- plugins/channelrx/freqtracker/freqtracker.h | 1 + plugins/channelrx/localsink/localsink.cpp | 24 ++++++++++++++---- plugins/channelrx/localsink/localsink.h | 1 + plugins/channelrx/noisefigure/noisefigure.cpp | 24 ++++++++++++++---- plugins/channelrx/noisefigure/noisefigure.h | 2 +- .../radioastronomy/radioastronomy.cpp | 24 ++++++++++++++---- .../channelrx/radioastronomy/radioastronomy.h | 2 +- plugins/channelrx/radioclock/radioclock.cpp | 24 ++++++++++++++---- plugins/channelrx/radioclock/radioclock.h | 2 +- plugins/channelrx/remotesink/remotesink.cpp | 24 ++++++++++++++---- plugins/channelrx/remotesink/remotesink.h | 1 + .../channelrx/sigmffilesink/sigmffilesink.cpp | 24 ++++++++++++++---- .../channelrx/sigmffilesink/sigmffilesink.h | 1 + plugins/channelrx/udpsink/udpsink.cpp | 25 +++++++++++++++---- plugins/channelrx/udpsink/udpsink.h | 1 + plugins/channelrx/udpsink/udpsinkbaseband.h | 1 + plugins/channelrx/udpsink/udpsinksink.h | 1 + sdrbase/audio/audiofifo.cpp | 13 ++++++++-- sdrbase/audio/audiofifo.h | 3 +++ sdrbase/channel/channelapi.h | 11 +++++++- 85 files changed, 644 insertions(+), 146 deletions(-) diff --git a/plugins/channelrx/chanalyzer/chanalyzer.cpp b/plugins/channelrx/chanalyzer/chanalyzer.cpp index 4fcfe330e..a54c56203 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzer.cpp @@ -48,11 +48,6 @@ ChannelAnalyzer::ChannelAnalyzer(DeviceAPI *deviceAPI) : setObjectName(m_channelId); getChannelSampleRate(); m_basebandSink = new ChannelAnalyzerBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->moveToThread(&m_thread); applySettings(m_settings, true); @@ -62,6 +57,12 @@ ChannelAnalyzer::ChannelAnalyzer(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &ChannelAnalyzer::handleIndexInDeviceSetChanged + ); } ChannelAnalyzer::~ChannelAnalyzer() @@ -720,3 +721,16 @@ void ChannelAnalyzer::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void ChannelAnalyzer::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/chanalyzer/chanalyzer.h b/plugins/channelrx/chanalyzer/chanalyzer.h index 0cbe884d0..0dda3c8fe 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.h +++ b/plugins/channelrx/chanalyzer/chanalyzer.h @@ -154,6 +154,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_CHANALYZER_H diff --git a/plugins/channelrx/chanalyzer/chanalyzersink.h b/plugins/channelrx/chanalyzer/chanalyzersink.h index 081fffafe..a70f40d71 100644 --- a/plugins/channelrx/chanalyzer/chanalyzersink.h +++ b/plugins/channelrx/chanalyzer/chanalyzersink.h @@ -27,7 +27,6 @@ #include "dsp/phaselockcomplex.h" #include "dsp/freqlockcomplex.h" #include "dsp/costasloop.h" -#include "audio/audiofifo.h" #include "util/movingaverage.h" diff --git a/plugins/channelrx/demodadsb/adsbdemod.cpp b/plugins/channelrx/demodadsb/adsbdemod.cpp index d6cb74106..7ff105653 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.cpp +++ b/plugins/channelrx/demodadsb/adsbdemod.cpp @@ -65,11 +65,6 @@ ADSBDemod::ADSBDemod(DeviceAPI *devieAPI) : m_thread = new QThread(this); m_basebandSink = new ADSBDemodBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->moveToThread(m_thread); m_worker = new ADSBDemodWorker(); @@ -82,6 +77,12 @@ ADSBDemod::ADSBDemod(DeviceAPI *devieAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &ADSBDemod::handleIndexInDeviceSetChanged + ); } ADSBDemod::~ADSBDemod() @@ -778,3 +779,16 @@ void ADSBDemod::setTarget(const QString& name, float targetAzimuth, float target } } } + +void ADSBDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodadsb/adsbdemod.h b/plugins/channelrx/demodadsb/adsbdemod.h index 7812112fd..82801585c 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.h +++ b/plugins/channelrx/demodadsb/adsbdemod.h @@ -152,6 +152,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_ADSBDEMOD_H diff --git a/plugins/channelrx/demodais/aisdemod.cpp b/plugins/channelrx/demodais/aisdemod.cpp index 05bcf09fd..527587d08 100644 --- a/plugins/channelrx/demodais/aisdemod.cpp +++ b/plugins/channelrx/demodais/aisdemod.cpp @@ -53,11 +53,6 @@ AISDemod::AISDemod(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new AISDemodBaseband(this); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setMessageQueueToChannel(getInputMessageQueue()); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(&m_thread); @@ -70,6 +65,12 @@ AISDemod::AISDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &AISDemod::handleIndexInDeviceSetChanged + ); } AISDemod::~AISDemod() @@ -701,3 +702,16 @@ void AISDemod::handleChannelMessages() } } } + +void AISDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodais/aisdemod.h b/plugins/channelrx/demodais/aisdemod.h index d5104886a..00e455b16 100644 --- a/plugins/channelrx/demodais/aisdemod.h +++ b/plugins/channelrx/demodais/aisdemod.h @@ -183,6 +183,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void handleChannelMessages(); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_AISDEMOD_H diff --git a/plugins/channelrx/demodam/amdemod.cpp b/plugins/channelrx/demodam/amdemod.cpp index 3f0cdb59f..8e7074d1b 100644 --- a/plugins/channelrx/demodam/amdemod.cpp +++ b/plugins/channelrx/demodam/amdemod.cpp @@ -56,11 +56,6 @@ AMDemod::AMDemod(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new AMDemodBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(&m_thread); @@ -79,6 +74,12 @@ AMDemod::AMDemod(DeviceAPI *deviceAPI) : // this, // &AMDemod::handleWrittenToFifo // ); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &AMDemod::handleIndexInDeviceSetChanged + ); } AMDemod::~AMDemod() @@ -678,3 +679,17 @@ void AMDemod::handleWrittenToFifo(int nsamples, qint64 timestamp) ); m_lastTs = timestamp; } + +void AMDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodam/amdemod.h b/plugins/channelrx/demodam/amdemod.h index b17bab7d6..0a7d66064 100644 --- a/plugins/channelrx/demodam/amdemod.h +++ b/plugins/channelrx/demodam/amdemod.h @@ -164,6 +164,7 @@ private slots: void networkManagerFinished(QNetworkReply *reply); void handleChannelMessages(); void handleWrittenToFifo(int nsamples, qint64 timestamp); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_AMDEMOD_H diff --git a/plugins/channelrx/demodam/amdemodbaseband.h b/plugins/channelrx/demodam/amdemodbaseband.h index 7bfb58650..cc12af36a 100644 --- a/plugins/channelrx/demodam/amdemodbaseband.h +++ b/plugins/channelrx/demodam/amdemodbaseband.h @@ -75,6 +75,7 @@ public: void setChannel(ChannelAPI *channel); bool isRunning() const { return m_running; } void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/demodam/amdemodsink.h b/plugins/channelrx/demodam/amdemodsink.h index a2847328c..b9f61eb15 100644 --- a/plugins/channelrx/demodam/amdemodsink.h +++ b/plugins/channelrx/demodam/amdemodsink.h @@ -52,6 +52,7 @@ public: bool getPllLocked() const { return m_settings.m_pll && m_pll.locked(); } Real getPllFrequency() const { return m_pll.getFreq(); } AudioFifo *getAudioFifo() { return &m_audioFifo; } + void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); } void setChannel(ChannelAPI *channel) { m_channel = channel; } void getMagSqLevels(double& avg, double& peak, int& nbSamples) diff --git a/plugins/channelrx/demodapt/aptdemod.cpp b/plugins/channelrx/demodapt/aptdemod.cpp index d90a3ec70..96c9752d9 100644 --- a/plugins/channelrx/demodapt/aptdemod.cpp +++ b/plugins/channelrx/demodapt/aptdemod.cpp @@ -61,11 +61,6 @@ APTDemod::APTDemod(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new APTDemodBaseband(this); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->moveToThread(&m_thread); m_imageWorker = new APTDemodImageWorker(this); @@ -79,6 +74,12 @@ APTDemod::APTDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &APTDemod::handleIndexInDeviceSetChanged + ); startImageWorker(); } @@ -876,3 +877,16 @@ void APTDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void APTDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodapt/aptdemod.h b/plugins/channelrx/demodapt/aptdemod.h index 31c6bc7e2..1f9a812fd 100644 --- a/plugins/channelrx/demodapt/aptdemod.h +++ b/plugins/channelrx/demodapt/aptdemod.h @@ -287,7 +287,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_APTDEMOD_H diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index a73d866e2..58eddf8b7 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -53,6 +53,13 @@ ATVDemod::ATVDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSink(this); m_deviceAPI->addChannelSinkAPI(this); + + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &ATVDemod::handleIndexInDeviceSetChanged + ); } ATVDemod::~ATVDemod() @@ -177,3 +184,16 @@ void ATVDemod::applySettings(const ATVDemodSettings& settings, bool force) m_settings = settings; } + +void ATVDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodatv/atvdemod.h b/plugins/channelrx/demodatv/atvdemod.h index da95bbe8b..a700746f8 100644 --- a/plugins/channelrx/demodatv/atvdemod.h +++ b/plugins/channelrx/demodatv/atvdemod.h @@ -108,6 +108,9 @@ private: virtual bool handleMessage(const Message& cmd); void applySettings(const ATVDemodSettings& settings, bool force = false); + +private slots: + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_ATVDEMOD_H diff --git a/plugins/channelrx/demodatv/atvdemodsink.h b/plugins/channelrx/demodatv/atvdemodsink.h index 9d5bc9ff7..71f1eb8b0 100644 --- a/plugins/channelrx/demodatv/atvdemodsink.h +++ b/plugins/channelrx/demodatv/atvdemodsink.h @@ -30,7 +30,6 @@ #include "dsp/phaselock.h" #include "dsp/recursivefilters.h" #include "dsp/phasediscri.h" -#include "audio/audiofifo.h" #include "util/movingaverage.h" #include "gui/tvscreenanalog.h" diff --git a/plugins/channelrx/demodbfm/bfmdemod.cpp b/plugins/channelrx/demodbfm/bfmdemod.cpp index 760bc4474..7252b970d 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.cpp +++ b/plugins/channelrx/demodbfm/bfmdemod.cpp @@ -57,11 +57,6 @@ BFMDemod::BFMDemod(DeviceAPI *deviceAPI) : m_thread = new QThread(this); m_basebandSink = new BFMDemodBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setSpectrumSink(&m_spectrumVis); m_basebandSink->moveToThread(m_thread); @@ -72,6 +67,12 @@ BFMDemod::BFMDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &BFMDemod::handleIndexInDeviceSetChanged + ); } BFMDemod::~BFMDemod() @@ -667,3 +668,17 @@ void BFMDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void BFMDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodbfm/bfmdemod.h b/plugins/channelrx/demodbfm/bfmdemod.h index 8838afb39..dd658f93e 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.h +++ b/plugins/channelrx/demodbfm/bfmdemod.h @@ -176,6 +176,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_BFMDEMOD_H diff --git a/plugins/channelrx/demodbfm/bfmdemodbaseband.h b/plugins/channelrx/demodbfm/bfmdemodbaseband.h index c2d706425..4ac0b437e 100644 --- a/plugins/channelrx/demodbfm/bfmdemodbaseband.h +++ b/plugins/channelrx/demodbfm/bfmdemodbaseband.h @@ -80,6 +80,7 @@ public: void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_sink.getMagSqLevels(avg, peak, nbSamples); } RDSParser& getRDSParser() { return m_sink.getRDSParser(); } void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/demodbfm/bfmdemodsink.h b/plugins/channelrx/demodbfm/bfmdemodsink.h index 7028955e1..bb0194e18 100644 --- a/plugins/channelrx/demodbfm/bfmdemodsink.h +++ b/plugins/channelrx/demodbfm/bfmdemodsink.h @@ -83,6 +83,7 @@ public: void applySettings(const BFMDemodSettings& settings, bool force = false); AudioFifo *getAudioFifo() { return &m_audioFifo; } + void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); } void applyAudioSampleRate(int sampleRate); int getAudioSampleRate() const { return m_audioSampleRate; } diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp index 594c3a98e..868aeef07 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp +++ b/plugins/channelrx/demodchirpchat/chirpchatdemod.cpp @@ -72,11 +72,6 @@ ChirpChatDemod::ChirpChatDemod(DeviceAPI* deviceAPI) : m_thread = new QThread(this); m_basebandSink = new ChirpChatDemodBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setSpectrumSink(&m_spectrumVis); m_basebandSink->setDecoderMessageQueue(getInputMessageQueue()); // Decoder held on the main thread m_basebandSink->moveToThread(m_thread); @@ -85,6 +80,13 @@ ChirpChatDemod::ChirpChatDemod(DeviceAPI* deviceAPI) : m_deviceAPI->addChannelSink(this); m_deviceAPI->addChannelSinkAPI(this); + + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &ChirpChatDemod::handleIndexInDeviceSetChanged + ); } ChirpChatDemod::~ChirpChatDemod() @@ -930,3 +932,16 @@ double ChirpChatDemod::getTotalPower() const { return m_basebandSink->getTotalPower(); } + +void ChirpChatDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemod.h b/plugins/channelrx/demodchirpchat/chirpchatdemod.h index d9113f8b3..766223213 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemod.h +++ b/plugins/channelrx/demodchirpchat/chirpchatdemod.h @@ -309,6 +309,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_CHIRPCHATDEMOD_H diff --git a/plugins/channelrx/demoddab/dabdemod.cpp b/plugins/channelrx/demoddab/dabdemod.cpp index 872764380..844dae274 100644 --- a/plugins/channelrx/demoddab/dabdemod.cpp +++ b/plugins/channelrx/demoddab/dabdemod.cpp @@ -64,11 +64,6 @@ DABDemod::DABDemod(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new DABDemodBaseband(this); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setMessageQueueToChannel(getInputMessageQueue()); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(&m_thread); @@ -81,6 +76,12 @@ DABDemod::DABDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &DABDemod::handleIndexInDeviceSetChanged + ); } DABDemod::~DABDemod() @@ -656,3 +657,17 @@ void DABDemod::handleChannelMessages() } } } + +void DABDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demoddab/dabdemod.h b/plugins/channelrx/demoddab/dabdemod.h index 31b12e38e..71c4f8348 100644 --- a/plugins/channelrx/demoddab/dabdemod.h +++ b/plugins/channelrx/demoddab/dabdemod.h @@ -400,6 +400,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void handleChannelMessages(); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_DABDEMOD_H diff --git a/plugins/channelrx/demoddab/dabdemodbaseband.h b/plugins/channelrx/demoddab/dabdemodbaseband.h index ccc3684e7..99607ed9e 100644 --- a/plugins/channelrx/demoddab/dabdemodbaseband.h +++ b/plugins/channelrx/demoddab/dabdemodbaseband.h @@ -76,6 +76,7 @@ public: bool isRunning() const { return m_running; } int getAudioSampleRate() const { return m_sink.getAudioSampleRate(); } void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/demoddab/dabdemodsink.h b/plugins/channelrx/demoddab/dabdemodsink.h index 11332192c..6ab1b780d 100644 --- a/plugins/channelrx/demoddab/dabdemodsink.h +++ b/plugins/channelrx/demoddab/dabdemodsink.h @@ -53,6 +53,7 @@ public: void applyDABAudioSampleRate(int sampleRate); int getAudioSampleRate() const { return m_audioSampleRate; } AudioFifo *getAudioFifo() { return &m_audioFifo; } + void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); } void setMessageQueueToChannel(MessageQueue *messageQueue) { m_messageQueueToChannel = messageQueue; } void setChannel(ChannelAPI *channel) { m_channel = channel; } diff --git a/plugins/channelrx/demoddatv/datvdemod.cpp b/plugins/channelrx/demoddatv/datvdemod.cpp index 7d2c1765a..d010a513b 100644 --- a/plugins/channelrx/demoddatv/datvdemod.cpp +++ b/plugins/channelrx/demoddatv/datvdemod.cpp @@ -46,11 +46,6 @@ DATVDemod::DATVDemod(DeviceAPI *deviceAPI) : qDebug("DATVDemod::DATVDemod"); setObjectName(m_channelId); m_basebandSink = new DATVDemodBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->moveToThread(&m_thread); applySettings(m_settings, true); @@ -60,6 +55,12 @@ DATVDemod::DATVDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &DATVDemod::handleIndexInDeviceSetChanged + ); } DATVDemod::~DATVDemod() @@ -732,3 +733,17 @@ void DATVDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void DATVDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demoddatv/datvdemod.h b/plugins/channelrx/demoddatv/datvdemod.h index 87ed3c64c..acf136b38 100644 --- a/plugins/channelrx/demoddatv/datvdemod.h +++ b/plugins/channelrx/demoddatv/datvdemod.h @@ -180,6 +180,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_DATVDEMOD_H diff --git a/plugins/channelrx/demoddatv/datvdemodbaseband.h b/plugins/channelrx/demoddatv/datvdemodbaseband.h index a3eb77627..b06b3345f 100644 --- a/plugins/channelrx/demoddatv/datvdemodbaseband.h +++ b/plugins/channelrx/demoddatv/datvdemodbaseband.h @@ -91,6 +91,7 @@ public: bool isCstlnSetByModcod() const { return m_sink.isCstlnSetByModcod(); } bool isRunning() const { return m_running; } void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/demoddatv/datvdemodsink.h b/plugins/channelrx/demoddatv/datvdemodsink.h index d4dcd75b9..79fd59e5f 100644 --- a/plugins/channelrx/demoddatv/datvdemodsink.h +++ b/plugins/channelrx/demoddatv/datvdemodsink.h @@ -79,6 +79,7 @@ public: bool isCstlnSetByModcod() const { return m_cstlnSetByModcod; } void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; } AudioFifo *getAudioFifo() { return &m_audioFifo; } + void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); } float getMERAvg() const { return r_merMeter ? r_merMeter->m_avg : 0; diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index f8d3d68f1..ab6057cf1 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -60,11 +60,6 @@ DSDDemod::DSDDemod(DeviceAPI *deviceAPI) : m_thread = new QThread(this); m_basebandSink = new DSDDemodBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(m_thread); @@ -76,6 +71,12 @@ DSDDemod::DSDDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &DSDDemod::handleIndexInDeviceSetChanged + ); } DSDDemod::~DSDDemod() @@ -756,3 +757,17 @@ void DSDDemod::handleChannelMessages() } } } + +void DSDDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index 648b8b437..ca8414637 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -160,6 +160,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void handleChannelMessages(); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_DSDDEMOD_H diff --git a/plugins/channelrx/demoddsd/dsddemodbaseband.h b/plugins/channelrx/demoddsd/dsddemodbaseband.h index 3b2e5875b..13f54448c 100644 --- a/plugins/channelrx/demoddsd/dsddemodbaseband.h +++ b/plugins/channelrx/demoddsd/dsddemodbaseband.h @@ -74,6 +74,7 @@ public: const char *updateAndGetStatusText() { return m_sink.updateAndGetStatusText(); } void setChannel(ChannelAPI *channel); void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/demoddsd/dsddemodsink.h b/plugins/channelrx/demoddsd/dsddemodsink.h index 7ce2cb8a1..3279d553d 100644 --- a/plugins/channelrx/demoddsd/dsddemodsink.h +++ b/plugins/channelrx/demoddsd/dsddemodsink.h @@ -49,6 +49,10 @@ public: void applySettings(const DSDDemodSettings& settings, bool force = false); AudioFifo *getAudioFifo1() { return &m_audioFifo1; } AudioFifo *getAudioFifo2() { return &m_audioFifo2; } + void setAudioFifoLabel(const QString& label) { + m_audioFifo1.setLabel("1:" + label); + m_audioFifo2.setLabel("2:" + label); + } int getAudioSampleRate() const { return m_audioSampleRate; } void setChannel(ChannelAPI *channel) { m_channel = channel; } diff --git a/plugins/channelrx/demodfreedv/freedvdemod.cpp b/plugins/channelrx/demodfreedv/freedvdemod.cpp index 244580500..e6dac1894 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemod.cpp @@ -51,11 +51,6 @@ FreeDVDemod::FreeDVDemod(DeviceAPI *deviceAPI) : m_thread = new QThread(this); m_basebandSink = new FreeDVDemodBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setSpectrumSink(&m_spectrumVis); m_basebandSink->moveToThread(m_thread); @@ -66,6 +61,12 @@ FreeDVDemod::FreeDVDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &FreeDVDemod::handleIndexInDeviceSetChanged + ); } FreeDVDemod::~FreeDVDemod() @@ -621,3 +622,17 @@ void FreeDVDemod::setLevelMeter(QObject *levelMeter) { connect(m_basebandSink, SIGNAL(levelChanged(qreal, qreal, int)), levelMeter, SLOT(levelChanged(qreal, qreal, int))); } + +void FreeDVDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodfreedv/freedvdemod.h b/plugins/channelrx/demodfreedv/freedvdemod.h index 179539945..bfc7c6ee0 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.h +++ b/plugins/channelrx/demodfreedv/freedvdemod.h @@ -177,6 +177,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_FREEDVDEMOD_H diff --git a/plugins/channelrx/demodfreedv/freedvdemodbaseband.h b/plugins/channelrx/demodfreedv/freedvdemodbaseband.h index a18e3b47f..52224b865 100644 --- a/plugins/channelrx/demodfreedv/freedvdemodbaseband.h +++ b/plugins/channelrx/demodfreedv/freedvdemodbaseband.h @@ -90,6 +90,7 @@ public: float getFrequencyOffset() const { return m_sink.getFrequencyOffset(); } bool isSync() const { return m_sink.isSync(); } void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } signals: /** diff --git a/plugins/channelrx/demodfreedv/freedvdemodsink.h b/plugins/channelrx/demodfreedv/freedvdemodsink.h index b26f3923d..aa12a732e 100644 --- a/plugins/channelrx/demodfreedv/freedvdemodsink.h +++ b/plugins/channelrx/demodfreedv/freedvdemodsink.h @@ -49,6 +49,7 @@ public: void applyAudioSampleRate(int sampleRate); void applyFreeDVMode(FreeDVDemodSettings::FreeDVMode mode); AudioFifo *getAudioFifo() { return &m_audioFifo; } + void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); } void resyncFreeDV(); void setSpectrumSink(BasebandSampleSink* spectrumSink) { m_spectrumSink = spectrumSink; } diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index ff97ddcd9..3757497be 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -75,6 +75,12 @@ NFMDemod::NFMDemod(DeviceAPI *devieAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &NFMDemod::handleIndexInDeviceSetChanged + ); } NFMDemod::~NFMDemod() @@ -693,3 +699,17 @@ void NFMDemod::handleChannelMessages() } } } + +void NFMDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index bb389c0cb..158319e90 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -160,6 +160,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void handleChannelMessages(); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_NFMDEMOD_H diff --git a/plugins/channelrx/demodnfm/nfmdemodbaseband.h b/plugins/channelrx/demodnfm/nfmdemodbaseband.h index 33c86d06b..7eb046d2f 100644 --- a/plugins/channelrx/demodnfm/nfmdemodbaseband.h +++ b/plugins/channelrx/demodnfm/nfmdemodbaseband.h @@ -71,6 +71,7 @@ public: void setBasebandSampleRate(int sampleRate); void setChannel(ChannelAPI *channel); void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/demodnfm/nfmdemodsink.h b/plugins/channelrx/demodnfm/nfmdemodsink.h index 3cc6e976b..fd175bc5f 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsink.h +++ b/plugins/channelrx/demodnfm/nfmdemodsink.h @@ -75,6 +75,7 @@ public: void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; } AudioFifo *getAudioFifo() { return &m_audioFifo; } + void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); } void applyAudioSampleRate(unsigned int sampleRate); int getAudioSampleRate() const { return m_audioSampleRate; } void setChannel(ChannelAPI *channel) { m_channel = channel; } diff --git a/plugins/channelrx/demodpacket/packetdemod.cpp b/plugins/channelrx/demodpacket/packetdemod.cpp index 361a62e2c..929cec556 100644 --- a/plugins/channelrx/demodpacket/packetdemod.cpp +++ b/plugins/channelrx/demodpacket/packetdemod.cpp @@ -55,11 +55,6 @@ PacketDemod::PacketDemod(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new PacketDemodBaseband(this); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setMessageQueueToChannel(getInputMessageQueue()); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(&m_thread); @@ -72,6 +67,12 @@ PacketDemod::PacketDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &PacketDemod::handleIndexInDeviceSetChanged + ); } PacketDemod::~PacketDemod() @@ -686,3 +687,16 @@ void PacketDemod::handleChannelMessages() } } } + +void PacketDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodpacket/packetdemod.h b/plugins/channelrx/demodpacket/packetdemod.h index dbe6e3b56..21fc83ec7 100644 --- a/plugins/channelrx/demodpacket/packetdemod.h +++ b/plugins/channelrx/demodpacket/packetdemod.h @@ -161,6 +161,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void handleChannelMessages(); + void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/demodpager/pagerdemod.cpp b/plugins/channelrx/demodpager/pagerdemod.cpp index edc8649cd..f802e517a 100644 --- a/plugins/channelrx/demodpager/pagerdemod.cpp +++ b/plugins/channelrx/demodpager/pagerdemod.cpp @@ -48,11 +48,6 @@ PagerDemod::PagerDemod(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new PagerDemodBaseband(this); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setMessageQueueToChannel(getInputMessageQueue()); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(&m_thread); @@ -65,6 +60,12 @@ PagerDemod::PagerDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &PagerDemod::handleIndexInDeviceSetChanged + ); } PagerDemod::~PagerDemod() @@ -700,3 +701,16 @@ void PagerDemod::handleChannelMessages() } } } + +void PagerDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodpager/pagerdemod.h b/plugins/channelrx/demodpager/pagerdemod.h index 5a16edcd6..2c6ce0add 100644 --- a/plugins/channelrx/demodpager/pagerdemod.h +++ b/plugins/channelrx/demodpager/pagerdemod.h @@ -217,6 +217,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void handleChannelMessages(); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_PAGERDEMOD_H diff --git a/plugins/channelrx/demodradiosonde/radiosondedemod.cpp b/plugins/channelrx/demodradiosonde/radiosondedemod.cpp index 02b413fef..e3f508bc6 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemod.cpp +++ b/plugins/channelrx/demodradiosonde/radiosondedemod.cpp @@ -52,11 +52,6 @@ RadiosondeDemod::RadiosondeDemod(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new RadiosondeDemodBaseband(this); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setMessageQueueToChannel(getInputMessageQueue()); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(&m_thread); @@ -69,6 +64,12 @@ RadiosondeDemod::RadiosondeDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &RadiosondeDemod::handleIndexInDeviceSetChanged + ); } RadiosondeDemod::~RadiosondeDemod() @@ -718,3 +719,16 @@ void RadiosondeDemod::handleChannelMessages() } } } + +void RadiosondeDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodradiosonde/radiosondedemod.h b/plugins/channelrx/demodradiosonde/radiosondedemod.h index cec2df55d..d38ea105c 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemod.h +++ b/plugins/channelrx/demodradiosonde/radiosondedemod.h @@ -190,6 +190,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void handleChannelMessages(); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_RADIOSONDEDEMOD_H diff --git a/plugins/channelrx/demodssb/ssbdemod.cpp b/plugins/channelrx/demodssb/ssbdemod.cpp index 6a75f9f1d..f5e40d4c8 100644 --- a/plugins/channelrx/demodssb/ssbdemod.cpp +++ b/plugins/channelrx/demodssb/ssbdemod.cpp @@ -57,11 +57,6 @@ SSBDemod::SSBDemod(DeviceAPI *deviceAPI) : m_thread = new QThread(this); m_basebandSink = new SSBDemodBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setSpectrumSink(&m_spectrumVis); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(m_thread); @@ -74,6 +69,12 @@ SSBDemod::SSBDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &SSBDemod::handleIndexInDeviceSetChanged + ); } SSBDemod::~SSBDemod() @@ -738,3 +739,17 @@ void SSBDemod::handleChannelMessages() } } } + +void SSBDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodssb/ssbdemod.h b/plugins/channelrx/demodssb/ssbdemod.h index b2d878c6c..8927d9bd3 100644 --- a/plugins/channelrx/demodssb/ssbdemod.h +++ b/plugins/channelrx/demodssb/ssbdemod.h @@ -164,6 +164,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void handleChannelMessages(); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_SSBDEMOD_H diff --git a/plugins/channelrx/demodssb/ssbdemodbaseband.h b/plugins/channelrx/demodssb/ssbdemodbaseband.h index 456b7ba40..e14e3e431 100644 --- a/plugins/channelrx/demodssb/ssbdemodbaseband.h +++ b/plugins/channelrx/demodssb/ssbdemodbaseband.h @@ -73,6 +73,7 @@ public: void setMessageQueueToGUI(MessageQueue *messageQueue) { m_messageQueueToGUI = messageQueue; } void setChannel(ChannelAPI *channel); void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/demodssb/ssbdemodsink.h b/plugins/channelrx/demodssb/ssbdemodsink.h index 44c6d71a6..f8376a66a 100644 --- a/plugins/channelrx/demodssb/ssbdemodsink.h +++ b/plugins/channelrx/demodssb/ssbdemodsink.h @@ -49,6 +49,7 @@ public: double getMagSq() const { return m_magsq; } bool getAudioActive() const { return m_audioActive; } void setChannel(ChannelAPI *channel) { m_channel = channel; } + void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); } void getMagSqLevels(double& avg, double& peak, int& nbSamples) { diff --git a/plugins/channelrx/demodvor/vordemod.cpp b/plugins/channelrx/demodvor/vordemod.cpp index aa1a49703..02417e0b3 100644 --- a/plugins/channelrx/demodvor/vordemod.cpp +++ b/plugins/channelrx/demodvor/vordemod.cpp @@ -54,11 +54,6 @@ VORDemod::VORDemod(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new VORDemodBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->moveToThread(&m_thread); applySettings(m_settings, true); @@ -68,6 +63,12 @@ VORDemod::VORDemod(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &VORDemod::handleIndexInDeviceSetChanged + ); } VORDemod::~VORDemod() @@ -558,3 +559,16 @@ void VORDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void VORDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodvor/vordemod.h b/plugins/channelrx/demodvor/vordemod.h index 2f454a825..34eb42e47 100644 --- a/plugins/channelrx/demodvor/vordemod.h +++ b/plugins/channelrx/demodvor/vordemod.h @@ -162,7 +162,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_VORDEMOD_H diff --git a/plugins/channelrx/demodvorsc/vordemodsc.cpp b/plugins/channelrx/demodvorsc/vordemodsc.cpp index 5db79e8e8..92fac34be 100644 --- a/plugins/channelrx/demodvorsc/vordemodsc.cpp +++ b/plugins/channelrx/demodvorsc/vordemodsc.cpp @@ -55,11 +55,6 @@ VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new VORDemodSCBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setMessageQueueToChannel(getInputMessageQueue()); m_basebandSink->moveToThread(&m_thread); @@ -70,6 +65,12 @@ VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &VORDemodSC::handleIndexInDeviceSetChanged + ); } VORDemodSC::~VORDemodSC() @@ -662,3 +663,17 @@ void VORDemodSC::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void VORDemodSC::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodvorsc/vordemodsc.h b/plugins/channelrx/demodvorsc/vordemodsc.h index 0b6bd4e72..cf5919ba0 100644 --- a/plugins/channelrx/demodvorsc/vordemodsc.h +++ b/plugins/channelrx/demodvorsc/vordemodsc.h @@ -164,7 +164,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_VORDEMODSC_H diff --git a/plugins/channelrx/demodvorsc/vordemodscbaseband.h b/plugins/channelrx/demodvorsc/vordemodscbaseband.h index 84a4adc98..1fab48b7b 100644 --- a/plugins/channelrx/demodvorsc/vordemodscbaseband.h +++ b/plugins/channelrx/demodvorsc/vordemodscbaseband.h @@ -71,6 +71,7 @@ public: double getMagSq() const { return m_sink.getMagSq(); } bool isRunning() const { return m_running; } void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/demodvorsc/vordemodscsink.h b/plugins/channelrx/demodvorsc/vordemodscsink.h index 03bee528b..79abd6c39 100644 --- a/plugins/channelrx/demodvorsc/vordemodscsink.h +++ b/plugins/channelrx/demodvorsc/vordemodscsink.h @@ -50,6 +50,7 @@ public: double getMagSq() const { return m_magsq; } bool getSquelchOpen() const { return m_squelchOpen; } AudioFifo *getAudioFifo() { return &m_audioFifo; } + void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); } void getMagSqLevels(double& avg, double& peak, int& nbSamples) { diff --git a/plugins/channelrx/demodwfm/wfmdemod.cpp b/plugins/channelrx/demodwfm/wfmdemod.cpp index c0a6e28d1..d92cb739c 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.cpp +++ b/plugins/channelrx/demodwfm/wfmdemod.cpp @@ -60,11 +60,6 @@ WFMDemod::WFMDemod(DeviceAPI* deviceAPI) : m_thread = new QThread(this); m_basebandSink = new WFMDemodBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(m_thread); @@ -76,6 +71,12 @@ WFMDemod::WFMDemod(DeviceAPI* deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &WFMDemod::handleIndexInDeviceSetChanged + ); } WFMDemod::~WFMDemod() @@ -618,3 +619,17 @@ void WFMDemod::handleChannelMessages() } } } + +void WFMDemod::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/demodwfm/wfmdemod.h b/plugins/channelrx/demodwfm/wfmdemod.h index 6d38b0c63..f79792516 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.h +++ b/plugins/channelrx/demodwfm/wfmdemod.h @@ -156,6 +156,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void handleChannelMessages(); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_WFMDEMOD_H diff --git a/plugins/channelrx/demodwfm/wfmdemodbaseband.h b/plugins/channelrx/demodwfm/wfmdemodbaseband.h index d8e6e6498..e9b1d79d5 100644 --- a/plugins/channelrx/demodwfm/wfmdemodbaseband.h +++ b/plugins/channelrx/demodwfm/wfmdemodbaseband.h @@ -72,6 +72,7 @@ public: void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_sink.getMagSqLevels(avg, peak, nbSamples); } void setChannel(ChannelAPI *channel); void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/demodwfm/wfmdemodsink.h b/plugins/channelrx/demodwfm/wfmdemodsink.h index 0c8c2b5ef..fa569979c 100644 --- a/plugins/channelrx/demodwfm/wfmdemodsink.h +++ b/plugins/channelrx/demodwfm/wfmdemodsink.h @@ -67,6 +67,7 @@ public: void applySettings(const WFMDemodSettings& settings, bool force = false); AudioFifo *getAudioFifo() { return &m_audioFifo; } + void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); } void applyAudioSampleRate(int sampleRate); int getAudioSampleRate() const { return m_audioSampleRate; } void setChannel(ChannelAPI *channel) { m_channel = channel; } diff --git a/plugins/channelrx/filesink/filesink.cpp b/plugins/channelrx/filesink/filesink.cpp index 89489a521..e91e2f7b3 100644 --- a/plugins/channelrx/filesink/filesink.cpp +++ b/plugins/channelrx/filesink/filesink.cpp @@ -59,11 +59,6 @@ FileSink::FileSink(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new FileSinkBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setSpectrumSink(&m_spectrumVis); m_basebandSink->moveToThread(&m_thread); @@ -74,6 +69,12 @@ FileSink::FileSink(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &FileSink::handleIndexInDeviceSetChanged + ); } FileSink::~FileSink() @@ -745,3 +746,16 @@ void FileSink::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void FileSink::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/filesink/filesink.h b/plugins/channelrx/filesink/filesink.h index 969c6f424..1d488a30b 100644 --- a/plugins/channelrx/filesink/filesink.h +++ b/plugins/channelrx/filesink/filesink.h @@ -186,6 +186,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif /* INCLUDE_FILESINK_H_ */ diff --git a/plugins/channelrx/freqtracker/freqtracker.cpp b/plugins/channelrx/freqtracker/freqtracker.cpp index fdcbc5467..c9f10a543 100644 --- a/plugins/channelrx/freqtracker/freqtracker.cpp +++ b/plugins/channelrx/freqtracker/freqtracker.cpp @@ -61,11 +61,6 @@ FreqTracker::FreqTracker(DeviceAPI *deviceAPI) : m_thread = new QThread(this); m_basebandSink = new FreqTrackerBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setSpectrumSink(&m_spectrumVis); propagateMessageQueue(getInputMessageQueue()); m_basebandSink->moveToThread(m_thread); @@ -77,6 +72,12 @@ FreqTracker::FreqTracker(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &FreqTracker::handleIndexInDeviceSetChanged + ); } FreqTracker::~FreqTracker() @@ -684,3 +685,16 @@ void FreqTracker::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void FreqTracker::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/freqtracker/freqtracker.h b/plugins/channelrx/freqtracker/freqtracker.h index 9eac693e7..f74b236a2 100644 --- a/plugins/channelrx/freqtracker/freqtracker.h +++ b/plugins/channelrx/freqtracker/freqtracker.h @@ -160,6 +160,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_FREQTRACKER_H diff --git a/plugins/channelrx/localsink/localsink.cpp b/plugins/channelrx/localsink/localsink.cpp index fbc0b1060..766d8ba9a 100644 --- a/plugins/channelrx/localsink/localsink.cpp +++ b/plugins/channelrx/localsink/localsink.cpp @@ -57,11 +57,6 @@ LocalSink::LocalSink(DeviceAPI *deviceAPI) : m_thread = new QThread(this); m_basebandSink = new LocalSinkBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->moveToThread(m_thread); applySettings(m_settings, true); @@ -71,6 +66,12 @@ LocalSink::LocalSink(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &LocalSink::handleIndexInDeviceSetChanged + ); } LocalSink::~LocalSink() @@ -605,3 +606,16 @@ void LocalSink::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void LocalSink::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/localsink/localsink.h b/plugins/channelrx/localsink/localsink.h index e7b64bfa5..0bec67920 100644 --- a/plugins/channelrx/localsink/localsink.h +++ b/plugins/channelrx/localsink/localsink.h @@ -171,6 +171,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif /* INCLUDE_LOCALSINK_H_ */ diff --git a/plugins/channelrx/noisefigure/noisefigure.cpp b/plugins/channelrx/noisefigure/noisefigure.cpp index 19a05d163..a00e0edef 100644 --- a/plugins/channelrx/noisefigure/noisefigure.cpp +++ b/plugins/channelrx/noisefigure/noisefigure.cpp @@ -66,11 +66,6 @@ NoiseFigure::NoiseFigure(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new NoiseFigureBaseband(this); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setMessageQueueToChannel(getInputMessageQueue()); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(&m_thread); @@ -82,6 +77,12 @@ NoiseFigure::NoiseFigure(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &NoiseFigure::handleIndexInDeviceSetChanged + ); } NoiseFigure::~NoiseFigure() @@ -881,3 +882,16 @@ void NoiseFigure::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void NoiseFigure::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/noisefigure/noisefigure.h b/plugins/channelrx/noisefigure/noisefigure.h index f05b2fa9f..b65710562 100644 --- a/plugins/channelrx/noisefigure/noisefigure.h +++ b/plugins/channelrx/noisefigure/noisefigure.h @@ -278,7 +278,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void nextState(); - + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_NOISEFIGURE_H diff --git a/plugins/channelrx/radioastronomy/radioastronomy.cpp b/plugins/channelrx/radioastronomy/radioastronomy.cpp index 61a7a04cf..1e2146c92 100644 --- a/plugins/channelrx/radioastronomy/radioastronomy.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomy.cpp @@ -71,11 +71,6 @@ RadioAstronomy::RadioAstronomy(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new RadioAstronomyBaseband(this); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setMessageQueueToChannel(getInputMessageQueue()); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(&m_thread); @@ -96,6 +91,12 @@ RadioAstronomy::RadioAstronomy(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &RadioAstronomy::handleIndexInDeviceSetChanged + ); m_sweepTimer.setSingleShot(true); } @@ -1189,3 +1190,16 @@ void RadioAstronomy::handleChannelMessages() } } } + +void RadioAstronomy::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/radioastronomy/radioastronomy.h b/plugins/channelrx/radioastronomy/radioastronomy.h index 37aaf6b3d..5f3d0f9f6 100644 --- a/plugins/channelrx/radioastronomy/radioastronomy.h +++ b/plugins/channelrx/radioastronomy/radioastronomy.h @@ -433,7 +433,7 @@ private slots: void waitUntilOnTarget(); void sweepNext(); void sweepComplete(); - + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_RADIOASTRONOMY_H diff --git a/plugins/channelrx/radioclock/radioclock.cpp b/plugins/channelrx/radioclock/radioclock.cpp index b55d33b6a..b29cd1f55 100644 --- a/plugins/channelrx/radioclock/radioclock.cpp +++ b/plugins/channelrx/radioclock/radioclock.cpp @@ -55,11 +55,6 @@ RadioClock::RadioClock(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new RadioClockBaseband(this); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setMessageQueueToChannel(getInputMessageQueue()); m_basebandSink->setChannel(this); m_basebandSink->moveToThread(&m_thread); @@ -71,6 +66,12 @@ RadioClock::RadioClock(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &RadioClock::handleIndexInDeviceSetChanged + ); } RadioClock::~RadioClock() @@ -564,3 +565,16 @@ void RadioClock::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void RadioClock::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/radioclock/radioclock.h b/plugins/channelrx/radioclock/radioclock.h index 7f8b5ef6f..b35f53760 100644 --- a/plugins/channelrx/radioclock/radioclock.h +++ b/plugins/channelrx/radioclock/radioclock.h @@ -199,7 +199,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - + void handleIndexInDeviceSetChanged(int index); }; #endif // INCLUDE_RADIOCLOCK_H diff --git a/plugins/channelrx/remotesink/remotesink.cpp b/plugins/channelrx/remotesink/remotesink.cpp index 24a976eef..575b291ff 100644 --- a/plugins/channelrx/remotesink/remotesink.cpp +++ b/plugins/channelrx/remotesink/remotesink.cpp @@ -58,11 +58,6 @@ RemoteSink::RemoteSink(DeviceAPI *deviceAPI) : updateWithDeviceData(); m_basebandSink = new RemoteSinkBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->moveToThread(&m_thread); applySettings(m_settings, true); @@ -72,6 +67,12 @@ RemoteSink::RemoteSink(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &RemoteSink::handleIndexInDeviceSetChanged + ); } RemoteSink::~RemoteSink() @@ -622,3 +623,16 @@ void RemoteSink::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void RemoteSink::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/remotesink/remotesink.h b/plugins/channelrx/remotesink/remotesink.h index 8621953da..738411d80 100644 --- a/plugins/channelrx/remotesink/remotesink.h +++ b/plugins/channelrx/remotesink/remotesink.h @@ -150,6 +150,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif /* INCLUDE_REMOTESINK_H_ */ diff --git a/plugins/channelrx/sigmffilesink/sigmffilesink.cpp b/plugins/channelrx/sigmffilesink/sigmffilesink.cpp index 6a40d4747..41c884b5b 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesink.cpp +++ b/plugins/channelrx/sigmffilesink/sigmffilesink.cpp @@ -59,11 +59,6 @@ SigMFFileSink::SigMFFileSink(DeviceAPI *deviceAPI) : setObjectName(m_channelId); m_basebandSink = new SigMFFileSinkBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setSpectrumSink(&m_spectrumVis); m_basebandSink->moveToThread(&m_thread); @@ -74,6 +69,12 @@ SigMFFileSink::SigMFFileSink(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &SigMFFileSink::handleIndexInDeviceSetChanged + ); } SigMFFileSink::~SigMFFileSink() @@ -745,3 +746,16 @@ void SigMFFileSink::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +void SigMFFileSink::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/sigmffilesink/sigmffilesink.h b/plugins/channelrx/sigmffilesink/sigmffilesink.h index ef8a05ed2..9236c738f 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesink.h +++ b/plugins/channelrx/sigmffilesink/sigmffilesink.h @@ -186,6 +186,7 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); }; #endif /* INCLUDE_SIGMFFILESINK_H_ */ diff --git a/plugins/channelrx/udpsink/udpsink.cpp b/plugins/channelrx/udpsink/udpsink.cpp index a8d604faa..ddd882127 100644 --- a/plugins/channelrx/udpsink/udpsink.cpp +++ b/plugins/channelrx/udpsink/udpsink.cpp @@ -54,11 +54,6 @@ UDPSink::UDPSink(DeviceAPI *deviceAPI) : m_thread = new QThread(this); m_basebandSink = new UDPSinkBaseband(); - m_basebandSink->setFifoLabel(QString("%1 [%2:%3]") - .arg(m_channelId) - .arg(m_deviceAPI->getDeviceSetIndex()) - .arg(getIndexInDeviceSet()) - ); m_basebandSink->setSpectrum(&m_spectrumVis); m_basebandSink->moveToThread(m_thread); @@ -69,6 +64,12 @@ UDPSink::UDPSink(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + this, + &ChannelAPI::indexInDeviceSetChanged, + this, + &UDPSink::handleIndexInDeviceSetChanged + ); } UDPSink::~UDPSink() @@ -698,3 +699,17 @@ void UDPSink::enableSpectrum(bool enable) UDPSinkBaseband::MsgEnableSpectrum *msg = UDPSinkBaseband::MsgEnableSpectrum::create(enable); m_basebandSink->getInputMessageQueue()->push(msg); } + +void UDPSink::handleIndexInDeviceSetChanged(int index) +{ + if (index < 0) { + return; + } + + QString fifoLabel = QString("%1 [%2:%3]") + .arg(m_channelId) + .arg(m_deviceAPI->getDeviceSetIndex()) + .arg(index); + m_basebandSink->setFifoLabel(fifoLabel); + m_basebandSink->setAudioFifoLabel(fifoLabel); +} diff --git a/plugins/channelrx/udpsink/udpsink.h b/plugins/channelrx/udpsink/udpsink.h index 9ce6da587..9e9fabe5f 100644 --- a/plugins/channelrx/udpsink/udpsink.h +++ b/plugins/channelrx/udpsink/udpsink.h @@ -127,6 +127,7 @@ public: private slots: void networkManagerFinished(QNetworkReply *reply); + void handleIndexInDeviceSetChanged(int index); protected: DeviceAPI* m_deviceAPI; diff --git a/plugins/channelrx/udpsink/udpsinkbaseband.h b/plugins/channelrx/udpsink/udpsinkbaseband.h index 9f339195b..7b114a651 100644 --- a/plugins/channelrx/udpsink/udpsinkbaseband.h +++ b/plugins/channelrx/udpsink/udpsinkbaseband.h @@ -89,6 +89,7 @@ public: double getInMagSq() const { return m_sink.getInMagSq(); } bool getSquelchOpen() const { return m_sink.getSquelchOpen(); } void setFifoLabel(const QString& label) { m_sampleFifo.setLabel(label); } + void setAudioFifoLabel(const QString& label) { m_sink.setAudioFifoLabel(label); } private: SampleSinkFifo m_sampleFifo; diff --git a/plugins/channelrx/udpsink/udpsinksink.h b/plugins/channelrx/udpsink/udpsinksink.h index 0388af371..cab2c01ea 100644 --- a/plugins/channelrx/udpsink/udpsinksink.h +++ b/plugins/channelrx/udpsink/udpsinksink.h @@ -48,6 +48,7 @@ public: void applySettings(const UDPSinkSettings& settings, bool force = false); AudioFifo *getAudioFifo() { return &m_audioFifo; } + void setAudioFifoLabel(const QString& label) { m_audioFifo.setLabel(label); } void setSpectrum(BasebandSampleSink* spectrum) { m_spectrum = spectrum; } void enableSpectrum(bool enable) { m_spectrumEnabled = enable; } void setSpectrumPositiveOnly(bool positiveOnly) { m_spectrumPositiveOnly = positiveOnly; } diff --git a/sdrbase/audio/audiofifo.cpp b/sdrbase/audio/audiofifo.cpp index 01a780648..93d2d97c8 100644 --- a/sdrbase/audio/audiofifo.cpp +++ b/sdrbase/audio/audiofifo.cpp @@ -63,7 +63,7 @@ bool AudioFifo::setSize(uint32_t numSamples) return create(numSamples); } -uint AudioFifo::write(const quint8* data, uint32_t numSamples) +uint32_t AudioFifo::write(const quint8* data, uint32_t numSamples) { uint32_t total; uint32_t remaining; @@ -102,11 +102,20 @@ uint AudioFifo::write(const quint8* data, uint32_t numSamples) } m_mutex.unlock(); + emit dataReady(); + + if (total < numSamples) + { + qCritical("AudioFifo::write: (%s) overflow %u samples", + qPrintable(m_label), numSamples - total); + emit overflow(numSamples - total); + } + return total; } -uint AudioFifo::read(quint8* data, uint32_t numSamples) +uint32_t AudioFifo::read(quint8* data, uint32_t numSamples) { uint32_t total; uint32_t remaining; diff --git a/sdrbase/audio/audiofifo.h b/sdrbase/audio/audiofifo.h index 269539049..6ef854abb 100644 --- a/sdrbase/audio/audiofifo.h +++ b/sdrbase/audio/audiofifo.h @@ -46,6 +46,7 @@ public: inline bool isEmpty() const { return m_fill == 0; } inline bool isFull() const { return m_fill == m_size; } inline uint32_t size() const { return m_size; } + void setLabel(const QString& label) { m_label = label; } private: QMutex m_mutex; @@ -58,11 +59,13 @@ private: uint32_t m_fill; uint32_t m_head; uint32_t m_tail; + QString m_label; bool create(uint32_t numSamples); signals: void dataReady(); + void overflow(int nsamples); }; #endif // INCLUDE_AUDIOFIFO_H diff --git a/sdrbase/channel/channelapi.h b/sdrbase/channel/channelapi.h index d86f60a37..b341d41c5 100644 --- a/sdrbase/channel/channelapi.h +++ b/sdrbase/channel/channelapi.h @@ -120,7 +120,13 @@ public: } int getIndexInDeviceSet() const { return m_indexInDeviceSet; } - void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; } + + void setIndexInDeviceSet(int indexInDeviceSet) + { + m_indexInDeviceSet = indexInDeviceSet; + emit indexInDeviceSetChanged(indexInDeviceSet); + } + int getDeviceSetIndex() const { return m_deviceSetIndex; } void setDeviceSetIndex(int deviceSetIndex) { m_deviceSetIndex = deviceSetIndex; } DeviceAPI *getDeviceAPI() { return m_deviceAPI; } @@ -164,6 +170,9 @@ private: int m_deviceSetIndex; DeviceAPI *m_deviceAPI; uint64_t m_uid; + +signals: + void indexInDeviceSetChanged(int index); };