mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
Fix displaying of audio device when it's disconnected
This commit is contained in:
parent
2f7a2d5134
commit
465ca97531
1 changed files with 9 additions and 2 deletions
|
@ -957,7 +957,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
||||||
propagate_used_devices();
|
propagate_used_devices();
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto get_audio_output_devices = [this]()
|
const auto get_audio_output_devices = [this](bool keep_old = true)
|
||||||
{
|
{
|
||||||
const QVariantList var_list = ui->audioOutBox->currentData().toList();
|
const QVariantList var_list = ui->audioOutBox->currentData().toList();
|
||||||
ensure(var_list.size() == 2 && var_list[1].canConvert<int>());
|
ensure(var_list.size() == 2 && var_list[1].canConvert<int>());
|
||||||
|
@ -981,6 +981,13 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device_index == 0 && keep_old && selected_device != audio_device_enumerator::DEFAULT_DEV_ID)
|
||||||
|
{
|
||||||
|
cfg_log.error("The selected audio device (%s) was not found", selected_device);
|
||||||
|
ui->audioDeviceBox->addItem(tr("Unknown device"), qsv(selected_device));
|
||||||
|
device_index = ui->audioDeviceBox->count() - 1;
|
||||||
|
}
|
||||||
|
|
||||||
ui->audioDeviceBox->blockSignals(false);
|
ui->audioDeviceBox->blockSignals(false);
|
||||||
ui->audioDeviceBox->setCurrentIndex(std::max(device_index, 0));
|
ui->audioDeviceBox->setCurrentIndex(std::max(device_index, 0));
|
||||||
};
|
};
|
||||||
|
@ -1007,7 +1014,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
||||||
#endif
|
#endif
|
||||||
connect(ui->audioOutBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [change_audio_output_device, get_audio_output_devices](int)
|
connect(ui->audioOutBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [change_audio_output_device, get_audio_output_devices](int)
|
||||||
{
|
{
|
||||||
get_audio_output_devices();
|
get_audio_output_devices(false);
|
||||||
change_audio_output_device(0); // Set device to 'Default'
|
change_audio_output_device(0); // Set device to 'Default'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue