2014-05-18 15:52:39 +00:00
|
|
|
#ifndef INCLUDE_PLUGININTERFACE_H
|
|
|
|
#define INCLUDE_PLUGININTERFACE_H
|
|
|
|
|
|
|
|
#include <QtPlugin>
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
struct PluginDescriptor {
|
|
|
|
// general plugin description
|
|
|
|
const QString displayedName;
|
|
|
|
const QString version;
|
|
|
|
const QString copyright;
|
|
|
|
const QString website;
|
|
|
|
bool licenseIsGPL;
|
|
|
|
const QString sourceCodeURL;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PluginAPI;
|
2016-10-10 23:17:55 +00:00
|
|
|
class DeviceSourceAPI;
|
2016-10-14 16:47:19 +00:00
|
|
|
class DeviceSinkAPI;
|
2014-05-18 15:52:39 +00:00
|
|
|
class PluginGUI;
|
2016-05-17 01:41:01 +00:00
|
|
|
class QWidget;
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
class PluginInterface {
|
|
|
|
public:
|
2016-10-13 20:23:43 +00:00
|
|
|
struct SamplingDevice
|
2015-09-30 04:57:40 +00:00
|
|
|
{
|
2014-05-18 15:52:39 +00:00
|
|
|
QString displayedName;
|
2016-12-29 11:41:10 +00:00
|
|
|
QString hardwareId;
|
2015-09-30 04:57:40 +00:00
|
|
|
QString id;
|
|
|
|
QString serial;
|
|
|
|
int sequence;
|
|
|
|
|
2016-10-13 20:23:43 +00:00
|
|
|
SamplingDevice(const QString& _displayedName,
|
2016-12-29 11:41:10 +00:00
|
|
|
const QString& _hardwareId,
|
2015-09-30 04:57:40 +00:00
|
|
|
const QString& _id,
|
|
|
|
const QString& _serial,
|
|
|
|
int _sequence) :
|
2014-05-18 15:52:39 +00:00
|
|
|
displayedName(_displayedName),
|
2016-12-29 11:41:10 +00:00
|
|
|
hardwareId(_hardwareId),
|
2015-09-30 04:57:40 +00:00
|
|
|
id(_id),
|
|
|
|
serial(_serial),
|
|
|
|
sequence(_sequence)
|
2014-05-18 15:52:39 +00:00
|
|
|
{ }
|
|
|
|
};
|
2016-10-13 20:23:43 +00:00
|
|
|
typedef QList<SamplingDevice> SamplingDevices;
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
virtual ~PluginInterface() { };
|
|
|
|
|
|
|
|
virtual const PluginDescriptor& getPluginDescriptor() const = 0;
|
|
|
|
virtual void initPlugin(PluginAPI* pluginAPI) = 0;
|
|
|
|
|
2016-10-13 21:42:08 +00:00
|
|
|
// channel Rx plugins
|
|
|
|
virtual PluginGUI* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) { return 0; }
|
2014-05-18 15:52:39 +00:00
|
|
|
|
2016-10-14 16:47:19 +00:00
|
|
|
// channel Tx plugins
|
2016-10-17 22:03:51 +00:00
|
|
|
virtual PluginGUI* createTxChannel(const QString& channelName, DeviceSinkAPI *deviceAPI) { return 0; }
|
2016-10-14 16:47:19 +00:00
|
|
|
|
|
|
|
// device source plugins only
|
2016-10-13 20:23:43 +00:00
|
|
|
virtual SamplingDevices enumSampleSources() { return SamplingDevices(); }
|
2016-10-14 16:47:19 +00:00
|
|
|
virtual PluginGUI* createSampleSourcePluginGUI(const QString& sourceId, QWidget **widget, DeviceSourceAPI *deviceAPI) { return 0; }
|
|
|
|
|
|
|
|
// device sink plugins only
|
|
|
|
virtual SamplingDevices enumSampleSinks() { return SamplingDevices(); }
|
|
|
|
virtual PluginGUI* createSampleSinkPluginGUI(const QString& sinkId, QWidget **widget, DeviceSinkAPI *deviceAPI) { return 0; }
|
2014-05-18 15:52:39 +00:00
|
|
|
};
|
|
|
|
|
2015-10-05 02:47:23 +00:00
|
|
|
Q_DECLARE_INTERFACE(PluginInterface, "SDRangel.PluginInterface/0.1");
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
#endif // INCLUDE_PLUGININTERFACE_H
|