1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 17:58:43 -05:00
sdrangel/plugins/samplesource/fcd/fcdplugin.cpp

56 lines
1.2 KiB
C++
Raw Normal View History

2014-11-29 13:09:35 -05:00
#include <QtPlugin>
#include <QAction>
#include "plugin/pluginapi.h"
#include "util/simpleserializer.h"
#include "fcdplugin.h"
#include "fcdgui.h"
const PluginDescriptor FCDPlugin::m_pluginDescriptor = {
QString("FunCube Input"),
2014-12-02 09:23:21 -05:00
QString("V20"),
2014-11-29 13:09:35 -05:00
QString("(c) John Greb"),
QString("http://funcubedongle.com"),
true,
2014-12-03 13:41:38 -05:00
QString("github.com/hexameron/rtl-sdrangelove")
2014-11-29 13:09:35 -05:00
};
FCDPlugin::FCDPlugin(QObject* parent) :
QObject(parent)
{
}
const PluginDescriptor& FCDPlugin::getPluginDescriptor() const
{
return m_pluginDescriptor;
}
void FCDPlugin::initPlugin(PluginAPI* pluginAPI)
{
m_pluginAPI = pluginAPI;
m_pluginAPI->registerSampleSource("org.osmocom.sdr.samplesource.fcd", this);
}
PluginInterface::SampleSourceDevices FCDPlugin::enumSampleSources()
{
SampleSourceDevices result;
QString displayedName(QString("Funcube Dongle #1"));
SimpleSerializer s(1);
s.writeS32(1, 0);
result.append(SampleSourceDevice(displayedName, "org.osmocom.sdr.samplesource.fcd", s.final()));
return result;
}
PluginGUI* FCDPlugin::createSampleSource(const QString& sourceName, const QByteArray& address)
{
if(sourceName == "org.osmocom.sdr.samplesource.fcd") {
FCDGui* gui = new FCDGui(m_pluginAPI);
m_pluginAPI->setInputGUI(gui);
return gui;
} else {
return NULL;
}
}