mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-27 02:09:14 -05:00
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#include <QtPlugin>
|
|
#include "plugin/pluginapi.h"
|
|
#include "tcpsrcplugin.h"
|
|
#include "tcpsrcgui.h"
|
|
|
|
const PluginDescriptor TCPSrcPlugin::m_pluginDescriptor = {
|
|
QString("TCP Channel Source"),
|
|
QString("---"),
|
|
QString("(c) Edouard Griffiths, F4EXB"),
|
|
QString("https://github.com/f4exb/sdrangel"),
|
|
true,
|
|
QString("https://github.com/f4exb/sdrangel")
|
|
};
|
|
|
|
TCPSrcPlugin::TCPSrcPlugin(QObject* parent) :
|
|
QObject(parent)
|
|
{
|
|
}
|
|
|
|
const PluginDescriptor& TCPSrcPlugin::getPluginDescriptor() const
|
|
{
|
|
return m_pluginDescriptor;
|
|
}
|
|
|
|
void TCPSrcPlugin::initPlugin(PluginAPI* pluginAPI)
|
|
{
|
|
m_pluginAPI = pluginAPI;
|
|
|
|
// register TCP Channel Source
|
|
m_pluginAPI->registerChannel("sdrangel.channel.tcpsrc", this);
|
|
}
|
|
|
|
PluginGUI* TCPSrcPlugin::createChannel(const QString& channelName)
|
|
{
|
|
if(channelName == "sdrangel.channel.tcpsrc") {
|
|
TCPSrcGUI* gui = TCPSrcGUI::create(m_pluginAPI);
|
|
m_pluginAPI->registerChannelInstance("sdrangel.channel.tcpsrc", gui);
|
|
m_pluginAPI->addChannelRollup(gui);
|
|
return gui;
|
|
} else {
|
|
return NULL;
|
|
}
|
|
}
|
|
|
|
void TCPSrcPlugin::createInstanceTCPSrc()
|
|
{
|
|
TCPSrcGUI* gui = TCPSrcGUI::create(m_pluginAPI);
|
|
m_pluginAPI->registerChannelInstance("sdrangel.channel.tcpsrc", gui);
|
|
m_pluginAPI->addChannelRollup(gui);
|
|
}
|