1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-24 10:50:29 -05:00

Multi device support: SDRDaemon plugin removed useless dependencies on plugin API

This commit is contained in:
f4exb 2016-05-17 19:08:04 +02:00
parent 35df869115
commit 197feb1c9d
5 changed files with 10 additions and 13 deletions

View File

@ -30,7 +30,6 @@
#include <nanomsg/pair.h>
#include "ui_sdrdaemongui.h"
#include "plugin/pluginapi.h"
#include "device/deviceapi.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
@ -42,10 +41,9 @@
#include "sdrdaemongui.h"
SDRdaemonGui::SDRdaemonGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
SDRdaemonGui::SDRdaemonGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
ui(new Ui::SDRdaemonGui),
m_pluginAPI(pluginAPI),
m_deviceAPI(deviceAPI),
m_sampleSource(NULL),
m_acquisition(false),
@ -88,9 +86,9 @@ SDRdaemonGui::SDRdaemonGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget*
connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware()));
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
m_statusTimer.start(500);
connect(&(m_pluginAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
connect(&(deviceAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
m_sampleSource = new SDRdaemonInput(m_pluginAPI->getMainWindow()->getMasterTimer(), m_deviceAPI);
m_sampleSource = new SDRdaemonInput(deviceAPI->getMainWindow()->getMasterTimer(), m_deviceAPI);
connect(m_sampleSource->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
m_deviceAPI->setSource(m_sampleSource);

View File

@ -23,7 +23,6 @@
#include "sdrdaemoninput.h"
class PluginAPI;
class DeviceAPI;
class FileSink;
@ -35,7 +34,7 @@ class SDRdaemonGui : public QWidget, public PluginGUI {
Q_OBJECT
public:
explicit SDRdaemonGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
explicit SDRdaemonGui(DeviceAPI *deviceAPI, QWidget* parent = NULL);
virtual ~SDRdaemonGui();
void destroy();
@ -52,7 +51,6 @@ public:
private:
Ui::SDRdaemonGui* ui;
PluginAPI* m_pluginAPI;
DeviceAPI* m_deviceAPI;
QTimer m_updateTimer;
QTimer m_statusTimer;

View File

@ -46,8 +46,7 @@ const PluginDescriptor& SDRdaemonPlugin::getPluginDescriptor() const
void SDRdaemonPlugin::initPlugin(PluginAPI* pluginAPI)
{
m_pluginAPI = pluginAPI;
m_pluginAPI->registerSampleSource(m_deviceTypeID, this);
pluginAPI->registerSampleSource(m_deviceTypeID, this);
}
PluginInterface::SampleSourceDevices SDRdaemonPlugin::enumSampleSources()
@ -72,7 +71,7 @@ PluginGUI* SDRdaemonPlugin::createSampleSourcePluginGUI(const QString& sourceId,
{
if(sourceId == m_deviceTypeID)
{
SDRdaemonGui* gui = new SDRdaemonGui(m_pluginAPI, deviceAPI);
SDRdaemonGui* gui = new SDRdaemonGui(deviceAPI);
*widget = gui;
return gui;
}

View File

@ -22,6 +22,8 @@
#define SDRDAEMON_DEVICE_TYPE_ID "sdrangel.samplesource.sdrdaemon"
class PluginAPI;
class SDRdaemonPlugin : public QObject, public PluginInterface {
Q_OBJECT
Q_INTERFACES(PluginInterface)
@ -40,8 +42,6 @@ public:
private:
static const PluginDescriptor m_pluginDescriptor;
PluginAPI* m_pluginAPI;
};
#endif // INCLUDE_SDRDAEMONPLUGIN_H

View File

@ -80,6 +80,8 @@ public:
void loadChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
void saveChannelSettings(Preset* preset);
MainWindow *getMainWindow() { return m_mainWindow; }
protected:
struct ChannelInstanceRegistration
{