diff --git a/sdrbase/dsp/dspengine.h b/sdrbase/dsp/dspengine.h index 285c5db3c..fbc88f259 100644 --- a/sdrbase/dsp/dspengine.h +++ b/sdrbase/dsp/dspengine.h @@ -59,16 +59,17 @@ public: void addThreadedSink(ThreadedSampleSink* sink, uint deviceIndex = 0); //!< Add a sample sink that will run on its own thread void removeThreadedSink(ThreadedSampleSink* sink, uint deviceIndex = 0); //!< Remove a sample sink that runs on its own thread + void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection, uint deviceIndex = 0); //!< Configure DSP corrections + + DSPDeviceEngine::State state(uint deviceIndex = 0) const; + QString errorMessage(uint deviceIndex = 0); //!< Return the current error message + QString sourceDeviceDescription(uint deviceIndex = 0); //!< Return the source device description + + DSPDeviceEngine *getDeviceEngine(uint deviceIndex) { return m_deviceEngines[deviceIndex]; } + void addAudioSink(AudioFifo* audioFifo); //!< Add the audio sink void removeAudioSink(AudioFifo* audioFifo); //!< Remove the audio sink - void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection, uint deviceIndex = 0); //!< Configure DSP corrections - - DSPDeviceEngine::State state(uint deviceIndex = 0) const; - - QString errorMessage(uint deviceIndex = 0); //!< Return the current error message - QString sourceDeviceDescription(uint deviceIndex = 0); //!< Return the source device description - // Serial DV methods: bool hasDVSerialSupport() diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index bc29c8d00..860def5f4 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -104,7 +104,7 @@ MainWindow::MainWindow(QWidget* parent) : qDebug() << "MainWindow::MainWindow: m_pluginManager->loadPlugins ..."; - m_pluginManager = new PluginManager(this, m_dspEngine); + m_pluginManager = new PluginManager(this, m_dspEngine->getDeviceEngine(0)); m_pluginManager->loadPlugins(); //bool sampleSourceSignalsBlocked = ui->sampleSource->blockSignals(true); diff --git a/sdrbase/plugin/pluginmanager.cpp b/sdrbase/plugin/pluginmanager.cpp index eb1ec5e49..292d3d12a 100644 --- a/sdrbase/plugin/pluginmanager.cpp +++ b/sdrbase/plugin/pluginmanager.cpp @@ -5,16 +5,16 @@ #include "plugin/plugingui.h" #include "settings/preset.h" #include "mainwindow.h" -#include "dsp/dspengine.h" +#include "dsp/dspdeviceengine.h" #include "dsp/samplesource.h" #include -PluginManager::PluginManager(MainWindow* mainWindow, DSPEngine* dspEngine, QObject* parent) : +PluginManager::PluginManager(MainWindow* mainWindow, DSPDeviceEngine* dspDeviceEngine, QObject* parent) : QObject(parent), m_pluginAPI(this, mainWindow), m_mainWindow(mainWindow), - m_dspEngine(dspEngine), + m_dspDeviceEngine(dspDeviceEngine), m_sampleSourceId(), m_sampleSourceSerial(), m_sampleSourceSequence(0), @@ -207,7 +207,7 @@ void PluginManager::saveSourceSettings(Preset* preset) void PluginManager::freeAll() { - m_dspEngine->stopAcquistion(); + m_dspDeviceEngine->stopAcquistion(); while(!m_channelInstanceRegistrations.isEmpty()) { ChannelInstanceRegistration reg(m_channelInstanceRegistrations.takeLast()); @@ -215,7 +215,7 @@ void PluginManager::freeAll() } if(m_sampleSourcePluginGUI != NULL) { - m_dspEngine->setSource(NULL); + m_dspDeviceEngine->setSource(NULL); m_sampleSourcePluginGUI->destroy(); m_sampleSourcePluginGUI = NULL; m_sampleSourceId.clear(); @@ -282,11 +282,11 @@ int PluginManager::selectSampleSourceByIndex(int index) { qDebug("PluginManager::selectSampleSourceByIndex: index: %d", index); - m_dspEngine->stopAcquistion(); + m_dspDeviceEngine->stopAcquistion(); if(m_sampleSourcePluginGUI != NULL) { - m_dspEngine->stopAcquistion(); - m_dspEngine->setSource(NULL); + m_dspDeviceEngine->stopAcquistion(); + m_dspDeviceEngine->setSource(NULL); m_sampleSourcePluginGUI->destroy(); m_sampleSourcePluginGUI = NULL; m_sampleSourceId.clear(); @@ -317,7 +317,7 @@ int PluginManager::selectSampleSourceByIndex(int index) << " seq: " << m_sampleSourceSequence; m_sampleSourcePluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceId); - m_dspEngine->setSourceSequence(m_sampleSourceSequence); + m_dspDeviceEngine->setSourceSequence(m_sampleSourceSequence); return index; } @@ -328,11 +328,11 @@ int PluginManager::selectFirstSampleSource(const QString& sourceId) int index = -1; - m_dspEngine->stopAcquistion(); + m_dspDeviceEngine->stopAcquistion(); if(m_sampleSourcePluginGUI != NULL) { - m_dspEngine->stopAcquistion(); - m_dspEngine->setSource(NULL); + m_dspDeviceEngine->stopAcquistion(); + m_dspDeviceEngine->setSource(NULL); m_sampleSourcePluginGUI->destroy(); m_sampleSourcePluginGUI = NULL; m_sampleSourceId.clear(); diff --git a/sdrbase/plugin/pluginmanager.h b/sdrbase/plugin/pluginmanager.h index da713f35e..1d1836123 100644 --- a/sdrbase/plugin/pluginmanager.h +++ b/sdrbase/plugin/pluginmanager.h @@ -14,6 +14,7 @@ class Preset; class MainWindow; class SampleSource; class Message; +class DSPDeviceEngine; class SDRANGEL_API PluginManager : public QObject { Q_OBJECT @@ -34,7 +35,7 @@ public: typedef QList Plugins; - explicit PluginManager(MainWindow* mainWindow, DSPEngine* dspEngine, QObject* parent = NULL); + explicit PluginManager(MainWindow* mainWindow, DSPDeviceEngine* dspDeviceEngine, QObject* parent = NULL); ~PluginManager(); void loadPlugins(); @@ -121,7 +122,7 @@ private: PluginAPI m_pluginAPI; MainWindow* m_mainWindow; - DSPEngine* m_dspEngine; + DSPDeviceEngine* m_dspDeviceEngine; Plugins m_plugins; ChannelRegistrations m_channelRegistrations;