kopia lustrzana https://github.com/f4exb/sdrangel
Plugin interface: simplify createTxChannel
rodzic
703aa21159
commit
0f7faff299
|
@ -61,15 +61,9 @@ PluginInstanceGUI* AMModPlugin::createTxChannelGUI(const QString& channelName, D
|
|||
}
|
||||
}
|
||||
|
||||
BasebandSampleSource* AMModPlugin::createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI)
|
||||
BasebandSampleSource* AMModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == AMMod::m_channelIdURI)
|
||||
{
|
||||
AMMod* source = new AMMod(deviceAPI);
|
||||
return source;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return new AMMod(deviceAPI);
|
||||
}
|
||||
|
||||
ChannelSourceAPI* AMModPlugin::createTxChannelCS(DeviceSinkAPI *deviceAPI)
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
||||
virtual BasebandSampleSource* createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI);
|
||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
|
|
|
@ -61,15 +61,9 @@ PluginInstanceGUI* ATVModPlugin::createTxChannelGUI(const QString& channelName,
|
|||
}
|
||||
}
|
||||
|
||||
BasebandSampleSource* ATVModPlugin::createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI)
|
||||
BasebandSampleSource* ATVModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == ATVMod::m_channelIdURI)
|
||||
{
|
||||
ATVMod* source = new ATVMod(deviceAPI);
|
||||
return source;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return new ATVMod(deviceAPI);
|
||||
}
|
||||
|
||||
ChannelSourceAPI* ATVModPlugin::createTxChannelCS(DeviceSinkAPI *deviceAPI)
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
||||
virtual BasebandSampleSource* createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI);
|
||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
|
|
|
@ -70,15 +70,9 @@ PluginInstanceGUI* NFMModPlugin::createTxChannelGUI(const QString& channelName,
|
|||
}
|
||||
#endif
|
||||
|
||||
BasebandSampleSource* NFMModPlugin::createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI)
|
||||
BasebandSampleSource* NFMModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == NFMMod::m_channelIdURI)
|
||||
{
|
||||
NFMMod* source = new NFMMod(deviceAPI);
|
||||
return source;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return new NFMMod(deviceAPI);
|
||||
}
|
||||
|
||||
ChannelSourceAPI* NFMModPlugin::createTxChannelCS(DeviceSinkAPI *deviceAPI)
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *rxChannel);
|
||||
virtual BasebandSampleSource* createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI);
|
||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
|
|
|
@ -61,15 +61,9 @@ PluginInstanceGUI* SSBModPlugin::createTxChannelGUI(const QString& channelName,
|
|||
}
|
||||
}
|
||||
|
||||
BasebandSampleSource* SSBModPlugin::createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI)
|
||||
BasebandSampleSource* SSBModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == SSBMod::m_channelIdURI)
|
||||
{
|
||||
SSBMod* source = new SSBMod(deviceAPI);
|
||||
return source;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return new SSBMod(deviceAPI);
|
||||
}
|
||||
|
||||
ChannelSourceAPI* SSBModPlugin::createTxChannelCS(DeviceSinkAPI *deviceAPI)
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
||||
virtual BasebandSampleSource* createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI);
|
||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
|
|
|
@ -61,15 +61,9 @@ PluginInstanceGUI* WFMModPlugin::createTxChannelGUI(const QString& channelName,
|
|||
}
|
||||
}
|
||||
|
||||
BasebandSampleSource* WFMModPlugin::createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI)
|
||||
BasebandSampleSource* WFMModPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == WFMMod::m_channelIdURI)
|
||||
{
|
||||
WFMMod* source = new WFMMod(deviceAPI);
|
||||
return source;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return new WFMMod(deviceAPI);
|
||||
}
|
||||
|
||||
ChannelSourceAPI* WFMModPlugin::createTxChannelCS(DeviceSinkAPI *deviceAPI)
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
||||
virtual BasebandSampleSource* createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI);
|
||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
|
|
|
@ -63,15 +63,9 @@ PluginInstanceGUI* UDPSinkPlugin::createTxChannelGUI(const QString& channelName,
|
|||
}
|
||||
}
|
||||
|
||||
BasebandSampleSource* UDPSinkPlugin::createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI)
|
||||
BasebandSampleSource* UDPSinkPlugin::createTxChannelBS(DeviceSinkAPI *deviceAPI)
|
||||
{
|
||||
if(channelName == UDPSink::m_channelIdURI)
|
||||
{
|
||||
UDPSink* source = new UDPSink(deviceAPI);
|
||||
return source;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return new UDPSink(deviceAPI);
|
||||
}
|
||||
|
||||
ChannelSourceAPI* UDPSinkPlugin::createTxChannelCS(DeviceSinkAPI *deviceAPI)
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
void initPlugin(PluginAPI* pluginAPI);
|
||||
|
||||
virtual PluginInstanceGUI* createTxChannelGUI(const QString& channelName, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel);
|
||||
virtual BasebandSampleSource* createTxChannelBS(const QString& channelName, DeviceSinkAPI *deviceAPI);
|
||||
virtual BasebandSampleSource* createTxChannelBS(DeviceSinkAPI *deviceAPI);
|
||||
virtual ChannelSourceAPI* createTxChannelCS(DeviceSinkAPI *deviceAPI);
|
||||
|
||||
private:
|
||||
|
|
|
@ -101,7 +101,6 @@ public:
|
|||
{ return 0; }
|
||||
|
||||
virtual BasebandSampleSource* createTxChannelBS(
|
||||
const QString& channelName __attribute__((unused)),
|
||||
DeviceSinkAPI *deviceAPI __attribute__((unused)) )
|
||||
{ return 0; }
|
||||
|
||||
|
|
|
@ -193,8 +193,7 @@ void PluginManager::createTxChannelInstance(int channelPluginIndex, DeviceUISet
|
|||
if (channelPluginIndex < m_txChannelRegistrations.size())
|
||||
{
|
||||
PluginInterface *pluginInterface = m_txChannelRegistrations[channelPluginIndex].m_plugin;
|
||||
BasebandSampleSource *txChannel = pluginInterface->createTxChannelBS(
|
||||
m_txChannelRegistrations[channelPluginIndex].m_channelIdURI, deviceAPI);
|
||||
BasebandSampleSource *txChannel = pluginInterface->createTxChannelBS(deviceAPI);
|
||||
pluginInterface->createTxChannelGUI(m_txChannelRegistrations[channelPluginIndex].m_channelIdURI, deviceUISet, txChannel);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -274,12 +274,10 @@ void DeviceUISet::loadTxChannelSettings(const Preset *preset, PluginAPI *pluginA
|
|||
if((*channelRegistrations)[i].m_channelIdURI == channelConfig.m_channelIdURI)
|
||||
{
|
||||
qDebug("DeviceUISet::loadChannelSettings: creating new channel [%s]", qPrintable(channelConfig.m_channelIdURI));
|
||||
BasebandSampleSource *txChannel = (*channelRegistrations)[i].m_plugin->createTxChannelBS(
|
||||
channelConfig.m_channelIdURI, m_deviceSinkAPI);
|
||||
BasebandSampleSource *txChannel = (*channelRegistrations)[i].m_plugin->createTxChannelBS(m_deviceSinkAPI);
|
||||
PluginInstanceGUI *txChannelGUI = (*channelRegistrations)[i].m_plugin->createTxChannelGUI(
|
||||
channelConfig.m_channelIdURI, this, txChannel);
|
||||
reg = ChannelInstanceRegistration(
|
||||
channelConfig.m_channelIdURI, txChannelGUI);
|
||||
reg = ChannelInstanceRegistration(channelConfig.m_channelIdURI, txChannelGUI);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue