From 66daf9fa4eac2d84f051aa65b7181f982be986b8 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 11 May 2016 18:29:01 +0200 Subject: [PATCH] Multi device support: access DSPDeviceEngine from the channel plugins using the plubgin API and not a direct access --- plugins/channel/chanalyzer/chanalyzergui.cpp | 26 ++++++++++---------- plugins/channel/demodam/amdemodgui.cpp | 23 ++++++++--------- plugins/channel/demodbfm/bfmdemodgui.cpp | 4 +-- plugins/channel/demoddsd/dsddemodgui.cpp | 4 +-- plugins/channel/demodlora/lorademodgui.cpp | 24 +++++++++--------- plugins/channel/demodnfm/nfmdemodgui.cpp | 4 +-- plugins/channel/demodssb/ssbdemodgui.cpp | 14 +++++------ plugins/channel/demodwfm/wfmdemodgui.cpp | 4 +-- plugins/channel/tcpsrc/tcpsrcgui.cpp | 14 +++++------ plugins/channel/udpsrc/udpsrcgui.cpp | 14 +++++------ sdrbase/plugin/pluginapi.cpp | 10 ++++++++ sdrbase/plugin/pluginapi.h | 5 ++++ sdrbase/plugin/pluginmanager.cpp | 10 ++++++++ sdrbase/plugin/pluginmanager.h | 4 +++ 14 files changed, 95 insertions(+), 65 deletions(-) diff --git a/plugins/channel/chanalyzer/chanalyzergui.cpp b/plugins/channel/chanalyzer/chanalyzergui.cpp index 437af554f..8d1620805 100644 --- a/plugins/channel/chanalyzer/chanalyzergui.cpp +++ b/plugins/channel/chanalyzer/chanalyzergui.cpp @@ -69,11 +69,11 @@ void ChannelAnalyzerGUI::setCenterFrequency(qint64 centerFrequency) void ChannelAnalyzerGUI::resetToDefaults() { blockApplySettings(true); - + ui->BW->setValue(30); ui->deltaFrequency->setValue(0); ui->spanLog2->setValue(3); - + blockApplySettings(false); applySettings(); } @@ -96,22 +96,22 @@ bool ChannelAnalyzerGUI::deserialize(const QByteArray& data) { SimpleDeserializer d(data); - if(!d.isValid()) + if(!d.isValid()) { resetToDefaults(); return false; } - if(d.getVersion() == 1) + if(d.getVersion() == 1) { QByteArray bytetmp; quint32 u32tmp; qint32 tmp, bw, lowCut; bool tmpBool; - + blockApplySettings(true); m_channelMarker.blockSignals(true); - + d.readS32(1, &tmp, 0); m_channelMarker.setCenterFrequency(tmp); d.readS32(2, &bw, 30); @@ -133,16 +133,16 @@ bool ChannelAnalyzerGUI::deserialize(const QByteArray& data) ui->ssb->setChecked(tmpBool); d.readBlob(8, &bytetmp); ui->scopeGUI->deserialize(bytetmp); - + blockApplySettings(false); m_channelMarker.blockSignals(false); - + ui->BW->setValue(bw); ui->lowCut->setValue(lowCut); // does applySettings(); return true; - } - else + } + else { resetToDefaults(); return false; @@ -324,7 +324,7 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, QWidget* parent) : m_channelizer = new Channelizer(m_channelAnalyzer); m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged())); - DSPEngine::instance()->addThreadedSink(m_threadedChannelizer); + m_pluginAPI->addThreadedSink(m_threadedChannelizer); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->deltaFrequency->setValueRange(7, 0U, 9999999U); @@ -358,7 +358,7 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, QWidget* parent) : ChannelAnalyzerGUI::~ChannelAnalyzerGUI() { m_pluginAPI->removeChannelInstance(this); - DSPEngine::instance()->removeThreadedSink(m_threadedChannelizer); + m_pluginAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; delete m_channelAnalyzer; @@ -380,7 +380,7 @@ bool ChannelAnalyzerGUI::setNewRate(int spanLog2) m_spanLog2 = spanLog2; //m_rate = 48000 / (1<getSampleRate() / (1<BW->value() < -m_rate/200) { ui->BW->setValue(-m_rate/200); m_channelMarker.setBandwidth(-m_rate*2); diff --git a/plugins/channel/demodam/amdemodgui.cpp b/plugins/channel/demodam/amdemodgui.cpp index 04ec9cdf5..5a82f681b 100644 --- a/plugins/channel/demodam/amdemodgui.cpp +++ b/plugins/channel/demodam/amdemodgui.cpp @@ -52,7 +52,7 @@ void AMDemodGUI::setCenterFrequency(qint64 centerFrequency) void AMDemodGUI::resetToDefaults() { blockApplySettings(true); - + ui->rfBW->setValue(4); ui->afBW->setValue(3); ui->volume->setValue(20); @@ -79,21 +79,21 @@ bool AMDemodGUI::deserialize(const QByteArray& data) { SimpleDeserializer d(data); - if(!d.isValid()) + if(!d.isValid()) { resetToDefaults(); return false; } - if(d.getVersion() == 1) + if(d.getVersion() == 1) { QByteArray bytetmp; quint32 u32tmp; qint32 tmp; - + blockApplySettings(true); m_channelMarker.blockSignals(true); - + d.readS32(1, &tmp, 0); m_channelMarker.setCenterFrequency(tmp); d.readS32(2, &tmp, 4); @@ -104,19 +104,19 @@ bool AMDemodGUI::deserialize(const QByteArray& data) ui->volume->setValue(tmp); d.readS32(5, &tmp, -40); ui->squelch->setValue(tmp); - + if(d.readU32(7, &u32tmp)) { m_channelMarker.setColor(u32tmp); } - + blockApplySettings(false); m_channelMarker.blockSignals(false); applySettings(); return true; - } - else + } + else { resetToDefaults(); return false; @@ -218,7 +218,8 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : m_amDemod = new AMDemod(); m_channelizer = new Channelizer(m_amDemod); m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); - DSPEngine::instance()->addThreadedSink(m_threadedChannelizer); + m_pluginAPI->addThreadedSink(m_threadedChannelizer); + connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); @@ -237,7 +238,7 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : AMDemodGUI::~AMDemodGUI() { m_pluginAPI->removeChannelInstance(this); - DSPEngine::instance()->removeThreadedSink(m_threadedChannelizer); + m_pluginAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; delete m_amDemod; diff --git a/plugins/channel/demodbfm/bfmdemodgui.cpp b/plugins/channel/demodbfm/bfmdemodgui.cpp index d28082bac..cfe2e6527 100644 --- a/plugins/channel/demodbfm/bfmdemodgui.cpp +++ b/plugins/channel/demodbfm/bfmdemodgui.cpp @@ -379,7 +379,7 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : m_channelizer = new Channelizer(m_bfmDemod); m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); connect(m_channelizer, SIGNAL(inputSampleRateChanged()), this, SLOT(channelSampleRateChanged())); - DSPEngine::instance()->addThreadedSink(m_threadedChannelizer); + m_pluginAPI->addThreadedSink(m_threadedChannelizer); ui->glSpectrum->setCenterFrequency(m_rate / 4); ui->glSpectrum->setSampleRate(m_rate / 2); @@ -413,7 +413,7 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : BFMDemodGUI::~BFMDemodGUI() { m_pluginAPI->removeChannelInstance(this); - DSPEngine::instance()->removeThreadedSink(m_threadedChannelizer); + m_pluginAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; delete m_bfmDemod; diff --git a/plugins/channel/demoddsd/dsddemodgui.cpp b/plugins/channel/demoddsd/dsddemodgui.cpp index 0bc16417c..512b90f92 100644 --- a/plugins/channel/demoddsd/dsddemodgui.cpp +++ b/plugins/channel/demoddsd/dsddemodgui.cpp @@ -276,7 +276,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : m_channelizer = new Channelizer(m_dsdDemod); m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); - DSPEngine::instance()->addThreadedSink(m_threadedChannelizer); + m_pluginAPI->addThreadedSink(m_threadedChannelizer); //m_channelMarker = new ChannelMarker(this); m_channelMarker.setColor(Qt::cyan); @@ -296,7 +296,7 @@ DSDDemodGUI::DSDDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : DSDDemodGUI::~DSDDemodGUI() { m_pluginAPI->removeChannelInstance(this); - DSPEngine::instance()->removeThreadedSink(m_threadedChannelizer); + m_pluginAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; delete m_dsdDemod; diff --git a/plugins/channel/demodlora/lorademodgui.cpp b/plugins/channel/demodlora/lorademodgui.cpp index 8b5cfb4a6..bc1f42b4e 100644 --- a/plugins/channel/demodlora/lorademodgui.cpp +++ b/plugins/channel/demodlora/lorademodgui.cpp @@ -48,10 +48,10 @@ void LoRaDemodGUI::setCenterFrequency(qint64 centerFrequency) void LoRaDemodGUI::resetToDefaults() { blockApplySettings(true); - + ui->BW->setValue(0); ui->Spread->setValue(0); - + blockApplySettings(false); applySettings(); } @@ -70,20 +70,20 @@ bool LoRaDemodGUI::deserialize(const QByteArray& data) { SimpleDeserializer d(data); - if(!d.isValid()) + if(!d.isValid()) { resetToDefaults(); return false; } - if(d.getVersion() == 1) + if(d.getVersion() == 1) { QByteArray bytetmp; qint32 tmp; - + blockApplySettings(true); m_channelMarker.blockSignals(true); - + d.readS32(1, &tmp, 0); m_channelMarker.setCenterFrequency(tmp); d.readS32(2, &tmp, 0); @@ -92,14 +92,14 @@ bool LoRaDemodGUI::deserialize(const QByteArray& data) ui->Spread->setValue(tmp); d.readBlob(4, &bytetmp); ui->spectrumGUI->deserialize(bytetmp); - + blockApplySettings(false); m_channelMarker.blockSignals(false); - + applySettings(); return true; - } - else + } + else { resetToDefaults(); return false; @@ -163,7 +163,7 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : m_LoRaDemod = new LoRaDemod(m_spectrumVis); m_channelizer = new Channelizer(m_LoRaDemod); m_threadedChannelizer = new ThreadedSampleSink(m_channelizer); - DSPEngine::instance()->addThreadedSink(m_threadedChannelizer); + m_pluginAPI->addThreadedSink(m_threadedChannelizer); ui->glSpectrum->setCenterFrequency(16000); ui->glSpectrum->setSampleRate(32000); @@ -188,7 +188,7 @@ LoRaDemodGUI::LoRaDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : LoRaDemodGUI::~LoRaDemodGUI() { m_pluginAPI->removeChannelInstance(this); - DSPEngine::instance()->removeThreadedSink(m_threadedChannelizer); + m_pluginAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; delete m_LoRaDemod; diff --git a/plugins/channel/demodnfm/nfmdemodgui.cpp b/plugins/channel/demodnfm/nfmdemodgui.cpp index ac06f497e..a3ff10667 100644 --- a/plugins/channel/demodnfm/nfmdemodgui.cpp +++ b/plugins/channel/demodnfm/nfmdemodgui.cpp @@ -289,7 +289,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : m_channelizer = new Channelizer(m_nfmDemod); m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); - DSPEngine::instance()->addThreadedSink(m_threadedChannelizer); + m_pluginAPI->addThreadedSink(m_threadedChannelizer); //m_channelMarker = new ChannelMarker(this); m_channelMarker.setColor(Qt::red); @@ -307,7 +307,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : NFMDemodGUI::~NFMDemodGUI() { m_pluginAPI->removeChannelInstance(this); - DSPEngine::instance()->removeThreadedSink(m_threadedChannelizer); + m_pluginAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; delete m_nfmDemod; diff --git a/plugins/channel/demodssb/ssbdemodgui.cpp b/plugins/channel/demodssb/ssbdemodgui.cpp index 9c5a77a1d..cb0ac565f 100644 --- a/plugins/channel/demodssb/ssbdemodgui.cpp +++ b/plugins/channel/demodssb/ssbdemodgui.cpp @@ -51,7 +51,7 @@ void SSBDemodGUI::setCenterFrequency(qint64 centerFrequency) void SSBDemodGUI::resetToDefaults() { blockApplySettings(true); - + ui->BW->setValue(30); ui->volume->setValue(40); ui->deltaFrequency->setValue(0); @@ -92,10 +92,10 @@ bool SSBDemodGUI::deserialize(const QByteArray& data) QByteArray bytetmp; quint32 u32tmp; qint32 tmp; - + blockApplySettings(true); m_channelMarker.blockSignals(true); - + d.readS32(1, &tmp, 0); m_channelMarker.setCenterFrequency(tmp); d.readS32(2, &tmp, 30); @@ -117,10 +117,10 @@ bool SSBDemodGUI::deserialize(const QByteArray& data) ui->audioFlipChannels->setChecked(m_audioFlipChannels); d.readBool(10, &m_dsb); ui->dsb->setChecked(m_dsb); - + blockApplySettings(false); m_channelMarker.blockSignals(false); - + applySettings(); return true; } @@ -338,7 +338,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : m_ssbDemod = new SSBDemod(m_spectrumVis); m_channelizer = new Channelizer(m_ssbDemod); m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); - DSPEngine::instance()->addThreadedSink(m_threadedChannelizer); + m_pluginAPI->addThreadedSink(m_threadedChannelizer); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); @@ -369,7 +369,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : SSBDemodGUI::~SSBDemodGUI() { m_pluginAPI->removeChannelInstance(this); - DSPEngine::instance()->removeThreadedSink(m_threadedChannelizer); + m_pluginAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; delete m_ssbDemod; diff --git a/plugins/channel/demodwfm/wfmdemodgui.cpp b/plugins/channel/demodwfm/wfmdemodgui.cpp index ee77cc19a..55c50a763 100644 --- a/plugins/channel/demodwfm/wfmdemodgui.cpp +++ b/plugins/channel/demodwfm/wfmdemodgui.cpp @@ -232,7 +232,7 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : m_wfmDemod = new WFMDemod(0); m_channelizer = new Channelizer(m_wfmDemod); m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); - DSPEngine::instance()->addThreadedSink(m_threadedChannelizer); + m_pluginAPI->addThreadedSink(m_threadedChannelizer); connect(&m_pluginAPI->getMainWindow()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); @@ -250,7 +250,7 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, QWidget* parent) : WFMDemodGUI::~WFMDemodGUI() { m_pluginAPI->removeChannelInstance(this); - DSPEngine::instance()->removeThreadedSink(m_threadedChannelizer); + m_pluginAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; delete m_wfmDemod; diff --git a/plugins/channel/tcpsrc/tcpsrcgui.cpp b/plugins/channel/tcpsrc/tcpsrcgui.cpp index 5bebe4e07..0bd40dcbe 100644 --- a/plugins/channel/tcpsrc/tcpsrcgui.cpp +++ b/plugins/channel/tcpsrc/tcpsrcgui.cpp @@ -46,7 +46,7 @@ QString TCPSrcGUI::getName() const void TCPSrcGUI::resetToDefaults() { blockApplySettings(true); - + ui->sampleFormat->setCurrentIndex(0); ui->sampleRate->setText("48000"); ui->rfBandwidth->setText("32000"); @@ -88,10 +88,10 @@ bool TCPSrcGUI::deserialize(const QByteArray& data) QByteArray bytetmp; qint32 s32tmp; Real realtmp; - + blockApplySettings(true); m_channelMarker.blockSignals(true); - + d.readBlob(1, &bytetmp); restoreState(bytetmp); d.readS32(2, &s32tmp, 0); @@ -123,10 +123,10 @@ bool TCPSrcGUI::deserialize(const QByteArray& data) ui->boost->setValue(s32tmp); d.readS32(9, &s32tmp, 0); m_channelMarker.setCenterFrequency(s32tmp); - + blockApplySettings(false); m_channelMarker.blockSignals(false); - + applySettings(); return true; } @@ -199,7 +199,7 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) : m_tcpSrc = new TCPSrc(m_pluginAPI->getMainWindowMessageQueue(), this, m_spectrumVis); m_channelizer = new Channelizer(m_tcpSrc); m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); - DSPEngine::instance()->addThreadedSink(m_threadedChannelizer); + m_pluginAPI->addThreadedSink(m_threadedChannelizer); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::ReverseGold)); ui->deltaFrequency->setValueRange(7, 0U, 9999999U); @@ -229,7 +229,7 @@ TCPSrcGUI::TCPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) : TCPSrcGUI::~TCPSrcGUI() { m_pluginAPI->removeChannelInstance(this); - DSPEngine::instance()->removeThreadedSink(m_threadedChannelizer); + m_pluginAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; delete m_tcpSrc; diff --git a/plugins/channel/udpsrc/udpsrcgui.cpp b/plugins/channel/udpsrc/udpsrcgui.cpp index 3ca715d82..33d91fc5d 100644 --- a/plugins/channel/udpsrc/udpsrcgui.cpp +++ b/plugins/channel/udpsrc/udpsrcgui.cpp @@ -64,7 +64,7 @@ QString UDPSrcGUI::getName() const void UDPSrcGUI::resetToDefaults() { blockApplySettings(true); - + ui->sampleFormat->setCurrentIndex(0); ui->sampleRate->setText("48000"); ui->rfBandwidth->setText("32000"); @@ -121,10 +121,10 @@ bool UDPSrcGUI::deserialize(const QByteArray& data) qint32 s32tmp; Real realtmp; bool booltmp; - + blockApplySettings(true); m_channelMarker.blockSignals(true); - + d.readBlob(1, &bytetmp); restoreState(bytetmp); d.readS32(2, &s32tmp, 0); @@ -183,10 +183,10 @@ bool UDPSrcGUI::deserialize(const QByteArray& data) ui->audioStereo->setChecked(booltmp); d.readS32(15, &s32tmp, 2500); ui->fmDeviation->setText(QString("%1").arg(s32tmp)); - + blockApplySettings(false); m_channelMarker.blockSignals(false); - + applySettingsImmediate(); applySettings(); return true; @@ -237,7 +237,7 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) : m_udpSrc = new UDPSrc(m_pluginAPI->getMainWindowMessageQueue(), this, m_spectrumVis); m_channelizer = new Channelizer(m_udpSrc); m_threadedChannelizer = new ThreadedSampleSink(m_channelizer, this); - DSPEngine::instance()->addThreadedSink(m_threadedChannelizer); + m_pluginAPI->addThreadedSink(m_threadedChannelizer); ui->fmDeviation->setEnabled(false); @@ -270,7 +270,7 @@ UDPSrcGUI::UDPSrcGUI(PluginAPI* pluginAPI, QWidget* parent) : UDPSrcGUI::~UDPSrcGUI() { m_pluginAPI->removeChannelInstance(this); - DSPEngine::instance()->removeThreadedSink(m_threadedChannelizer); + m_pluginAPI->removeThreadedSink(m_threadedChannelizer); delete m_threadedChannelizer; delete m_channelizer; delete m_udpSrc; diff --git a/sdrbase/plugin/pluginapi.cpp b/sdrbase/plugin/pluginapi.cpp index 03b916ed3..16bbed104 100644 --- a/sdrbase/plugin/pluginapi.cpp +++ b/sdrbase/plugin/pluginapi.cpp @@ -59,6 +59,16 @@ void PluginAPI::registerSampleSource(const QString& sourceName, PluginInterface* m_pluginManager->registerSampleSource(sourceName, plugin); } +void PluginAPI::addThreadedSink(ThreadedSampleSink* sink) +{ + m_pluginManager->addThreadedSink(sink); +} + +void PluginAPI::removeThreadedSink(ThreadedSampleSink* sink) +{ + m_pluginManager->removeThreadedSink(sink); +} + PluginAPI::PluginAPI(PluginManager* pluginManager, MainWindow* mainWindow) : QObject(mainWindow), m_pluginManager(pluginManager), diff --git a/sdrbase/plugin/pluginapi.h b/sdrbase/plugin/pluginapi.h index de315f222..2c9cafc2c 100644 --- a/sdrbase/plugin/pluginapi.h +++ b/sdrbase/plugin/pluginapi.h @@ -16,6 +16,7 @@ class AudioFifo; class MessageQueue; class MainWindow; class ChannelMarker; +class ThreadedSampleSink; class PluginGUI; class SDRANGEL_API PluginAPI : public QObject { @@ -39,6 +40,10 @@ public: // Sample Source stuff void registerSampleSource(const QString& sourceName, PluginInterface* plugin); + // Device engine stuff + void addThreadedSink(ThreadedSampleSink* sink); + void removeThreadedSink(ThreadedSampleSink* sink); + // R/O access to main window const MainWindow* getMainWindow() const { return m_mainWindow; } diff --git a/sdrbase/plugin/pluginmanager.cpp b/sdrbase/plugin/pluginmanager.cpp index 292d3d12a..82557ef46 100644 --- a/sdrbase/plugin/pluginmanager.cpp +++ b/sdrbase/plugin/pluginmanager.cpp @@ -86,6 +86,16 @@ void PluginManager::registerSampleSource(const QString& sourceName, PluginInterf m_sampleSourceRegistrations.append(SampleSourceRegistration(sourceName, plugin)); } +void PluginManager::addThreadedSink(ThreadedSampleSink* sink) +{ + m_dspDeviceEngine->addThreadedSink(sink); +} + +void PluginManager::removeThreadedSink(ThreadedSampleSink* sink) +{ + m_dspDeviceEngine->removeThreadedSink(sink); +} + void PluginManager::loadSettings(const Preset* preset) { fprintf(stderr, "PluginManager::loadSettings: Loading preset [%s | %s]\n", qPrintable(preset->getGroup()), qPrintable(preset->getDescription())); diff --git a/sdrbase/plugin/pluginmanager.h b/sdrbase/plugin/pluginmanager.h index 1d1836123..afca432f2 100644 --- a/sdrbase/plugin/pluginmanager.h +++ b/sdrbase/plugin/pluginmanager.h @@ -15,6 +15,7 @@ class MainWindow; class SampleSource; class Message; class DSPDeviceEngine; +class ThreadedSampleSink; class SDRANGEL_API PluginManager : public QObject { Q_OBJECT @@ -48,6 +49,9 @@ public: void registerSampleSource(const QString& sourceName, PluginInterface* plugin); + void addThreadedSink(ThreadedSampleSink* sink); + void removeThreadedSink(ThreadedSampleSink* sink); + void loadSettings(const Preset* preset); void loadSourceSettings(const Preset* preset); void saveSettings(Preset* preset);