mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 17:58:43 -05:00
Multi device support: BladeRF plugin removed useless dependencies on plugin API
This commit is contained in:
parent
1974b375ee
commit
35df869115
@ -20,7 +20,6 @@
|
||||
#include <libbladeRF.h>
|
||||
|
||||
#include "ui_bladerfgui.h"
|
||||
#include "plugin/pluginapi.h"
|
||||
#include "device/deviceapi.h"
|
||||
#include "gui/colormapper.h"
|
||||
#include "gui/glspectrum.h"
|
||||
@ -29,10 +28,9 @@
|
||||
#include "dsp/filesink.h"
|
||||
#include "bladerfgui.h"
|
||||
|
||||
BladerfGui::BladerfGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent) :
|
||||
BladerfGui::BladerfGui(DeviceAPI *deviceAPI, QWidget* parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::BladerfGui),
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_deviceAPI(deviceAPI),
|
||||
m_settings(),
|
||||
m_sampleSource(NULL),
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
#include "bladerfinput.h"
|
||||
|
||||
class PluginAPI;
|
||||
class DeviceAPI;
|
||||
class FileSink;
|
||||
|
||||
@ -35,7 +34,7 @@ class BladerfGui : public QWidget, public PluginGUI {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BladerfGui(PluginAPI* pluginAPI, DeviceAPI *deviceAPI, QWidget* parent = NULL);
|
||||
explicit BladerfGui(DeviceAPI *deviceAPI, QWidget* parent = NULL);
|
||||
virtual ~BladerfGui();
|
||||
void destroy();
|
||||
|
||||
@ -52,7 +51,6 @@ public:
|
||||
private:
|
||||
Ui::BladerfGui* ui;
|
||||
|
||||
PluginAPI* m_pluginAPI;
|
||||
DeviceAPI* m_deviceAPI;
|
||||
BladeRFSettings m_settings;
|
||||
QTimer m_updateTimer;
|
||||
|
@ -35,8 +35,7 @@ const PluginDescriptor BlderfPlugin::m_pluginDescriptor = {
|
||||
const QString BlderfPlugin::m_deviceTypeID = BLADERF_DEVICE_TYPE_ID;
|
||||
|
||||
BlderfPlugin::BlderfPlugin(QObject* parent) :
|
||||
QObject(parent),
|
||||
m_pluginAPI(0)
|
||||
QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -47,8 +46,7 @@ const PluginDescriptor& BlderfPlugin::getPluginDescriptor() const
|
||||
|
||||
void BlderfPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
{
|
||||
m_pluginAPI = pluginAPI;
|
||||
m_pluginAPI->registerSampleSource(m_deviceTypeID, this);
|
||||
pluginAPI->registerSampleSource(m_deviceTypeID, this);
|
||||
}
|
||||
|
||||
PluginInterface::SampleSourceDevices BlderfPlugin::enumSampleSources()
|
||||
@ -78,14 +76,9 @@ PluginInterface::SampleSourceDevices BlderfPlugin::enumSampleSources()
|
||||
|
||||
PluginGUI* BlderfPlugin::createSampleSourcePluginGUI(const QString& sourceId,QWidget **widget, DeviceAPI *deviceAPI)
|
||||
{
|
||||
if (!m_pluginAPI)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(sourceId == m_deviceTypeID)
|
||||
{
|
||||
BladerfGui* gui = new BladerfGui(m_pluginAPI, deviceAPI);
|
||||
BladerfGui* gui = new BladerfGui(deviceAPI);
|
||||
*widget = gui;
|
||||
return gui;
|
||||
}
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include <QObject>
|
||||
#include "plugin/plugininterface.h"
|
||||
|
||||
class PluginAPI;
|
||||
|
||||
#define BLADERF_DEVICE_TYPE_ID "sdrangel.samplesource.bladerf"
|
||||
|
||||
class BlderfPlugin : public QObject, public PluginInterface {
|
||||
@ -40,8 +42,6 @@ public:
|
||||
|
||||
private:
|
||||
static const PluginDescriptor m_pluginDescriptor;
|
||||
|
||||
PluginAPI* m_pluginAPI;
|
||||
};
|
||||
|
||||
#endif // INCLUDE_BLADERFPLUGIN_H
|
||||
|
Loading…
Reference in New Issue
Block a user