mirror of
https://github.com/xlmnxp/blue-recorder.git
synced 2025-04-02 07:44:54 +03:00
default configs to zeros when not exists
This commit is contained in:
parent
58ed310a2b
commit
7f036c2049
14
src/ui.rs
14
src/ui.rs
@ -170,7 +170,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
format_chooser_combobox.append(Some("avi"), &get_bundle("avi-format", None));
|
||||
format_chooser_combobox.append(Some("wmv"), &get_bundle("wmv-format", None));
|
||||
format_chooser_combobox.append(Some("nut"), &get_bundle("nut-format", None));
|
||||
format_chooser_combobox.set_active(Some(config_management::get("default", "format").parse::<u32>().unwrap()));
|
||||
format_chooser_combobox.set_active(Some(config_management::get("default", "format").parse::<u32>().unwrap_or(0u32)));
|
||||
|
||||
// Get audio sources
|
||||
let input_device = host_audio_device.input_devices().unwrap();
|
||||
@ -373,17 +373,17 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
("frame-{}",
|
||||
&format_chooser_combobox.active().unwrap().to_string()))
|
||||
.parse::<f64>()
|
||||
.unwrap(),
|
||||
.unwrap_or(0f64),
|
||||
);
|
||||
audio_bitrate_spin.set_value(
|
||||
config_management::get("default", "audiobitrate")
|
||||
.parse::<f64>()
|
||||
.unwrap(),
|
||||
.unwrap_or(0f64),
|
||||
);
|
||||
delay_spin.set_value(
|
||||
config_management::get("default", "delay")
|
||||
.parse::<f64>()
|
||||
.unwrap(),
|
||||
.unwrap_or(0f64),
|
||||
);
|
||||
video_bitrate_spin.set_value(
|
||||
config_management::get("default",
|
||||
@ -391,7 +391,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
("videobitrate-{}",
|
||||
&format_chooser_combobox.active().unwrap().to_string()))
|
||||
.parse::<f64>()
|
||||
.unwrap(),
|
||||
.unwrap_or(0f64),
|
||||
);
|
||||
|
||||
let _format_chooser_combobox = format_chooser_combobox.clone();
|
||||
@ -411,7 +411,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
("frame-{}",
|
||||
&format_chooser_combobox.active().unwrap().to_string()))
|
||||
.parse::<f64>()
|
||||
.unwrap(),
|
||||
.unwrap_or(0f64),
|
||||
);
|
||||
_video_bitrate_spin.set_value(
|
||||
config_management::get("default",
|
||||
@ -419,7 +419,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
("videobitrate-{}",
|
||||
&format_chooser_combobox.active().unwrap().to_string()))
|
||||
.parse::<f64>()
|
||||
.unwrap(),
|
||||
.unwrap_or(0f64),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user