mirror of
https://github.com/xlmnxp/blue-recorder.git
synced 2024-11-23 17:13:11 +03:00
update
This commit is contained in:
parent
68aea8349f
commit
31567745f5
@ -13,14 +13,14 @@
|
|||||||
<property name="page-increment">2</property>
|
<property name="page-increment">2</property>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkAdjustment" id="adjustment-frames">
|
<object class="GtkAdjustment" id="adjustment-frames">
|
||||||
<property name="lower">1</property>
|
<property name="lower">0</property>
|
||||||
<property name="upper">200</property>
|
<property name="upper">240</property>
|
||||||
<property name="step-increment">1</property>
|
<property name="step-increment">1</property>
|
||||||
<property name="page-increment">10</property>
|
<property name="page-increment">10</property>
|
||||||
</object>
|
</object>
|
||||||
<object class="GtkAdjustment" id="adjustment-quality">
|
<object class="GtkAdjustment" id="adjustment-bitrate">
|
||||||
<property name="lower">0</property>
|
<property name="lower">0</property>
|
||||||
<property name="upper">51</property>
|
<property name="upper">50000</property>
|
||||||
<property name="step-increment">1</property>
|
<property name="step-increment">1</property>
|
||||||
<property name="page-increment">10</property>
|
<property name="page-increment">10</property>
|
||||||
</object>
|
</object>
|
||||||
@ -478,7 +478,7 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel" id="quality_label">
|
<object class="GtkLabel" id="bitrate_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="label" translatable="yes">label</property>
|
<property name="label" translatable="yes">label</property>
|
||||||
@ -489,13 +489,13 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSpinButton" id="quality">
|
<object class="GtkSpinButton" id="bitrate">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">True</property>
|
<property name="can-focus">True</property>
|
||||||
<property name="max-width-chars">2</property>
|
<property name="max-width-chars">2</property>
|
||||||
<property name="width-chars">2</property>
|
<property name="width-chars">2</property>
|
||||||
<property name="text">number</property>
|
<property name="text">number</property>
|
||||||
<property name="adjustment">adjustment-quality</property>
|
<property name="adjustment">adjustment-bitrate</property>
|
||||||
<property name="climb-rate">1</property>
|
<property name="climb-rate">1</property>
|
||||||
<property name="has-tooltip">True</property>
|
<property name="has-tooltip">True</property>
|
||||||
<layout>
|
<layout>
|
||||||
|
@ -102,8 +102,8 @@ license =
|
|||||||
|
|
||||||
لمزيد تفاصيل راجع رخصة جنو العمومية. إن لم تكن حصلت على نسخة من رخصة جنو العمومية مع المسجل الأزرق فانظر { license-website }.
|
لمزيد تفاصيل راجع رخصة جنو العمومية. إن لم تكن حصلت على نسخة من رخصة جنو العمومية مع المسجل الأزرق فانظر { license-website }.
|
||||||
|
|
||||||
# Quality label
|
# Bitrate label
|
||||||
quality = الجودة:
|
bitrate = معدل البت:
|
||||||
|
|
||||||
# Recording button
|
# Recording button
|
||||||
record = سجل
|
record = سجل
|
||||||
@ -146,7 +146,7 @@ format-tooltip = لاختيار صيغة الخَرج
|
|||||||
frames-tooltip = عدد الإطارات في الثانية
|
frames-tooltip = عدد الإطارات في الثانية
|
||||||
hide-tooltip = لإخفاء نافذة المسجل الأزرق عند بدء التسجيل
|
hide-tooltip = لإخفاء نافذة المسجل الأزرق عند بدء التسجيل
|
||||||
mouse-tooltip = يظهر مؤشر الفأرة عند التسجيل
|
mouse-tooltip = يظهر مؤشر الفأرة عند التسجيل
|
||||||
quality-tooltip = جودة التسجيل (CRF)
|
bitrate-tooltip = ضبط معدل البت بوحدة KB
|
||||||
record-tooltip = يبدأ تسجيل الشاشة
|
record-tooltip = يبدأ تسجيل الشاشة
|
||||||
screen-tooltip = يحدد الشاشة ليسجلها
|
screen-tooltip = يحدد الشاشة ليسجلها
|
||||||
speaker-tooltip = يسجل باستخدام مخرج الصوت
|
speaker-tooltip = يسجل باستخدام مخرج الصوت
|
||||||
|
@ -102,8 +102,8 @@ license =
|
|||||||
|
|
||||||
لمزيد تفاصيل راجع رخصة جنو العمومية. إن لم تكن حصلت على نسخة من رخصة جنو العمومية مع المسجل الأزرق فانظر { license-website }.
|
لمزيد تفاصيل راجع رخصة جنو العمومية. إن لم تكن حصلت على نسخة من رخصة جنو العمومية مع المسجل الأزرق فانظر { license-website }.
|
||||||
|
|
||||||
# Quality label
|
# Bitrate label
|
||||||
quality = الجودة:
|
bitrate = معدل البت:
|
||||||
|
|
||||||
# Recording button
|
# Recording button
|
||||||
record = سجل
|
record = سجل
|
||||||
@ -146,7 +146,7 @@ format-tooltip = لاختيار صيغة الخَرج
|
|||||||
frames-tooltip = عدد الإطارات في الثانية
|
frames-tooltip = عدد الإطارات في الثانية
|
||||||
hide-tooltip = لإخفاء نافذة المسجل الأزرق عند بدء التسجيل
|
hide-tooltip = لإخفاء نافذة المسجل الأزرق عند بدء التسجيل
|
||||||
mouse-tooltip = يظهر مؤشر الفأرة عند التسجيل
|
mouse-tooltip = يظهر مؤشر الفأرة عند التسجيل
|
||||||
quality-tooltip = جودة التسجيل (CRF)
|
bitrate-tooltip = ضبط معدل البت بوحدة KB
|
||||||
record-tooltip = يبدأ تسجيل الشاشة
|
record-tooltip = يبدأ تسجيل الشاشة
|
||||||
screen-tooltip = يحدد الشاشة ليسجلها
|
screen-tooltip = يحدد الشاشة ليسجلها
|
||||||
speaker-tooltip = يسجل باستخدام مخرج الصوت
|
speaker-tooltip = يسجل باستخدام مخرج الصوت
|
||||||
|
@ -99,8 +99,8 @@ license =
|
|||||||
Blue Recorder is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
Blue Recorder is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Blue Recorder. If not, see { license-website }.
|
See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Blue Recorder. If not, see { license-website }.
|
||||||
|
|
||||||
# Quality label
|
# Bitrate label
|
||||||
quality = Quality:
|
bitrate = Bitrate:
|
||||||
|
|
||||||
# Recording button
|
# Recording button
|
||||||
record = Record
|
record = Record
|
||||||
@ -143,7 +143,7 @@ format-tooltip = Select file format
|
|||||||
frames-tooltip = Frames rate
|
frames-tooltip = Frames rate
|
||||||
hide-tooltip = Hide window when start recording
|
hide-tooltip = Hide window when start recording
|
||||||
mouse-tooltip = Mouse appears in video recording
|
mouse-tooltip = Mouse appears in video recording
|
||||||
quality-tooltip = Video quality (CRF)
|
bitrate-tooltip = Set video bitrate in KB
|
||||||
record-tooltip = Start screen record
|
record-tooltip = Start screen record
|
||||||
screen-tooltip = Select screen to record
|
screen-tooltip = Select screen to record
|
||||||
speaker-tooltip = Speakr sound recording
|
speaker-tooltip = Speakr sound recording
|
||||||
|
@ -99,8 +99,8 @@ license =
|
|||||||
Blue Recorder is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
Blue Recorder is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Blue Recorder. If not, see { license-website }.
|
See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Blue Recorder. If not, see { license-website }.
|
||||||
|
|
||||||
# Quality label
|
# Bitrate label
|
||||||
quality = Quality:
|
bitrate = Bitrate:
|
||||||
|
|
||||||
# Recording button
|
# Recording button
|
||||||
record = Record
|
record = Record
|
||||||
@ -143,7 +143,7 @@ format-tooltip = Select file format
|
|||||||
frames-tooltip = Frames rate
|
frames-tooltip = Frames rate
|
||||||
hide-tooltip = Hide window when start recording
|
hide-tooltip = Hide window when start recording
|
||||||
mouse-tooltip = Mouse appears in video recording
|
mouse-tooltip = Mouse appears in video recording
|
||||||
quality-tooltip = Video quality (CRF)
|
bitrate-tooltip = Set video bitrate in KB
|
||||||
record-tooltip = Start screen record
|
record-tooltip = Start screen record
|
||||||
screen-tooltip = Select screen to record
|
screen-tooltip = Select screen to record
|
||||||
speaker-tooltip = Speakr sound recording
|
speaker-tooltip = Speakr sound recording
|
||||||
|
@ -28,9 +28,9 @@ pub fn initialize() -> PathBuf {
|
|||||||
|
|
||||||
fn default() {
|
fn default() {
|
||||||
for format in 0..7 {
|
for format in 0..7 {
|
||||||
set_default_quality(&format.to_string());
|
set_default_bitrate(&format.to_string());
|
||||||
|
set_default_frame(&format.to_string());
|
||||||
}
|
}
|
||||||
set("default", "frame", "60");
|
|
||||||
set("default", "delay", "0");
|
set("default", "delay", "0");
|
||||||
set("default", "format", "0");
|
set("default", "format", "0");
|
||||||
set(
|
set(
|
||||||
@ -131,16 +131,30 @@ pub fn folder_icon(folder_chooser_name: Option<&str>) -> &str {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_default_quality(format: &str) -> bool {
|
pub fn set_default_bitrate(format: &str) -> bool {
|
||||||
let crf = match format {
|
let rate = match format {
|
||||||
"0" => self::set("default", "quality-0", "23"),
|
"0" => self::set("default", "bitrate-0", "0"),
|
||||||
"1" => self::set("default", "quality-1", "23"),
|
"1" => self::set("default", "bitrate-1", "0"),
|
||||||
"2" => self::set("default", "quality-2", "10"),
|
"2" => self::set("default", "bitrate-2", "0"),
|
||||||
"3" => self::set("default", "quality-3", "23"),
|
"3" => self::set("default", "bitrate-3", "0"),
|
||||||
"4" => self::set("default", "quality-4", "23"),
|
"4" => self::set("default", "bitrate-4", "0"),
|
||||||
"5" => self::set("default", "quality-5", "23"),
|
"5" => self::set("default", "bitrate-5", "0"),
|
||||||
"6" => self::set("default", "quality-6", "23"),
|
"6" => self::set("default", "bitrate-6", "0"),
|
||||||
_ => self::set("default", "quality-0", "23"), // Default value
|
_ => self::set("default", "bitrate-0", "0"), // Default value
|
||||||
};
|
};
|
||||||
crf
|
rate
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_default_frame(format: &str) -> bool {
|
||||||
|
let rate = match format {
|
||||||
|
"0" => self::set("default", "frame-0", "60"),
|
||||||
|
"1" => self::set("default", "frame-1", "60"),
|
||||||
|
"2" => self::set("default", "frame-2", "60"),
|
||||||
|
"3" => self::set("default", "frame-3", "60"),
|
||||||
|
"4" => self::set("default", "frame-4", "60"),
|
||||||
|
"5" => self::set("default", "frame-5", "60"),
|
||||||
|
"6" => self::set("default", "frame-6", "60"),
|
||||||
|
_ => self::set("default", "frame-0", "60"), // Default value
|
||||||
|
};
|
||||||
|
rate
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ pub struct Ffmpeg {
|
|||||||
pub main_context: gtk::glib::MainContext,
|
pub main_context: gtk::glib::MainContext,
|
||||||
pub temp_video_filename: String,
|
pub temp_video_filename: String,
|
||||||
pub bundle: String,
|
pub bundle: String,
|
||||||
pub record_quality: SpinButton,
|
pub record_bitrate: SpinButton,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Ffmpeg {
|
impl Ffmpeg {
|
||||||
@ -89,7 +89,6 @@ impl Ffmpeg {
|
|||||||
|
|
||||||
// record video with specified width and hight
|
// record video with specified width and hight
|
||||||
ffmpeg_command.size(width.into(), height.into())
|
ffmpeg_command.size(width.into(), height.into())
|
||||||
.rate(self.record_frames.value() as f32)
|
|
||||||
.format("x11grab")
|
.format("x11grab")
|
||||||
.input(format!("{}+{},{}", std::env::var("DISPLAY").unwrap_or_else(|_| ":0".to_string())
|
.input(format!("{}+{},{}", std::env::var("DISPLAY").unwrap_or_else(|_| ":0".to_string())
|
||||||
.as_str(),
|
.as_str(),
|
||||||
@ -97,12 +96,22 @@ impl Ffmpeg {
|
|||||||
y
|
y
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// Disable frame rate if value is zero
|
||||||
|
if self.record_frames.value() > 0.0 {
|
||||||
|
ffmpeg_command.rate(self.record_frames.value() as f32);
|
||||||
|
}
|
||||||
|
|
||||||
// if show mouse switch is enabled, draw the mouse to video
|
// if show mouse switch is enabled, draw the mouse to video
|
||||||
ffmpeg_command.arg("-draw_mouse");
|
|
||||||
if self.record_mouse.is_active() {
|
if self.record_mouse.is_active() {
|
||||||
ffmpeg_command.arg("1");
|
ffmpeg_command.args([
|
||||||
|
"-draw_mouse",
|
||||||
|
"1",
|
||||||
|
]);
|
||||||
} else {
|
} else {
|
||||||
ffmpeg_command.arg("0");
|
ffmpeg_command.args([
|
||||||
|
"-draw_mouse",
|
||||||
|
"0",
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if follow mouse switch is enabled, follow the mouse
|
// if follow mouse switch is enabled, follow the mouse
|
||||||
@ -110,13 +119,20 @@ impl Ffmpeg {
|
|||||||
ffmpeg_command.args(["-follow_mouse", "centered"]);
|
ffmpeg_command.args(["-follow_mouse", "centered"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable bitrate if value is zero
|
||||||
|
if self.record_bitrate.value() > 0.0 {
|
||||||
|
ffmpeg_command.args([
|
||||||
|
"-b:v",
|
||||||
|
&format!("{}K", self.record_bitrate.value()),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
let video_filename = format!(
|
let video_filename = format!(
|
||||||
"{}.temp.without.audio.{}",
|
"{}.temp.without.audio.{}",
|
||||||
self.saved_filename.as_ref().unwrap(),
|
self.saved_filename.as_ref().unwrap(),
|
||||||
self.filename.2.active_id().unwrap()
|
self.filename.2.active_id().unwrap()
|
||||||
);
|
);
|
||||||
|
|
||||||
ffmpeg_command.crf(self.record_quality.value() as u32);
|
|
||||||
ffmpeg_command.args([
|
ffmpeg_command.args([
|
||||||
{
|
{
|
||||||
if self.record_audio.is_active() {
|
if self.record_audio.is_active() {
|
||||||
@ -227,14 +243,20 @@ impl Ffmpeg {
|
|||||||
if is_wayland() {
|
if is_wayland() {
|
||||||
// convert webm to specified format
|
// convert webm to specified format
|
||||||
let mut ffmpeg_command = FfmpegCommand::new();
|
let mut ffmpeg_command = FfmpegCommand::new();
|
||||||
ffmpeg_command.input(self.temp_video_filename.as_str())
|
ffmpeg_command.input(self.temp_video_filename.as_str());
|
||||||
.crf(self.record_quality.value() as u32)
|
if self.record_bitrate.value() > 0.0 {
|
||||||
.args([
|
ffmpeg_command.args([
|
||||||
"-c:a",
|
"-b:v",
|
||||||
self.filename.2.active_id().unwrap().as_str(),
|
&format!("{}K", self.record_bitrate.value()),
|
||||||
self.saved_filename.as_ref().unwrap(),
|
]);
|
||||||
]).overwrite().spawn()
|
}
|
||||||
.unwrap().wait().unwrap();
|
ffmpeg_command.args([
|
||||||
|
"-c:a",
|
||||||
|
self.filename.2.active_id().unwrap().as_str(),
|
||||||
|
self.saved_filename.as_ref().unwrap(),
|
||||||
|
]).overwrite()
|
||||||
|
.spawn()
|
||||||
|
.unwrap().wait().unwrap();
|
||||||
} else {
|
} else {
|
||||||
let mut move_command = Command::new("mv");
|
let mut move_command = Command::new("mv");
|
||||||
move_command.args([
|
move_command.args([
|
||||||
@ -253,7 +275,6 @@ impl Ffmpeg {
|
|||||||
FfmpegCommand::new().input(video_filename.as_str())
|
FfmpegCommand::new().input(video_filename.as_str())
|
||||||
.format("ogg")
|
.format("ogg")
|
||||||
.input(audio_filename.as_str())
|
.input(audio_filename.as_str())
|
||||||
.crf(self.record_quality.value() as u32)
|
|
||||||
.args([
|
.args([
|
||||||
"-c:a",
|
"-c:a",
|
||||||
"aac",
|
"aac",
|
||||||
|
53
src/main.rs
53
src/main.rs
@ -112,8 +112,8 @@ pub fn build_ui(application: &Application) {
|
|||||||
let main_window: Window = builder.object("main_window").unwrap();
|
let main_window: Window = builder.object("main_window").unwrap();
|
||||||
let mouse_switch: CheckButton = builder.object("mouseswitch").unwrap();
|
let mouse_switch: CheckButton = builder.object("mouseswitch").unwrap();
|
||||||
let play_button: Button = builder.object("playbutton").unwrap();
|
let play_button: Button = builder.object("playbutton").unwrap();
|
||||||
let quality_label: Label = builder.object("quality_label").unwrap();
|
let bitrate_label: Label = builder.object("bitrate_label").unwrap();
|
||||||
let quality_spin: SpinButton = builder.object("quality").unwrap();
|
let bitrate_spin: SpinButton = builder.object("bitrate").unwrap();
|
||||||
let record_button: Button = builder.object("recordbutton").unwrap();
|
let record_button: Button = builder.object("recordbutton").unwrap();
|
||||||
let record_label: Label = builder.object("record_label").unwrap();
|
let record_label: Label = builder.object("record_label").unwrap();
|
||||||
let record_time_label: Label = builder.object("record_time_label").unwrap();
|
let record_time_label: Label = builder.object("record_time_label").unwrap();
|
||||||
@ -395,10 +395,13 @@ pub fn build_ui(application: &Application) {
|
|||||||
.value().unwrap(), None, &mut vec![]).to_string()));
|
.value().unwrap(), None, &mut vec![]).to_string()));
|
||||||
delay_spin.set_tooltip_text(Some(&bundle.format_pattern(bundle.get_message("delay-tooltip").unwrap()
|
delay_spin.set_tooltip_text(Some(&bundle.format_pattern(bundle.get_message("delay-tooltip").unwrap()
|
||||||
.value().unwrap(), None, &mut vec![]).to_string()));
|
.value().unwrap(), None, &mut vec![]).to_string()));
|
||||||
quality_spin.set_tooltip_text(Some(&bundle.format_pattern(bundle.get_message("quality-tooltip").unwrap()
|
bitrate_spin.set_tooltip_text(Some(&bundle.format_pattern(bundle.get_message("bitrate-tooltip").unwrap()
|
||||||
.value().unwrap(), None, &mut vec![]).to_string()));
|
.value().unwrap(), None, &mut vec![]).to_string()));
|
||||||
frames_spin.set_value(
|
frames_spin.set_value(
|
||||||
config_management::get("default", "frame")
|
config_management::get("default",
|
||||||
|
&format!
|
||||||
|
("frame-{}",
|
||||||
|
&format_chooser_combobox.active().unwrap().to_string()))
|
||||||
.parse::<f64>()
|
.parse::<f64>()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
);
|
);
|
||||||
@ -407,17 +410,18 @@ pub fn build_ui(application: &Application) {
|
|||||||
.parse::<f64>()
|
.parse::<f64>()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
);
|
);
|
||||||
quality_spin.set_value(
|
bitrate_spin.set_value(
|
||||||
config_management::get("default",
|
config_management::get("default",
|
||||||
&format!
|
&format!
|
||||||
("quality-{}",
|
("bitrate-{}",
|
||||||
&format_chooser_combobox.active().unwrap().to_string()))
|
&format_chooser_combobox.active().unwrap().to_string()))
|
||||||
.parse::<f64>()
|
.parse::<f64>()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let _format_chooser_combobox = format_chooser_combobox.clone();
|
let _format_chooser_combobox = format_chooser_combobox.clone();
|
||||||
let _quality_spin = quality_spin.clone();
|
let _frames_spin = frames_spin.clone();
|
||||||
|
let _bitrate_spin = bitrate_spin.clone();
|
||||||
format_chooser_combobox.connect_changed(move |_| {
|
format_chooser_combobox.connect_changed(move |_| {
|
||||||
let format_chooser_combobox = _format_chooser_combobox.clone();
|
let format_chooser_combobox = _format_chooser_combobox.clone();
|
||||||
if _format_chooser_combobox.active_text().is_some() {
|
if _format_chooser_combobox.active_text().is_some() {
|
||||||
@ -426,10 +430,18 @@ pub fn build_ui(application: &Application) {
|
|||||||
"format",
|
"format",
|
||||||
&_format_chooser_combobox.active().unwrap().to_string(),
|
&_format_chooser_combobox.active().unwrap().to_string(),
|
||||||
);
|
);
|
||||||
_quality_spin.set_value(
|
_frames_spin.set_value(
|
||||||
config_management::get("default",
|
config_management::get("default",
|
||||||
&format!
|
&format!
|
||||||
("quality-{}",
|
("frame-{}",
|
||||||
|
&format_chooser_combobox.active().unwrap().to_string()))
|
||||||
|
.parse::<f64>()
|
||||||
|
.unwrap(),
|
||||||
|
);
|
||||||
|
_bitrate_spin.set_value(
|
||||||
|
config_management::get("default",
|
||||||
|
&format!
|
||||||
|
("bitrate-{}",
|
||||||
&format_chooser_combobox.active().unwrap().to_string()))
|
&format_chooser_combobox.active().unwrap().to_string()))
|
||||||
.parse::<f64>()
|
.parse::<f64>()
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
@ -438,12 +450,13 @@ pub fn build_ui(application: &Application) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let _frames_spin = frames_spin.to_owned();
|
let _frames_spin = frames_spin.to_owned();
|
||||||
|
let _format_chooser_combobox = format_chooser_combobox.clone();
|
||||||
frames_spin.connect_value_changed(move |_| {
|
frames_spin.connect_value_changed(move |_| {
|
||||||
config_management::set(
|
config_management::set("default",
|
||||||
"default",
|
&format!
|
||||||
"frame",
|
("frame-{}",
|
||||||
_frames_spin.value().to_string().as_str(),
|
&_format_chooser_combobox.active().unwrap().to_string()),
|
||||||
);
|
_frames_spin.value().to_string().as_str());
|
||||||
});
|
});
|
||||||
let _delay_spin = delay_spin.to_owned();
|
let _delay_spin = delay_spin.to_owned();
|
||||||
delay_spin.connect_value_changed(move |_| {
|
delay_spin.connect_value_changed(move |_| {
|
||||||
@ -451,14 +464,14 @@ pub fn build_ui(application: &Application) {
|
|||||||
"delay",
|
"delay",
|
||||||
_delay_spin.value().to_string().as_str());
|
_delay_spin.value().to_string().as_str());
|
||||||
});
|
});
|
||||||
let _quality_spin = quality_spin.to_owned();
|
let _bitrate_spin = bitrate_spin.to_owned();
|
||||||
let _format_chooser_combobox = format_chooser_combobox.clone();
|
let _format_chooser_combobox = format_chooser_combobox.clone();
|
||||||
quality_spin.connect_value_changed(move |_| {
|
bitrate_spin.connect_value_changed(move |_| {
|
||||||
config_management::set("default",
|
config_management::set("default",
|
||||||
&format!
|
&format!
|
||||||
("quality-{}",
|
("bitrate-{}",
|
||||||
&_format_chooser_combobox.active().unwrap().to_string()),
|
&_format_chooser_combobox.active().unwrap().to_string()),
|
||||||
_quality_spin.value().to_string().as_str());
|
_bitrate_spin.value().to_string().as_str());
|
||||||
});
|
});
|
||||||
|
|
||||||
// Labels
|
// Labels
|
||||||
@ -468,7 +481,7 @@ pub fn build_ui(application: &Application) {
|
|||||||
.value().unwrap(), None, &mut vec![]).to_string());
|
.value().unwrap(), None, &mut vec![]).to_string());
|
||||||
delay_label.set_label(&bundle.format_pattern(bundle.get_message("delay").unwrap()
|
delay_label.set_label(&bundle.format_pattern(bundle.get_message("delay").unwrap()
|
||||||
.value().unwrap(), None, &mut vec![]).to_string());
|
.value().unwrap(), None, &mut vec![]).to_string());
|
||||||
quality_label.set_label(&bundle.format_pattern(bundle.get_message("quality").unwrap()
|
bitrate_label.set_label(&bundle.format_pattern(bundle.get_message("bitrate").unwrap()
|
||||||
.value().unwrap(), None, &mut vec![]).to_string());
|
.value().unwrap(), None, &mut vec![]).to_string());
|
||||||
audio_source_label.set_label(&bundle.format_pattern(bundle.get_message("audio-source").unwrap()
|
audio_source_label.set_label(&bundle.format_pattern(bundle.get_message("audio-source").unwrap()
|
||||||
.value().unwrap(), None, &mut vec![]).to_string());
|
.value().unwrap(), None, &mut vec![]).to_string());
|
||||||
@ -607,7 +620,7 @@ pub fn build_ui(application: &Application) {
|
|||||||
main_context,
|
main_context,
|
||||||
temp_video_filename: String::new(),
|
temp_video_filename: String::new(),
|
||||||
bundle: bundle_msg,
|
bundle: bundle_msg,
|
||||||
record_quality: quality_spin,
|
record_bitrate: bitrate_spin,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Record Button
|
// Record Button
|
||||||
|
Loading…
Reference in New Issue
Block a user