2014-05-18 11:52:39 -04:00
|
|
|
#ifndef INCLUDE_PLUGINAPI_H
|
|
|
|
#define INCLUDE_PLUGINAPI_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2016-05-16 12:34:23 -04:00
|
|
|
#include <QList>
|
|
|
|
|
2018-03-20 08:49:21 -04:00
|
|
|
#include "export.h"
|
2017-11-01 15:06:33 -04:00
|
|
|
#include "plugin/plugininterface.h"
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2016-05-14 22:38:37 -04:00
|
|
|
class QString;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
class PluginManager;
|
2016-05-16 04:35:36 -04:00
|
|
|
class MessageQueue;
|
2017-09-25 18:22:08 -04:00
|
|
|
class PluginInstanceGUI;
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2018-03-03 14:23:38 -05:00
|
|
|
class SDRBASE_API PluginAPI : public QObject {
|
2014-05-18 11:52:39 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-11-01 22:30:54 -04:00
|
|
|
struct SamplingDeviceRegistration //!< This is the device registration
|
|
|
|
{
|
|
|
|
QString m_deviceId;
|
|
|
|
PluginInterface* m_plugin;
|
|
|
|
SamplingDeviceRegistration(const QString& deviceId, PluginInterface* plugin) :
|
|
|
|
m_deviceId(deviceId),
|
|
|
|
m_plugin(plugin)
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<SamplingDeviceRegistration> SamplingDeviceRegistrations;
|
|
|
|
|
2016-05-16 12:34:23 -04:00
|
|
|
struct ChannelRegistration
|
|
|
|
{
|
2017-11-22 19:19:32 -05:00
|
|
|
QString m_channelIdURI; //!< Channel type ID in URI form
|
|
|
|
QString m_channelId; //!< Channel type ID in short form from object name
|
2016-05-16 12:34:23 -04:00
|
|
|
PluginInterface* m_plugin;
|
2017-11-22 19:19:32 -05:00
|
|
|
ChannelRegistration(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin) :
|
|
|
|
m_channelIdURI(channelIdURI),
|
2017-11-01 08:03:12 -04:00
|
|
|
m_channelId(channelId),
|
2016-05-16 12:34:23 -04:00
|
|
|
m_plugin(plugin)
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<ChannelRegistration> ChannelRegistrations;
|
|
|
|
|
2016-10-19 12:07:27 -04:00
|
|
|
// Rx Channel stuff
|
2017-11-22 19:19:32 -05:00
|
|
|
void registerRxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
|
2016-10-13 16:23:43 -04:00
|
|
|
ChannelRegistrations *getRxChannelRegistrations();
|
2014-05-18 11:52:39 -04:00
|
|
|
|
2016-10-19 12:07:27 -04:00
|
|
|
// Tx Channel stuff
|
2017-11-22 19:19:32 -05:00
|
|
|
void registerTxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
|
2016-10-19 12:07:27 -04:00
|
|
|
ChannelRegistrations *getTxChannelRegistrations();
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
// Sample Source stuff
|
|
|
|
void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
|
|
|
|
|
2016-10-19 12:07:27 -04:00
|
|
|
// Sample Sink stuff
|
|
|
|
void registerSampleSink(const QString& sinkName, PluginInterface* plugin);
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
protected:
|
|
|
|
PluginManager* m_pluginManager;
|
|
|
|
|
2017-10-24 08:01:31 -04:00
|
|
|
PluginAPI(PluginManager* pluginManager);
|
2016-05-13 05:42:03 -04:00
|
|
|
~PluginAPI();
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
friend class PluginManager;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_PLUGINAPI_H
|