From e3d39c7d3f56bd5adebe23e3614cd2ceeccf2384 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 11 May 2016 16:03:03 +0200 Subject: [PATCH] Multi device support: suppress reference to DSPEngine in PluginAPI --- sdrbase/mainwindow.cpp | 2 +- sdrbase/plugin/pluginapi.cpp | 37 ++------------------------------ sdrbase/plugin/pluginapi.h | 13 +---------- sdrbase/plugin/pluginmanager.cpp | 2 +- 4 files changed, 5 insertions(+), 49 deletions(-) diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index d825df7bf..bc29c8d00 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -64,7 +64,6 @@ MainWindow::MainWindow(QWidget* parent) : m_sampleFileName(std::string("./test.sdriq")) { qDebug() << "MainWindow::MainWindow: start"; - m_pluginManager = new PluginManager(this, m_dspEngine); connect(m_dspEngine->getOutputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleDSPMessages()), Qt::QueuedConnection); m_dspEngine->start(); @@ -105,6 +104,7 @@ MainWindow::MainWindow(QWidget* parent) : qDebug() << "MainWindow::MainWindow: m_pluginManager->loadPlugins ..."; + m_pluginManager = new PluginManager(this, m_dspEngine); m_pluginManager->loadPlugins(); //bool sampleSourceSignalsBlocked = ui->sampleSource->blockSignals(true); diff --git a/sdrbase/plugin/pluginapi.cpp b/sdrbase/plugin/pluginapi.cpp index 78966fc5d..03b916ed3 100644 --- a/sdrbase/plugin/pluginapi.cpp +++ b/sdrbase/plugin/pluginapi.cpp @@ -54,47 +54,14 @@ void PluginAPI::removeChannelMarker(ChannelMarker* channelMarker) m_mainWindow->removeChannelMarker(channelMarker); } -/* -void PluginAPI::setSampleSource(SampleSource* sampleSource) -{ - m_dspEngine->stopAcquistion(); - m_dspEngine->setSource(sampleSource); -} - -void PluginAPI::addSampleSink(SampleSink* sampleSink) -{ - m_dspEngine->addSink(sampleSink); -} - -void PluginAPI::removeSampleSink(SampleSink* sampleSink) -{ - m_dspEngine->removeSink(sampleSink); -} - -MessageQueue* PluginAPI::getDSPEngineMessageQueue() -{ - return m_dspEngine->getInputMessageQueue(); -} - -void PluginAPI::addAudioSource(AudioFifo* audioFifo) -{ - m_dspEngine->addAudioSink(audioFifo); -} - -void PluginAPI::removeAudioSource(AudioFifo* audioFifo) -{ - m_dspEngine->removeAudioSink(audioFifo); -}*/ - void PluginAPI::registerSampleSource(const QString& sourceName, PluginInterface* plugin) { m_pluginManager->registerSampleSource(sourceName, plugin); } -PluginAPI::PluginAPI(PluginManager* pluginManager, MainWindow* mainWindow, DSPEngine* dspEngine) : +PluginAPI::PluginAPI(PluginManager* pluginManager, MainWindow* mainWindow) : QObject(mainWindow), m_pluginManager(pluginManager), - m_mainWindow(mainWindow), - m_dspEngine(dspEngine) + m_mainWindow(mainWindow) { } diff --git a/sdrbase/plugin/pluginapi.h b/sdrbase/plugin/pluginapi.h index 89077e6f9..de315f222 100644 --- a/sdrbase/plugin/pluginapi.h +++ b/sdrbase/plugin/pluginapi.h @@ -36,16 +36,6 @@ public: void addChannelMarker(ChannelMarker* channelMarker); void removeChannelMarker(ChannelMarker* channelMarker); - // DSPEngine access - /* Direct access with DSP engine singleton - void setSampleSource(SampleSource* sampleSource); - void addSampleSink(SampleSink* sampleSink); - void removeSampleSink(SampleSink* sampleSink); - MessageQueue* getDSPEngineMessageQueue(); - void addAudioSource(AudioFifo* audioFifo); - void removeAudioSource(AudioFifo* audioFifo); - */ - // Sample Source stuff void registerSampleSource(const QString& sourceName, PluginInterface* plugin); @@ -55,9 +45,8 @@ public: protected: PluginManager* m_pluginManager; MainWindow* m_mainWindow; - DSPEngine* m_dspEngine; - PluginAPI(PluginManager* pluginManager, MainWindow* mainWindow, DSPEngine* dspEngine); + PluginAPI(PluginManager* pluginManager, MainWindow* mainWindow); friend class PluginManager; }; diff --git a/sdrbase/plugin/pluginmanager.cpp b/sdrbase/plugin/pluginmanager.cpp index d111bf09f..eb1ec5e49 100644 --- a/sdrbase/plugin/pluginmanager.cpp +++ b/sdrbase/plugin/pluginmanager.cpp @@ -12,7 +12,7 @@ PluginManager::PluginManager(MainWindow* mainWindow, DSPEngine* dspEngine, QObject* parent) : QObject(parent), - m_pluginAPI(this, mainWindow, dspEngine), + m_pluginAPI(this, mainWindow), m_mainWindow(mainWindow), m_dspEngine(dspEngine), m_sampleSourceId(),