SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
plugininterface.h
Go to the documentation of this file.
1 #ifndef INCLUDE_PLUGININTERFACE_H
2 #define INCLUDE_PLUGININTERFACE_H
3 
4 #include <QtPlugin>
5 #include <QString>
6 
7 #include "export.h"
8 
10  // general plugin description
11  const QString displayedName;
12  const QString version;
13  const QString copyright;
14  const QString website;
16  const QString sourceCodeURL;
17 };
18 
19 class PluginAPI;
20 class DeviceAPI;
21 class DeviceUISet;
22 class PluginInstanceGUI;
23 class QWidget;
24 class DeviceSampleSource;
25 class DeviceSampleSink;
26 class DeviceSampleMIMO;
27 class BasebandSampleSink;
29 class ChannelAPI;
30 
32 public:
34  {
36  {
38  BuiltInDevice
39  };
40 
42  {
45  StreamMIMO
46  };
47 
48  QString displayedName;
49  QString hardwareId;
50  QString id;
51  QString serial;
52  int sequence;
57  int claimed;
58 
59  SamplingDevice(const QString& _displayedName,
60  const QString& _hardwareId,
61  const QString& _id,
62  const QString& _serial,
63  int _sequence,
64  SamplingDeviceType _type,
65  StreamType _streamType,
66  int _deviceNbItems,
67  int _deviceItemIndex) :
68  displayedName(_displayedName),
69  hardwareId(_hardwareId),
70  id(_id),
71  serial(_serial),
72  sequence(_sequence),
73  type(_type),
74  streamType(_streamType),
75  deviceNbItems(_deviceNbItems),
76  deviceItemIndex(_deviceItemIndex),
77  claimed(-1)
78  { }
79  };
80  typedef QList<SamplingDevice> SamplingDevices;
81 
82  virtual ~PluginInterface() { }
83 
84  virtual const PluginDescriptor& getPluginDescriptor() const = 0;
85  virtual void initPlugin(PluginAPI* pluginAPI) = 0;
86 
87  // channel Rx plugins
88 
90  DeviceUISet *deviceUISet,
91  BasebandSampleSink *rxChannel)
92  {
93  (void) deviceUISet;
94  (void) rxChannel;
95  return nullptr;
96  }
97 
99  DeviceAPI *deviceAPI)
100  {
101  (void) deviceAPI;
102  return nullptr;
103  }
104 
106  DeviceAPI *deviceAPI)
107  {
108  (void) deviceAPI;
109  return nullptr;
110  }
111 
112  // channel Tx plugins
113 
115  DeviceUISet *deviceUISet,
116  BasebandSampleSource *txChannel)
117  {
118  (void) deviceUISet;
119  (void) txChannel;
120  return nullptr;
121  }
122 
124  DeviceAPI *deviceAPI)
125  {
126  (void) deviceAPI;
127  return nullptr;
128  }
129 
131  DeviceAPI *deviceAPI)
132  {
133  (void) deviceAPI;
134  return nullptr;
135  }
136 
137  // device source plugins only
138 
139  virtual SamplingDevices enumSampleSources() { return SamplingDevices(); }
140 
142  const QString& sourceId,
143  QWidget **widget,
144  DeviceUISet *deviceUISet)
145  {
146  (void) sourceId;
147  (void) widget;
148  (void) deviceUISet;
149  return nullptr;
150  }
151 
152  virtual DeviceSampleSource* createSampleSourcePluginInstance( // creates the input "core"
153  const QString& sourceId,
154  DeviceAPI *deviceAPI)
155  {
156  (void) sourceId;
157  (void) deviceAPI;
158  return nullptr;
159  }
160  virtual void deleteSampleSourcePluginInstanceGUI(PluginInstanceGUI *ui);
161  virtual void deleteSampleSourcePluginInstanceInput(DeviceSampleSource *source);
162 
163  // device sink plugins only
164 
165  virtual SamplingDevices enumSampleSinks() { return SamplingDevices(); }
166 
168  const QString& sinkId,
169  QWidget **widget,
170  DeviceUISet *deviceUISet)
171  {
172  (void) sinkId;
173  (void) widget;
174  (void) deviceUISet;
175  return nullptr;
176  }
177 
178  virtual DeviceSampleSink* createSampleSinkPluginInstance( // creates the output "core"
179  const QString& sinkId,
180  DeviceAPI *deviceAPI)
181  {
182  (void) sinkId;
183  (void) deviceAPI;
184  return nullptr;
185  }
186 
187  virtual void deleteSampleSinkPluginInstanceGUI(PluginInstanceGUI *ui);
188  virtual void deleteSampleSinkPluginInstanceOutput(DeviceSampleSink *sink);
189 
190  // device MIMO plugins only
191 
192  virtual SamplingDevices enumSampleMIMO() { return SamplingDevices(); }
193 
195  const QString& mimoId,
196  QWidget **widget,
197  DeviceUISet *deviceUISet)
198  {
199  (void) mimoId;
200  (void) widget;
201  (void) deviceUISet;
202  return nullptr;
203  }
204 
205  virtual DeviceSampleMIMO* createSampleMIMOPluginInstance( // creates the MIMO "core"
206  const QString& mimoId,
207  DeviceAPI *deviceAPI)
208  {
209  (void) mimoId;
210  (void) deviceAPI;
211  return nullptr;
212  }
213 
214  virtual void deleteSampleMIMOPluginInstanceGUI(PluginInstanceGUI *ui);
215  virtual void deleteSampleMIMOPluginInstanceMIMO(DeviceSampleMIMO *mimo);
216 
217 };
218 
219 Q_DECLARE_INTERFACE(PluginInterface, "SDRangel.PluginInterface/0.1");
220 
221 #endif // INCLUDE_PLUGININTERFACE_H
const QString version
const QString displayedName
virtual DeviceSampleSource * createSampleSourcePluginInstance(const QString &sourceId, DeviceAPI *deviceAPI)
int sequence
The device sequence. >0 when more than one device of the same type is connected.
const QString copyright
QString displayedName
The human readable name.
virtual BasebandSampleSink * createRxChannelBS(DeviceAPI *deviceAPI)
virtual ~PluginInterface()
virtual DeviceSampleMIMO * createSampleMIMOPluginInstance(const QString &mimoId, DeviceAPI *deviceAPI)
virtual PluginInstanceGUI * createSampleSinkPluginInstanceGUI(const QString &sinkId, QWidget **widget, DeviceUISet *deviceUISet)
virtual SamplingDevices enumSampleSources()
QString hardwareId
The internal id that identifies the type of hardware (i.e. HackRF, BladeRF, ...)
SamplingDeviceType type
The sampling device type for behavior information.
SamplingDevice(const QString &_displayedName, const QString &_hardwareId, const QString &_id, const QString &_serial, int _sequence, SamplingDeviceType _type, StreamType _streamType, int _deviceNbItems, int _deviceItemIndex)
virtual SamplingDevices enumSampleSinks()
Q_DECLARE_INTERFACE(PluginInterface, "SDRangel.PluginInterface/0.1")
virtual ChannelAPI * createRxChannelCS(DeviceAPI *deviceAPI)
int deviceNbItems
Number of items (or streams) in the device. >1 for composite devices.
virtual PluginInstanceGUI * createSampleMIMOPluginInstanceGUI(const QString &mimoId, QWidget **widget, DeviceUISet *deviceUISet)
virtual PluginInstanceGUI * createSampleSourcePluginInstanceGUI(const QString &sourceId, QWidget **widget, DeviceUISet *deviceUISet)
const QString sourceCodeURL
virtual PluginInstanceGUI * createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
virtual DeviceSampleSink * createSampleSinkPluginInstance(const QString &sinkId, DeviceAPI *deviceAPI)
int claimed
This is the device set index if claimed else -1.
QString id
The internal plugin ID corresponding to the device (i.e. for HackRF input, for HackRF output ...
Exposes a single output stream that can be one of the streams of a physical device.
QString serial
The device serial number defined by the vendor or a fake one (SDRplay)
Exposes a single input stream that can be one of the streams of a physical device.
virtual PluginInstanceGUI * createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
StreamType streamType
This is the type of stream supported.
#define SDRBASE_API
Definition: export.h:40
virtual BasebandSampleSource * createTxChannelBS(DeviceAPI *deviceAPI)
int deviceItemIndex
For composite devices this is the Rx or Tx stream index. -1 if not initialized.
QList< SamplingDevice > SamplingDevices
const QString website
virtual SamplingDevices enumSampleMIMO()
virtual ChannelAPI * createTxChannelCS(DeviceAPI *deviceAPI)