1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

Fixed device enumerator in-use indicator not reset on device set delete

This commit is contained in:
f4exb 2022-05-14 11:18:09 +02:00
parent 63edbe94fa
commit 11ce179f02

View File

@ -342,7 +342,8 @@ void MainWindow::sampleSourceCreate(
deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName); deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName);
deviceAPI->setSamplingDevicePluginInterface(DeviceEnumerator::instance()->getRxPluginInterface(deviceIndex)); deviceAPI->setSamplingDevicePluginInterface(DeviceEnumerator::instance()->getRxPluginInterface(deviceIndex));
qDebug() << "MainWindow::sampleSourceImplement:" qDebug() << "MainWindow::sampleSourceCreate:"
<< "deviceSetIndex:" << deviceSetIndex
<< "deviceIndex:" << deviceIndex << "deviceIndex:" << deviceIndex
<< "hardwareId:" << samplingDevice->hardwareId << "hardwareId:" << samplingDevice->hardwareId
<< "sequence:" << samplingDevice->sequence << "sequence:" << samplingDevice->sequence
@ -352,7 +353,7 @@ void MainWindow::sampleSourceCreate(
if (deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default if (deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default
{ {
qDebug("MainWindow::sampleSourceAdd: non existent device replaced by File Input"); qDebug("MainWindow::sampleSourceCreate: non existent device replaced by File Input");
int fileInputDeviceIndex = DeviceEnumerator::instance()->getFileInputDeviceIndex(); int fileInputDeviceIndex = DeviceEnumerator::instance()->getFileInputDeviceIndex();
selectedDeviceIndex = fileInputDeviceIndex; selectedDeviceIndex = fileInputDeviceIndex;
samplingDevice = DeviceEnumerator::instance()->getRxSamplingDevice(fileInputDeviceIndex); samplingDevice = DeviceEnumerator::instance()->getRxSamplingDevice(fileInputDeviceIndex);
@ -557,7 +558,8 @@ void MainWindow::sampleSinkCreate(
deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName); deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName);
deviceAPI->setSamplingDevicePluginInterface(DeviceEnumerator::instance()->getTxPluginInterface(deviceIndex)); deviceAPI->setSamplingDevicePluginInterface(DeviceEnumerator::instance()->getTxPluginInterface(deviceIndex));
qDebug() << "MainWindow::sampleSinkImplement:" qDebug() << "MainWindow::sampleSinkCreate:"
<< "deviceSetIndex:" << deviceSetIndex
<< "newDeviceIndex:" << deviceIndex << "newDeviceIndex:" << deviceIndex
<< "hardwareId:" << samplingDevice->hardwareId << "hardwareId:" << samplingDevice->hardwareId
<< "sequence:" << samplingDevice->sequence << "sequence:" << samplingDevice->sequence
@ -567,7 +569,7 @@ void MainWindow::sampleSinkCreate(
if (deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default if (deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default
{ {
qDebug("MainWindow::sampleSinkImplement: non existent device replaced by File Sink"); qDebug("MainWindow::sampleSinkCreate: non existent device replaced by File Sink");
int fileSinkDeviceIndex = DeviceEnumerator::instance()->getFileOutputDeviceIndex(); int fileSinkDeviceIndex = DeviceEnumerator::instance()->getFileOutputDeviceIndex();
selectedDeviceIndex = fileSinkDeviceIndex; selectedDeviceIndex = fileSinkDeviceIndex;
const PluginInterface::SamplingDevice *samplingDevice = DeviceEnumerator::instance()->getTxSamplingDevice(fileSinkDeviceIndex); const PluginInterface::SamplingDevice *samplingDevice = DeviceEnumerator::instance()->getTxSamplingDevice(fileSinkDeviceIndex);
@ -780,7 +782,8 @@ void MainWindow::sampleMIMOCreate(
deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName); deviceAPI->setSamplingDeviceDisplayName(samplingDevice->displayedName);
deviceAPI->setSamplingDevicePluginInterface(DeviceEnumerator::instance()->getMIMOPluginInterface(deviceIndex)); deviceAPI->setSamplingDevicePluginInterface(DeviceEnumerator::instance()->getMIMOPluginInterface(deviceIndex));
qDebug() << "MainWindow::sampleMIMOImplement:" qDebug() << "MainWindow::sampleMIMOCreate:"
<< "deviceSetIndex" << deviceSetIndex
<< "newDeviceIndex:" << deviceIndex << "newDeviceIndex:" << deviceIndex
<< "hardwareId:" << samplingDevice->hardwareId << "hardwareId:" << samplingDevice->hardwareId
<< "sequence:" << samplingDevice->sequence << "sequence:" << samplingDevice->sequence
@ -790,7 +793,7 @@ void MainWindow::sampleMIMOCreate(
if (deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default if (deviceAPI->getSamplingDeviceId().size() == 0) // non existent device => replace by default
{ {
qDebug("MainWindow::sampleMIMOImplement: non existent device replaced by Test MIMO"); qDebug("MainWindow::sampleMIMOCreate: non existent device replaced by Test MIMO");
int testMIMODeviceIndex = DeviceEnumerator::instance()->getTestMIMODeviceIndex(); int testMIMODeviceIndex = DeviceEnumerator::instance()->getTestMIMODeviceIndex();
selectedDeviceIndex = testMIMODeviceIndex; selectedDeviceIndex = testMIMODeviceIndex;
const PluginInterface::SamplingDevice *samplingDevice = DeviceEnumerator::instance()->getMIMOSamplingDevice(testMIMODeviceIndex); const PluginInterface::SamplingDevice *samplingDevice = DeviceEnumerator::instance()->getMIMOSamplingDevice(testMIMODeviceIndex);
@ -916,6 +919,7 @@ void MainWindow::removeDeviceSet(int deviceSetIndex)
deviceEngine->stop(); deviceEngine->stop();
m_dspEngine->removeDeviceEngineAt(deviceSetIndex); m_dspEngine->removeDeviceEngineAt(deviceSetIndex);
DeviceEnumerator::instance()->removeRxSelection(deviceSetIndex);
delete sourceAPI; delete sourceAPI;
} }
@ -939,6 +943,7 @@ void MainWindow::removeDeviceSet(int deviceSetIndex)
deviceEngine->stop(); deviceEngine->stop();
m_dspEngine->removeDeviceEngineAt(deviceSetIndex); m_dspEngine->removeDeviceEngineAt(deviceSetIndex);
DeviceEnumerator::instance()->removeTxSelection(deviceSetIndex);
delete sinkAPI; delete sinkAPI;
} }
@ -962,6 +967,7 @@ void MainWindow::removeDeviceSet(int deviceSetIndex)
deviceEngine->stop(); deviceEngine->stop();
m_dspEngine->removeDeviceEngineAt(deviceSetIndex); m_dspEngine->removeDeviceEngineAt(deviceSetIndex);
DeviceEnumerator::instance()->removeMIMOSelection(deviceSetIndex);
delete mimoAPI; delete mimoAPI;
} }