1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-17 23:28:50 -05:00

Multi device support: partially removed DSPDeviceEngine dependency in plugin manager

This commit is contained in:
f4exb 2016-05-16 11:32:22 +02:00
parent 9013e057fa
commit 6747a1cae7
3 changed files with 15 additions and 7 deletions

View File

@ -99,6 +99,11 @@ void DeviceAPI::configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCo
m_deviceEngine->configureCorrections(dcOffsetCorrection, iqImbalanceCorrection);
}
void DeviceAPI::setSourceSequence(int sourceSequence)
{
m_deviceEngine->setSourceSequence(sourceSequence);
}
GLSpectrum *DeviceAPI::getSpectrum()
{
return m_spectrum;

View File

@ -34,6 +34,7 @@ class SampleSource;
class MessageQueue;
class ChannelMarker;
class QWidget;
class PluginGUI;
class SDRANGEL_API DeviceAPI : public QObject {
Q_OBJECT
@ -54,6 +55,7 @@ public:
MessageQueue *getDeviceInputMessageQueue();
MessageQueue *getDeviceOutputMessageQueue();
void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection); //!< Configure current device engine DSP corrections
void setSourceSequence(int sourceSequence);
// device related stuff
GLSpectrum *getSpectrum(); //!< Direct spectrum getter

View File

@ -5,6 +5,7 @@
#include "plugin/pluginmanager.h"
#include "plugin/plugingui.h"
#include "device/deviceapi.h"
#include "settings/preset.h"
#include "mainwindow.h"
#include "gui/glspectrum.h"
@ -286,11 +287,11 @@ int PluginManager::selectSampleSourceByIndex(int index, DeviceAPI *deviceAPI)
{
qDebug("PluginManager::selectSampleSourceByIndex: index: %d", index);
m_dspDeviceEngine->stopAcquistion();
deviceAPI->stopAcquisition();
if(m_sampleSourcePluginGUI != NULL) {
m_dspDeviceEngine->stopAcquistion();
m_dspDeviceEngine->setSource(NULL);
deviceAPI->stopAcquisition();
deviceAPI->setSource(0);
m_sampleSourcePluginGUI->destroy();
m_sampleSourcePluginGUI = NULL;
m_sampleSourceId.clear();
@ -321,7 +322,7 @@ int PluginManager::selectSampleSourceByIndex(int index, DeviceAPI *deviceAPI)
<< " seq: " << m_sampleSourceSequence;
m_sampleSourcePluginGUI = m_sampleSourceDevices[index].m_plugin->createSampleSourcePluginGUI(m_sampleSourceId, m_sampleSourceDevices[index].m_displayName, deviceAPI);
m_dspDeviceEngine->setSourceSequence(m_sampleSourceSequence);
deviceAPI->setSourceSequence(m_sampleSourceSequence);
return index;
}
@ -332,11 +333,11 @@ int PluginManager::selectFirstSampleSource(const QString& sourceId, DeviceAPI *d
int index = -1;
m_dspDeviceEngine->stopAcquistion();
deviceAPI->stopAcquisition();
if(m_sampleSourcePluginGUI != NULL) {
m_dspDeviceEngine->stopAcquistion();
m_dspDeviceEngine->setSource(NULL);
deviceAPI->stopAcquisition();
deviceAPI->setSource(0);
m_sampleSourcePluginGUI->destroy();
m_sampleSourcePluginGUI = NULL;
m_sampleSourceId.clear();