2018-08-31 17:29:53 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2018 Edouard Griffiths, F4EXB //
|
|
|
|
// //
|
|
|
|
// 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 //
|
|
|
|
// //
|
|
|
|
// 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"
|
|
|
|
|
|
|
|
#ifndef SERVER_MODE
|
2018-09-11 10:50:55 -04:00
|
|
|
#include "daemonsourcegui.h"
|
2018-08-31 17:29:53 -04:00
|
|
|
#endif
|
2018-09-11 10:50:55 -04:00
|
|
|
#include "daemonsource.h"
|
|
|
|
#include "daemonsourceplugin.h"
|
2018-08-31 17:29:53 -04:00
|
|
|
|
2018-09-11 10:32:14 -04:00
|
|
|
const PluginDescriptor DaemonSourcePlugin::m_pluginDescriptor = {
|
2018-08-31 17:29:53 -04:00
|
|
|
QString("Daemon channel source"),
|
|
|
|
QString("4.1.0"),
|
|
|
|
QString("(c) Edouard Griffiths, F4EXB"),
|
|
|
|
QString("https://github.com/f4exb/sdrangel"),
|
|
|
|
true,
|
|
|
|
QString("https://github.com/f4exb/sdrangel")
|
|
|
|
};
|
|
|
|
|
2018-09-11 10:32:14 -04:00
|
|
|
DaemonSourcePlugin::DaemonSourcePlugin(QObject* parent) :
|
2018-08-31 17:29:53 -04:00
|
|
|
QObject(parent),
|
|
|
|
m_pluginAPI(0)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-09-11 10:32:14 -04:00
|
|
|
const PluginDescriptor& DaemonSourcePlugin::getPluginDescriptor() const
|
2018-08-31 17:29:53 -04:00
|
|
|
{
|
|
|
|
return m_pluginDescriptor;
|
|
|
|
}
|
|
|
|
|
2018-09-11 10:32:14 -04:00
|
|
|
void DaemonSourcePlugin::initPlugin(PluginAPI* pluginAPI)
|
2018-08-31 17:29:53 -04:00
|
|
|
{
|
|
|
|
m_pluginAPI = pluginAPI;
|
|
|
|
|
|
|
|
// register source
|
2018-09-11 10:32:14 -04:00
|
|
|
m_pluginAPI->registerTxChannel(DaemonSource::m_channelIdURI, DaemonSource::m_channelId, this);
|
2018-08-31 17:29:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef SERVER_MODE
|
2018-09-11 10:32:14 -04:00
|
|
|
PluginInstanceGUI* DaemonSourcePlugin::createTxChannelGUI(
|
2018-08-31 17:29:53 -04:00
|
|
|
DeviceUISet *deviceUISet __attribute__((unused)),
|
|
|
|
BasebandSampleSource *txChannel __attribute__((unused)))
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#else
|
2018-09-11 10:32:14 -04:00
|
|
|
PluginInstanceGUI* DaemonSourcePlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
2018-08-31 17:29:53 -04:00
|
|
|
{
|
2018-09-11 10:32:14 -04:00
|
|
|
return DaemonSourceGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
2018-08-31 17:29:53 -04:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-09-11 10:32:14 -04:00
|
|
|
BasebandSampleSource* DaemonSourcePlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
2018-08-31 17:29:53 -04:00
|
|
|
{
|
2018-09-11 10:32:14 -04:00
|
|
|
return new DaemonSource(deviceAPI);
|
2018-08-31 17:29:53 -04:00
|
|
|
}
|
|
|
|
|
2018-09-11 10:32:14 -04:00
|
|
|
ChannelSourceAPI* DaemonSourcePlugin::createTxChannelCS(DeviceSinkAPI *deviceAPI)
|
2018-08-31 17:29:53 -04:00
|
|
|
{
|
2018-09-11 10:32:14 -04:00
|
|
|
return new DaemonSource(deviceAPI);
|
2018-08-31 17:29:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|