mirror of
https://github.com/xlmnxp/blue-recorder.git
synced 2025-04-02 07:44:54 +03:00
update ffmpeg_window
This commit is contained in:
parent
056bdf6db6
commit
a6987857bd
@ -530,16 +530,16 @@ impl Ffmpeg {
|
|||||||
|
|
||||||
// Record audio input
|
// Record audio input
|
||||||
if self.audio_input_switch.is_active() {
|
if self.audio_input_switch.is_active() {
|
||||||
ffmpeg_command.format("pulse")
|
ffmpeg_command.format("dshow");
|
||||||
.input(&self.audio_input_id.active_id()
|
ffmpeg_command.input(format!("audio=\"{}\"", &self.audio_input_id.active_text()
|
||||||
.ok_or_else(|| anyhow!("Failed to get audio input ID."))?
|
.ok_or_else(|| anyhow!("Failed to get audio input source."))?)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Record audio output
|
// Record audio output
|
||||||
if self.audio_output_switch.is_active() {
|
if self.audio_output_switch.is_active() {
|
||||||
ffmpeg_command.format("pulse")
|
ffmpeg_command.format("dshow");
|
||||||
.input(&self.audio_output_id);
|
ffmpeg_command.input(format!("audio=\"{}\"", &self.audio_output_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable bitrate if value is zero
|
// Disable bitrate if value is zero
|
||||||
@ -631,7 +631,7 @@ impl Ffmpeg {
|
|||||||
)
|
)
|
||||||
.format("ogg");
|
.format("ogg");
|
||||||
if self.audio_output_switch.is_active() {
|
if self.audio_output_switch.is_active() {
|
||||||
ffmpeg_command.format("pulse")
|
ffmpeg_command.format("dshow")
|
||||||
.input(&self.audio_output_id);
|
.input(&self.audio_output_id);
|
||||||
}
|
}
|
||||||
ffmpeg_command.format("ogg");
|
ffmpeg_command.format("ogg");
|
||||||
|
@ -745,7 +745,6 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
|
|
||||||
// Disable show area check button
|
// Disable show area check button
|
||||||
if !area_grab_button.is_active() {
|
if !area_grab_button.is_active() {
|
||||||
input_widgets.push(area_switch.clone().into());
|
|
||||||
area_switch.set_active(false);
|
area_switch.set_active(false);
|
||||||
area_switch.set_sensitive(false);
|
area_switch.set_sensitive(false);
|
||||||
}
|
}
|
||||||
@ -782,7 +781,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
audio_output_switch: audio_output_switch.clone(),
|
audio_output_switch: audio_output_switch.clone(),
|
||||||
follow_mouse: follow_mouse_switch.clone(),
|
follow_mouse: follow_mouse_switch.clone(),
|
||||||
record_mouse: mouse_switch.clone(),
|
record_mouse: mouse_switch.clone(),
|
||||||
show_area: area_switch,
|
show_area: area_switch.clone(),
|
||||||
video_switch: video_switch.clone()
|
video_switch: video_switch.clone()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -811,7 +810,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
audio_output_switch: audio_output_switch.clone(),
|
audio_output_switch: audio_output_switch.clone(),
|
||||||
follow_mouse: follow_mouse_switch.clone(),
|
follow_mouse: follow_mouse_switch.clone(),
|
||||||
record_mouse: mouse_switch.clone(),
|
record_mouse: mouse_switch.clone(),
|
||||||
show_area: area_switch,
|
show_area: area_switch.clone(),
|
||||||
video_switch: video_switch.clone(),
|
video_switch: video_switch.clone(),
|
||||||
wayland_recorder: glib::MainContext::default().block_on(WaylandRecorder::new())
|
wayland_recorder: glib::MainContext::default().block_on(WaylandRecorder::new())
|
||||||
}));
|
}));
|
||||||
@ -821,6 +820,8 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
delay_window_title.set_label(&get_bundle("delay-title", None));
|
delay_window_title.set_label(&get_bundle("delay-title", None));
|
||||||
record_button.set_tooltip_text(Some(&get_bundle("record-tooltip", None)));
|
record_button.set_tooltip_text(Some(&get_bundle("record-tooltip", None)));
|
||||||
record_label.set_label(&get_bundle("record", None));
|
record_label.set_label(&get_bundle("record", None));
|
||||||
|
let _area_grab_button = area_grab_button.clone();
|
||||||
|
let _area_switch = area_switch.clone();
|
||||||
let _audio_input_switch = audio_input_switch.clone();
|
let _audio_input_switch = audio_input_switch.clone();
|
||||||
let _audio_output_switch = audio_output_switch.clone();
|
let _audio_output_switch = audio_output_switch.clone();
|
||||||
let _delay_spin = delay_spin.clone();
|
let _delay_spin = delay_spin.clone();
|
||||||
@ -842,14 +843,17 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
is_record_button_clicked: false,
|
is_record_button_clicked: false,
|
||||||
}));
|
}));
|
||||||
record_button.connect_clicked(move |_| {
|
record_button.connect_clicked(move |_| {
|
||||||
let mode: RecordMode = if area_grab_button.is_active() {
|
let mode: RecordMode = if _area_grab_button.is_active() {
|
||||||
RecordMode::Area
|
RecordMode::Area
|
||||||
} else if window_grab_button.is_active() {
|
} else if window_grab_button.is_active() {
|
||||||
RecordMode::Window
|
RecordMode::Window
|
||||||
} else {
|
} else {
|
||||||
RecordMode::Screen
|
RecordMode::Screen
|
||||||
};
|
};
|
||||||
|
// Disable show area check button
|
||||||
|
if _area_grab_button.is_active() {
|
||||||
|
_area_switch.set_sensitive(false);
|
||||||
|
}
|
||||||
// Disable mouse cursor capture during record
|
// Disable mouse cursor capture during record
|
||||||
if _video_switch.is_active() {
|
if _video_switch.is_active() {
|
||||||
_mouse_switch.set_sensitive(false);
|
_mouse_switch.set_sensitive(false);
|
||||||
@ -858,6 +862,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
}
|
}
|
||||||
match _ffmpeg_record_interface.borrow_mut().get_filename() {
|
match _ffmpeg_record_interface.borrow_mut().get_filename() {
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
if _area_grab_button.is_active() {
|
||||||
|
_area_switch.set_sensitive(true);
|
||||||
|
}
|
||||||
if _video_switch.is_active() {
|
if _video_switch.is_active() {
|
||||||
_mouse_switch.set_sensitive(true);
|
_mouse_switch.set_sensitive(true);
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
||||||
@ -924,6 +931,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
// Do nothing
|
// Do nothing
|
||||||
},
|
},
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
if _area_grab_button.is_active() {
|
||||||
|
_area_switch.set_sensitive(true);
|
||||||
|
}
|
||||||
if _video_switch.is_active() {
|
if _video_switch.is_active() {
|
||||||
_mouse_switch.set_sensitive(true);
|
_mouse_switch.set_sensitive(true);
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
||||||
@ -945,6 +955,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
// Do nothing
|
// Do nothing
|
||||||
},
|
},
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
if _area_grab_button.is_active() {
|
||||||
|
_area_switch.set_sensitive(true);
|
||||||
|
}
|
||||||
if _video_switch.is_active() {
|
if _video_switch.is_active() {
|
||||||
_mouse_switch.set_sensitive(true);
|
_mouse_switch.set_sensitive(true);
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
||||||
@ -983,6 +996,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
// Do nothing
|
// Do nothing
|
||||||
},
|
},
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
if _area_grab_button.is_active() {
|
||||||
|
_area_switch.set_sensitive(true);
|
||||||
|
}
|
||||||
if _video_switch.is_active() {
|
if _video_switch.is_active() {
|
||||||
_mouse_switch.set_sensitive(true);
|
_mouse_switch.set_sensitive(true);
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
||||||
@ -1029,6 +1045,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
// Continue
|
// Continue
|
||||||
},
|
},
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
if area_grab_button.is_active() {
|
||||||
|
area_switch.set_sensitive(true);
|
||||||
|
}
|
||||||
if _video_switch.is_active() {
|
if _video_switch.is_active() {
|
||||||
_mouse_switch.set_sensitive(true);
|
_mouse_switch.set_sensitive(true);
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
||||||
@ -1051,6 +1070,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
// Continue
|
// Continue
|
||||||
},
|
},
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
if area_grab_button.is_active() {
|
||||||
|
area_switch.set_sensitive(true);
|
||||||
|
}
|
||||||
if _video_switch.is_active() {
|
if _video_switch.is_active() {
|
||||||
_mouse_switch.set_sensitive(true);
|
_mouse_switch.set_sensitive(true);
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
||||||
@ -1073,6 +1095,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
// Continue
|
// Continue
|
||||||
},
|
},
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
|
if area_grab_button.is_active() {
|
||||||
|
area_switch.set_sensitive(true);
|
||||||
|
}
|
||||||
if _video_switch.is_active() {
|
if _video_switch.is_active() {
|
||||||
_mouse_switch.set_sensitive(true);
|
_mouse_switch.set_sensitive(true);
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
||||||
@ -1089,6 +1114,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if area_grab_button.is_active() {
|
||||||
|
area_switch.set_sensitive(true);
|
||||||
|
}
|
||||||
if _video_switch.is_active() {
|
if _video_switch.is_active() {
|
||||||
_mouse_switch.set_sensitive(true);
|
_mouse_switch.set_sensitive(true);
|
||||||
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
||||||
|
Loading…
Reference in New Issue
Block a user