mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-08-26 15:56:35 -04:00
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#include <QtPlugin>
|
|
#include <QAction>
|
|
#include "plugin/pluginapi.h"
|
|
#include "util/simpleserializer.h"
|
|
#include "v4lplugin.h"
|
|
#include "v4lgui.h"
|
|
|
|
const PluginDescriptor V4LPlugin::m_pluginDescriptor = {
|
|
QString("V4L SDRplay Input"),
|
|
QString("4.0"),
|
|
QString("(c) 2015 John Greb"),
|
|
QString("http://palosaari.fi/linux/"),
|
|
true,
|
|
QString("github.com/hexameron/rtl-sdrangelove")
|
|
};
|
|
|
|
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;
|
|
|
|
QString displayedName(QString("Linux V4L (SDRplay)"));
|
|
SimpleSerializer s(1);
|
|
s.writeS32(1, 0);
|
|
result.append(SampleSourceDevice(displayedName, "org.osmocom.sdr.samplesource.v4l", s.final()));
|
|
|
|
return result;
|
|
}
|
|
|
|
PluginGUI* V4LPlugin::createSampleSourcePluginGUI(const QString& sourceName, const QByteArray& address)
|
|
{
|
|
if(sourceName == "org.osmocom.sdr.samplesource.v4l") {
|
|
V4LGui* gui = new V4LGui(m_pluginAPI);
|
|
m_pluginAPI->setInputGUI(gui);
|
|
return gui;
|
|
} else {
|
|
return NULL;
|
|
}
|
|
}
|