mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-05 06:37:51 -04:00
Multi device support: sort of works but plugin manager is not fixed
This commit is contained in:
parent
00864bfb6c
commit
3f2b3cdea3
@ -188,21 +188,26 @@ void DeviceAPI::renameChannelInstances()
|
|||||||
|
|
||||||
void DeviceAPI::freeAll()
|
void DeviceAPI::freeAll()
|
||||||
{
|
{
|
||||||
m_deviceEngine->stopAcquistion();
|
// while(!m_channelInstanceRegistrations.isEmpty())
|
||||||
|
// {
|
||||||
|
// ChannelInstanceRegistration reg(m_channelInstanceRegistrations.takeLast());
|
||||||
|
// reg.m_gui->destroy();
|
||||||
|
// }
|
||||||
|
|
||||||
while(!m_channelInstanceRegistrations.isEmpty())
|
for(int i = 0; i < m_channelInstanceRegistrations.count(); i++)
|
||||||
{
|
{
|
||||||
ChannelInstanceRegistration reg(m_channelInstanceRegistrations.takeLast());
|
qDebug("PluginManager::loadSettings: destroying channel [%s]", qPrintable(m_channelInstanceRegistrations[i].m_channelName));
|
||||||
reg.m_gui->destroy();
|
m_channelInstanceRegistrations[i].m_gui->destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_sampleSourcePluginGUI != 0)
|
|
||||||
{
|
// if(m_sampleSourcePluginGUI != 0)
|
||||||
m_deviceEngine->setSource(0);
|
// {
|
||||||
m_sampleSourcePluginGUI->destroy();
|
// m_deviceEngine->setSource(0);
|
||||||
m_sampleSourcePluginGUI = 0;
|
// m_sampleSourcePluginGUI->destroy();
|
||||||
m_sampleSourceId.clear();
|
// m_sampleSourcePluginGUI = 0;
|
||||||
}
|
// m_sampleSourceId.clear();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceAPI::loadSourceSettings(const Preset* preset)
|
void DeviceAPI::loadSourceSettings(const Preset* preset)
|
||||||
|
@ -229,25 +229,24 @@ void MainWindow::removeLastDevice()
|
|||||||
lastDeviceEngine->stopAcquistion();
|
lastDeviceEngine->stopAcquistion();
|
||||||
lastDeviceEngine->removeSink(m_deviceUIs.back()->m_spectrumVis);
|
lastDeviceEngine->removeSink(m_deviceUIs.back()->m_spectrumVis);
|
||||||
|
|
||||||
ui->tabChannels->removeTab(ui->tabChannels->count() - 1);
|
|
||||||
ui->tabSpectraGUI->removeTab(ui->tabSpectraGUI->count() - 1);
|
ui->tabSpectraGUI->removeTab(ui->tabSpectraGUI->count() - 1);
|
||||||
ui->tabSpectra->removeTab(ui->tabSpectra->count() - 1);
|
ui->tabSpectra->removeTab(ui->tabSpectra->count() - 1);
|
||||||
|
|
||||||
// PluginManager destructor does freeAll() which does stopAcquistion() but stopAcquistion()
|
// PluginManager destructor does freeAll() which does stopAcquistion() but stopAcquistion()
|
||||||
// can be done several times only the first is active so it is fine to do it here
|
// can be done several times only the first is active so it is fine to do it here
|
||||||
// On the other hand freeAll() must be executed only once
|
// On the other hand freeAll() must be executed only once
|
||||||
delete m_deviceUIs.back()->m_pluginManager;
|
//delete m_deviceUIs.back()->m_pluginManager;
|
||||||
//m_deviceUIs.back()->m_pluginManager->freeAll();
|
//m_deviceUIs.back()->m_pluginManager->freeAll();
|
||||||
//delete m_deviceUIs.back()->m_deviceAPI; // TODO: reinstate when plugin manager is not created for each device
|
//delete m_deviceUIs.back()->m_deviceAPI; // TODO: reinstate when plugin manager is not created for each device
|
||||||
|
|
||||||
|
m_deviceUIs.back()->m_deviceAPI->freeAll();
|
||||||
|
|
||||||
|
ui->tabChannels->removeTab(ui->tabChannels->count() - 1);
|
||||||
|
|
||||||
lastDeviceEngine->stop();
|
lastDeviceEngine->stop();
|
||||||
m_dspEngine->removeLastDeviceEngine();
|
m_dspEngine->removeLastDeviceEngine();
|
||||||
|
|
||||||
if (ui->tabInputsView->count() == ui->tabInputsSelect->count())
|
ui->tabInputsView->removeTab(ui->tabInputsView->count() - 1);
|
||||||
{
|
|
||||||
ui->tabInputsView->removeTab(ui->tabInputsView->count() - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->tabInputsSelect->removeTab(ui->tabInputsSelect->count() - 1);
|
ui->tabInputsSelect->removeTab(ui->tabInputsSelect->count() - 1);
|
||||||
|
|
||||||
delete m_deviceUIs.back();
|
delete m_deviceUIs.back();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user