mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-25 04:03:30 -05:00
70 lines
2.1 KiB
C++
70 lines
2.1 KiB
C++
#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;
|
|
class DeviceSourceAPI;
|
|
class DeviceSinkAPI;
|
|
class PluginGUI;
|
|
class QWidget;
|
|
|
|
class PluginInterface {
|
|
public:
|
|
struct SamplingDevice
|
|
{
|
|
QString displayedName;
|
|
QString hardwareId;
|
|
QString id;
|
|
QString serial;
|
|
int sequence;
|
|
|
|
SamplingDevice(const QString& _displayedName,
|
|
const QString& _hardwareId,
|
|
const QString& _id,
|
|
const QString& _serial,
|
|
int _sequence) :
|
|
displayedName(_displayedName),
|
|
hardwareId(_hardwareId),
|
|
id(_id),
|
|
serial(_serial),
|
|
sequence(_sequence)
|
|
{ }
|
|
};
|
|
typedef QList<SamplingDevice> SamplingDevices;
|
|
|
|
virtual ~PluginInterface() { };
|
|
|
|
virtual const PluginDescriptor& getPluginDescriptor() const = 0;
|
|
virtual void initPlugin(PluginAPI* pluginAPI) = 0;
|
|
|
|
// channel Rx plugins
|
|
virtual PluginGUI* createRxChannel(const QString& channelName __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused)) ) { return 0; }
|
|
|
|
// channel Tx plugins
|
|
virtual PluginGUI* createTxChannel(const QString& channelName __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused)) ) { return 0; }
|
|
|
|
// device source plugins only
|
|
virtual SamplingDevices enumSampleSources() { return SamplingDevices(); }
|
|
virtual PluginGUI* createSampleSourcePluginGUI(const QString& sourceId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSourceAPI *deviceAPI __attribute__((unused))) { return 0; }
|
|
|
|
// device sink plugins only
|
|
virtual SamplingDevices enumSampleSinks() { return SamplingDevices(); }
|
|
virtual PluginGUI* createSampleSinkPluginGUI(const QString& sinkId __attribute__((unused)), QWidget **widget __attribute__((unused)), DeviceSinkAPI *deviceAPI __attribute__((unused))) { return 0; }
|
|
};
|
|
|
|
Q_DECLARE_INTERFACE(PluginInterface, "SDRangel.PluginInterface/0.1");
|
|
|
|
#endif // INCLUDE_PLUGININTERFACE_H
|