2014-05-18 11:52:39 -04: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 19:17:55 -04:00
|
|
|
class DeviceSourceAPI;
|
2016-10-14 12:47:19 -04:00
|
|
|
class DeviceSinkAPI;
|
2017-09-03 13:55:00 -04:00
|
|
|
class PluginInstanceUI;
|
2016-05-16 21:41:01 -04:00
|
|
|
class QWidget;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
class PluginInterface {
|
|
|
|
public:
|
2016-10-13 16:23:43 -04:00
|
|
|
struct SamplingDevice
|
2015-09-30 00:57:40 -04:00
|
|
|
{
|
2014-05-18 11:52:39 -04:00
|
|
|
QString displayedName;
|
2016-12-29 06:41:10 -05:00
|
|
|
QString hardwareId;
|
2015-09-30 00:57:40 -04:00
|
|
|
QString id;
|
|
|
|
QString serial;
|
|
|
|
int sequence;
|
|
|
|
|
2016-10-13 16:23:43 -04:00
|
|
|
SamplingDevice(const QString& _displayedName,
|
2016-12-29 06:41:10 -05:00
|
|
|
const QString& _hardwareId,
|
2015-09-30 00:57:40 -04:00
|
|
|
const QString& _id,
|
|
|
|
const QString& _serial,
|
|
|
|
int _sequence) :
|
2014-05-18 11:52:39 -04:00
|
|
|
displayedName(_displayedName),
|
2016-12-29 06:41:10 -05:00
|
|
|
hardwareId(_hardwareId),
|
2015-09-30 00:57:40 -04:00
|
|
|
id(_id),
|
|
|
|
serial(_serial),
|
|
|
|
sequence(_sequence)
|
2014-05-18 11:52:39 -04:00
|
|
|
{ }
|
|
|
|
};
|
2016-10-13 16:23:43 -04:00
|
|
|
typedef QList<SamplingDevice> SamplingDevices;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
virtual ~PluginInterface() { };
|
|
|
|
|
|
|
|
virtual const PluginDescriptor& getPluginDescriptor() const = 0;
|
|
|
|
virtual void initPlugin(PluginAPI* pluginAPI) = 0;
|
|
|
|
|
2016-10-13 17:42:08 -04:00
|
|
|
// channel Rx plugins
|
2017-09-03 13:55:00 -04:00
|
|
|
virtual PluginInstanceUI* createRxChannel(const QString& channelName __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused)) ) { return 0; }
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2016-10-14 12:47:19 -04:00
|
|
|
// channel Tx plugins
|
2017-09-03 13:55:00 -04:00
|
|
|
virtual PluginInstanceUI* createTxChannel(const QString& channelName __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused)) ) { return 0; }
|
2016-10-14 12:47:19 -04:00
|
|
|
|
|
|
|
// device source plugins only
|
2016-10-13 16:23:43 -04:00
|
|
|
virtual SamplingDevices enumSampleSources() { return SamplingDevices(); }
|
2017-09-03 14:24:17 -04:00
|
|
|
virtual PluginInstanceUI* createSampleSourcePluginInstanceUI(const QString& sourceId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused))) { return 0; }
|
2016-10-14 12:47:19 -04:00
|
|
|
|
|
|
|
// device sink plugins only
|
|
|
|
virtual SamplingDevices enumSampleSinks() { return SamplingDevices(); }
|
2017-09-03 14:24:17 -04:00
|
|
|
virtual PluginInstanceUI* createSampleSinkPluginInstanceUI(const QString& sinkId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused))) { return 0; }
|
2014-05-18 11:52:39 -04:00
|
|
|
};
|
|
|
|
|
2015-10-04 22:47:23 -04:00
|
|
|
Q_DECLARE_INTERFACE(PluginInterface, "SDRangel.PluginInterface/0.1");
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
#endif // INCLUDE_PLUGININTERFACE_H
|