1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Refactored GUI queue access (from kasper93)

This commit is contained in:
f4exb 2020-10-31 19:27:35 +01:00
parent ecbf85e1a0
commit b9adbfb1d8
14 changed files with 25 additions and 18 deletions

View File

@ -114,7 +114,10 @@ public:
SWGSDRangel::SWGChannelSettings& response);
void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_basebandSink->getMagSqLevels(avg, peak, nbSamples); }
void propagateMessageQueueToGUI() { m_basebandSink->setMessageQueueToGUI(getMessageQueueToGUI()); }
void setMessageQueueToGUI(MessageQueue* queue) override {
BasebandSampleSink::setMessageQueueToGUI(queue);
m_basebandSink->setMessageQueueToGUI(queue);
}
void setTarget(float targetAzimuth, float targetElevation)
{

View File

@ -835,7 +835,6 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb
m_adsbDemod = reinterpret_cast<ADSBDemod*>(rxChannel); //new ADSBDemod(m_deviceUISet->m_deviceSourceAPI);
m_adsbDemod->setMessageQueueToGUI(getInputMessageQueue());
m_adsbDemod->propagateMessageQueueToGUI();
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));

View File

@ -111,7 +111,10 @@ public:
int getBER() const { return m_basebandSink->getBER(); }
float getFrequencyOffset() const { return m_basebandSink->getFrequencyOffset(); }
bool isSync() const { return m_basebandSink->isSync(); }
void propagateMessageQueueToGUI() { m_basebandSink->setMessageQueueToGUI(getMessageQueueToGUI()); }
void setMessageQueueToGUI(MessageQueue* queue) override {
BasebandSampleSink::setMessageQueueToGUI(queue);
m_basebandSink->setMessageQueueToGUI(queue);
}
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,

View File

@ -258,7 +258,6 @@ FreeDVDemodGUI::FreeDVDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B
m_spectrumVis = m_freeDVDemod->getSpectrumVis();
m_spectrumVis->setGLSpectrum(ui->glSpectrum);
m_freeDVDemod->setMessageQueueToGUI(getInputMessageQueue());
m_freeDVDemod->propagateMessageQueueToGUI();
resetToDefaults();

View File

@ -115,7 +115,10 @@ public:
void setSelectedCtcssIndex(int selectedCtcssIndex) { m_basebandSink->setSelectedCtcssIndex(selectedCtcssIndex); }
bool getSquelchOpen() const { return m_basebandSink->getSquelchOpen(); }
void getMagSqLevels(double& avg, double& peak, int& nbSamples) { m_basebandSink->getMagSqLevels(avg, peak, nbSamples); }
void propagateMessageQueueToGUI() { m_basebandSink->setMessageQueueToGUI(getMessageQueueToGUI()); }
void setMessageQueueToGUI(MessageQueue* queue) override {
BasebandSampleSink::setMessageQueueToGUI(queue);
m_basebandSink->setMessageQueueToGUI(queue);
}
int getAudioSampleRate() const { return m_basebandSink->getAudioSampleRate(); }
uint32_t getNumberOfDeviceStreams() const;

View File

@ -91,7 +91,10 @@ public:
return m_settings.m_inputFrequencyOffset;
}
void propagateMessageQueueToGUI() { m_basebandSink->setMessageQueueToGUI(getMessageQueueToGUI()); }
void setMessageQueueToGUI(MessageQueue* queue) override {
BasebandSampleSink::setMessageQueueToGUI(queue);
m_basebandSink->setMessageQueueToGUI(queue);
}
uint32_t getAudioSampleRate() const { return m_basebandSink->getAudioSampleRate(); }
uint32_t getChannelSampleRate() const { return m_basebandSink->getChannelSampleRate(); }
double getMagSq() const { return m_basebandSink->getMagSq(); }

View File

@ -290,7 +290,6 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_spectrumVis = m_ssbDemod->getSpectrumVis();
m_spectrumVis->setGLSpectrum(ui->glSpectrum);
m_ssbDemod->setMessageQueueToGUI(getInputMessageQueue());
m_ssbDemod->propagateMessageQueueToGUI();
CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->audioMute);
connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect()));

View File

@ -616,9 +616,9 @@ void FileSource::getMagSqLevels(double& avg, double& peak, int& nbSamples) const
m_basebandSource->getMagSqLevels(avg, peak, nbSamples);
}
void FileSource::propagateMessageQueueToGUI()
{
m_basebandSource->setMessageQueueToGUI(getMessageQueueToGUI());
void FileSource::setMessageQueueToGUI(MessageQueue* queue) {
BasebandSampleSource::setMessageQueueToGUI(queue);
m_basebandSource->setMessageQueueToGUI(queue);
}
double FileSource::getMagSq() const

View File

@ -228,7 +228,7 @@ public:
double getMagSq() const;
void getMagSqLevels(double& avg, double& peak, int& nbSamples) const;
void propagateMessageQueueToGUI();
void setMessageQueueToGUI(MessageQueue* queue) override;
uint32_t getNumberOfDeviceStreams() const;
static const QString m_channelIdURI;

View File

@ -188,7 +188,6 @@ FileSourceGUI::FileSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
m_fileSource = (FileSource*) channelTx;
m_fileSource->setMessageQueueToGUI(getInputMessageQueue());
m_fileSource->propagateMessageQueueToGUI();
m_fileName = m_settings.m_fileName;
connect(&(m_deviceUISet->m_deviceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));

View File

@ -764,7 +764,7 @@ void ATVMod::getCameraNumbers(std::vector<int>& numbers)
m_basebandSource->getCameraNumbers(numbers);
}
void ATVMod::propagateMessageQueueToGUI()
{
m_basebandSource->setMessageQueueToGUI(getMessageQueueToGUI());
void ATVMod::setMessageQueueToGUI(MessageQueue* queue) {
BasebandSampleSource::setMessageQueueToGUI(queue);
m_basebandSource->setMessageQueueToGUI(queue);
}

View File

@ -300,7 +300,7 @@ public:
void setLevelMeter(QObject *levelMeter);
int getEffectiveSampleRate() const;
void getCameraNumbers(std::vector<int>& numbers);
void propagateMessageQueueToGUI();
void setMessageQueueToGUI(MessageQueue* queue) override;
static const QString m_channelIdURI;
static const QString m_channelId;

View File

@ -70,7 +70,6 @@ ATVModGUI::ATVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
m_atvMod = (ATVMod*) channelTx;
m_atvMod->setMessageQueueToGUI(getInputMessageQueue());
m_atvMod->propagateMessageQueueToGUI();
connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));

View File

@ -38,7 +38,7 @@ public:
virtual bool handleMessage(const Message& cmd) = 0; //!< Processing of a message. Returns true if message has actually been processed
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } //!< Get the queue for asynchronous inbound communication
void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
virtual void setMessageQueueToGUI(MessageQueue *queue) { m_guiMessageQueue = queue; }
MessageQueue *getMessageQueueToGUI() { return m_guiMessageQueue; }
protected: