mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-23 07:58:05 +02:00
Make sure controls are empty if the last sound device is removed.
This commit is contained in:
parent
71bfad1a4a
commit
abaac6b443
@ -545,12 +545,15 @@ void DeviceToolBar::FillHostDevices()
|
|||||||
foundHostIndex = inMaps[0].hostIndex;
|
foundHostIndex = inMaps[0].hostIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure in/out are clear in case no host was found
|
||||||
|
mInput->Clear();
|
||||||
|
mOutput->Clear();
|
||||||
|
|
||||||
// If we still have no host it means no devices, in which case do nothing.
|
// If we still have no host it means no devices, in which case do nothing.
|
||||||
if (foundHostIndex == -1)
|
if (foundHostIndex == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Repopulate the Input/Output device list available to the user
|
// Repopulate the Input/Output device list available to the user
|
||||||
mInput->Clear();
|
|
||||||
for (i = 0; i < inMaps.size(); i++) {
|
for (i = 0; i < inMaps.size(); i++) {
|
||||||
if (foundHostIndex == inMaps[i].hostIndex) {
|
if (foundHostIndex == inMaps[i].hostIndex) {
|
||||||
mInput->Append(MakeDeviceSourceString(&inMaps[i]));
|
mInput->Append(MakeDeviceSourceString(&inMaps[i]));
|
||||||
@ -566,7 +569,6 @@ void DeviceToolBar::FillHostDevices()
|
|||||||
mInput->InvalidateBestSize();
|
mInput->InvalidateBestSize();
|
||||||
mInput->SetMaxSize(mInput->GetBestSize());
|
mInput->SetMaxSize(mInput->GetBestSize());
|
||||||
|
|
||||||
mOutput->Clear();
|
|
||||||
for (i = 0; i < outMaps.size(); i++) {
|
for (i = 0; i < outMaps.size(); i++) {
|
||||||
if (foundHostIndex == outMaps[i].hostIndex) {
|
if (foundHostIndex == outMaps[i].hostIndex) {
|
||||||
mOutput->Append(MakeDeviceSourceString(&outMaps[i]));
|
mOutput->Append(MakeDeviceSourceString(&outMaps[i]));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user