2014-05-18 15:52:39 +00:00
|
|
|
#ifndef INCLUDE_PLUGINAPI_H
|
|
|
|
#define INCLUDE_PLUGINAPI_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2016-05-16 16:34:23 +00:00
|
|
|
#include <QList>
|
|
|
|
|
2014-05-18 15:52:39 +00:00
|
|
|
#include "util/export.h"
|
2017-11-01 19:06:33 +00:00
|
|
|
#include "plugin/plugininterface.h"
|
2014-05-18 15:52:39 +00:00
|
|
|
|
2016-05-15 02:38:37 +00:00
|
|
|
class QString;
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
class PluginManager;
|
2016-05-16 08:35:36 +00:00
|
|
|
class MessageQueue;
|
2017-09-25 22:22:08 +00:00
|
|
|
class PluginInstanceGUI;
|
2014-05-18 15:52:39 +00:00
|
|
|
|
2015-08-29 23:26:51 +00:00
|
|
|
class SDRANGEL_API PluginAPI : public QObject {
|
2014-05-18 15:52:39 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-11-02 02:30:54 +00: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 16:34:23 +00:00
|
|
|
struct ChannelRegistration
|
|
|
|
{
|
2017-11-23 00:19:32 +00: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 16:34:23 +00:00
|
|
|
PluginInterface* m_plugin;
|
2017-11-23 00:19:32 +00:00
|
|
|
ChannelRegistration(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin) :
|
|
|
|
m_channelIdURI(channelIdURI),
|
2017-11-01 12:03:12 +00:00
|
|
|
m_channelId(channelId),
|
2016-05-16 16:34:23 +00:00
|
|
|
m_plugin(plugin)
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<ChannelRegistration> ChannelRegistrations;
|
|
|
|
|
2016-10-19 16:07:27 +00:00
|
|
|
// Rx Channel stuff
|
2017-11-23 00:19:32 +00:00
|
|
|
void registerRxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
|
2016-10-13 20:23:43 +00:00
|
|
|
ChannelRegistrations *getRxChannelRegistrations();
|
2014-05-18 15:52:39 +00:00
|
|
|
|
2016-10-19 16:07:27 +00:00
|
|
|
// Tx Channel stuff
|
2017-11-23 00:19:32 +00:00
|
|
|
void registerTxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
|
2016-10-19 16:07:27 +00:00
|
|
|
ChannelRegistrations *getTxChannelRegistrations();
|
|
|
|
|
2014-05-18 15:52:39 +00:00
|
|
|
// Sample Source stuff
|
|
|
|
void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
|
|
|
|
|
2016-10-19 16:07:27 +00:00
|
|
|
// Sample Sink stuff
|
|
|
|
void registerSampleSink(const QString& sinkName, PluginInterface* plugin);
|
|
|
|
|
2014-05-18 15:52:39 +00:00
|
|
|
protected:
|
|
|
|
PluginManager* m_pluginManager;
|
|
|
|
|
2017-10-24 12:01:31 +00:00
|
|
|
PluginAPI(PluginManager* pluginManager);
|
2016-05-13 09:42:03 +00:00
|
|
|
~PluginAPI();
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
friend class PluginManager;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_PLUGINAPI_H
|