sdrangel/plugins/channelrx/udpsink/udpsinkplugin.cpp

85 wiersze
2.9 KiB
C++
Czysty Zwykły widok Historia

///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2015 F4EXB //
// written by Edouard Griffiths //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
2019-04-11 04:39:30 +00:00
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include <QtPlugin>
#include "plugin/pluginapi.h"
2018-05-29 09:24:20 +00:00
#ifndef SERVER_MODE
2018-09-11 22:08:47 +00:00
#include "udpsinkgui.h"
2018-05-29 09:24:20 +00:00
#endif
2018-09-11 22:08:47 +00:00
#include "udpsink.h"
#include "udpsinkwebapiadapter.h"
2018-09-11 22:08:47 +00:00
#include "udpsinkplugin.h"
2018-09-11 22:08:47 +00:00
const PluginDescriptor UDPSinkPlugin::m_pluginDescriptor = {
QString("UDP Channel Sink"),
QString("4.11.6"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,
QString("https://github.com/f4exb/sdrangel")
};
2018-09-11 22:08:47 +00:00
UDPSinkPlugin::UDPSinkPlugin(QObject* parent) :
2017-05-05 08:40:45 +00:00
QObject(parent),
m_pluginAPI(0)
{
}
2018-09-11 22:08:47 +00:00
const PluginDescriptor& UDPSinkPlugin::getPluginDescriptor() const
{
return m_pluginDescriptor;
}
2018-09-11 22:08:47 +00:00
void UDPSinkPlugin::initPlugin(PluginAPI* pluginAPI)
{
m_pluginAPI = pluginAPI;
// register TCP Channel Source
2018-09-11 22:08:47 +00:00
m_pluginAPI->registerRxChannel(UDPSink::m_channelIdURI, UDPSink::m_channelId, this);
}
2018-05-29 09:24:20 +00:00
#ifdef SERVER_MODE
2018-09-11 22:08:47 +00:00
PluginInstanceGUI* UDPSinkPlugin::createRxChannelGUI(
DeviceUISet *deviceUISet,
BasebandSampleSink *rxChannel) const
2018-05-29 09:24:20 +00:00
{
return 0;
}
#else
PluginInstanceGUI* UDPSinkPlugin::createRxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel) const
{
2018-09-11 22:08:47 +00:00
return UDPSinkGUI::create(m_pluginAPI, deviceUISet, rxChannel);
}
2018-05-29 09:24:20 +00:00
#endif
BasebandSampleSink* UDPSinkPlugin::createRxChannelBS(DeviceAPI *deviceAPI) const
{
2018-09-11 22:08:47 +00:00
return new UDPSink(deviceAPI);
}
2017-12-17 22:15:42 +00:00
ChannelAPI* UDPSinkPlugin::createRxChannelCS(DeviceAPI *deviceAPI) const
2017-12-17 22:15:42 +00:00
{
2018-09-11 22:08:47 +00:00
return new UDPSink(deviceAPI);
2017-12-17 22:15:42 +00:00
}
ChannelWebAPIAdapter* UDPSinkPlugin::createChannelWebAPIAdapter() const
{
return new UDPSinkWebAPIAdapter();
}