mirror of
https://github.com/xlmnxp/blue-recorder.git
synced 2025-04-04 16:54:55 +03:00
Compare commits
No commits in common. "d313eacd01fd28f57d2e94a5bb2bb0460b8d84bf" and "fcba5a7be8f84ee3d1061db2b8c268e09ba8e685" have entirely different histories.
d313eacd01
...
fcba5a7be8
1647
Cargo.lock
generated
1647
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@ edition = "2021"
|
||||
[dependencies]
|
||||
anyhow = "1.0.86"
|
||||
async-std = {version = "1.12.0", features = ["attributes"]}
|
||||
blue-recorder-core = { git = "https://github.com/ochibani/blue-recorder-core.git", rev = "85c9d8f" }
|
||||
blue-recorder-core = { git = "https://github.com/ochibani/blue-recorder-core.git", rev = "fb3ff78" }
|
||||
cpal = "0.15.3"
|
||||
dark-light = "1.0.0"
|
||||
dirs = "4.0.0"
|
||||
|
@ -423,7 +423,7 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="areaswitch">
|
||||
<object class="GtkCheckButton" id="trayswitch">
|
||||
<property name="label" translatable="yes">checkbutton</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
@ -437,9 +437,9 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="trayswitch">
|
||||
<object class="GtkCheckButton" id="areaswitch">
|
||||
<property name="label" translatable="yes">checkbutton</property>
|
||||
<property name="visible">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="active">True</property>
|
||||
|
@ -147,8 +147,8 @@ show-area = Show Area
|
||||
# Show mouse label
|
||||
show-mouse = إظهار مؤشر الفأرة
|
||||
|
||||
# Minimize to tray icon
|
||||
tray-minimize = Minimize to tray
|
||||
# Show tray icon
|
||||
show-tray = Show Tray
|
||||
|
||||
# Video bitrate label
|
||||
video-bitrate = B/Video:
|
||||
@ -173,10 +173,9 @@ video-bitrate-tooltip = Set video bitrate in KB/s
|
||||
record-tooltip = يبدأ تسجيل الشاشة
|
||||
screen-tooltip = يحدد الشاشة ليسجلها
|
||||
show-area-tooltip = Show selected area during record
|
||||
show-tray-tooltip = Show tray icon
|
||||
speaker-tooltip = Speakr sound recording
|
||||
stop-tooltip = وقف تسجيل الشاشة
|
||||
tray-minimize-tooltip = Minimize application to tray icon
|
||||
video-tooltip = يسجل الشاشة
|
||||
wayland-tooltip = غير مدعوم في وايلاند
|
||||
window-tooltip = يحدد نافذة ليسجلها
|
||||
windows-unsupported-tooltip = Not supported in windows platform
|
||||
|
@ -147,8 +147,8 @@ show-area = Show Area
|
||||
# Show mouse label
|
||||
show-mouse = إظهار مؤشر الفأرة
|
||||
|
||||
# Minimize to tray icon
|
||||
tray-minimize = Minimize to tray
|
||||
# Show tray icon
|
||||
show-tray = Show Tray
|
||||
|
||||
# Video bitrate label
|
||||
video-bitrate = B/Video:
|
||||
@ -173,10 +173,9 @@ video-bitrate-tooltip = Set video bitrate in KB/s
|
||||
record-tooltip = يبدأ تسجيل الشاشة
|
||||
screen-tooltip = يحدد الشاشة ليسجلها
|
||||
show-area-tooltip = Show selected area during record
|
||||
show-tray-tooltip = Show tray icon
|
||||
speaker-tooltip = Speakr sound recording
|
||||
stop-tooltip = وقف تسجيل الشاشة
|
||||
tray-minimize-tooltip = Minimize application to tray icon
|
||||
video-tooltip = يسجل الشاشة
|
||||
wayland-tooltip = غير مدعوم في وايلاند
|
||||
window-tooltip = يحدد نافذة ليسجلها
|
||||
windows-unsupported-tooltip = Not supported in windows platform
|
||||
|
@ -66,9 +66,6 @@ close = Close
|
||||
# Copy right
|
||||
copy-right = © 2021 Salem Yaslem
|
||||
|
||||
# Close error dialog
|
||||
close-error-dialog = Close
|
||||
|
||||
# Run command label
|
||||
default-command = Default command:
|
||||
|
||||
@ -84,12 +81,12 @@ delay-title = Start Recording in…
|
||||
# Stop delay timer
|
||||
delay-window-stop = Stop
|
||||
|
||||
# Details button
|
||||
details-button = Details
|
||||
|
||||
# About message
|
||||
dialog-comment = A simple screen recorder for Linux desktop. Supports Wayland & Xorg.
|
||||
|
||||
# Details button
|
||||
details-button = Details
|
||||
|
||||
# Run command input
|
||||
enter-command = Enter your command here..
|
||||
|
||||
@ -147,8 +144,8 @@ show-area = Show Area
|
||||
# Show mouse label
|
||||
show-mouse = Show Mouse
|
||||
|
||||
# Minimize to tray icon
|
||||
tray-minimize = Minimize to tray
|
||||
# Show tray icon
|
||||
show-tray = Show Tray
|
||||
|
||||
# Video bitrate label
|
||||
video-bitrate = B/Video:
|
||||
@ -173,10 +170,9 @@ video-bitrate-tooltip = Set video bitrate in KB/s
|
||||
record-tooltip = Start screen record
|
||||
screen-tooltip = Select screen to record
|
||||
show-area-tooltip = Show selected area during record
|
||||
show-tray-tooltip = Show tray icon
|
||||
speaker-tooltip = Speakr sound recording
|
||||
stop-tooltip = Stop screen recording
|
||||
tray-minimize-tooltip = Minimize application to tray icon
|
||||
video-tooltip = Video recording
|
||||
wayland-tooltip = Not supported in Wayland
|
||||
window-tooltip = Select window to record
|
||||
windows-unsupported-tooltip = Not supported in windows platform
|
||||
|
@ -144,8 +144,8 @@ show-area = Show Area
|
||||
# Show mouse label
|
||||
show-mouse = Show Mouse
|
||||
|
||||
# Minimize to tray icon
|
||||
tray-minimize = Minimize to tray
|
||||
# Show tray icon
|
||||
show-tray = Show Tray
|
||||
|
||||
# Video bitrate label
|
||||
video-bitrate = B/Video:
|
||||
@ -170,10 +170,9 @@ video-bitrate-tooltip = Set video bitrate in KB/s
|
||||
record-tooltip = Start screen record
|
||||
screen-tooltip = Select screen to record
|
||||
show-area-tooltip = Show selected area during record
|
||||
show-tray-tooltip = Show tray icon
|
||||
speaker-tooltip = Speakr sound recording
|
||||
stop-tooltip = Stop screen recording
|
||||
tray-minimize-tooltip = Minimize application to tray icon
|
||||
video-tooltip = Video recording
|
||||
wayland-tooltip = Not supported in Wayland
|
||||
window-tooltip = Select window to record
|
||||
windows-unsupported-tooltip = Not supported in windows platform
|
||||
|
@ -10,9 +10,8 @@ pub fn get_bundle(message_id: &str, arg: Option<&FluentArgs>) -> String {
|
||||
current_exec_dir
|
||||
}.join(Path::new("locales"));
|
||||
if !ftl_path.exists() {
|
||||
let var = std::env::var("LC_DIR");
|
||||
ftl_path = std::fs::canonicalize(Path::new(
|
||||
&var.unwrap_or_else(|_| String::from("locales")),
|
||||
&std::env::var("LC_DIR").unwrap_or_else(|_| String::from("locales")),
|
||||
)).unwrap();
|
||||
}
|
||||
let supported_lang: Vec<String> = std::fs::read_dir(&ftl_path)
|
||||
@ -28,9 +27,8 @@ pub fn get_bundle(message_id: &str, arg: Option<&FluentArgs>) -> String {
|
||||
locale = String::from("en_US");
|
||||
}
|
||||
}
|
||||
let ftl_in_loacle = ftl_path.join(Path::new(&locale.split('.').next().unwrap()));
|
||||
let ftl_file = std::fs::read_to_string(
|
||||
format!("{}.ftl", ftl_in_loacle.to_str().unwrap())
|
||||
format!("{}/{}.ftl", ftl_path.to_str().unwrap(),locale.split('.').next().unwrap())
|
||||
).unwrap();
|
||||
let res = FluentResource::try_new(ftl_file).unwrap();
|
||||
let mut bundle = FluentBundle::default();
|
||||
|
47
src/ui.rs
47
src/ui.rs
@ -1,8 +1,5 @@
|
||||
use anyhow::{anyhow, Result};
|
||||
#[cfg(any(target_os = "freebsd", target_os = "linux"))]
|
||||
use blue_recorder_core::ffmpeg_linux::Ffmpeg;
|
||||
#[cfg(target_os = "windows")]
|
||||
use blue_recorder_core::ffmpeg_windows::Ffmpeg;
|
||||
use blue_recorder_core::utils::is_wayland;
|
||||
use cpal::traits::{DeviceTrait, HostTrait};
|
||||
use libadwaita::{Application, Window};
|
||||
@ -15,7 +12,7 @@ use std::ops::Add;
|
||||
use std::path::Path;
|
||||
use std::rc::Rc;
|
||||
|
||||
use crate::{/*area_capture,*/ config_management, fluent::get_bundle};
|
||||
use crate::{area_capture, config_management, fluent::get_bundle};
|
||||
use crate::timer::{recording_delay, start_timer, stop_timer};
|
||||
|
||||
pub fn run_ui(application: &Application) {
|
||||
@ -170,7 +167,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_or(0u32)));
|
||||
format_chooser_combobox.set_active(Some(config_management::get("default", "format").parse::<u32>().unwrap()));
|
||||
|
||||
// Get audio sources
|
||||
let input_device = host_audio_device.input_devices().unwrap();
|
||||
@ -199,7 +196,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
hide_switch.set_label(Some(&get_bundle("auto-hide", None)));
|
||||
mouse_switch.set_label(Some(&get_bundle("show-mouse", None)));
|
||||
speaker_switch.set_label(Some(&get_bundle("record-speaker", None)));
|
||||
tray_switch.set_label(Some(&get_bundle("tray-minimize", None)));
|
||||
tray_switch.set_label(Some(&get_bundle("show-tray", 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)));
|
||||
@ -207,7 +204,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
hide_switch.set_tooltip_text(Some(&get_bundle("hide-tooltip", None)));
|
||||
mouse_switch.set_tooltip_text(Some(&get_bundle("mouse-tooltip", None)));
|
||||
speaker_switch.set_tooltip_text(Some(&get_bundle("speaker-tooltip", None)));
|
||||
tray_switch.set_tooltip_text(Some(&get_bundle("tray-minimize-tooltip", None)));
|
||||
tray_switch.set_tooltip_text(Some(&get_bundle("show-tray-tooltip", None)));
|
||||
video_switch.set_tooltip_text(Some(&get_bundle("video-tooltip", None)));
|
||||
|
||||
let _mouse_switch = mouse_switch.clone();
|
||||
@ -373,17 +370,17 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
("frame-{}",
|
||||
&format_chooser_combobox.active().unwrap().to_string()))
|
||||
.parse::<f64>()
|
||||
.unwrap_or(0f64),
|
||||
.unwrap(),
|
||||
);
|
||||
audio_bitrate_spin.set_value(
|
||||
config_management::get("default", "audiobitrate")
|
||||
.parse::<f64>()
|
||||
.unwrap_or(0f64),
|
||||
.unwrap(),
|
||||
);
|
||||
delay_spin.set_value(
|
||||
config_management::get("default", "delay")
|
||||
.parse::<f64>()
|
||||
.unwrap_or(0f64),
|
||||
.unwrap(),
|
||||
);
|
||||
video_bitrate_spin.set_value(
|
||||
config_management::get("default",
|
||||
@ -391,7 +388,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
("videobitrate-{}",
|
||||
&format_chooser_combobox.active().unwrap().to_string()))
|
||||
.parse::<f64>()
|
||||
.unwrap_or(0f64),
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
let _format_chooser_combobox = format_chooser_combobox.clone();
|
||||
@ -411,7 +408,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
("frame-{}",
|
||||
&format_chooser_combobox.active().unwrap().to_string()))
|
||||
.parse::<f64>()
|
||||
.unwrap_or(0f64),
|
||||
.unwrap(),
|
||||
);
|
||||
_video_bitrate_spin.set_value(
|
||||
config_management::get("default",
|
||||
@ -419,7 +416,7 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
("videobitrate-{}",
|
||||
&format_chooser_combobox.active().unwrap().to_string()))
|
||||
.parse::<f64>()
|
||||
.unwrap_or(0f64),
|
||||
.unwrap(),
|
||||
);
|
||||
}
|
||||
});
|
||||
@ -529,12 +526,12 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
});
|
||||
|
||||
// Buttons
|
||||
//let area_capture: Rc<RefCell<area_capture::AreaCapture>> =
|
||||
//Rc::new(RefCell::new(area_capture::AreaCapture::new()?));
|
||||
let area_capture: Rc<RefCell<area_capture::AreaCapture>> =
|
||||
Rc::new(RefCell::new(area_capture::AreaCapture::new()?));
|
||||
|
||||
area_grab_label.set_label(&get_bundle("select-area", None));
|
||||
let _area_chooser_window = area_chooser_window.clone();
|
||||
//let mut _area_capture = area_capture.clone();
|
||||
let mut _area_capture = area_capture.clone();
|
||||
let _area_switch = area_switch.clone();
|
||||
area_grab_button.connect_clicked(move |_| {
|
||||
config_management::set("default", "mode", "area");
|
||||
@ -545,23 +542,23 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
|
||||
area_apply_label.set_label(&get_bundle("apply", None));
|
||||
let _area_chooser_window = area_chooser_window.clone();
|
||||
//let mut _area_capture = area_capture.clone();
|
||||
let mut _area_capture = area_capture.clone();
|
||||
let _error_dialog = error_dialog.clone();
|
||||
let _error_message = error_message.clone();
|
||||
area_set_button.connect_clicked(move |_| {
|
||||
let text_buffer = TextBuffer::new(None);
|
||||
/*if _area_capture
|
||||
if _area_capture
|
||||
.borrow_mut()
|
||||
.get_window_by_name(_area_chooser_window.title().unwrap().as_str()).is_err() {
|
||||
text_buffer.set_text("failed to get area size value");
|
||||
_error_message.set_buffer(Some(&text_buffer));
|
||||
_error_dialog.show();
|
||||
}*/
|
||||
}
|
||||
_area_chooser_window.hide();
|
||||
});
|
||||
|
||||
let _area_chooser_window = area_chooser_window.clone();
|
||||
//let mut _area_capture = area_capture.clone();
|
||||
let mut _area_capture = area_capture.clone();
|
||||
let _area_switch = area_switch.clone();
|
||||
let _error_dialog = error_dialog.clone();
|
||||
let _error_message = error_message.clone();
|
||||
@ -578,15 +575,15 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
config_management::set("default", "mode", "screen");
|
||||
screen_grab_button_record_window.replace(false);
|
||||
_area_chooser_window.hide();
|
||||
/*if _area_capture.borrow_mut().reset().is_err() {
|
||||
if _area_capture.borrow_mut().reset().is_err() {
|
||||
text_buffer.set_text("failed to get reset area_capture value");
|
||||
_error_message.set_buffer(Some(&text_buffer));
|
||||
_error_dialog.show();
|
||||
}*/
|
||||
}
|
||||
});
|
||||
|
||||
let _area_chooser_window: Window = area_chooser_window.clone();
|
||||
//let mut _area_capture: Rc<RefCell<area_capture::AreaCapture>> = area_capture.clone();
|
||||
let mut _area_capture: Rc<RefCell<area_capture::AreaCapture>> = area_capture.clone();
|
||||
let _area_switch = area_switch.clone();
|
||||
let _error_dialog = error_dialog.clone();
|
||||
let _error_message = error_message.clone();
|
||||
@ -602,11 +599,11 @@ fn build_ui(application: &Application, error_dialog: MessageDialog, error_messag
|
||||
if is_wayland() {
|
||||
window_grab_button_record_window.replace(true);
|
||||
} else {
|
||||
/*if _area_capture.borrow_mut().get_area().is_err() {
|
||||
if _area_capture.borrow_mut().get_area().is_err() {
|
||||
text_buffer.set_text("failed to get window size value");
|
||||
_error_message.set_buffer(Some(&text_buffer));
|
||||
_error_dialog.show();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user