mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-24 11:04:10 -04:00
Add GUI to device set outside plugin
This commit is contained in:
+16
-8
@@ -1922,17 +1922,21 @@ void MainWindow::channelAddClicked(int channelIndex)
|
||||
{
|
||||
PluginAPI::ChannelRegistrations *channelRegistrations = m_pluginManager->getRxChannelRegistrations(); // Available channel plugins
|
||||
PluginInterface *pluginInterface = (*channelRegistrations)[channelIndex].m_plugin;
|
||||
ChannelAPI *channelAPI;
|
||||
BasebandSampleSink *rxChannel;
|
||||
pluginInterface->createRxChannel(deviceUI->m_deviceAPI, &rxChannel, nullptr);
|
||||
pluginInterface->createRxChannelGUI(deviceUI, rxChannel);
|
||||
pluginInterface->createRxChannel(deviceUI->m_deviceAPI, &rxChannel, &channelAPI);
|
||||
PluginInstanceGUI *gui = pluginInterface->createRxChannelGUI(deviceUI, rxChannel);
|
||||
deviceUI->registerRxChannelInstance(gui->getName(), channelAPI, gui);
|
||||
}
|
||||
else if (deviceUI->m_deviceSinkEngine) // sink device => Tx channels
|
||||
{
|
||||
PluginAPI::ChannelRegistrations *channelRegistrations = m_pluginManager->getTxChannelRegistrations(); // Available channel plugins
|
||||
PluginInterface *pluginInterface = (*channelRegistrations)[channelIndex].m_plugin;
|
||||
ChannelAPI *channelAPI;
|
||||
BasebandSampleSource *txChannel;
|
||||
pluginInterface->createTxChannel(deviceUI->m_deviceAPI, &txChannel, nullptr);
|
||||
pluginInterface->createTxChannelGUI(deviceUI, txChannel);
|
||||
pluginInterface->createTxChannel(deviceUI->m_deviceAPI, &txChannel, &channelAPI);
|
||||
PluginInstanceGUI *gui = pluginInterface->createTxChannelGUI(deviceUI, txChannel);
|
||||
deviceUI->registerTxChannelInstance(gui->getName(), channelAPI, gui);
|
||||
}
|
||||
else if (deviceUI->m_deviceMIMOEngine) // MIMO device => all possible channels. Depends on index range
|
||||
{
|
||||
@@ -1945,17 +1949,21 @@ void MainWindow::channelAddClicked(int channelIndex)
|
||||
{
|
||||
PluginAPI::ChannelRegistrations *channelRegistrations = m_pluginManager->getRxChannelRegistrations(); // Available channel plugins
|
||||
PluginInterface *pluginInterface = (*channelRegistrations)[channelIndex].m_plugin;
|
||||
ChannelAPI *channelAPI;
|
||||
BasebandSampleSink *rxChannel;
|
||||
pluginInterface->createRxChannel(deviceUI->m_deviceAPI, &rxChannel, nullptr);
|
||||
pluginInterface->createRxChannelGUI(deviceUI, rxChannel);
|
||||
pluginInterface->createRxChannel(deviceUI->m_deviceAPI, &rxChannel, &channelAPI);
|
||||
PluginInstanceGUI *gui = pluginInterface->createRxChannelGUI(deviceUI, rxChannel);
|
||||
deviceUI->registerRxChannelInstance(gui->getName(), channelAPI, gui);
|
||||
}
|
||||
else if (channelIndex < nbRxChannels + nbTxChannels)
|
||||
{
|
||||
PluginAPI::ChannelRegistrations *channelRegistrations = m_pluginManager->getTxChannelRegistrations(); // Available channel plugins
|
||||
PluginInterface *pluginInterface = (*channelRegistrations)[channelIndex - nbRxChannels].m_plugin;
|
||||
ChannelAPI *channelAPI;
|
||||
BasebandSampleSource *txChannel;
|
||||
pluginInterface->createTxChannel(deviceUI->m_deviceAPI, &txChannel, nullptr);
|
||||
pluginInterface->createTxChannelGUI(deviceUI, txChannel);
|
||||
pluginInterface->createTxChannel(deviceUI->m_deviceAPI, &txChannel, &channelAPI);
|
||||
PluginInstanceGUI *gui = pluginInterface->createTxChannelGUI(deviceUI, txChannel);
|
||||
deviceUI->registerTxChannelInstance(gui->getName(), channelAPI, gui);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user