1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-18 19:06:34 -04:00
sdrangel/plugins/channel/usb/usbplugin.cpp

54 lines
1.4 KiB
C++
Raw Normal View History

2014-06-27 18:28:31 -04:00
#include <QtPlugin>
#include <QAction>
#include "plugin/pluginapi.h"
#include "usbplugin.h"
#include "usbdemodgui.h"
const PluginDescriptor USBPlugin::m_pluginDescriptor = {
QString("USB Demodulator"),
2014-12-03 13:41:38 -05:00
QString("0.1"),
QString("(c) 2014 John Greb"),
2014-06-27 18:28:31 -04:00
QString("http://www.maintech.de"),
true,
2014-12-03 13:41:38 -05:00
QString("github.com/hexameron/rtl-sdrangelove")
2014-06-27 18:28:31 -04:00
};
USBPlugin::USBPlugin(QObject* parent) :
QObject(parent)
{
}
const PluginDescriptor& USBPlugin::getPluginDescriptor() const
{
return m_pluginDescriptor;
}
void USBPlugin::initPlugin(PluginAPI* pluginAPI)
{
m_pluginAPI = pluginAPI;
// register demodulator
QAction* action = new QAction(tr("&USB Demodulator"), this);
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceUSB()));
m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.usb", this, action);
}
PluginGUI* USBPlugin::createChannel(const QString& channelName)
{
if(channelName == "de.maintech.sdrangelove.channel.usb") {
USBDemodGUI* gui = USBDemodGUI::create(m_pluginAPI);
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.usb", gui);
m_pluginAPI->addChannelRollup(gui);
return gui;
} else {
return NULL;
}
}
void USBPlugin::createInstanceUSB()
{
USBDemodGUI* gui = USBDemodGUI::create(m_pluginAPI);
m_pluginAPI->registerChannelInstance("de.maintech.sdrangelove.channel.usb", gui);
m_pluginAPI->addChannelRollup(gui);
}