mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 06:04:39 -04:00
Replace separate create channel methods (BS and CS): common plugins
This commit is contained in:
@@ -57,6 +57,22 @@ void UDPSourcePlugin::initPlugin(PluginAPI* pluginAPI)
|
||||
m_pluginAPI->registerTxChannel(UDPSource::m_channelIdURI, UDPSource::m_channelId, this);
|
||||
}
|
||||
|
||||
void UDPSourcePlugin::createTxChannel(DeviceAPI *deviceAPI, BasebandSampleSource **bs, ChannelAPI **cs) const
|
||||
{
|
||||
if (bs || cs)
|
||||
{
|
||||
UDPSource *instance = new UDPSource(deviceAPI);
|
||||
|
||||
if (bs) {
|
||||
*bs = instance;
|
||||
}
|
||||
|
||||
if (cs) {
|
||||
*cs = instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SERVER_MODE
|
||||
PluginInstanceGUI* UDPSourcePlugin::createTxChannelGUI(
|
||||
DeviceUISet *deviceUISet,
|
||||
@@ -71,16 +87,6 @@ PluginInstanceGUI* UDPSourcePlugin::createTxChannelGUI(DeviceUISet *deviceUISet,
|
||||
}
|
||||
#endif
|
||||
|
||||
BasebandSampleSource* UDPSourcePlugin::createTxChannelBS(DeviceAPI *deviceAPI) const
|
||||
{
|
||||
return new UDPSource(deviceAPI);
|
||||
}
|
||||
|
||||
ChannelAPI* UDPSourcePlugin::createTxChannelCS(DeviceAPI *deviceAPI) const
|
||||
{
|
||||
return new UDPSource(deviceAPI);
|
||||
}
|
||||
|
||||
ChannelWebAPIAdapter* UDPSourcePlugin::createChannelWebAPIAdapter() const
|
||||
{
|
||||
return new UDPSourceWebAPIAdapter();
|
||||
|
||||
Reference in New Issue
Block a user