Skip to content

Commit 78a7175

Browse files
committed
[*] refactor: video-editor
1 parent 770bc62 commit 78a7175

File tree

20 files changed

+3565
-56
lines changed

20 files changed

+3565
-56
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wayshot/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pmacro.workspace = true
2525
anyhow.workspace = true
2626
camera.workspace = true
2727
fast2s.workspace = true
28+
chrono.workspace = true
2829
tempfile.workspace = true
2930
recorder.workspace = true
3031
clipboard.workspace = true
@@ -40,6 +41,7 @@ downloader.workspace = true
4041
audio-utils.workspace = true
4142
video-utils.workspace = true
4243
image-effect.workspace = true
44+
video-editor.workspace = true
4345
native-dialog.workspace = true
4446
platform-dirs.workspace = true
4547
screen-capture.workspace = true

wayshot/src/logic.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,32 @@ macro_rules! logic_cb {
8989
};
9090
}
9191

92+
#[macro_export]
93+
macro_rules! logic_cb_pure {
94+
($callback_name:ident, $ui:expr, $($arg:ident),*) => {
95+
{{
96+
let ui_weak = $ui.as_weak();
97+
paste::paste! {
98+
crate::global_logic!($ui)
99+
.[<on_ $callback_name>](move |$($arg),*| {
100+
$callback_name(&ui_weak.unwrap(), $($arg),*)
101+
});
102+
}
103+
}}
104+
};
105+
($callback_name:ident, $ui:expr) => {
106+
{{
107+
let ui_weak = $ui.as_weak();
108+
paste::paste! {
109+
crate::global_logic!($ui)
110+
.[<on_ $callback_name>](move || {
111+
$callback_name(&ui_weak.unwrap())
112+
});
113+
}
114+
}}
115+
};
116+
}
117+
92118
#[macro_export]
93119
macro_rules! impl_slint_enum_serde {
94120
($ty:ident, $($arg:ident),+) => {

wayshot/src/logic/video_editor.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1+
mod command;
12
mod common_type;
3+
mod conversion;
4+
mod export;
5+
mod library;
6+
mod playlist;
7+
mod preview;
28
mod project;
9+
mod segment;
10+
mod subtitle;
11+
mod track;
12+
mod validation;
313

414
pub fn init(ui: &crate::slint_generatedAppWindow::AppWindow) {
515
project::init(ui);
16+
command::init(ui);
17+
track::init(ui);
18+
export::init(ui);
19+
library::init(ui);
20+
playlist::init(ui);
21+
preview::init(ui);
22+
segment::init(ui);
23+
subtitle::init(ui);
624
}

0 commit comments

Comments
 (0)