1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-23 00:18:37 -05:00
sdrangel/sdrbase/plugin/pluginapi.h

96 lines
2.9 KiB
C
Raw Normal View History

#ifndef INCLUDE_PLUGINAPI_H
#define INCLUDE_PLUGINAPI_H
#include <QObject>
#include <QList>
#include "export.h"
#include "plugin/plugininterface.h"
2016-05-14 22:38:37 -04:00
class QString;
class PluginManager;
class MessageQueue;
2018-03-03 14:23:38 -05:00
class SDRBASE_API PluginAPI : public QObject {
Q_OBJECT
public:
2017-11-01 22:30:54 -04:00
struct SamplingDeviceRegistration //!< This is the device registration
{
QString m_deviceHardwareId;
2017-11-01 22:30:54 -04:00
QString m_deviceId;
PluginInterface* m_plugin;
SamplingDeviceRegistration(const QString& hardwareId, const QString& deviceId, PluginInterface* plugin) :
m_deviceHardwareId(hardwareId),
2017-11-01 22:30:54 -04:00
m_deviceId(deviceId),
m_plugin(plugin)
{ }
};
typedef QList<SamplingDeviceRegistration> SamplingDeviceRegistrations;
struct ChannelRegistration
{
QString m_channelIdURI; //!< Channel type ID in URI form
QString m_channelId; //!< Channel type ID in short form from object name
PluginInterface* m_plugin;
ChannelRegistration(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin) :
m_channelIdURI(channelIdURI),
m_channelId(channelId),
m_plugin(plugin)
{ }
};
typedef QList<ChannelRegistration> ChannelRegistrations;
struct FeatureRegistration
{
QString m_featureIdURI; //!< Feature type ID in URI form
QString m_featureId; //!< Feature type ID in short form from object name
PluginInterface *m_plugin;
FeatureRegistration(const QString& featureIdURI, const QString& featureId, PluginInterface* plugin) :
m_featureIdURI(featureIdURI),
m_featureId(featureId),
m_plugin(plugin)
{ }
};
typedef QList<FeatureRegistration> FeatureRegistrations;
// Rx Channel stuff
void registerRxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
2016-10-13 16:23:43 -04:00
ChannelRegistrations *getRxChannelRegistrations();
// Tx Channel stuff
void registerTxChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
ChannelRegistrations *getTxChannelRegistrations();
// MIMO Channel stuff
void registerMIMOChannel(const QString& channelIdURI, const QString& channelId, PluginInterface* plugin);
ChannelRegistrations *getMIMOChannelRegistrations();
// Sample Source stuff
void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
// Sample Sink stuff
void registerSampleSink(const QString& sinkName, PluginInterface* plugin);
// Sample MIMO stuff
void registerSampleMIMO(const QString& sinkName, PluginInterface* plugin);
// Feature stuff
void registerFeature(const QString& featureIdURI, const QString& featureId, PluginInterface* plugin);
FeatureRegistrations *getFeatureRegistrations();
protected:
PluginManager* m_pluginManager;
PluginAPI(PluginManager* pluginManager);
~PluginAPI();
friend class PluginManager;
};
#endif // INCLUDE_PLUGINAPI_H