1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-05 00:11:16 -05:00
sdrangel/plugins/samplesource/v4l-rtl/v4lplugin.cpp

57 lines
1.3 KiB
C++
Raw Normal View History

2014-11-03 12:13:32 -05:00
#include <QtPlugin>
#include <QAction>
#include <rtl-sdr.h>
#include "plugin/pluginapi.h"
#include "util/simpleserializer.h"
#include "v4lplugin.h"
#include "v4lgui.h"
const PluginDescriptor V4LPlugin::m_pluginDescriptor = {
QString("V4L Input"),
2014-12-03 13:41:38 -05:00
QString("3.18"),
QString("(c) 2014 John Greb"),
QString("http://palosaari.fi/linux/"),
2014-11-03 12:13:32 -05:00
true,
2014-12-03 13:41:38 -05:00
QString("github.com/hexameron/rtl-sdrangelove")
2014-11-03 12:13:32 -05:00
};
V4LPlugin::V4LPlugin(QObject* parent) :
QObject(parent)
{
}
const PluginDescriptor& V4LPlugin::getPluginDescriptor() const
{
return m_pluginDescriptor;
}
void V4LPlugin::initPlugin(PluginAPI* pluginAPI)
{
m_pluginAPI = pluginAPI;
m_pluginAPI->registerSampleSource("org.osmocom.sdr.samplesource.v4l", this);
}
PluginInterface::SampleSourceDevices V4LPlugin::enumSampleSources()
{
SampleSourceDevices result;
2014-11-21 14:44:19 -05:00
QString displayedName(QString("Kernel Source #1"));
SimpleSerializer s(1);
s.writeS32(1, 0);
result.append(SampleSourceDevice(displayedName, "org.osmocom.sdr.samplesource.v4l", s.final()));
2014-11-03 12:13:32 -05:00
return result;
}
PluginGUI* V4LPlugin::createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address)
2014-11-03 12:13:32 -05:00
{
if(sourceName == "org.osmocom.sdr.samplesource.v4l") {
V4LGui* gui = new V4LGui(m_pluginAPI);
m_pluginAPI->setInputGUI(gui);
return gui;
} else {
return NULL;
}
}