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

Multi device support: remainder source plugins: removed useless dependencies on plugin API

This commit is contained in:
f4exb 2016-05-17 19:26:23 +02:00
parent 197feb1c9d
commit 7863a3cb69
20 changed files with 36 additions and 73 deletions

View File

@ -21,7 +21,6 @@
#include "airspygui.h"
#include "ui_airspygui.h"
#include "plugin/pluginapi.h"
#include "device/deviceapi.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
@ -29,10 +28,9 @@
#include "dsp/dspcommands.h"
#include "dsp/filesink.h"
AirspyGui::AirspyGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
AirspyGui::AirspyGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
ui(new Ui::AirspyGui),
m_pluginAPI(pluginAPI),
m_deviceAPI(deviceAPI),
m_settings(),
m_sampleSource(0),

View File

@ -24,7 +24,6 @@
#define AIRSPY_MAX_DEVICE (32)
class PluginAPI;
class DeviceAPI;
class FileSink;
@ -37,7 +36,7 @@ class AirspyGui : public QWidget, public PluginGUI {
Q_OBJECT
public:
explicit AirspyGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
explicit AirspyGui(DeviceAPI *deviceAPI, QWidget* parent = NULL);
virtual ~AirspyGui();
void destroy();
@ -56,7 +55,6 @@ public:
private:
Ui::AirspyGui* ui;
PluginAPI* m_pluginAPI;
DeviceAPI* m_deviceAPI;
AirspySettings m_settings;
QTimer m_updateTimer;

View File

@ -36,8 +36,7 @@ const PluginDescriptor AirspyPlugin::m_pluginDescriptor = {
const QString AirspyPlugin::m_deviceTypeID = AIRSPY_DEVICE_TYPE_ID;
AirspyPlugin::AirspyPlugin(QObject* parent) :
QObject(parent),
m_pluginAPI(0)
QObject(parent)
{
}
@ -48,8 +47,7 @@ const PluginDescriptor& AirspyPlugin::getPluginDescriptor() const
void AirspyPlugin::initPlugin(PluginAPI* pluginAPI)
{
m_pluginAPI = pluginAPI;
m_pluginAPI->registerSampleSource(m_deviceTypeID, this);
pluginAPI->registerSampleSource(m_deviceTypeID, this);
}
PluginInterface::SampleSourceDevices AirspyPlugin::enumSampleSources()
@ -120,14 +118,9 @@ PluginInterface::SampleSourceDevices AirspyPlugin::enumSampleSources()
PluginGUI* AirspyPlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceAPI *deviceAPI)
{
if (!m_pluginAPI)
{
return 0;
}
if (sourceId == m_deviceTypeID)
{
AirspyGui* gui = new AirspyGui(m_pluginAPI, deviceAPI);
AirspyGui* gui = new AirspyGui(deviceAPI);
*widget = gui;
return gui;
}

View File

@ -22,6 +22,8 @@
#define AIRSPY_DEVICE_TYPE_ID "sdrangel.samplesource.airspy"
class PluginAPI;
class AirspyPlugin : 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_AIRSPYPLUGIN_H

View File

@ -17,7 +17,6 @@
#include <QMessageBox>
#include "ui_fcdprogui.h"
#include "plugin/pluginapi.h"
#include "device/deviceapi.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
@ -27,10 +26,9 @@
#include "fcdprogui.h"
#include "fcdproconst.h"
FCDProGui::FCDProGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
FCDProGui::FCDProGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
ui(new Ui::FCDProGui),
m_pluginAPI(pluginAPI),
m_deviceAPI(deviceAPI),
m_settings(),
m_sampleSource(NULL),

View File

@ -22,9 +22,9 @@
#include "fcdproinput.h"
#include "plugin/plugingui.h"
class PluginAPI;
class DeviceAPI;
class FileSink;
class QWidget;
namespace Ui {
class FCDProGui;
@ -34,7 +34,7 @@ class FCDProGui : public QWidget, public PluginGUI {
Q_OBJECT
public:
explicit FCDProGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
explicit FCDProGui(DeviceAPI *deviceAPI, QWidget* parent = NULL);
virtual ~FCDProGui();
void destroy();
@ -52,7 +52,6 @@ public:
private:
Ui::FCDProGui* ui;
PluginAPI* m_pluginAPI;
DeviceAPI* m_deviceAPI;
FCDProSettings m_settings;
QTimer m_updateTimer;

View File

@ -46,9 +46,7 @@ const PluginDescriptor& FCDProPlugin::getPluginDescriptor() const
void FCDProPlugin::initPlugin(PluginAPI* pluginAPI)
{
m_pluginAPI = pluginAPI;
m_pluginAPI->registerSampleSource(fcd_traits<Pro>::interfaceIID, this);
pluginAPI->registerSampleSource(fcd_traits<Pro>::interfaceIID, this);
}
PluginInterface::SampleSourceDevices FCDProPlugin::enumSampleSources()
@ -79,7 +77,7 @@ PluginGUI* FCDProPlugin::createSampleSourcePluginGUI(const QString& sourceId, QW
{
if(sourceId == fcd_traits<Pro>::interfaceIID)
{
FCDProGui* gui = new FCDProGui(m_pluginAPI, deviceAPI);
FCDProGui* gui = new FCDProGui(deviceAPI);
*widget = gui;
return gui;
}

View File

@ -6,6 +6,8 @@
#define FCDPRO_DEVICE_TYPE_ID "sdrangel.samplesource.fcdpro"
class PluginAPI;
class FCDProPlugin : public QObject, public PluginInterface {
Q_OBJECT
Q_INTERFACES(PluginInterface)
@ -24,8 +26,6 @@ public:
private:
static const PluginDescriptor m_pluginDescriptor;
PluginAPI* m_pluginAPI;
};
#endif // INCLUDE_FCDPLUGIN_H

View File

@ -18,7 +18,6 @@
#include <QMessageBox>
#include "ui_fcdproplusgui.h"
#include "plugin/pluginapi.h"
#include "device/deviceapi.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
@ -28,10 +27,9 @@
#include "fcdproplusgui.h"
#include "fcdproplusconst.h"
FCDProPlusGui::FCDProPlusGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
FCDProPlusGui::FCDProPlusGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
ui(new Ui::FCDProPlusGui),
m_pluginAPI(pluginAPI),
m_deviceAPI(deviceAPI),
m_settings(),
m_sampleSource(NULL),

View File

@ -22,7 +22,6 @@
#include "fcdproplusinput.h"
#include "plugin/plugingui.h"
class PluginAPI;
class DeviceAPI;
class FileSink;
@ -34,7 +33,7 @@ class FCDProPlusGui : public QWidget, public PluginGUI {
Q_OBJECT
public:
explicit FCDProPlusGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
explicit FCDProPlusGui(DeviceAPI *deviceAPI, QWidget* parent = NULL);
virtual ~FCDProPlusGui();
void destroy();
@ -52,7 +51,6 @@ public:
private:
Ui::FCDProPlusGui* ui;
PluginAPI* m_pluginAPI;
DeviceAPI* m_deviceAPI;
FCDProPlusSettings m_settings;
QTimer m_updateTimer;

View File

@ -46,9 +46,7 @@ const PluginDescriptor& FCDProPlusPlugin::getPluginDescriptor() const
void FCDProPlusPlugin::initPlugin(PluginAPI* pluginAPI)
{
m_pluginAPI = pluginAPI;
m_pluginAPI->registerSampleSource(fcd_traits<ProPlus>::interfaceIID, this);
pluginAPI->registerSampleSource(fcd_traits<ProPlus>::interfaceIID, this);
}
PluginInterface::SampleSourceDevices FCDProPlusPlugin::enumSampleSources()
@ -79,7 +77,7 @@ PluginGUI* FCDProPlusPlugin::createSampleSourcePluginGUI(const QString& sourceId
{
if(sourceId == fcd_traits<ProPlus>::interfaceIID)
{
FCDProPlusGui* gui = new FCDProPlusGui(m_pluginAPI, deviceAPI);
FCDProPlusGui* gui = new FCDProPlusGui(deviceAPI);
*widget = gui;
return gui;
}

View File

@ -6,6 +6,8 @@
#define FCDPROPLUS_DEVICE_TYPE_ID "sdrangel.samplesource.fcdproplus"
class PluginAPI;
class FCDProPlusPlugin : public QObject, public PluginInterface {
Q_OBJECT
Q_INTERFACES(PluginInterface)
@ -24,8 +26,6 @@ public:
private:
static const PluginDescriptor m_pluginDescriptor;
PluginAPI* m_pluginAPI;
};
#endif // INCLUDE_FCDPROPLUSPLUGIN_H

View File

@ -34,10 +34,9 @@
#include "filesourcegui.h"
FileSourceGui::FileSourceGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
FileSourceGui::FileSourceGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
ui(new Ui::FileSourceGui),
m_pluginAPI(pluginAPI),
m_deviceAPI(deviceAPI),
m_settings(),
m_sampleSource(NULL),
@ -57,7 +56,7 @@ FileSourceGui::FileSourceGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget
ui->centerFrequency->setValueRange(7, 0, pow(10,7));
ui->fileNameText->setText(m_fileName);
connect(&(m_pluginAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
connect(&(m_deviceAPI->getMainWindow()->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus()));
m_statusTimer.start(500);
@ -67,7 +66,7 @@ FileSourceGui::FileSourceGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget
ui->playLoop->setChecked(true); // FIXME: always play in a loop
ui->playLoop->setEnabled(false);
m_sampleSource = new FileSourceInput(m_pluginAPI->getMainWindow()->getMasterTimer());
m_sampleSource = new FileSourceInput(m_deviceAPI->getMainWindow()->getMasterTimer());
connect(m_sampleSource->getOutputMessageQueueToGUI(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
m_deviceAPI->setSource(m_sampleSource);

View File

@ -22,7 +22,6 @@
#include "filesourceinput.h"
class PluginAPI;
class DeviceAPI;
namespace Ui {
@ -33,7 +32,7 @@ class FileSourceGui : public QWidget, public PluginGUI {
Q_OBJECT
public:
explicit FileSourceGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
explicit FileSourceGui(DeviceAPI *deviceAPI, QWidget* parent = NULL);
virtual ~FileSourceGui();
void destroy();
@ -50,7 +49,6 @@ public:
private:
Ui::FileSourceGui* ui;
PluginAPI* m_pluginAPI;
DeviceAPI* m_deviceAPI;
FileSourceInput::Settings m_settings;
QTimer m_statusTimer;

View File

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

View File

@ -22,6 +22,8 @@
#define FILESOURCE_DEVICE_TYPE_ID "sdrangel.samplesource.filesource"
class PluginAPI;
class FileSourcePlugin : 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_FILESOURCEPLUGIN_H

View File

@ -19,7 +19,6 @@
#include <libhackrf/hackrf.h>
#include "plugin/pluginapi.h"
#include "device/deviceapi.h"
#include "gui/colormapper.h"
#include "gui/glspectrum.h"
@ -29,10 +28,9 @@
#include "hackrfgui.h"
#include "ui_hackrfgui.h"
HackRFGui::HackRFGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
HackRFGui::HackRFGui(DeviceAPI *deviceAPI, QWidget* parent) :
QWidget(parent),
ui(new Ui::HackRFGui),
m_pluginAPI(pluginAPI),
m_deviceAPI(deviceAPI),
m_settings(),
m_sampleSource(NULL),

View File

@ -24,7 +24,6 @@
#define HACKRF_MAX_DEVICE (32)
class PluginAPI;
class DeviceAPI;
class FileSink;
@ -44,7 +43,7 @@ public:
HACKRF_IMGREJ_NB
} HackRFImgRejValue;
explicit HackRFGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
explicit HackRFGui(DeviceAPI *deviceAPI, QWidget* parent = NULL);
virtual ~HackRFGui();
void destroy();
@ -61,7 +60,6 @@ public:
private:
Ui::HackRFGui* ui;
PluginAPI* m_pluginAPI;
DeviceAPI* m_deviceAPI;
HackRFSettings m_settings;
QTimer m_updateTimer;

View File

@ -37,8 +37,7 @@ const PluginDescriptor HackRFPlugin::m_pluginDescriptor = {
const QString HackRFPlugin::m_deviceTypeID = HACKRF_DEVICE_TYPE_ID;
HackRFPlugin::HackRFPlugin(QObject* parent) :
QObject(parent),
m_pluginAPI(0)
QObject(parent)
{
}
@ -49,8 +48,7 @@ const PluginDescriptor& HackRFPlugin::getPluginDescriptor() const
void HackRFPlugin::initPlugin(PluginAPI* pluginAPI)
{
m_pluginAPI = pluginAPI;
m_pluginAPI->registerSampleSource(m_deviceTypeID, this);
pluginAPI->registerSampleSource(m_deviceTypeID, this);
}
PluginInterface::SampleSourceDevices HackRFPlugin::enumSampleSources()
@ -115,14 +113,9 @@ PluginInterface::SampleSourceDevices HackRFPlugin::enumSampleSources()
PluginGUI* HackRFPlugin::createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceAPI *deviceAPI)
{
if (!m_pluginAPI)
{
return 0;
}
if(sourceId == m_deviceTypeID)
{
HackRFGui* gui = new HackRFGui(m_pluginAPI, deviceAPI);
HackRFGui* gui = new HackRFGui(deviceAPI);
*widget = gui;
return gui;
}

View File

@ -22,6 +22,8 @@
#define HACKRF_DEVICE_TYPE_ID "sdrangel.samplesource.hackrf"
class PluginAPI;
class HackRFPlugin : 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_HACKRFPLUGIN_H