mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-01 21:54:55 -04:00
Multi device support: remainder source plugins: removed useless dependencies on plugin API
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user