2014-05-18 11:52:39 -04:00
|
|
|
#ifndef INCLUDE_PLUGINAPI_H
|
|
|
|
#define INCLUDE_PLUGINAPI_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include "util/export.h"
|
2016-05-11 17:35:16 -04:00
|
|
|
#include "dsp/dspdeviceengine.h"
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
class QDockWidget;
|
|
|
|
class QAction;
|
|
|
|
|
|
|
|
class PluginManager;
|
|
|
|
class PluginInterface;
|
|
|
|
class SampleSource;
|
|
|
|
class SampleSink;
|
|
|
|
class DSPEngine;
|
|
|
|
class AudioFifo;
|
|
|
|
class MessageQueue;
|
|
|
|
class MainWindow;
|
|
|
|
class ChannelMarker;
|
2016-05-11 12:29:01 -04:00
|
|
|
class ThreadedSampleSink;
|
2016-05-12 04:31:57 -04:00
|
|
|
class GLSpectrum;
|
2014-05-18 11:52:39 -04:00
|
|
|
class PluginGUI;
|
|
|
|
|
2015-08-29 19:26:51 -04:00
|
|
|
class SDRANGEL_API PluginAPI : public QObject {
|
2014-05-18 11:52:39 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
// MainWindow access
|
2016-05-13 05:42:03 -04:00
|
|
|
//QDockWidget* createMainWindowDock(Qt::DockWidgetArea dockWidgetArea, const QString& title);
|
2014-05-18 11:52:39 -04:00
|
|
|
MessageQueue* getMainWindowMessageQueue();
|
|
|
|
void setInputGUI(QWidget* inputGUI);
|
|
|
|
|
|
|
|
// Channel stuff
|
|
|
|
void registerChannel(const QString& channelName, PluginInterface* plugin, QAction* action);
|
|
|
|
void registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI);
|
|
|
|
void addChannelRollup(QWidget* pluginGUI);
|
|
|
|
void removeChannelInstance(PluginGUI* pluginGUI);
|
|
|
|
|
|
|
|
void addChannelMarker(ChannelMarker* channelMarker);
|
|
|
|
void removeChannelMarker(ChannelMarker* channelMarker);
|
|
|
|
|
|
|
|
// Sample Source stuff
|
|
|
|
void registerSampleSource(const QString& sourceName, PluginInterface* plugin);
|
|
|
|
|
2016-05-11 12:29:01 -04:00
|
|
|
// Device engine stuff
|
2016-05-12 04:31:57 -04:00
|
|
|
void addSink(SampleSink* sink); //!< Add a sample sink to device engine
|
|
|
|
void removeSink(SampleSink* sink); //!< Remove a sample sink from device engine
|
|
|
|
void addThreadedSink(ThreadedSampleSink* sink); //!< Add a sample sink that will run on its own thread to device engine
|
2016-05-12 18:50:29 -04:00
|
|
|
void setSource(SampleSource* source); //!< Set device engine sample source type
|
2016-05-12 04:31:57 -04:00
|
|
|
void removeThreadedSink(ThreadedSampleSink* sink); //!< Remove a sample sink that runs on its own thread from device engine
|
2016-05-11 17:35:16 -04:00
|
|
|
bool initAcquisition(); //!< Initialize device engine acquisition sequence
|
|
|
|
bool startAcquisition(); //!< Start device engine acquisition sequence
|
|
|
|
void stopAcquistion(); //!< Stop device engine acquisition sequence
|
|
|
|
DSPDeviceEngine::State state() const; //!< device engine state
|
|
|
|
QString errorMessage(); //!< Return the current device engine error message
|
2016-05-12 04:31:57 -04:00
|
|
|
uint getDeviceUID() const; //!< Return the current device engine unique ID
|
|
|
|
MessageQueue *getDeviceInputMessageQueue();
|
|
|
|
MessageQueue *getDeviceOutputMessageQueue();
|
2016-05-12 18:03:58 -04:00
|
|
|
void configureCorrections(bool dcOffsetCorrection, bool iqImbalanceCorrection); //!< Configure current device engine DSP corrections
|
2016-05-12 04:31:57 -04:00
|
|
|
|
|
|
|
GLSpectrum *getSpectrum();
|
2016-05-11 12:29:01 -04:00
|
|
|
|
2015-07-31 22:07:09 -04:00
|
|
|
// R/O access to main window
|
|
|
|
const MainWindow* getMainWindow() const { return m_mainWindow; }
|
|
|
|
|
2014-05-18 11:52:39 -04:00
|
|
|
protected:
|
|
|
|
PluginManager* m_pluginManager;
|
|
|
|
MainWindow* m_mainWindow;
|
|
|
|
|
2016-05-11 10:03:03 -04:00
|
|
|
PluginAPI(PluginManager* pluginManager, MainWindow* mainWindow);
|
2016-05-13 05:42:03 -04:00
|
|
|
~PluginAPI();
|
2014-05-18 11:52:39 -04:00
|
|
|
|
|
|
|
friend class PluginManager;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_PLUGINAPI_H
|