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
a6987857bd
commit
982c64800b
@ -628,13 +628,11 @@ impl Ffmpeg {
|
|||||||
ffmpeg_command.format("dshow")
|
ffmpeg_command.format("dshow")
|
||||||
.input(format!("audio=\"{}\"", &self.audio_input_id.active_text()
|
.input(format!("audio=\"{}\"", &self.audio_input_id.active_text()
|
||||||
.ok_or_else(|| anyhow!("Failed to get audio input source."))?)
|
.ok_or_else(|| anyhow!("Failed to get audio input source."))?)
|
||||||
)
|
);
|
||||||
.format("ogg");
|
|
||||||
if self.audio_output_switch.is_active() {
|
if self.audio_output_switch.is_active() {
|
||||||
ffmpeg_command.format("dshow")
|
ffmpeg_command.format("dshow")
|
||||||
.input(&self.audio_output_id);
|
.input(&self.audio_output_id);
|
||||||
}
|
}
|
||||||
ffmpeg_command.format("ogg");
|
|
||||||
|
|
||||||
// Disable bitrate if value is zero
|
// Disable bitrate if value is zero
|
||||||
if self.audio_record_bitrate.value() as u16 > 0 {
|
if self.audio_record_bitrate.value() as u16 > 0 {
|
||||||
@ -646,6 +644,8 @@ impl Ffmpeg {
|
|||||||
|
|
||||||
// Remove metadate
|
// Remove metadate
|
||||||
ffmpeg_command.args(["-map_metadata", "-1"]);
|
ffmpeg_command.args(["-map_metadata", "-1"]);
|
||||||
|
|
||||||
|
// Output
|
||||||
ffmpeg_command.arg(&self.saved_filename);
|
ffmpeg_command.arg(&self.saved_filename);
|
||||||
ffmpeg_command.overwrite();
|
ffmpeg_command.overwrite();
|
||||||
|
|
||||||
@ -685,10 +685,12 @@ impl Ffmpeg {
|
|||||||
pub fn start_output_audio(&mut self) -> Result<()> {
|
pub fn start_output_audio(&mut self) -> Result<()> {
|
||||||
let mut ffmpeg_command = FfmpegCommand::new();
|
let mut ffmpeg_command = FfmpegCommand::new();
|
||||||
ffmpeg_command.format("dshow")
|
ffmpeg_command.format("dshow")
|
||||||
.input(format!("audio=\"{}\"", &self.audio_output_id))
|
.input(format!("audio=\"{}\"", &self.audio_output_id));
|
||||||
.format("ogg");
|
|
||||||
// Remove metadate
|
// Remove metadate
|
||||||
ffmpeg_command.args(["-map_metadata", "-1"]);
|
ffmpeg_command.args(["-map_metadata", "-1"]);
|
||||||
|
|
||||||
|
// Output
|
||||||
ffmpeg_command.arg(&self.saved_filename);
|
ffmpeg_command.arg(&self.saved_filename);
|
||||||
ffmpeg_command.overwrite();
|
ffmpeg_command.overwrite();
|
||||||
|
|
||||||
|
@ -872,7 +872,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
}
|
}
|
||||||
enable_input_widgets(_input_widgets.clone());
|
enable_input_widgets(_input_widgets.clone());
|
||||||
_record_button.show();
|
_record_button.show();
|
||||||
|
_record_time_label.set_visible(false);
|
||||||
_stop_button.hide();
|
_stop_button.hide();
|
||||||
|
stop_timer(_record_time_label.clone());
|
||||||
let text_buffer = TextBuffer::new(None);
|
let text_buffer = TextBuffer::new(None);
|
||||||
text_buffer.set_text(&format!("{}", error));
|
text_buffer.set_text(&format!("{}", error));
|
||||||
_error_message.set_buffer(Some(&text_buffer));
|
_error_message.set_buffer(Some(&text_buffer));
|
||||||
@ -917,8 +919,8 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
let _window_title = window_title.borrow_mut();
|
let _window_title = window_title.borrow_mut();
|
||||||
disable_input_widgets(_input_widgets.clone());
|
disable_input_widgets(_input_widgets.clone());
|
||||||
start_timer(record_time_label.clone());
|
start_timer(_record_time_label.clone());
|
||||||
record_time_label.set_visible(true);
|
_record_time_label.set_visible(true);
|
||||||
if hide_switch.is_active() {
|
if hide_switch.is_active() {
|
||||||
_main_window.minimize();
|
_main_window.minimize();
|
||||||
}
|
}
|
||||||
@ -941,7 +943,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
}
|
}
|
||||||
enable_input_widgets(_input_widgets.clone());
|
enable_input_widgets(_input_widgets.clone());
|
||||||
_record_button.show();
|
_record_button.show();
|
||||||
|
_record_time_label.set_visible(false);
|
||||||
_stop_button.hide();
|
_stop_button.hide();
|
||||||
|
stop_timer(_record_time_label.clone());
|
||||||
let text_buffer = TextBuffer::new(None);
|
let text_buffer = TextBuffer::new(None);
|
||||||
text_buffer.set_text(&format!("{}", error));
|
text_buffer.set_text(&format!("{}", error));
|
||||||
_error_message.set_buffer(Some(&text_buffer));
|
_error_message.set_buffer(Some(&text_buffer));
|
||||||
@ -965,7 +969,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
}
|
}
|
||||||
enable_input_widgets(_input_widgets.clone());
|
enable_input_widgets(_input_widgets.clone());
|
||||||
_record_button.show();
|
_record_button.show();
|
||||||
|
_record_time_label.set_visible(false);
|
||||||
_stop_button.hide();
|
_stop_button.hide();
|
||||||
|
stop_timer(_record_time_label.clone());
|
||||||
let text_buffer = TextBuffer::new(None);
|
let text_buffer = TextBuffer::new(None);
|
||||||
text_buffer.set_text(&format!("{}", error));
|
text_buffer.set_text(&format!("{}", error));
|
||||||
_error_message.set_buffer(Some(&text_buffer));
|
_error_message.set_buffer(Some(&text_buffer));
|
||||||
@ -1006,7 +1012,9 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
}
|
}
|
||||||
enable_input_widgets(_input_widgets.clone());
|
enable_input_widgets(_input_widgets.clone());
|
||||||
_record_button.show();
|
_record_button.show();
|
||||||
|
_record_time_label.set_visible(false);
|
||||||
_stop_button.hide();
|
_stop_button.hide();
|
||||||
|
stop_timer(_record_time_label.clone());
|
||||||
let text_buffer = TextBuffer::new(None);
|
let text_buffer = TextBuffer::new(None);
|
||||||
text_buffer.set_text(&format!("{}", error));
|
text_buffer.set_text(&format!("{}", error));
|
||||||
_error_message.set_buffer(Some(&text_buffer));
|
_error_message.set_buffer(Some(&text_buffer));
|
||||||
@ -1037,8 +1045,8 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
|||||||
stop_button.connect_clicked(move |_| {
|
stop_button.connect_clicked(move |_| {
|
||||||
_spinner_window.show();
|
_spinner_window.show();
|
||||||
let mut show_play = true;
|
let mut show_play = true;
|
||||||
_record_time_label.set_visible(false);
|
record_time_label.set_visible(false);
|
||||||
stop_timer(_record_time_label.clone());
|
stop_timer(record_time_label.clone());
|
||||||
if _audio_input_switch.is_active() && !_video_switch.is_active() {
|
if _audio_input_switch.is_active() && !_video_switch.is_active() {
|
||||||
match _ffmpeg_record_interface.borrow_mut().stop_input_audio() {
|
match _ffmpeg_record_interface.borrow_mut().stop_input_audio() {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user