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"
|
|
|
|
|
2016-05-15 02:38:37 +00:00
|
|
|
class QString;
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
class PluginManager;
|
|
|
|
class PluginInterface;
|
|
|
|
class MainWindow;
|
2016-05-16 08:35:36 +00:00
|
|
|
class MessageQueue;
|
2014-05-18 15:52:39 +00:00
|
|
|
class PluginGUI;
|
|
|
|
|
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:
|
2016-05-16 16:34:23 +00:00
|
|
|
struct ChannelRegistration
|
|
|
|
{
|
|
|
|
QString m_channelName;
|
|
|
|
PluginInterface* m_plugin;
|
|
|
|
ChannelRegistration(const QString& channelName, PluginInterface* plugin) :
|
|
|
|
m_channelName(channelName),
|
|
|
|
m_plugin(plugin)
|
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<ChannelRegistration> ChannelRegistrations;
|
|
|
|
|
2014-05-18 15:52:39 +00:00
|
|
|
// MainWindow access
|
|
|
|
MessageQueue* getMainWindowMessageQueue();
|
|
|
|
|
2016-10-19 16:07:27 +00:00
|
|
|
// Rx Channel stuff
|
2016-10-13 20:23:43 +00:00
|
|
|
void registerRxChannel(const QString& channelName, PluginInterface* plugin);
|
|
|
|
ChannelRegistrations *getRxChannelRegistrations();
|
2014-05-18 15:52:39 +00:00
|
|
|
|
2016-10-19 16:07:27 +00:00
|
|
|
// Tx Channel stuff
|
|
|
|
void registerTxChannel(const QString& channelName, PluginInterface* plugin);
|
|
|
|
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);
|
|
|
|
|
2015-08-01 02:07:09 +00:00
|
|
|
// R/O access to main window
|
|
|
|
const MainWindow* getMainWindow() const { return m_mainWindow; }
|
|
|
|
|
2014-05-18 15:52:39 +00:00
|
|
|
protected:
|
|
|
|
PluginManager* m_pluginManager;
|
|
|
|
MainWindow* m_mainWindow;
|
|
|
|
|
2016-05-11 14:03:03 +00:00
|
|
|
PluginAPI(PluginManager* pluginManager, MainWindow* mainWindow);
|
2016-05-13 09:42:03 +00:00
|
|
|
~PluginAPI();
|
2014-05-18 15:52:39 +00:00
|
|
|
|
|
|
|
friend class PluginManager;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_PLUGINAPI_H
|