update gui

This commit is contained in:
ochibani 2025-01-08 07:13:24 +00:00
parent 05f415e2ab
commit 9ea3d138ea
No known key found for this signature in database
GPG Key ID: 2C6B61CE0C704ED4

View File

@ -191,28 +191,25 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
// Get audio sources // Get audio sources
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ let input_device = host_audio_device.input_devices()?;
let input_device = host_audio_device.input_devices()?; #[cfg(target_os = "windows")]
let sources_descriptions: Vec<String> = input_device let sources_descriptions: Vec<String> = input_device
.filter_map(|device| device.name().ok()) .filter_map(|device| device.name().ok())
.collect(); .collect();
let host_output_device = host_audio_device.default_output_device(); #[cfg(target_os = "windows")]
let audio_output_source = if host_output_device.is_some() { let host_output_device = host_audio_device.default_output_device();
host_output_device.unwrap().name()? #[cfg(target_os = "windows")]
} else { let audio_output_source = if host_output_device.is_some() {
String::new() host_output_device.unwrap().name()?
}; } else {
audio_source_combobox.append(Some("default"), &get_bundle("audio-input", None)); String::new()
for (id, audio_source) in sources_descriptions.iter().enumerate() { };
audio_source_combobox.append(Some(id.to_string().as_str()), audio_source);
}
}
#[cfg(any(target_os = "freebsd", target_os = "linux"))] #[cfg(any(target_os = "freebsd", target_os = "linux"))]
let sources_descriptions: Vec<String> = sources_descriptions_list().unwrap_or_else(|_| Vec::new()); let sources_descriptions: Vec<String> = sources_descriptions_list().unwrap_or_else(|_| Vec::new());
#[cfg(any(target_os = "freebsd", target_os = "linux"))] #[cfg(any(target_os = "freebsd", target_os = "linux"))]
let audio_output_source: String = audio_output_source().unwrap_or_else(|_| String::new()); let audio_output_source: String = audio_output_source().unwrap_or_else(|_| String::new());
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
audio_source_combobox.append(Some("default"), &get_bundle("audio-input", None)); audio_source_combobox.append(Some("default"), &get_bundle("audio-input", None));
for (id, audio_source) in sources_descriptions.iter().enumerate() { for (id, audio_source) in sources_descriptions.iter().enumerate() {
audio_source_combobox.append(Some(id.to_string().as_str()), audio_source); audio_source_combobox.append(Some(id.to_string().as_str()), audio_source);