The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.
Rust ffmpegfree-video-editormodel-context-protocolnon-linear-editoroffline-firstopen-source-video-editorself-hostedvideo-editingvideo-editing-automationvideo-editing-softwarevideo-editing-toolsvideo-editorvoice-cloningyoutube-automationyoutube-shorts
Read the inspector's chains from the effect catalogue
Jareerdb6019c741d1
diff --git a/engine/Cargo.lock b/engine/Cargo.lockindex 20c714bd..d828f0eb 100644--- a/engine/Cargo.lock+++ b/engine/Cargo.lock@@ -1096,6 +1096,7 @@ name = "concat"version = "0.2.0"dependencies = ["concat-core",+ "concat-effects","concat-export","concat-host","concat-media",diff --git a/engine/crates/concat-effects/packages/concat.bright/effect.toml b/engine/crates/concat-effects/packages/concat.bright/effect.tomlnew file mode 100644index 00000000..661ff206--- /dev/null+++ b/engine/crates/concat-effects/packages/concat.bright/effect.toml@@ -0,0 +1,21 @@+[effect]+id = "concat.bright"+name = "Bright"+kind = "audio"+category = "Tone"+order = 22+intensity = "gain"+aliases = ["bright"]+description = "Air and presence: a lift above six kilohertz."++[[param]]+key = "gain"+label = "Gain"+min = 0+max = 12+default = 5+step = 0.5+unit = "dB"++[ffmpeg]+chain = "treble=g={fixed(gain, 2)}:f=6000:w=0.8,alimiter=limit=0.95"diff --git a/engine/crates/concat-effects/packages/concat.bright/fixtures.toml b/engine/crates/concat-effects/packages/concat.bright/fixtures.tomlnew file mode 100644index 00000000..efda8ef6--- /dev/null+++ b/engine/crates/concat-effects/packages/concat.bright/fixtures.toml@@ -0,0 +1,13 @@+[[case]]+name = "default"+chain = "treble=g=5.00:f=6000:w=0.8,alimiter=limit=0.95"++[[case]]+name = "minimum"+at = "min"+chain = "treble=g=0.00:f=6000:w=0.8,alimiter=limit=0.95"++[[case]]+name = "maximum"+at = "max"+chain = "treble=g=12.00:f=6000:w=0.8,alimiter=limit=0.95"diff --git a/engine/crates/concat-effects/packages/concat.cathedral/effect.toml b/engine/crates/concat-effects/packages/concat.cathedral/effect.tomlnew file mode 100644index 00000000..22f3f9da--- /dev/null+++ b/engine/crates/concat-effects/packages/concat.cathedral/effect.toml@@ -0,0 +1,24 @@+[effect]+id = "concat.cathedral"+name = "Cathedral"+kind = "audio"+category = "Space"+order = 34+intensity = "size"+aliases = ["cathedral"]+description = "Stone and height: reflections that take a while to arrive."++[[param]]+key = "size"+label = "Size"+min = 0+max = 100+default = 55+step = 1+unit = "%"++[ffmpeg]+let = [+ "scale = 0.5 + (size / 100) * 1.5",+]+chain = "aecho=0.8:0.9:{round(120 * scale)}|{round(230 * scale)}|{round(390 * scale)}|{round(600 * scale)}:0.6|0.5|0.4|0.3"diff --git a/engine/crates/concat-effects/packages/concat.cathedral/fixtures.toml b/engine/crates/concat-effects/packages/concat.cathedral/fixtures.tomlnew file mode 100644index 00000000..ec95ecc1--- /dev/null+++ b/engine/crates/concat-effects/packages/concat.cathedral/fixtures.toml@@ -0,0 +1,13 @@+[[case]]+name = "default"+chain = "aecho=0.8:0.9:159|305|517|795:0.6|0.5|0.4|0.3"++[[case]]+name = "minimum"+at = "min"+chain = "aecho=0.8:0.9:60|115|195|300:0.6|0.5|0.4|0.3"++[[case]]+name = "maximum"+at = "max"+chain = "aecho=0.8:0.9:240|460|780|1200:0.6|0.5|0.4|0.3"diff --git a/engine/crates/concat-effects/packages/concat.hall/effect.toml b/engine/crates/concat-effects/packages/concat.hall/effect.tomlnew file mode 100644index 00000000..add688b7--- /dev/null+++ b/engine/crates/concat-effects/packages/concat.hall/effect.toml@@ -0,0 +1,24 @@+[effect]+id = "concat.hall"+name = "Hall"+kind = "audio"+category = "Space"+order = 32+intensity = "size"+aliases = ["hall"]+description = "A concert hall: long, even reflections."++[[param]]+key = "size"+label = "Size"+min = 0+max = 100+default = 50+step = 1+unit = "%"++[ffmpeg]+let = [+ "scale = 0.5 + (size / 100) * 1.5",+]+chain = "aecho=0.8:0.85:{round(60 * scale)}|{round(110 * scale)}|{round(180 * scale)}|{round(270 * scale)}:0.5|0.4|0.3|0.2"diff --git a/engine/crates/concat-effects/packages/concat.hall/fixtures.toml b/engine/crates/concat-effects/packages/concat.hall/fixtures.tomlnew file mode 100644index 00000000..15b91bdb--- /dev/null+++ b/engine/crates/concat-effects/packages/concat.hall/fixtures.toml@@ -0,0 +1,13 @@+[[case]]+name = "default"+chain = "aecho=0.8:0.85:75|138|225|338:0.5|0.4|0.3|0.2"++[[case]]+name = "minimum"+at = "min"+chain = "aecho=0.8:0.85:30|55|90|135:0.5|0.4|0.3|0.2"++[[case]]+name = "maximum"+at = "max"+chain = "aecho=0.8:0.85:120|220|360|540:0.5|0.4|0.3|0.2"diff --git a/engine/crates/concat-effects/packages/concat.plate/effect.toml b/engine/crates/concat-effects/packages/concat.plate/effect.tomlnew file mode 100644index 00000000..7f34f17e--- /dev/null+++ b/engine/crates/concat-effects/packages/concat.plate/effect.toml@@ -0,0 +1,24 @@+[effect]+id = "concat.plate"+name = "Plate"+kind = "audio"+category = "Space"+order = 33+intensity = "size"+aliases = ["plate"]+description = "A studio plate: dense, bright and short."++[[param]]+key = "size"+label = "Size"+min = 0+max = 100+default = 40+step = 1+unit = "%"++[ffmpeg]+let = [+ "scale = 0.5 + (size / 100) * 1.5",+]+chain = "aecho=0.8:0.9:{round(8 * scale)}|{round(17 * scale)}|{round(29 * scale)}|{round(43 * scale)}:0.45|0.35|0.25|0.15"diff --git a/engine/crates/concat-effects/packages/concat.plate/fixtures.toml b/engine/crates/concat-effects/packages/concat.plate/fixtures.tomlnew file mode 100644index 00000000..031c1713--- /dev/null+++ b/engine/crates/concat-effects/packages/concat.plate/fixtures.toml@@ -0,0 +1,13 @@+[[case]]+name = "default"+chain = "aecho=0.8:0.9:9|19|32|47:0.45|0.35|0.25|0.15"++[[case]]+name = "minimum"+at = "min"+chain = "aecho=0.8:0.9:4|9|15|22:0.45|0.35|0.25|0.15"++[[case]]+name = "maximum"+at = "max"+chain = "aecho=0.8:0.9:16|34|58|86:0.45|0.35|0.25|0.15"diff --git a/engine/crates/concat-effects/packages/concat.radio/effect.toml b/engine/crates/concat-effects/packages/concat.radio/effect.tomlnew file mode 100644index 00000000..ab6c43fe--- /dev/null+++ b/engine/crates/concat-effects/packages/concat.radio/effect.toml@@ -0,0 +1,24 @@+[effect]+id = "concat.radio"+name = "Radio"+kind = "audio"+category = "Tone"+order = 24+intensity = "noise"+aliases = ["radio"]+description = "A small speaker on a long wave: narrow band, a little crunch."++[[param]]+key = "noise"+label = "Noise"+min = 0+max = 100+default = 30+step = 1+unit = "%"++[ffmpeg]+let = [+ "bits = 16 - (noise / 100) * 12",+]+chain = "highpass=f=300,lowpass=f=3400,acrusher=bits={round(bits)}:mode=log:mix=0.6,alimiter=limit=0.9"diff --git a/engine/crates/concat-effects/packages/concat.radio/fixtures.toml b/engine/crates/concat-effects/packages/concat.radio/fixtures.tomlnew file mode 100644index 00000000..02904256--- /dev/null+++ b/engine/crates/concat-effects/packages/concat.radio/fixtures.toml@@ -0,0 +1,13 @@+[[case]]+name = "default"+chain = "highpass=f=300,lowpass=f=3400,acrusher=bits=12:mode=log:mix=0.6,alimiter=limit=0.9"++[[case]]+name = "minimum"+at = "min"+chain = "highpass=f=300,lowpass=f=3400,acrusher=bits=16:mode=log:mix=0.6,alimiter=limit=0.9"++[[case]]+name = "maximum"+at = "max"+chain = "highpass=f=300,lowpass=f=3400,acrusher=bits=4:mode=log:mix=0.6,alimiter=limit=0.9"diff --git a/engine/crates/concat/Cargo.toml b/engine/crates/concat/Cargo.tomlindex 13a7eba7..aa91805d 100644--- a/engine/crates/concat/Cargo.toml+++ b/engine/crates/concat/Cargo.toml@@ -54,6 +54,8 @@ concat-project.workspace = trueconcat-export.workspace = trueconcat-host = { workspace = true, features = ["gpu"] }concat-speech.workspace = true+# The effect catalogue: the inspector's shelves and each link's knobs.+concat-effects.workspace = true# Native file and folder dialogs, which Slint deliberately does not have.rfd = "0.17"diff --git a/engine/crates/concat/src/main.rs b/engine/crates/concat/src/main.rsindex cc987257..34c59e6f 100644--- a/engine/crates/concat/src/main.rs+++ b/engine/crates/concat/src/main.rs@@ -125,6 +125,16 @@ fn main() -> Result<(), slint::PlatformError> {editor.set_media(ModelRc::from(models.media.clone()));editor.set_video_effects(ModelRc::from(models.video_effects.clone()));editor.set_audio_effects(ModelRc::from(models.audio_effects.clone()));+ editor.set_catalogue_effects(ModelRc::from(models.catalogue_effects.clone()));+ editor.set_catalogue_filters(ModelRc::from(models.catalogue_filters.clone()));+ editor.set_catalogue_audio(ModelRc::from(models.catalogue_audio.clone()));+ editor.set_effect_groups(ModelRc::from(models.effect_groups.clone()));+ editor.set_filter_groups(ModelRc::from(models.filter_groups.clone()));+ editor.set_audio_groups(ModelRc::from(models.audio_groups.clone()));+ editor.set_applied_visual(ModelRc::from(models.applied_visual.clone()));+ editor.set_applied_audio(ModelRc::from(models.applied_audio.clone()));+ editor.set_visual_params(ModelRc::from(models.visual_params.clone()));+ editor.set_audio_params(ModelRc::from(models.audio_params.clone()));editor.set_menu_items(ModelRc::from(models.menu.clone()));editor.set_av_items(ModelRc::from(models.av.clone()));app.set_app_menu_items(ModelRc::from(models.bar.clone()));@@ -409,14 +419,18 @@ fn main() -> Result<(), slint::PlatformError> {editor.on_library_add_text(on_window!(|state| {state.place_at_playhead("text:default:Title");}));+ // A filter is a colour look on the picture; audio is the sound's chain.editor.on_library_apply_filter(on_window!(|state, id: SharedString, _label: SharedString| {- state.apply_catalogue(id.as_str(), false);+ state.apply_catalogue(id.as_str(), true);}));editor.on_library_apply_effect(on_window!(|state, id: SharedString| {state.apply_catalogue(id.as_str(), true);}));+ editor.on_library_apply_audio(on_window!(|state, id: SharedString| {+ state.apply_catalogue(id.as_str(), false);+ }));editor.on_library_apply_transition(on_window!(|state, id: SharedString| {state.apply_transition(id.as_str());}));@@ -642,6 +656,25 @@ fn main() -> Result<(), slint::PlatformError> {state.clip_commit();}));+ // ── the chains ──+ editor.on_chain_add(on_window!(|state, audio: bool, id: SharedString| {+ state.chain_add(audio, id.as_str());+ }));+ editor.on_chain_toggle(on_window!(|state, audio: bool, index: i32| {+ state.chain_toggle(audio, index);+ }));+ editor.on_chain_move_by(on_window!(|state, audio: bool, index: i32, delta: i32| {+ state.chain_move(audio, index, delta);+ }));+ editor.on_chain_remove(on_window!(|state, audio: bool, index: i32| {+ state.chain_remove(audio, index);+ }));+ editor.on_chain_set_param(on_lanes!(+ |state, audio: bool, index: i32, key: SharedString, value: f32| {+ state.chain_set_param(audio, index, key.as_str(), value);+ }+ ));+// ── the monitor ──editor.on_seek(on_lanes!(|state, seconds: f32| {state.pause();diff --git a/engine/crates/concat/src/studio.rs b/engine/crates/concat/src/studio.rsindex b744ae4a..ab7e6b2f 100644--- a/engine/crates/concat/src/studio.rs+++ b/engine/crates/concat/src/studio.rs@@ -23,6 +23,8 @@ use std::collections::{HashMap, HashSet};use std::rc::Rc;use std::sync::Arc;+use concat_effects::Catalogue;+use concat_effects::manifest::Kind as PackageKind;use concat_host::export::{self, ExportSpec};use concat_host::playback::ClipSpec;use concat_host::preview::FrameSpec;@@ -377,6 +379,18 @@ pub struct Models {pub media: Rc<VecModel<MediaItemData>>,pub video_effects: Rc<VecModel<EffectData>>,pub audio_effects: Rc<VecModel<EffectData>>,+ /// The catalogue's shelves, one list per kind, and the shelf labels.+ pub catalogue_effects: Rc<VecModel<CatalogueEntryData>>,+ pub catalogue_filters: Rc<VecModel<CatalogueEntryData>>,+ pub catalogue_audio: Rc<VecModel<CatalogueEntryData>>,+ pub effect_groups: Rc<VecModel<SharedString>>,+ pub filter_groups: Rc<VecModel<SharedString>>,+ pub audio_groups: Rc<VecModel<SharedString>>,+ /// The selected clip's two chains and their knobs.+ pub applied_visual: Rc<VecModel<AppliedEntryData>>,+ pub applied_audio: Rc<VecModel<AppliedEntryData>>,+ pub visual_params: Rc<VecModel<AppliedParamData>>,+ pub audio_params: Rc<VecModel<AppliedParamData>>,pub menu: Rc<VecModel<MenuItemData>>,pub av: Rc<VecModel<MenuItemData>>,pub bar: Rc<VecModel<MenuItemData>>,@@ -398,6 +412,16 @@ impl Models {media: Rc::new(VecModel::default()),video_effects: Rc::new(VecModel::default()),audio_effects: Rc::new(VecModel::default()),+ catalogue_effects: Rc::new(VecModel::default()),+ catalogue_filters: Rc::new(VecModel::default()),+ catalogue_audio: Rc::new(VecModel::default()),+ effect_groups: Rc::new(VecModel::default()),+ filter_groups: Rc::new(VecModel::default()),+ audio_groups: Rc::new(VecModel::default()),+ applied_visual: Rc::new(VecModel::default()),+ applied_audio: Rc::new(VecModel::default()),+ visual_params: Rc::new(VecModel::default()),+ audio_params: Rc::new(VecModel::default()),menu: Rc::new(VecModel::default()),av: Rc::new(VecModel::default()),bar: Rc::new(VecModel::default()),@@ -559,6 +583,104 @@ fn new_title_style() -> TextStyle {}/// A label for a catalogue id: "black-white" reads as "Black White".+/// One kind's shelves for the inspector: the shelf labels, in catalogue+/// order, and every package on them with the index of its shelf.+fn shelves(kind: PackageKind) -> (Vec<SharedString>, Vec<CatalogueEntryData>) {+ let mut groups: Vec<String> = Vec::new();+ let mut entries = Vec::new();+ for package in Catalogue::builtin().of_kind(kind) {+ let meta = &package.manifest.effect;+ let category = if meta.category.is_empty() {+ "Other".to_owned()+ } else {+ meta.category.clone()+ };+ let group = match groups.iter().position(|held| *held == category) {+ Some(index) => index,+ None => {+ groups.push(category.clone());+ groups.len() - 1+ }+ };+ entries.push(CatalogueEntryData {+ id: meta.id.as_str().into(),+ name: meta.name.as_str().into(),+ category: category.as_str().into(),+ group: group as i32,+ description: meta.description.as_str().into(),+ });+ }+ (+ groups.into_iter().map(SharedString::from).collect(),+ entries,+ )+}++/// How a manifest's unit is read out. Anything the inspector has no words+/// for is a plain number.+fn format_of(unit: &str) -> ParamFormat {+ match unit.trim() {+ "%" => ParamFormat::Percent,+ "dB" => ParamFormat::Decibels,+ "Hz" => ParamFormat::Hertz,+ "s" => ParamFormat::Seconds,+ "ms" => ParamFormat::Millis,+ "st" => ParamFormat::Pitch,+ "K" => ParamFormat::Kelvin,+ "°" => ParamFormat::Degrees,+ "x" => ParamFormat::Rate,+ _ => ParamFormat::Plain,+ }+}++/// A chain as the inspector's stack draws it: one row per link, and one per+/// knob its package declares, holding the document's value or the default.+/// A link no package answers to keeps its row - so it can be removed - and+/// gets no knobs.+fn chain_rows(chain: &[AppliedFilter]) -> (Vec<AppliedEntryData>, Vec<AppliedParamData>) {+ let catalogue = Catalogue::builtin();+ let mut rows = Vec::new();+ let mut knobs = Vec::new();+ for (index, entry) in chain.iter().enumerate() {+ let package = catalogue+ .packages()+ .find(|package| package.answers_to(&entry.id));+ rows.push(AppliedEntryData {+ id: entry.id.as_str().into(),+ name: package+ .map(|package| package.manifest.effect.name.clone())+ .unwrap_or_else(|| label_of(&entry.id))+ .into(),+ on: entry.enabled,+ known: package.is_some(),+ });+ let Some(package) = package else { continue };+ for param in &package.manifest.params {+ let step = if param.step > 0.0 {+ param.step+ } else {+ (param.max - param.min) / 200.0+ };+ knobs.push(AppliedParamData {+ entry: index as i32,+ key: param.key.as_str().into(),+ label: param.label.as_str().into(),+ min: param.min as f32,+ max: param.max as f32,+ step: step as f32,+ default_value: param.default as f32,+ value: entry+ .params+ .get(¶m.key)+ .copied()+ .unwrap_or(param.default) as f32,+ fmt: format_of(¶m.unit),+ });+ }+ }+ (rows, knobs)+}+fn label_of(id: &str) -> String {id.split(['-', '_']).map(|word| {@@ -1549,6 +1671,106 @@ impl Studio {self.apply(Command::UpdateClip { clip_id, patch });}+ // ── the chains ──+ //+ // The picture's chain and the sound's, edited by index from the+ // inspector's stacks. Adding, removing, reordering and bypassing are+ // each one command; a knob is a stream and goes through the echo, the+ // way every other inspector control does.++ /// One edit to the selected clip's chain, as a command. `edit` returns+ /// false to say it changed nothing.+ fn chain_edit(&mut self, audio: bool, edit: impl FnOnce(&mut Vec<AppliedFilter>) -> bool) {+ let Some(clip_id) = self.sole_selection() else {+ return;+ };+ let Some(clip) = self.clip(&clip_id).cloned() else {+ return;+ };+ let mut chain = if audio {+ clip.filters+ } else {+ clip.video_effects+ };+ if !edit(&mut chain) {+ return;+ }+ let patch = if audio {+ ClipPatch {+ filters: Some(chain),+ ..ClipPatch::default()+ }+ } else {+ ClipPatch {+ video_effects: Some(chain),+ ..ClipPatch::default()+ }+ };+ self.apply(Command::UpdateClip { clip_id, patch });+ }++ pub fn chain_add(&mut self, audio: bool, id: &str) {+ self.apply_catalogue(id, !audio);+ }++ pub fn chain_toggle(&mut self, audio: bool, index: i32) {+ self.chain_edit(audio, |chain| {+ let Some(entry) = usize::try_from(index).ok().and_then(|i| chain.get_mut(i)) else {+ return false;+ };+ entry.enabled = !entry.enabled;+ true+ });+ }++ pub fn chain_move(&mut self, audio: bool, index: i32, delta: i32) {+ self.chain_edit(audio, |chain| {+ let Ok(from) = usize::try_from(index) else {+ return false;+ };+ let Ok(to) = usize::try_from(index + delta) else {+ return false;+ };+ if from >= chain.len() || to >= chain.len() || from == to {+ return false;+ }+ chain.swap(from, to);+ true+ });+ }++ pub fn chain_remove(&mut self, audio: bool, index: i32) {+ self.chain_edit(audio, |chain| {+ let Ok(at) = usize::try_from(index) else {+ return false;+ };+ if at >= chain.len() {+ return false;+ }+ chain.remove(at);+ true+ });+ }++ /// One knob of one link, on the echo. `clip_commit` makes it real.+ pub fn chain_set_param(&mut self, audio: bool, index: i32, key: &str, value: f32) {+ let Some(id) = self.sole_selection() else {+ return;+ };+ self.begin_echo();+ let Some(clip) = self.echo_clip_mut(&id) else {+ return;+ };+ let chain = if audio {+ &mut clip.filters+ } else {+ &mut clip.video_effects+ };+ if let Some(entry) = usize::try_from(index).ok().and_then(|i| chain.get_mut(i)) {+ entry.params.insert(key.to_owned(), f64::from(value));+ }+ }+// ── gestures ──/// A press resolves the selection before anything moves, so a drag that@@ -1913,6 +2135,12 @@ impl Studio {if after.text != before.text {patch.text = Some(after.text.clone());}+ if after.video_effects != before.video_effects {+ patch.video_effects = Some(after.video_effects.clone());+ }+ if after.filters != before.filters {+ patch.filters = Some(after.filters.clone());+ }if patch != ClipPatch::default() {commands.push(Command::UpdateClip { clip_id: id, patch });}@@ -3260,6 +3488,22 @@ impl Studio {};sync(&models.video_effects, video);sync(&models.audio_effects, audio);++ // The same chains as the inspector's stacks see them: a row per+ // link and a row per knob, from the catalogue's manifests.+ let (visual, visual_params, sound, sound_params) =+ match self.sole_selection().and_then(|id| self.clip(&id)) {+ Some(clip) => {+ let (visual, visual_params) = chain_rows(&clip.video_effects);+ let (sound, sound_params) = chain_rows(&clip.filters);+ (visual, visual_params, sound, sound_params)+ }+ None => (Vec::new(), Vec::new(), Vec::new(), Vec::new()),+ };+ sync(&models.applied_visual, visual);+ sync(&models.visual_params, visual_params);+ sync(&models.applied_audio, sound);+ sync(&models.audio_params, sound_params);}/// The selection, flattened for the inspector: exactly one clip or@@ -3313,6 +3557,18 @@ impl Studio {pub fn publish_chrome(&self, app: &App, models: &Models) {let editor = app.global::<Editor>();+ // The catalogue's shelves. Built in, so they never change after+ // start; `sync` makes republishing them a no-op.+ let (groups, entries) = shelves(PackageKind::Effect);+ sync(&models.effect_groups, groups);+ sync(&models.catalogue_effects, entries);+ let (groups, entries) = shelves(PackageKind::Filter);+ sync(&models.filter_groups, groups);+ sync(&models.catalogue_filters, entries);+ let (groups, entries) = shelves(PackageKind::Audio);+ sync(&models.audio_groups, groups);+ sync(&models.catalogue_audio, entries);+app.set_on_start(self.on_start);app.set_project_name(self.project_name.as_str().into());app.set_project_status(diff --git a/engine/crates/concat/ui/app.slint b/engine/crates/concat/ui/app.slintindex 60ae3c9d..b63fdf1a 100644--- a/engine/crates/concat/ui/app.slint+++ b/engine/crates/concat/ui/app.slint@@ -28,6 +28,10 @@ import { Editor } from "editor.slint";import { PaneKind } from "workspace/pane-switcher.slint";import { RecentProjectData, StartData, StartScreen } from "start.slint";import { TitleBar } from "title-bar.slint";+import {+ AppliedEntryData, AppliedParamData, CatalogueEntryData,+} from "inspector/clip-inspector.slint";+import { ParamFormat } from "inspector/controls.slint";import { ToastData, ToastLayer } from "primitives/toast.slint";import { TooltipLayer } from "primitives/tooltip.slint";import { Workspace } from "workspace/workspace.slint";@@ -40,6 +44,7 @@ import {// Re-exported so main.rs can reach the globals and the struct.export {Curves, Fmt, Payload, Theme, Bezier, Editor,+ AppliedEntryData, AppliedParamData, CatalogueEntryData, ParamFormat,DockDivider, DockSide, PaneKind, SeatBox,EffectData, MediaFilter, MediaItemData, MediaKind,ClipData, ClipField, ClipKind, ClipTextField, DropData, SelectedClipData,diff --git a/engine/crates/concat/ui/editor.slint b/engine/crates/concat/ui/editor.slintindex a0f0c212..83f27539 100644--- a/engine/crates/concat/ui/editor.slint+++ b/engine/crates/concat/ui/editor.slint@@ -2,6 +2,9 @@// SPDX-FileCopyrightText: 2026 Jareer and Concat contributorsimport { EffectData } from "demo/effects-panel.slint";+import {+ AppliedEntryData, AppliedParamData, CatalogueEntryData,+} from "inspector/clip-inspector.slint";import { MediaFilter, MediaItemData } from "workspace/media-pane.slint";import { DockDivider, DockSide, SeatBox } from "dock.slint";import { PaneKind } from "workspace/pane-switcher.slint";@@ -87,6 +90,7 @@ export global Editor {callback library-apply-effect(effect-id: string);callback library-apply-transition(transition-id: string);callback library-apply-filter(filter-id: string, label: string);+ callback library-apply-audio(effect-id: string);callback library-save-template();// ── the inspector ──@@ -96,6 +100,27 @@ export global Editor {callback clip-set-colour(field: ClipTextField, value: color);callback clip-commit();+ // The effect catalogue's shelves, published once, and the selected+ // clip's two chains with a row per parameter. See PresetStack.+ in-out property <[CatalogueEntryData]> catalogue-effects;+ in-out property <[CatalogueEntryData]> catalogue-filters;+ in-out property <[CatalogueEntryData]> catalogue-audio;+ in-out property <[string]> effect-groups;+ in-out property <[string]> filter-groups;+ in-out property <[string]> audio-groups;+ in-out property <[AppliedEntryData]> applied-visual;+ in-out property <[AppliedEntryData]> applied-audio;+ in-out property <[AppliedParamData]> visual-params;+ in-out property <[AppliedParamData]> audio-params;+ /// `audio` picks the chain: the sound's, or the picture's. A parameter+ /// change lands on the echo and `clip-commit` makes it a command, the+ /// same as every other inspector control.+ callback chain-add(audio: bool, id: string);+ callback chain-toggle(audio: bool, index: int);+ callback chain-move-by(audio: bool, index: int, delta: int);+ callback chain-remove(audio: bool, index: int);+ callback chain-set-param(audio: bool, index: int, key: string, value: float);+in-out property <[EffectData]> video-effects;in-out property <[EffectData]> audio-effects;in-out property <float> level;diff --git a/engine/crates/concat/ui/inspector/clip-inspector.slint b/engine/crates/concat/ui/inspector/clip-inspector.slintindex 919430b1..1d31e3d6 100644--- a/engine/crates/concat/ui/inspector/clip-inspector.slint+++ b/engine/crates/concat/ui/inspector/clip-inspector.slint@@ -18,65 +18,81 @@ import { ClipField, ClipKind, SelectedClipData } from "../timeline/model.slint";/// One parameter a preset exposes. `value` doubles as the default in the/// catalogue: applying a preset copies the row, and double-click restores/// `default-value`.-export struct ParamData {+/// One package on a library shelf. Published by Rust from the effect+/// catalogue; the id is what Rust is handed back when the row is clicked, and+/// ids are stable forever because project files store them.+export struct CatalogueEntryData {id: string,- label: string,- min: float,- max: float,- step: float,- default-value: float,- value: float,- fmt: ParamFormat,+ name: string,+ /// The shelf's label, and its index into the kind's group list.+ category: string,+ group: int,+ description: string,}-/// One preset in an applied chain: which one, whether it is live, its values.-/// Every preset in the catalogue exposes exactly two parameters, so the pair-/// is flattened here instead of nested in a model a struct cannot hold.-export struct AppliedPresetData {+/// One link of the selected clip's chain, in chain order.+export struct AppliedEntryData {id: string,name: string,+ /// False bypasses the link without losing what was dialled into it.on: bool,- p1: ParamData,- p2: ParamData,+ /// False when no package answers to the id: the row still shows, so the+ /// link can be removed, but it has no knobs and renders nothing.+ known: bool,}-/// A catalogue entry: the preset as it would be applied, plus its shelf.-export struct PresetDef {- group: int,- preset: AppliedPresetData,+/// One knob of one link. Flat rather than nested in the entry so a value+/// changing under a drag rewrites one small row and not the whole link.+export struct AppliedParamData {+ /// Which link, as an index into the applied list.+ entry: int,+ /// The manifest's key; what Rust is handed back with the new value.+ key: string,+ label: string,+ min: float,+ max: float,+ step: float,+ default-value: float,+ value: float,+ fmt: ParamFormat,}-// The applied chain plus the library that feeds it.+/// A chain and its library: the links applied to the selected clip, each+/// with a control per parameter its package declares, and under it the+/// shelves of packages that can be added. One component serves effects,+/// filters and audio alike — the data says which.export component PresetStack inherits VerticalLayout {/// lower-case singular, for labels and placeholders- in property <string> noun: "filter";- in property <string> library-title: "Filter library";+ in property <string> noun: "effect";+ in property <string> library-title: "Effect library";in property <[string]> group-labels;- in property <[PresetDef]> catalogue;+ in property <[CatalogueEntryData]> catalogue;/// Owned by Rust: a chain is edited by index, and Slint models cannot be/// spliced from the language.- in property <[AppliedPresetData]> applied;+ in property <[AppliedEntryData]> applied;+ in property <[AppliedParamData]> params;- callback add(preset: AppliedPresetData);+ callback add(id: string);callback toggle(index: int);callback move-by(index: int, delta: int);callback remove(index: int);- callback set-param(index: int, second: bool, value: float);+ /// One knob moved. The value lands on the echo; `commit` makes it real.+ callback set-param(index: int, key: string, value: float);+ callback commit();property <int> group;property <string> query;property <bool> help;- function shown(def: PresetDef) -> bool {- return def.group == root.group- && (root.query == "" || InspectorSearch.matches(def.preset.name, root.query));+ function shown(entry: CatalogueEntryData) -> bool {+ return entry.group == root.group+ && (root.query == "" || InspectorSearch.matches(entry.name, root.query));}function in-chain(id: string) -> bool {- // Two is the deepest the demo chains go before this reads awkwardly;- // a real member test wants a model lookup Slint cannot express, so- // Rust flags it the day chains grow params. Linear scan over a model- // is fine at this size.+ // A real member test wants a model lookup Slint cannot express, so+ // this scans the first eight links, which is deeper than a chain+ // gets before it stops being a chain and starts being a problem.return root.applied.length > 0 && (root.applied[0].id == id|| (root.applied.length > 1 && root.applied[1].id == id)|| (root.applied.length > 2 && root.applied[2].id == id)@@ -87,7 +103,7 @@ export component PresetStack inherits VerticalLayout {|| (root.applied.length > 7 && root.applied[7].id == id));}- // No empty shell: the section arrives with the first preset, so an+ // No empty shell: the section arrives with the first link, so an// untouched clip shows only its library.if root.applied.length > 0: Section {first: true;@@ -132,13 +148,20 @@ export component PresetStack inherits VerticalLayout {Text {horizontal-stretch: 1;text: item.name;- color: Theme.fg;+ color: item.known ? Theme.fg : Theme.fg-dim;font-size: Theme.fs;font-weight: Theme.weight-title;vertical-alignment: center;overflow: elide;}+ if !item.known: Text {+ text: "not installed";+ color: Theme.fg-dim;+ font-size: Theme.fs-xs;+ vertical-alignment: center;+ }+IconButton {glyph: Glyph.eye;label: item.on ? "Bypass \{item.name}" : "Enable \{item.name}";@@ -164,28 +187,31 @@ export component PresetStack inherits VerticalLayout {}}- Param {- label: item.p1.label;- value: item.p1.value;- minimum: item.p1.min;- maximum: item.p1.max;- step: item.p1.step;- default-value: item.p1.default-value;- fmt: item.p1.fmt;- enabled: item.on;- changed(v) => { root.set-param(index, false, v); }- }-- Param {- label: item.p2.label;- value: item.p2.value;- minimum: item.p2.min;- maximum: item.p2.max;- step: item.p2.step;- default-value: item.p2.default-value;- fmt: item.p2.fmt;- enabled: item.on;- changed(v) => { root.set-param(index, true, v); }+ // One control per parameter the package declares. The+ // knob writes to its own `value`, which drops a binding,+ // so the row re-seeds it whenever Rust republishes the+ // parameter — a new clip, an undo — and the control+ // never shows a number that is not the document's.+ for p in root.params: Rectangle {+ property <AppliedParamData> data: p;+ visible: p.entry == index;+ height: p.entry == index ? knob.preferred-height : 0;+ changed data => { knob.value = self.data.value; }++ knob := Param {+ label: p.label;+ value: p.value;+ minimum: p.min;+ maximum: p.max;+ step: p.step;+ default-value: p.default-value;+ fmt: p.fmt;+ enabled: item.on;+ changed(v) => {+ root.set-param(index, p.key, v);+ root.commit();+ }+ }}}}@@ -226,13 +252,13 @@ export component PresetStack inherits VerticalLayout {// keystroke and a hidden row costing zero height is the cheap,// geometry-proof way to narrow the list (see media-pane's// sidebar for the scar tissue behind this choice).- for def[index] in root.catalogue: row := Rectangle {+ for entry[index] in root.catalogue: row := Rectangle {// Named rather than reached through `parent`: a layout is not// transparent to a parent chain, so a descendant inside the// HorizontalLayout below cannot see the row's own properties// any other way.- property <bool> shown: root.shown(def);- property <bool> in-chain: root.in-chain(def.preset.id);+ property <bool> shown: root.shown(entry);+ property <bool> in-chain: root.in-chain(entry.id);visible: row.shown;height: row.shown ? 26px : 0;@@ -256,7 +282,7 @@ export component PresetStack inherits VerticalLayout {Text {horizontal-stretch: 1;- text: def.preset.name;+ text: entry.name;color: row.in-chain ? Theme.fg-dim : Theme.fg;font-size: Theme.fs;vertical-alignment: center;@@ -274,7 +300,7 @@ export component PresetStack inherits VerticalLayout {row-touch := TouchArea {enabled: !row.in-chain;mouse-cursor: pointer;- clicked => { root.add(def.preset); }+ clicked => { root.add(entry.id); }}}}@@ -617,89 +643,3 @@ export component FilterPanel inherits VerticalLayout {// The catalogues. Data only: the stack renders whatever params a preset// declares, so adding a processor is one entry here and no change to the// panel. The ids are written into project files, so they are stable forever.-export global PresetCatalog {- out property <[string]> filter-groups: ["Voice", "Tone", "Space"];- out property <[string]> effect-groups: ["Dynamics", "Time", "Colour"];-- out property <[PresetDef]> filters: [- { group: 0, preset: { id: "sweet", name: "Sweet", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 65, value: 65, fmt: ParamFormat.percent },- p2: { id: "pitch", label: "Pitch", min: 0, max: 12, step: 1, default-value: 0, value: 0, fmt: ParamFormat.pitch } } },- { group: 0, preset: { id: "deep", name: "Deep", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 70, value: 70, fmt: ParamFormat.percent },- p2: { id: "pitch", label: "Pitch", min: 0, max: 12, step: 1, default-value: 0, value: 0, fmt: ParamFormat.pitch } } },- { group: 0, preset: { id: "chipmunk", name: "Chipmunk", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 80, value: 80, fmt: ParamFormat.percent },- p2: { id: "pitch", label: "Pitch", min: 0, max: 12, step: 1, default-value: 0, value: 0, fmt: ParamFormat.pitch } } },- { group: 0, preset: { id: "robot", name: "Robot", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 60, value: 60, fmt: ParamFormat.percent },- p2: { id: "carrier", label: "Carrier", min: 40, max: 400, step: 10, default-value: 120, value: 120, fmt: ParamFormat.hertz } } },-- { group: 1, preset: { id: "warm", name: "Warm", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 50, value: 50, fmt: ParamFormat.percent },- p2: { id: "tilt", label: "Tilt", min: -12, max: 12, step: 0.5, default-value: -2, value: -2, fmt: ParamFormat.decibels } } },- { group: 1, preset: { id: "bright", name: "Bright", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 45, value: 45, fmt: ParamFormat.percent },- p2: { id: "tilt", label: "Tilt", min: -12, max: 12, step: 0.5, default-value: 3, value: 3, fmt: ParamFormat.decibels } } },- { group: 1, preset: { id: "telephone", name: "Telephone", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 100, value: 100, fmt: ParamFormat.percent },- p2: { id: "band", label: "Band", min: 300, max: 4000, step: 10, default-value: 1800, value: 1800, fmt: ParamFormat.hertz } } },- { group: 1, preset: { id: "radio", name: "Radio", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 75, value: 75, fmt: ParamFormat.percent },- p2: { id: "noise", label: "Noise", min: 0, max: 100, step: 1, default-value: 12, value: 12, fmt: ParamFormat.percent } } },-- { group: 2, preset: { id: "room", name: "Room", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 30, value: 30, fmt: ParamFormat.percent },- p2: { id: "decay", label: "Decay", min: 0, max: 8, step: 0.1, default-value: 0.6, value: 0.6, fmt: ParamFormat.seconds } } },- { group: 2, preset: { id: "hall", name: "Hall", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 40, value: 40, fmt: ParamFormat.percent },- p2: { id: "decay", label: "Decay", min: 0, max: 8, step: 0.1, default-value: 2.2, value: 2.2, fmt: ParamFormat.seconds } } },- { group: 2, preset: { id: "plate", name: "Plate", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 35, value: 35, fmt: ParamFormat.percent },- p2: { id: "decay", label: "Decay", min: 0, max: 8, step: 0.1, default-value: 1.4, value: 1.4, fmt: ParamFormat.seconds } } },- { group: 2, preset: { id: "cathedral", name: "Cathedral", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 55, value: 55, fmt: ParamFormat.percent },- p2: { id: "decay", label: "Decay", min: 0, max: 8, step: 0.1, default-value: 5, value: 5, fmt: ParamFormat.seconds } } },- ];-- out property <[PresetDef]> effects: [- { group: 0, preset: { id: "compressor", name: "Compressor", on: true,- p1: { id: "threshold", label: "Threshold", min: -60, max: 0, step: 0.5, default-value: -18, value: -18, fmt: ParamFormat.decibels },- p2: { id: "ratio", label: "Ratio", min: 1, max: 20, step: 0.5, default-value: 4, value: 4, fmt: ParamFormat.ratio } } },- { group: 0, preset: { id: "limiter", name: "Limiter", on: true,- p1: { id: "ceiling", label: "Ceiling", min: -12, max: 0, step: 0.5, default-value: -1, value: -1, fmt: ParamFormat.decibels },- p2: { id: "release", label: "Release", min: 0, max: 500, step: 5, default-value: 60, value: 60, fmt: ParamFormat.millis } } },- { group: 0, preset: { id: "gate", name: "Noise gate", on: true,- p1: { id: "threshold", label: "Threshold", min: -80, max: 0, step: 0.5, default-value: -42, value: -42, fmt: ParamFormat.decibels },- p2: { id: "hold", label: "Hold", min: 0, max: 1000, step: 5, default-value: 120, value: 120, fmt: ParamFormat.millis } } },- { group: 0, preset: { id: "deesser", name: "De-esser", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 45, value: 45, fmt: ParamFormat.percent },- p2: { id: "centre", label: "Centre", min: 2000, max: 12000, step: 10, default-value: 6500, value: 6500, fmt: ParamFormat.hertz } } },-- { group: 1, preset: { id: "delay", name: "Delay", on: true,- p1: { id: "time", label: "Time", min: 0, max: 1500, step: 5, default-value: 320, value: 320, fmt: ParamFormat.millis },- p2: { id: "feedback", label: "Feedback", min: 0, max: 100, step: 1, default-value: 28, value: 28, fmt: ParamFormat.percent } } },- { group: 1, preset: { id: "echo", name: "Echo", on: true,- p1: { id: "time", label: "Time", min: 0, max: 2000, step: 5, default-value: 500, value: 500, fmt: ParamFormat.millis },- p2: { id: "repeats", label: "Repeats", min: 1, max: 12, step: 1, default-value: 3, value: 3, fmt: ParamFormat.steps } } },- { group: 1, preset: { id: "stutter", name: "Stutter", on: true,- p1: { id: "rate", label: "Rate", min: 0.1, max: 24, step: 0.1, default-value: 8, value: 8, fmt: ParamFormat.rate-hz },- p2: { id: "depth", label: "Depth", min: 0, max: 100, step: 1, default-value: 70, value: 70, fmt: ParamFormat.percent } } },- { group: 1, preset: { id: "reverse", name: "Reverse", on: true,- p1: { id: "amount", label: "Amount", min: 0, max: 100, step: 1, default-value: 100, value: 100, fmt: ParamFormat.percent },- p2: { id: "crossfade", label: "Crossfade", min: 0, max: 400, step: 5, default-value: 40, value: 40, fmt: ParamFormat.millis } } },-- { group: 2, preset: { id: "saturator", name: "Saturator", on: true,- p1: { id: "drive", label: "Drive", min: 0, max: 100, step: 1, default-value: 35, value: 35, fmt: ParamFormat.percent },- p2: { id: "mix", label: "Mix", min: 0, max: 100, step: 1, default-value: 100, value: 100, fmt: ParamFormat.percent } } },- { group: 2, preset: { id: "bitcrush", name: "Bitcrush", on: true,- p1: { id: "bits", label: "Bits", min: 2, max: 16, step: 1, default-value: 12, value: 12, fmt: ParamFormat.steps },- p2: { id: "mix", label: "Mix", min: 0, max: 100, step: 1, default-value: 60, value: 60, fmt: ParamFormat.percent } } },- { group: 2, preset: { id: "chorus", name: "Chorus", on: true,- p1: { id: "rate", label: "Rate", min: 0.1, max: 8, step: 0.1, default-value: 1.2, value: 1.2, fmt: ParamFormat.rate-hz },- p2: { id: "depth", label: "Depth", min: 0, max: 100, step: 1, default-value: 40, value: 40, fmt: ParamFormat.percent } } },- { group: 2, preset: { id: "flanger", name: "Flanger", on: true,- p1: { id: "rate", label: "Rate", min: 0.1, max: 8, step: 0.1, default-value: 0.4, value: 0.4, fmt: ParamFormat.rate-hz },- p2: { id: "feedback", label: "Feedback", min: 0, max: 100, step: 1, default-value: 55, value: 55, fmt: ParamFormat.percent } } },- ];-}diff --git a/engine/crates/concat/ui/inspector/controls.slint b/engine/crates/concat/ui/inspector/controls.slintindex 871c274d..2469ae23 100644--- a/engine/crates/concat/ui/inspector/controls.slint+++ b/engine/crates/concat/ui/inspector/controls.slint@@ -37,6 +37,11 @@ export enum ParamFormat {height, // "9.0% of height"outline, // 0 is "none", else "3.5%"seconds2, // "1.25s" — two places, for a fade dialled against a duration++ // For a package parameter whose unit the manifest did not name, or+ // named in a unit nothing above spells.+ plain, // "1.25", or "12" when it is whole+ kelvin, // "4600 K"}export global InspectorFmt {@@ -98,6 +103,11 @@ export global InspectorFmt {if (fmt == ParamFormat.seconds2) {return v == 0 ? "none" : InspectorFmt.fixed2(v) + "s";}+ if (fmt == ParamFormat.plain) {+ return Math.abs(v - Math.round(v)) < 0.0005 ? "\{Math.round(v)}"+ : InspectorFmt.fixed2(v);+ }+ if (fmt == ParamFormat.kelvin) { return "\{Math.round(v)} K"; }return v == 0 ? "none" : InspectorFmt.fixed1(v) + " s";}diff --git a/engine/crates/concat/ui/workspace/config-pane.slint b/engine/crates/concat/ui/workspace/config-pane.slintindex dacab6ba..86aeaf0f 100644--- a/engine/crates/concat/ui/workspace/config-pane.slint+++ b/engine/crates/concat/ui/workspace/config-pane.slint@@ -6,7 +6,8 @@ import { Pane, PaneBody, PaneScroll } from "pane.slint";import { PaneKind, PaneSwitcher } from "pane-switcher.slint";import { EffectData } from "../demo/effects-panel.slint";import {- AdjustPanel, AppliedPresetData, FilterPanel, PresetCatalog, PresetStack,+ AdjustPanel, AppliedEntryData, AppliedParamData, CatalogueEntryData,+ FilterPanel, PresetStack,} from "../inspector/clip-inspector.slint";import { TextPanel } from "../inspector/text-panel.slint";import {@@ -120,42 +121,54 @@ export component ConfigPane inherits Rectangle {callback pane-removed();// ── the clip inspector's chains, owned by Rust ───────────────────────- in property <[AppliedPresetData]> filters-applied;- in property <[AppliedPresetData]> effects-applied;-- callback filters-add(preset: AppliedPresetData);- callback filters-toggle(index: int);- callback filters-move-by(index: int, delta: int);- callback filters-remove(index: int);- callback filters-set-param(index: int, second: bool, value: float);+ //+ // The library shelves come from the effect catalogue, the applied lists+ // from the selected clip. Two chains: the picture's, which the Filters+ // and Effects tabs both edit, and the sound's, which Audio edits. A+ // `audio` flag on every callback says which.+ in property <[CatalogueEntryData]> catalogue-effects;+ in property <[CatalogueEntryData]> catalogue-filters;+ in property <[CatalogueEntryData]> catalogue-audio;+ in property <[string]> effect-groups;+ in property <[string]> filter-groups;+ in property <[string]> audio-groups;+ in property <[AppliedEntryData]> applied-visual;+ in property <[AppliedEntryData]> applied-audio;+ in property <[AppliedParamData]> visual-params;+ in property <[AppliedParamData]> audio-params;++ callback chain-add(audio: bool, id: string);+ callback chain-toggle(audio: bool, index: int);+ callback chain-move-by(audio: bool, index: int, delta: int);+ callback chain-remove(audio: bool, index: int);+ callback chain-set-param(audio: bool, index: int, key: string, value: float);callback clip-set(field: ClipField, value: float);callback clip-set-text(field: ClipTextField, value: string);callback clip-set-colour(field: ClipTextField, value: color);callback clip-commit();- callback effects-add(preset: AppliedPresetData);- callback effects-toggle(index: int);- callback effects-move-by(index: int, delta: int);- callback effects-remove(index: int);- callback effects-set-param(index: int, second: bool, value: float);// The tab strip follows the selection: nothing selected shows only- // Details, since there is nothing to edit; a media clip shows what can be- // changed and what can be added; a still gets Effects but not Filters,- // because it has picture and no sound; and a title gets Text alone — it- // has no volume, no speed and no audio filters, and offering those tabs- // would be offering panels that can only say "nothing here".+ // Details, since there is nothing to edit; a video clip shows everything;+ // a still has picture and no sound, so it loses Audio; a sound clip has+ // no picture, so it loses Filters and Effects; and a title gets Text+ // alone — offering the others would be offering panels that can only say+ // "nothing here". The words are the ones video editors' users know:+ // Filters are colour looks, Effects happen to the picture, Audio is the+ // voice and the room.property <bool> is-text: root.selected.kind == ClipKind.text;property <bool> is-image: root.selected.kind == ClipKind.image;+ property <bool> is-audio: root.selected.kind == ClipKind.audio;/// A filter layer gets its own lone tab for the same reason a title does:/// it has no transform, no gain and no rate, and every other tab could/// only say "nothing here".property <bool> is-layer: root.selected.kind == ClipKind.filter;property <[string]> tabs: root.is-text ? ["Text"]: root.is-layer ? ["Filter"]- : root.is-image ? ["Adjust", "Effects"]- : ["Adjust", "Filters", "Effects"];+ : root.is-image ? ["Adjust", "Filters", "Effects"]+ : root.is-audio ? ["Adjust", "Audio"]+ : ["Adjust", "Audio", "Filters", "Effects"];/// A one-segment segmented control is a label wearing a costume, so a lone/// tab renders as the panel's plain heading instead.property <bool> single: root.tabs.length < 2;@@ -389,36 +402,61 @@ export component ConfigPane inherits Rectangle {commit => { root.clip-commit(); }}+ if root.showing == "Audio": PresetStack {+ noun: "audio effect";+ library-title: "Audio effects";+ group-labels: root.audio-groups;+ catalogue: root.catalogue-audio;+ applied: root.applied-audio;+ params: root.audio-params;++ add(id) => { root.chain-add(true, id); }+ toggle(index) => { root.chain-toggle(true, index); }+ move-by(index, delta) => { root.chain-move-by(true, index, delta); }+ remove(index) => { root.chain-remove(true, index); }+ set-param(index, key, value) => {+ root.chain-set-param(true, index, key, value);+ }+ commit => { root.clip-commit(); }+ }++ // Filters and Effects share one chain — a look and a blur+ // are links of the same picture chain, in one order — and+ // differ only in which shelves they offer.if root.showing == "Filters": PresetStack {noun: "filter";library-title: "Filter library";- group-labels: PresetCatalog.filter-groups;- catalogue: PresetCatalog.filters;- applied: root.filters-applied;-- add(preset) => { root.filters-add(preset); }- toggle(index) => { root.filters-toggle(index); }- move-by(index, delta) => { root.filters-move-by(index, delta); }- remove(index) => { root.filters-remove(index); }- set-param(index, second, value) => {- root.filters-set-param(index, second, value);+ group-labels: root.filter-groups;+ catalogue: root.catalogue-filters;+ applied: root.applied-visual;+ params: root.visual-params;++ add(id) => { root.chain-add(false, id); }+ toggle(index) => { root.chain-toggle(false, index); }+ move-by(index, delta) => { root.chain-move-by(false, index, delta); }+ remove(index) => { root.chain-remove(false, index); }+ set-param(index, key, value) => {+ root.chain-set-param(false, index, key, value);}+ commit => { root.clip-commit(); }}if root.showing == "Effects": PresetStack {noun: "effect";library-title: "Effect library";- group-labels: PresetCatalog.effect-groups;- catalogue: PresetCatalog.effects;- applied: root.effects-applied;-- add(preset) => { root.effects-add(preset); }- toggle(index) => { root.effects-toggle(index); }- move-by(index, delta) => { root.effects-move-by(index, delta); }- remove(index) => { root.effects-remove(index); }- set-param(index, second, value) => {- root.effects-set-param(index, second, value);+ group-labels: root.effect-groups;+ catalogue: root.catalogue-effects;+ applied: root.applied-visual;+ params: root.visual-params;++ add(id) => { root.chain-add(false, id); }+ toggle(index) => { root.chain-toggle(false, index); }+ move-by(index, delta) => { root.chain-move-by(false, index, delta); }+ remove(index) => { root.chain-remove(false, index); }+ set-param(index, key, value) => {+ root.chain-set-param(false, index, key, value);}+ commit => { root.clip-commit(); }}}}diff --git a/engine/crates/concat/ui/workspace/media-pane.slint b/engine/crates/concat/ui/workspace/media-pane.slintindex 7ae251a1..3b0378d3 100644--- a/engine/crates/concat/ui/workspace/media-pane.slint+++ b/engine/crates/concat/ui/workspace/media-pane.slint@@ -970,6 +970,8 @@ export component MediaPane inherits Rectangle {callback apply-effect(effect-id: string);callback apply-transition(transition-id: string);callback apply-filter(filter-id: string, label: string);+ /// Audio page: add a voice or room to the selected clip's sound.+ callback apply-audio(effect-id: string);/// Templates page: open the save-as-template flow for this project.callback save-template();@@ -997,6 +999,8 @@ export component MediaPane inherits Rectangle {property <int> effect-category;/// 0 = Voice, 1 = Tone, 2 = Space — the inspector's filter shelvesproperty <int> filter-category;+ property <int> audio-category;+ property <bool> audio-open: true;/// The category column. In-out, because it is dragged.in-out property <length> sidebar-w: 104px;/// Narrow enough to be a real squeeze, wide enough that a category name@@ -1029,24 +1033,24 @@ export component MediaPane inherits Rectangle {{ id: "zoom", label: "Zoom", enabled: false, glyph: Glyph.transition },];- // The audio filters: the same ids and the same shelves as- // PresetCatalog.filters in the inspector. They have no artwork and never- // will: a picture of a sound is a waveform, and every one of these would- // draw the same one. The mark says "this is audio" and the name does the- // rest.- property <[CatalogueItemData]> filters-voice: [+ // The audio effects: the same ids and shelves as the inspector's Audio+ // tab, which reads them from the catalogue. They have no artwork and+ // never will: a picture of a sound is a waveform, and every one of these+ // would draw the same one. The mark says "this is audio" and the name+ // does the rest.+ property <[CatalogueItemData]> audio-voice: [{ id: "sweet", label: "Sweet", enabled: true, glyph: Glyph.waveform },{ id: "deep", label: "Deep", enabled: true, glyph: Glyph.waveform },{ id: "chipmunk", label: "Chipmunk", enabled: true, glyph: Glyph.waveform },{ id: "robot", label: "Robot", enabled: true, glyph: Glyph.waveform },];- property <[CatalogueItemData]> filters-tone: [+ property <[CatalogueItemData]> audio-tone: [{ id: "warm", label: "Warm", enabled: true, glyph: Glyph.waveform },{ id: "bright", label: "Bright", enabled: true, glyph: Glyph.waveform },{ id: "telephone", label: "Telephone", enabled: true, glyph: Glyph.waveform },{ id: "radio", label: "Radio", enabled: true, glyph: Glyph.waveform },];- property <[CatalogueItemData]> filters-space: [+ property <[CatalogueItemData]> audio-space: [{ id: "room", label: "Room", enabled: true, glyph: Glyph.waveform },{ id: "hall", label: "Hall", enabled: true, glyph: Glyph.waveform },{ id: "plate", label: "Plate", enabled: true, glyph: Glyph.waveform },@@ -1070,7 +1074,7 @@ export component MediaPane inherits Rectangle {{ id: "motion-blur", label: "Motion Blur", enabled: true,art: @image-url("../assets/effect-previews/motion-blur.jpg") },];- property <[CatalogueItemData]> effects-color: [+ property <[CatalogueItemData]> filters-color: [{ id: "warm", label: "Warm", enabled: true,art: @image-url("../assets/effect-previews/warm.jpg") },{ id: "cool", label: "Cool", enabled: true,@@ -1163,10 +1167,15 @@ export component MediaPane inherits Rectangle {clicked => { root.tab = 4; }}LibraryTab {- label: "Templates";+ label: "Audio";current: root.tab == 5;clicked => { root.tab = 5; }}+ LibraryTab {+ label: "Templates";+ current: root.tab == 6;+ clicked => { root.tab = 6; }+ }}}@@ -1340,53 +1349,66 @@ export component MediaPane inherits Rectangle {}if root.effects-open: CategoryRow {height: 24px;- label: "Color";+ label: "Stylize";current: root.effect-category == 2;clicked => { root.effect-category = 2; }}if root.effects-open: CategoryRow {height: 24px;- label: "Stylize";+ label: "Distort";current: root.effect-category == 3;clicked => { root.effect-category = 3; }}- if root.effects-open: CategoryRow {- height: 24px;- label: "Distort";- current: root.effect-category == 4;- clicked => { root.effect-category = 4; }- }}+ // Filters are colour looks, the way every video editor's+ // users understand the word. What a voice or a room does+ // to the sound is on the Audio page.if root.tab == 4: VerticalLayout {spacing: 1px;CategoryHeading {height: 26px;- title: "Audio Filters";+ title: "Filters";open: root.filters-open;toggled => { root.filters-open = !root.filters-open; }}if root.filters-open: CategoryRow {height: 24px;- label: "Voice";+ label: "Color";current: root.filter-category == 0;clicked => { root.filter-category = 0; }}- if root.filters-open: CategoryRow {+ }++ if root.tab == 5: VerticalLayout {+ spacing: 1px;+ CategoryHeading {+ height: 26px;+ title: "Audio Effects";+ open: root.audio-open;+ toggled => { root.audio-open = !root.audio-open; }+ }+ if root.audio-open: CategoryRow {+ height: 24px;+ label: "Voice";+ current: root.audio-category == 0;+ clicked => { root.audio-category = 0; }+ }+ if root.audio-open: CategoryRow {height: 24px;label: "Tone";- current: root.filter-category == 1;- clicked => { root.filter-category = 1; }+ current: root.audio-category == 1;+ clicked => { root.audio-category = 1; }}- if root.filters-open: CategoryRow {+ if root.audio-open: CategoryRow {height: 24px;label: "Space";- current: root.filter-category == 2;- clicked => { root.filter-category = 2; }+ current: root.audio-category == 2;+ clicked => { root.audio-category = 2; }}}- if root.tab == 5: VerticalLayout {+ if root.tab == 6: VerticalLayout {spacing: 1px;CategoryHeading {height: 26px;@@ -1531,8 +1553,7 @@ export component MediaPane inherits Rectangle {horizontal-stretch: 1;items: root.effect-category == 0 ? root.effects-basic: root.effect-category == 1 ? root.effects-blur- : root.effect-category == 2 ? root.effects-color- : root.effect-category == 3 ? root.effects-stylize+ : root.effect-category == 2 ? root.effects-stylize: root.effects-distort;applied(id, label) => { root.apply-effect(id); }}@@ -1541,24 +1562,34 @@ export component MediaPane inherits Rectangle {if root.tab == 4: HorizontalLayout {padding: 8px;- // The one catalogue that is placed rather than applied:- // a filter is a layer over a span of the timeline, so it- // is dragged onto the lanes like a piece of media. The- // click is kept as the shortcut for the same thing — it- // lands at the playhead instead of under the pointer.+ // A filter is meant to be a layer over a span of the+ // timeline, dragged onto the lanes like a piece of media;+ // the payload says so, for the day the lanes accept it.+ // Until then a click applies the look to the selected+ // clip, which is the other way every editor offers.CatalogueGrid {horizontal-stretch: 1;payload-kind: "filter";- items: root.filter-category == 0 ? root.filters-voice- : root.filter-category == 1 ? root.filters-tone- : root.filters-space;+ items: root.filters-color;applied(id, label) => { root.apply-filter(id, label); }}}+ if root.tab == 5: HorizontalLayout {+ padding: 8px;++ CatalogueGrid {+ horizontal-stretch: 1;+ items: root.audio-category == 0 ? root.audio-voice+ : root.audio-category == 1 ? root.audio-tone+ : root.audio-space;+ applied(id, label) => { root.apply-audio(id); }+ }+ }+// Templates: the save affordance, then the gallery of saved// templates, which shows its empty state until one is saved.- if root.tab == 5: HorizontalLayout {+ if root.tab == 6: HorizontalLayout {padding: 8px;ImportButton {@@ -1568,7 +1599,7 @@ export component MediaPane inherits Rectangle {}}- if root.tab == 5: Empty {+ if root.tab == 6: Empty {glyph: Glyph.slot;text: "No templates yet. Mark media as slots, then save this project as a template.";}diff --git a/engine/crates/concat/ui/workspace/seat.slint b/engine/crates/concat/ui/workspace/seat.slintindex e5309d40..5d3ef79d 100644--- a/engine/crates/concat/ui/workspace/seat.slint+++ b/engine/crates/concat/ui/workspace/seat.slint@@ -115,6 +115,7 @@ export component Seat inherits Rectangle {apply-effect(id) => { Editor.library-apply-effect(id); }apply-transition(id) => { Editor.library-apply-transition(id); }apply-filter(id, label) => { Editor.library-apply-filter(id, label); }+ apply-audio(id) => { Editor.library-apply-audio(id); }save-template => { Editor.library-save-template(); }}@@ -174,6 +175,24 @@ export component Seat inherits Rectangle {add-effect(audio) => { Editor.add-effect(audio); }remove-effect(id) => { Editor.remove-effect(id); }+ catalogue-effects: Editor.catalogue-effects;+ catalogue-filters: Editor.catalogue-filters;+ catalogue-audio: Editor.catalogue-audio;+ effect-groups: Editor.effect-groups;+ filter-groups: Editor.filter-groups;+ audio-groups: Editor.audio-groups;+ applied-visual: Editor.applied-visual;+ applied-audio: Editor.applied-audio;+ visual-params: Editor.visual-params;+ audio-params: Editor.audio-params;+ chain-add(audio, id) => { Editor.chain-add(audio, id); }+ chain-toggle(audio, index) => { Editor.chain-toggle(audio, index); }+ chain-move-by(audio, index, delta) => { Editor.chain-move-by(audio, index, delta); }+ chain-remove(audio, index) => { Editor.chain-remove(audio, index); }+ chain-set-param(audio, index, key, value) => {+ Editor.chain-set-param(audio, index, key, value);+ }+selected: Editor.selected-clip;clip-set(field, value) => { Editor.clip-set(field, value); }clip-set-text(field, value) => { Editor.clip-set-text(field, value); }