mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-05-24 11:12:27 -04:00
Multi device support: use DSPDeviceEngine instead of DSPEngine in PluginManager
This commit is contained in:
parent
e3d39c7d3f
commit
33e5e781c0
@ -59,16 +59,17 @@ public:
|
|||||||
void addThreadedSink(ThreadedSampleSink* sink, uint deviceIndex = 0); //!< Add a sample sink that will run on its own thread
|
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 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 addAudioSink(AudioFifo* audioFifo); //!< Add the audio sink
|
||||||
void removeAudioSink(AudioFifo* audioFifo); //!< Remove 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:
|
// Serial DV methods:
|
||||||
|
|
||||||
bool hasDVSerialSupport()
|
bool hasDVSerialSupport()
|
||||||
|
@ -104,7 +104,7 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
|
|
||||||
qDebug() << "MainWindow::MainWindow: m_pluginManager->loadPlugins ...";
|
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();
|
m_pluginManager->loadPlugins();
|
||||||
|
|
||||||
//bool sampleSourceSignalsBlocked = ui->sampleSource->blockSignals(true);
|
//bool sampleSourceSignalsBlocked = ui->sampleSource->blockSignals(true);
|
||||||
|
@ -5,16 +5,16 @@
|
|||||||
#include "plugin/plugingui.h"
|
#include "plugin/plugingui.h"
|
||||||
#include "settings/preset.h"
|
#include "settings/preset.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "dsp/dspengine.h"
|
#include "dsp/dspdeviceengine.h"
|
||||||
#include "dsp/samplesource.h"
|
#include "dsp/samplesource.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
PluginManager::PluginManager(MainWindow* mainWindow, DSPEngine* dspEngine, QObject* parent) :
|
PluginManager::PluginManager(MainWindow* mainWindow, DSPDeviceEngine* dspDeviceEngine, QObject* parent) :
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
m_pluginAPI(this, mainWindow),
|
m_pluginAPI(this, mainWindow),
|
||||||
m_mainWindow(mainWindow),
|
m_mainWindow(mainWindow),
|
||||||
m_dspEngine(dspEngine),
|
m_dspDeviceEngine(dspDeviceEngine),
|
||||||
m_sampleSourceId(),
|
m_sampleSourceId(),
|
||||||
m_sampleSourceSerial(),
|
m_sampleSourceSerial(),
|
||||||
m_sampleSourceSequence(0),
|
m_sampleSourceSequence(0),
|
||||||
@ -207,7 +207,7 @@ void PluginManager::saveSourceSettings(Preset* preset)
|
|||||||
|
|
||||||
void PluginManager::freeAll()
|
void PluginManager::freeAll()
|
||||||
{
|
{
|
||||||
m_dspEngine->stopAcquistion();
|
m_dspDeviceEngine->stopAcquistion();
|
||||||
|
|
||||||
while(!m_channelInstanceRegistrations.isEmpty()) {
|
while(!m_channelInstanceRegistrations.isEmpty()) {
|
||||||
ChannelInstanceRegistration reg(m_channelInstanceRegistrations.takeLast());
|
ChannelInstanceRegistration reg(m_channelInstanceRegistrations.takeLast());
|
||||||
@ -215,7 +215,7 @@ void PluginManager::freeAll()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(m_sampleSourcePluginGUI != NULL) {
|
if(m_sampleSourcePluginGUI != NULL) {
|
||||||
m_dspEngine->setSource(NULL);
|
m_dspDeviceEngine->setSource(NULL);
|
||||||
m_sampleSourcePluginGUI->destroy();
|
m_sampleSourcePluginGUI->destroy();
|
||||||
m_sampleSourcePluginGUI = NULL;
|
m_sampleSourcePluginGUI = NULL;
|
||||||
m_sampleSourceId.clear();
|
m_sampleSourceId.clear();
|
||||||
@ -282,11 +282,11 @@ int PluginManager::selectSampleSourceByIndex(int index)
|
|||||||
{
|
{
|
||||||
qDebug("PluginManager::selectSampleSourceByIndex: index: %d", index);
|
qDebug("PluginManager::selectSampleSourceByIndex: index: %d", index);
|
||||||
|
|
||||||
m_dspEngine->stopAcquistion();
|
m_dspDeviceEngine->stopAcquistion();
|
||||||
|
|
||||||
if(m_sampleSourcePluginGUI != NULL) {
|
if(m_sampleSourcePluginGUI != NULL) {
|
||||||
m_dspEngine->stopAcquistion();
|
m_dspDeviceEngine->stopAcquistion();
|
||||||
m_dspEngine->setSource(NULL);
|
m_dspDeviceEngine->setSource(NULL);
|
||||||
m_sampleSourcePluginGUI->destroy();
|
m_sampleSourcePluginGUI->destroy();
|
||||||
m_sampleSourcePluginGUI = NULL;
|
m_sampleSourcePluginGUI = NULL;
|
||||||
m_sampleSourceId.clear();
|
m_sampleSourceId.clear();
|
||||||
@ -317,7 +317,7 @@ int PluginManager::selectSampleSourceByIndex(int index)
|
|||||||
<< " seq: " << m_sampleSourceSequence;
|
<< " seq: " << m_sampleSourceSequence;
|
||||||
|
|
||||||
m_sampleSourcePluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceId);
|
m_sampleSourcePluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceId);
|
||||||
m_dspEngine->setSourceSequence(m_sampleSourceSequence);
|
m_dspDeviceEngine->setSourceSequence(m_sampleSourceSequence);
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
@ -328,11 +328,11 @@ int PluginManager::selectFirstSampleSource(const QString& sourceId)
|
|||||||
|
|
||||||
int index = -1;
|
int index = -1;
|
||||||
|
|
||||||
m_dspEngine->stopAcquistion();
|
m_dspDeviceEngine->stopAcquistion();
|
||||||
|
|
||||||
if(m_sampleSourcePluginGUI != NULL) {
|
if(m_sampleSourcePluginGUI != NULL) {
|
||||||
m_dspEngine->stopAcquistion();
|
m_dspDeviceEngine->stopAcquistion();
|
||||||
m_dspEngine->setSource(NULL);
|
m_dspDeviceEngine->setSource(NULL);
|
||||||
m_sampleSourcePluginGUI->destroy();
|
m_sampleSourcePluginGUI->destroy();
|
||||||
m_sampleSourcePluginGUI = NULL;
|
m_sampleSourcePluginGUI = NULL;
|
||||||
m_sampleSourceId.clear();
|
m_sampleSourceId.clear();
|
||||||
|
@ -14,6 +14,7 @@ class Preset;
|
|||||||
class MainWindow;
|
class MainWindow;
|
||||||
class SampleSource;
|
class SampleSource;
|
||||||
class Message;
|
class Message;
|
||||||
|
class DSPDeviceEngine;
|
||||||
|
|
||||||
class SDRANGEL_API PluginManager : public QObject {
|
class SDRANGEL_API PluginManager : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -34,7 +35,7 @@ public:
|
|||||||
|
|
||||||
typedef QList<Plugin> Plugins;
|
typedef QList<Plugin> Plugins;
|
||||||
|
|
||||||
explicit PluginManager(MainWindow* mainWindow, DSPEngine* dspEngine, QObject* parent = NULL);
|
explicit PluginManager(MainWindow* mainWindow, DSPDeviceEngine* dspDeviceEngine, QObject* parent = NULL);
|
||||||
~PluginManager();
|
~PluginManager();
|
||||||
void loadPlugins();
|
void loadPlugins();
|
||||||
|
|
||||||
@ -121,7 +122,7 @@ private:
|
|||||||
|
|
||||||
PluginAPI m_pluginAPI;
|
PluginAPI m_pluginAPI;
|
||||||
MainWindow* m_mainWindow;
|
MainWindow* m_mainWindow;
|
||||||
DSPEngine* m_dspEngine;
|
DSPDeviceEngine* m_dspDeviceEngine;
|
||||||
Plugins m_plugins;
|
Plugins m_plugins;
|
||||||
|
|
||||||
ChannelRegistrations m_channelRegistrations;
|
ChannelRegistrations m_channelRegistrations;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user