diff --git a/plugins/channelrx/demodam/amdemodplugin.cpp b/plugins/channelrx/demodam/amdemodplugin.cpp index 3c781aa77..c93b20857 100644 --- a/plugins/channelrx/demodam/amdemodplugin.cpp +++ b/plugins/channelrx/demodam/amdemodplugin.cpp @@ -3,6 +3,7 @@ #include "plugin/pluginapi.h" #include "amdemodgui.h" +#include "amdemod.h" #include "amdemodplugin.h" const PluginDescriptor AMDemodPlugin::m_pluginDescriptor = { @@ -40,6 +41,17 @@ PluginInstanceGUI* AMDemodPlugin::createRxChannelGUI(const QString& channelName, AMDemodGUI* gui = AMDemodGUI::create(m_pluginAPI, deviceUISet); return gui; } else { - return NULL; + return 0; } } + +BasebandSampleSink* AMDemodPlugin::createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI) +{ + if(channelName == AMDemodGUI::m_channelID) + { + AMDemod* sink = new AMDemod(deviceAPI); + return sink; + } else { + return 0; + } +} diff --git a/plugins/channelrx/demodam/amdemodplugin.h b/plugins/channelrx/demodam/amdemodplugin.h index 0f4e4fca7..baf6352ad 100644 --- a/plugins/channelrx/demodam/amdemodplugin.h +++ b/plugins/channelrx/demodam/amdemodplugin.h @@ -21,6 +21,7 @@ #include "plugin/plugininterface.h" class DeviceUISet; +class BasebandSampleSink; class AMDemodPlugin : public QObject, PluginInterface { Q_OBJECT @@ -34,6 +35,7 @@ public: void initPlugin(PluginAPI* pluginAPI); PluginInstanceGUI* createRxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet); + BasebandSampleSink* createRxChannel(const QString& channelName, DeviceSourceAPI *deviceAPI); private: static const PluginDescriptor m_pluginDescriptor; diff --git a/sdrbase/plugin/plugininterface.h b/sdrbase/plugin/plugininterface.h index 92ff4409b..44c738209 100644 --- a/sdrbase/plugin/plugininterface.h +++ b/sdrbase/plugin/plugininterface.h @@ -22,6 +22,8 @@ class PluginInstanceGUI; class QWidget; class DeviceSampleSource; class DeviceSampleSink; +class BasebandSampleSink; +class BasebandSampleSource; class PluginInterface { public: @@ -76,13 +78,23 @@ public: DeviceUISet *deviceUISet __attribute__((unused)) ) { return 0; } - // channel Tx plugins + virtual BasebandSampleSink* createRxChannel( + const QString& channelName __attribute__((unused)), + DeviceSourceAPI *deviceAPI __attribute__((unused)) ) + { return 0; } + + // channel Tx plugins virtual PluginInstanceGUI* createTxChannelGUI( const QString& channelName __attribute__((unused)), DeviceUISet *deviceUISet __attribute__((unused)) ) { return 0; } + virtual BasebandSampleSource* createTxChannel( + const QString& channelName __attribute__((unused)), + DeviceSinkAPI *deviceAPI __attribute__((unused)) ) + { return 0; } + // device source plugins only virtual SamplingDevices enumSampleSources() { return SamplingDevices(); }