Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

Engine: list edge, params and reverse in the sequence.applyAudioTransition schema (#1100)

MarekSpodBiedry4823952c038d
diff --git a/crates/engine/src/commands.rs b/crates/engine/src/commands.rs
index 6609afddf..3b4956c08 100644
--- a/crates/engine/src/commands.rs
+++ b/crates/engine/src/commands.rs
@@ -1740,7 +1740,7 @@ fn build() -> Vec<CommandSpec> {
"Apply Audio Transition",
["Sequence"],
Some("Cmd+Shift+D"),
- r#"{"clip":id?,"effect":str?,"frames":i64?}"#,
+ r#"{"clip":id?,"effect":"constant_power|Constant Power|…"?,"frames":i64?,"edge":"in"|"out"?,"params":{param:value}?,"reverse":bool?}"#,
has_seq,
|s, p| apply_transition(s, p, TrackKind::Audio)
),
diff --git a/crates/engine/src/mixer_tests.rs b/crates/engine/src/mixer_tests.rs
index faf9243ae..4e218d113 100644
--- a/crates/engine/src/mixer_tests.rs
+++ b/crates/engine/src/mixer_tests.rs
@@ -520,3 +520,11 @@ fn surround_sequence_settings_and_panner_lanes() {
assert!(s.execute("file.newSequence", json!({"mix": "7.1"})).is_err());
s.execute("file.newSequence", json!({"trackType": "Standard"})).unwrap();
}
+
+#[test]
+fn audio_transition_schema_lists_edge_params_and_reverse() {
+ let params = find_command("sequence.applyAudioTransition").unwrap().params;
+ for key in ["\"edge\"", "\"params\"", "\"reverse\"", "constant_power"] {
+ assert!(params.contains(key), "schema `{params}` is missing {key}");
+ }
+}