update audio record

This commit is contained in:
ochibani 2025-01-28 23:45:19 +02:00
parent e20b7e456a
commit b7e66a01e7
No known key found for this signature in database
GPG Key ID: 2C6B61CE0C704ED4
5 changed files with 46 additions and 16 deletions

View File

@ -214,9 +214,21 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
};
#[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> = match sources_descriptions_list() {
Ok(descriptions) => descriptions,
Err(_) => {
Vec::new()
}
};
#[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 = match audio_output_source() {
Ok(audio_output_source) => {
audio_output_source
}
Err(_) => {
String::new()
}
};
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
audio_source_combobox.append(Some("default"), &get_bundle("audio-input", None));
@ -242,7 +254,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
tray_switch.set_label(Some(&get_bundle("tray-minimize", None)));
video_switch.set_label(Some(&get_bundle("record-video", None)));
area_switch.set_tooltip_text(Some(&get_bundle("show-area-tooltip", None)));
audio_input_switch.set_tooltip_text(Some(&get_bundle("audio-input-tooltip", None)));
audio_input_switch.set_tooltip_text(Some(&get_bundle("mic-tooltip", None)));
#[cfg(target_os = "windows")]
follow_mouse_switch.set_tooltip_text(Some(&get_bundle("windows-unsupported-tooltip", None)));
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
@ -721,13 +733,11 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
screen_grab_button.clone().into(),
window_grab_button.clone().into(),
video_switch.clone().into(),
audio_input_switch.clone().into(),
frames_label.clone().into(),
frames_spin.clone().into(),
delay_label.clone().into(),
delay_spin.clone().into(),
hide_switch.clone().into(),
audio_output_switch.clone().into(),
video_bitrate_label.clone().into(),
video_bitrate_spin.clone().into(),
audio_bitrate_label.clone().into(),
@ -737,6 +747,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
command_label.clone().into(),
command_entry.clone().into()
];
// Temporary solution
if !is_wayland() {
// Keep area_selection disaled in wayland
@ -749,18 +760,29 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
area_switch.set_sensitive(false);
}
// Record struct values
let audio_output_id = if audio_output_switch.is_active() {
audio_output_source
// Disable audio input record
if sources_descriptions.is_empty() {
audio_input_switch.set_active(false);
audio_input_switch.set_sensitive(false);
audio_input_switch.set_tooltip_text(Some(&get_bundle("no-audio-input-tooltip", None)));
} else {
String::new()
};
input_widgets.push(audio_input_switch.clone().into());
}
// Disable audio output record
if audio_output_source.is_empty() {
audio_output_switch.set_active(false);
audio_output_switch.set_sensitive(false);
audio_output_switch.set_tooltip_text(Some(&get_bundle("no-audio-output-tooltip", None)));
} else {
input_widgets.push(audio_output_switch.clone().into());
}
// Init record struct
#[cfg(target_os = "windows")]
let ffmpeg_record_interface: Rc<RefCell<Ffmpeg>> = Rc::new(RefCell::new(Ffmpeg {
audio_input_id: audio_source_combobox.clone(),
audio_output_id,
audio_output_id: audio_output_source,
filename: (
folder_chooser_native,
filename_entry,
@ -788,7 +810,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
let ffmpeg_record_interface: Rc<RefCell<Ffmpeg>> = Rc::new(RefCell::new(Ffmpeg {
audio_input_id: audio_source_combobox.clone(),
audio_output_id,
audio_output_id: audio_output_source,
filename: (
folder_chooser_native,
filename_entry,

View File

@ -164,14 +164,16 @@ about-tooltip = غرة ما يحسن بك علمه عن المسجل الأزر
area-tooltip = اختر البقعة المُراد تسجيلها
audio-bitrate-tooltip = اضبط جودة الصوت بما يناسب بالبت
audio-source-tooltip = اختر منبع الصوت
audio-input-tooltip = يسجل الصوت
delay-tooltip = المُهلة قبل بدء التسجيل
folder-tooltip = اختر مقر تسجيلاتك
follow-mouse-tooltip = اجعل الرقعة المختارة تتبع حركة السهم
format-tooltip = اختر صيغة الخَرج
frames-tooltip = خصص عدد الصور في الثانية
hide-tooltip = اطوِ نافذة المسجل الأزرق عند بدء التسجيل
mic-tooltip = يسجل الصوت
mouse-tooltip = يظهر مؤشر الفأرة عند التسجيل
no-audio-input-tooltip = لم يُعثَر على مدخل صوت
no-audio-output-tooltip = لم يُعثَر على مخرج صوت
play-tooltip = انقر لمشاهدة ما سُجِّل
record-tooltip = يشرع في التسجيل
screen-tooltip = يحدد الشاشة كاملة ليسجلها

View File

@ -164,14 +164,16 @@ about-tooltip = غرة ما يحسن بك علمه عن المسجل الأزر
area-tooltip = اختر البقعة المُراد تسجيلها
audio-bitrate-tooltip = اضبط جودة الصوت بما يناسب بالبت
audio-source-tooltip = اختر منبع الصوت
audio-input-tooltip = يسجل الصوت
delay-tooltip = المُهلة قبل بدء التسجيل
folder-tooltip = اختر مقر تسجيلاتك
follow-mouse-tooltip = اجعل الرقعة المختارة تتبع حركة السهم
format-tooltip = اختر صيغة الخَرج
frames-tooltip = خصص عدد الصور في الثانية
hide-tooltip = اطوِ نافذة المسجل الأزرق عند بدء التسجيل
mic-tooltip = يسجل الصوت
mouse-tooltip = يظهر مؤشر الفأرة عند التسجيل
no-audio-input-tooltip = لم يُعثَر على مدخل صوت
no-audio-output-tooltip = لم يُعثَر على مخرج صوت
play-tooltip = انقر لمشاهدة ما سُجِّل
record-tooltip = يشرع في التسجيل
screen-tooltip = يحدد الشاشة كاملة ليسجلها

View File

@ -164,14 +164,16 @@ about-tooltip = Information about Blue Recorder
area-tooltip = Select area to record
audio-bitrate-tooltip = Set audio bitrate in KB/s
audio-source-tooltip = Select audio source
audio-input-tooltip = Mic audio recording
delay-tooltip = Delay time before starting record
folder-tooltip = Select storage location
follow-mouse-tooltip = Make the grabbed area follow the mouse
format-tooltip = Select file format
frames-tooltip = Set frames rate
hide-tooltip = Hide window when start recording
mic-tooltip = Mic audio recording
mouse-tooltip = Mouse appears in video recording
no-audio-input-tooltip = There were no audio input devices detected
no-audio-output-tooltip = There were no audio output devices detected
play-tooltip = Click to play video
record-tooltip = Start screen record
screen-tooltip = Select screen to record

View File

@ -164,14 +164,16 @@ about-tooltip = Information about Blue Recorder
area-tooltip = Select area to record
audio-bitrate-tooltip = Set audio bitrate in KB/s
audio-source-tooltip = Select audio source
audio-input-tooltip = Mic audio recording
delay-tooltip = Delay time before starting record
folder-tooltip = Select storage location
follow-mouse-tooltip = Make the grabbed area follow the mouse
format-tooltip = Select file format
frames-tooltip = Set frames rate
hide-tooltip = Hide window when start recording
mic-tooltip = Mic audio recording
mouse-tooltip = Mouse appears in video recording
no-audio-input-tooltip = There were no audio input devices detected
no-audio-output-tooltip = There were no audio output devices detected
play-tooltip = Click to play video
record-tooltip = Start screen record
screen-tooltip = Select screen to record