mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-07-19 01:05:35 -04:00
Plugin interface: simplify createTxChannelGUI
This commit is contained in:
parent
31aacc9571
commit
d79ef49112
@ -50,15 +50,9 @@ void AMModPlugin::initPlugin(PluginAPI* pluginAPI)
|
|||||||
m_pluginAPI->registerTxChannel(AMMod::m_channelIdURI, AMMod::m_channelId, this);
|
m_pluginAPI->registerTxChannel(AMMod::m_channelIdURI, AMMod::m_channelId, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginInstanceGUI* AMModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
PluginInstanceGUI* AMModPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
||||||
{
|
{
|
||||||
if(channelName == AMMod::m_channelIdURI)
|
return AMModGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
||||||
{
|
|
||||||
AMModGUI* gui = AMModGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
|
||||||
return gui;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BasebandSampleSource* AMModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
BasebandSampleSource* AMModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
const PluginDescriptor& getPluginDescriptor() const;
|
const PluginDescriptor& getPluginDescriptor() const;
|
||||||
void initPlugin(PluginAPI* pluginAPI);
|
void initPlugin(PluginAPI* pluginAPI);
|
||||||
|
|
||||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
||||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -50,15 +50,9 @@ void ATVModPlugin::initPlugin(PluginAPI* pluginAPI)
|
|||||||
m_pluginAPI->registerTxChannel(ATVMod::m_channelIdURI, ATVMod::m_channelId, this);
|
m_pluginAPI->registerTxChannel(ATVMod::m_channelIdURI, ATVMod::m_channelId, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginInstanceGUI* ATVModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
PluginInstanceGUI* ATVModPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
||||||
{
|
{
|
||||||
if(channelName == ATVMod::m_channelIdURI)
|
return ATVModGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
||||||
{
|
|
||||||
ATVModGUI* gui = ATVModGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
|
||||||
return gui;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BasebandSampleSource* ATVModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
BasebandSampleSource* ATVModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
const PluginDescriptor& getPluginDescriptor() const;
|
const PluginDescriptor& getPluginDescriptor() const;
|
||||||
void initPlugin(PluginAPI* pluginAPI);
|
void initPlugin(PluginAPI* pluginAPI);
|
||||||
|
|
||||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
||||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -51,22 +51,15 @@ void NFMModPlugin::initPlugin(PluginAPI* pluginAPI)
|
|||||||
|
|
||||||
#ifdef SERVER_MODE
|
#ifdef SERVER_MODE
|
||||||
PluginInstanceGUI* NFMModPlugin::createTxChannelGUI(
|
PluginInstanceGUI* NFMModPlugin::createTxChannelGUI(
|
||||||
const QString& channelName __attribute__((unused)),
|
|
||||||
DeviceUISet *deviceUISet __attribute__((unused)),
|
DeviceUISet *deviceUISet __attribute__((unused)),
|
||||||
BasebandSampleSource *txChannel __attribute__((unused)))
|
BasebandSampleSource *txChannel __attribute__((unused)))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
PluginInstanceGUI* NFMModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
PluginInstanceGUI* NFMModPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
||||||
{
|
{
|
||||||
if(channelName == NFMMod::m_channelIdURI)
|
return NFMModGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
||||||
{
|
|
||||||
NFMModGUI* gui = NFMModGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
|
||||||
return gui;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
const PluginDescriptor& getPluginDescriptor() const;
|
const PluginDescriptor& getPluginDescriptor() const;
|
||||||
void initPlugin(PluginAPI* pluginAPI);
|
void initPlugin(PluginAPI* pluginAPI);
|
||||||
|
|
||||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *rxChannel);
|
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *rxChannel);
|
||||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -50,15 +50,9 @@ void SSBModPlugin::initPlugin(PluginAPI* pluginAPI)
|
|||||||
m_pluginAPI->registerTxChannel(SSBMod::m_channelIdURI, SSBMod::m_channelId, this);
|
m_pluginAPI->registerTxChannel(SSBMod::m_channelIdURI, SSBMod::m_channelId, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginInstanceGUI* SSBModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
PluginInstanceGUI* SSBModPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
||||||
{
|
{
|
||||||
if(channelName == SSBMod::m_channelIdURI)
|
return SSBModGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
||||||
{
|
|
||||||
SSBModGUI* gui = SSBModGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
|
||||||
return gui;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BasebandSampleSource* SSBModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
BasebandSampleSource* SSBModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
const PluginDescriptor& getPluginDescriptor() const;
|
const PluginDescriptor& getPluginDescriptor() const;
|
||||||
void initPlugin(PluginAPI* pluginAPI);
|
void initPlugin(PluginAPI* pluginAPI);
|
||||||
|
|
||||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
||||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -50,15 +50,9 @@ void WFMModPlugin::initPlugin(PluginAPI* pluginAPI)
|
|||||||
m_pluginAPI->registerTxChannel(WFMMod::m_channelIdURI, WFMMod::m_channelId, this);
|
m_pluginAPI->registerTxChannel(WFMMod::m_channelIdURI, WFMMod::m_channelId, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginInstanceGUI* WFMModPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
PluginInstanceGUI* WFMModPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
||||||
{
|
{
|
||||||
if(channelName == WFMMod::m_channelIdURI)
|
return WFMModGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
||||||
{
|
|
||||||
WFMModGUI* gui = WFMModGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
|
||||||
return gui;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BasebandSampleSource* WFMModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
BasebandSampleSource* WFMModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||||
|
@ -33,7 +33,7 @@ public:
|
|||||||
const PluginDescriptor& getPluginDescriptor() const;
|
const PluginDescriptor& getPluginDescriptor() const;
|
||||||
void initPlugin(PluginAPI* pluginAPI);
|
void initPlugin(PluginAPI* pluginAPI);
|
||||||
|
|
||||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
||||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -50,17 +50,9 @@ void UDPSinkPlugin::initPlugin(PluginAPI* pluginAPI)
|
|||||||
m_pluginAPI->registerTxChannel(UDPSink::m_channelIdURI, UDPSink::m_channelId, this);
|
m_pluginAPI->registerTxChannel(UDPSink::m_channelIdURI, UDPSink::m_channelId, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginInstanceGUI* UDPSinkPlugin::createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
PluginInstanceGUI* UDPSinkPlugin::createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel)
|
||||||
{
|
{
|
||||||
if(channelName == UDPSink::m_channelIdURI)
|
return UDPSinkGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
||||||
{
|
|
||||||
UDPSinkGUI* gui = UDPSinkGUI::create(m_pluginAPI, deviceUISet, txChannel);
|
|
||||||
// deviceAPI->registerChannelInstance("sdrangel.channel.udpsrc", gui);
|
|
||||||
// m_pluginAPI->addChannelRollup(gui);
|
|
||||||
return gui;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BasebandSampleSource* UDPSinkPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
BasebandSampleSource* UDPSinkPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||||
|
@ -35,7 +35,7 @@ public:
|
|||||||
const PluginDescriptor& getPluginDescriptor() const;
|
const PluginDescriptor& getPluginDescriptor() const;
|
||||||
void initPlugin(PluginAPI* pluginAPI);
|
void initPlugin(PluginAPI* pluginAPI);
|
||||||
|
|
||||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
virtual PluginInstanceGUI* createTxChannelGUI(DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
||||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||||
|
|
||||||
|
@ -94,7 +94,6 @@ public:
|
|||||||
// channel Tx plugins
|
// channel Tx plugins
|
||||||
|
|
||||||
virtual PluginInstanceGUI* createTxChannelGUI(
|
virtual PluginInstanceGUI* createTxChannelGUI(
|
||||||
const QString& channelName __attribute__((unused)),
|
|
||||||
DeviceUISet *deviceUISet __attribute__((unused)),
|
DeviceUISet *deviceUISet __attribute__((unused)),
|
||||||
BasebandSampleSource *txChannel __attribute__((unused)))
|
BasebandSampleSource *txChannel __attribute__((unused)))
|
||||||
{ return 0; }
|
{ return 0; }
|
||||||
|
@ -194,6 +194,6 @@ void PluginManager::createTxChannelInstance(int channelPluginIndex, DeviceUISet
|
|||||||
{
|
{
|
||||||
PluginInterface *pluginInterface = m_txChannelRegistrations[channelPluginIndex].m_plugin;
|
PluginInterface *pluginInterface = m_txChannelRegistrations[channelPluginIndex].m_plugin;
|
||||||
BasebandSampleSource *txChannel = pluginInterface->createTxChannelBS(deviceAPI);
|
BasebandSampleSource *txChannel = pluginInterface->createTxChannelBS(deviceAPI);
|
||||||
pluginInterface->createTxChannelGUI(m_txChannelRegistrations[channelPluginIndex].m_channelIdURI, deviceUISet, txChannel);
|
pluginInterface->createTxChannelGUI(deviceUISet, txChannel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -176,10 +176,10 @@ void DeviceUISet::loadRxChannelSettings(const Preset *preset, PluginAPI *pluginA
|
|||||||
if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
||||||
{
|
{
|
||||||
qDebug("DeviceUISet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
|
qDebug("DeviceUISet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
|
||||||
BasebandSampleSink *rxChannel
|
BasebandSampleSink *rxChannel =
|
||||||
= (*channelRegistrations)[i].m_plugin->createRxChannelBS(m_deviceSourceAPI);
|
(*channelRegistrations)[i].m_plugin->createRxChannelBS(m_deviceSourceAPI);
|
||||||
PluginInstanceGUI *rxChannelGUI
|
PluginInstanceGUI *rxChannelGUI =
|
||||||
= (*channelRegistrations)[i].m_plugin->createRxChannelGUI(this, rxChannel);
|
(*channelRegistrations)[i].m_plugin->createRxChannelGUI(this, rxChannel);
|
||||||
reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, rxChannelGUI);
|
reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, rxChannelGUI);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -274,9 +274,10 @@ void DeviceUISet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginA
|
|||||||
if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
||||||
{
|
{
|
||||||
qDebug("DeviceUISet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
|
qDebug("DeviceUISet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
|
||||||
BasebandSampleSource *txChannel = (*channelRegistrations)[i].m_plugin->createTxChannelBS(m_deviceSinkAPI);
|
BasebandSampleSource *txChannel =
|
||||||
PluginInstanceGUI *txChannelGUI = (*channelRegistrations)[i].m_plugin->createTxChannelGUI(
|
(*channelRegistrations)[i].m_plugin->createTxChannelBS(m_deviceSinkAPI);
|
||||||
channelConfig.m_channelIdURI, this, txChannel);
|
PluginInstanceGUI *txChannelGUI =
|
||||||
|
(*channelRegistrations)[i].m_plugin->createTxChannelGUI(this, txChannel);
|
||||||
reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, txChannelGUI);
|
reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, txChannelGUI);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user