diff --git a/sdrbase/device/deviceapi.cpp b/sdrbase/device/deviceapi.cpp index 359f752e6..54a7f7c99 100644 --- a/sdrbase/device/deviceapi.cpp +++ b/sdrbase/device/deviceapi.cpp @@ -15,6 +15,7 @@ /////////////////////////////////////////////////////////////////////////////////// #include "device/deviceapi.h" +#include "plugin/plugingui.h" #include "gui/glspectrum.h" #include "gui/channelwindow.h" #include "mainwindow.h" @@ -28,7 +29,9 @@ DeviceAPI::DeviceAPI(MainWindow *mainWindow, m_deviceTabIndex(deviceTabIndex), m_deviceEngine(deviceEngine), m_spectrum(glSpectrum), - m_channelWindow(channelWindow) + m_channelWindow(channelWindow), + m_sampleSourceSequence(0), + m_sampleSourcePluginGUI(0) { } @@ -135,3 +138,36 @@ void DeviceAPI::setInputGUI(QWidget* inputGUI, const QString& sourceDisplayName) { m_mainWindow->setInputGUI(m_deviceTabIndex, inputGUI, sourceDisplayName); } + +void DeviceAPI::setSampleSourceId(const QString& id) +{ + m_sampleSourceId = id; +} + +void DeviceAPI::setSampleSourceSerial(const QString& serial) +{ + m_sampleSourceSerial = serial; +} + +void DeviceAPI::setSampleSourceSequence(int sequence) +{ + m_sampleSourceSequence = sequence; +} + +void DeviceAPI::setSampleSourcePluginGUI(PluginGUI *gui) +{ + m_sampleSourcePluginGUI = gui; +} + +void DeviceAPI::freeAll() +{ + m_deviceEngine->stopAcquistion(); + + if(m_sampleSourcePluginGUI != 0) + { + m_deviceEngine->setSource(0); + m_sampleSourcePluginGUI->destroy(); + m_sampleSourcePluginGUI = 0; + m_sampleSourceId.clear(); + } +} diff --git a/sdrbase/device/deviceapi.h b/sdrbase/device/deviceapi.h index 72f6fb062..9f668a6c4 100644 --- a/sdrbase/device/deviceapi.h +++ b/sdrbase/device/deviceapi.h @@ -65,6 +65,13 @@ public: void addRollupWidget(QWidget *widget); //!< Add rollup widget to channel window void setInputGUI(QWidget* inputGUI, const QString& sourceDisplayName); + void setSampleSourceId(const QString& id); + void setSampleSourceSerial(const QString& serial); + void setSampleSourceSequence(int sequence); + void setSampleSourcePluginGUI(PluginGUI *gui); + + void freeAll(); + protected: DeviceAPI(MainWindow *mainWindow, int deviceTabIndex, @@ -79,6 +86,11 @@ protected: GLSpectrum *m_spectrum; ChannelWindow *m_channelWindow; + QString m_sampleSourceId; + QString m_sampleSourceSerial; + int m_sampleSourceSequence; + PluginGUI* m_sampleSourcePluginGUI; + friend class MainWindow; };