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
feat(timeline): B is the razor, a tool that cuts a clip where it is clicked; Ctrl+B splits at the playhead
Jareere1c218739e41
diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.jsonindex 42eb0c76..7af44946 100644--- a/src/crates/concat/locales/de.json+++ b/src/crates/concat/locales/de.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "Wiedergabe folgt dem Kürzen: Der Abspielkopf wandert mit der Kante, die du kürzt","tray.previewAxisOptions": "Optionen der Vorschauachse","tray.redo": "Wiederholen ({0})",- "tray.splitAtPlayhead": "Am Abspielkopf teilen (B, oder {0} für jeden Clip)",+ "tray.splitAtPlayhead": "Am Abspielkopf teilen ({0})",+ "tray.splitTool": "Schneidewerkzeug (B): Klick auf einen Clip schneidet ihn dort","tray.textToSpeech": "Text zu Sprache","tray.turnOffPreviewAxis": "Vorschauachse ausschalten (S)","tray.turnOnPreviewAxis": "Vorschauachse einschalten (S)",diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.jsonindex c4948186..ad9a30ea 100644--- a/src/crates/concat/locales/en.json+++ b/src/crates/concat/locales/en.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "Player follows the resize: the playhead rides the edge you trim","tray.previewAxisOptions": "Preview axis options","tray.redo": "Redo ({0})",- "tray.splitAtPlayhead": "Split at playhead (B, or {0} for every clip)",+ "tray.splitAtPlayhead": "Split at playhead ({0})",+ "tray.splitTool": "Split tool (B): click a clip to cut it there","tray.textToSpeech": "Text to Speech","tray.turnOffPreviewAxis": "Turn off Preview Axis (S)","tray.turnOnPreviewAxis": "Turn on Preview Axis (S)",diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.jsonindex e0ed9828..ad79d952 100644--- a/src/crates/concat/locales/es.json+++ b/src/crates/concat/locales/es.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "El reproductor sigue el recorte: el cabezal de reproducción acompaña el borde que recortas","tray.previewAxisOptions": "Opciones del eje de previsualización","tray.redo": "Rehacer ({0})",- "tray.splitAtPlayhead": "Dividir en el cabezal (B, o {0} para todos los clips)",+ "tray.splitAtPlayhead": "Dividir en el cabezal ({0})",+ "tray.splitTool": "Herramienta de corte (B): clic en un clip para cortarlo ahí","tray.textToSpeech": "Texto a voz","tray.turnOffPreviewAxis": "Desactivar el eje de previsualización (S)","tray.turnOnPreviewAxis": "Activar el eje de previsualización (S)",diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.jsonindex 22ae1524..f1b70886 100644--- a/src/crates/concat/locales/fa.json+++ b/src/crates/concat/locales/fa.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "پخشکننده برش را دنبال میکند: نشانگر پخش همراه لبهای که برش میدهید حرکت میکند","tray.previewAxisOptions": "گزینههای محور پیشنمایش","tray.redo": "انجام مجدد ({0})",- "tray.splitAtPlayhead": "تقسیم در نشانگر پخش (B، یا {0} برای همه کلیپها)",+ "tray.splitAtPlayhead": "تقسیم در نشانگر پخش ({0})",+ "tray.splitTool": "ابزار برش (B): روی کلیپ کلیک کنید تا همانجا بریده شود","tray.textToSpeech": "تبدیل متن به گفتار","tray.turnOffPreviewAxis": "خاموش کردن محور پیشنمایش (S)","tray.turnOnPreviewAxis": "روشن کردن محور پیشنمایش (S)",diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.jsonindex 7ecd42a1..0c5e6193 100644--- a/src/crates/concat/locales/fr.json+++ b/src/crates/concat/locales/fr.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "Le lecteur suit le rognage : la tête de lecture accompagne le bord que vous rognez","tray.previewAxisOptions": "Options de l'axe d'aperçu","tray.redo": "Rétablir ({0})",- "tray.splitAtPlayhead": "Couper à la tête de lecture (B, ou {0} pour tous les clips)",+ "tray.splitAtPlayhead": "Couper à la tête de lecture ({0})",+ "tray.splitTool": "Outil de coupe (B) : cliquez sur un clip pour le couper là","tray.textToSpeech": "Synthèse vocale","tray.turnOffPreviewAxis": "Désactiver l'axe d'aperçu (S)","tray.turnOnPreviewAxis": "Activer l'axe d'aperçu (S)",diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.jsonindex 497627da..800fc2c6 100644--- a/src/crates/concat/locales/hr.json+++ b/src/crates/concat/locales/hr.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "Reprodukcija prati skraćivanje: glava za reprodukciju prati rub koji skraćujete","tray.previewAxisOptions": "Mogućnosti osi pregleda","tray.redo": "Ponovi ({0})",- "tray.splitAtPlayhead": "Podijeli na playheadu (B, ili {0} za svaki klip)",+ "tray.splitAtPlayhead": "Podijeli na playheadu ({0})",+ "tray.splitTool": "Alat za rezanje (B): klik na klip reže ga ondje","tray.textToSpeech": "Tekst u govor","tray.turnOffPreviewAxis": "Isključi os pregleda (S)","tray.turnOnPreviewAxis": "Uključi os pregleda (S)",diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.jsonindex 109d1520..a59e489f 100644--- a/src/crates/concat/locales/it.json+++ b/src/crates/concat/locales/it.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "Il player segue l'accorciamento: la testina di riproduzione segue il bordo che accorci","tray.previewAxisOptions": "Opzioni dell'asse di anteprima","tray.redo": "Ripeti ({0})",- "tray.splitAtPlayhead": "Dividi alla testina (B, o {0} per tutte le clip)",+ "tray.splitAtPlayhead": "Dividi alla testina ({0})",+ "tray.splitTool": "Strumento taglio (B): clic su una clip per tagliarla lì","tray.textToSpeech": "Sintesi vocale","tray.turnOffPreviewAxis": "Disattiva l'asse di anteprima (S)","tray.turnOnPreviewAxis": "Attiva l'asse di anteprima (S)",diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.jsonindex 05645cd4..2c1fc0f6 100644--- a/src/crates/concat/locales/ja.json+++ b/src/crates/concat/locales/ja.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "プレーヤーがトリミングに追従:再生ヘッドがトリミング中の端に合わせて動きます","tray.previewAxisOptions": "プレビュー軸のオプション","tray.redo": "やり直す ({0})",- "tray.splitAtPlayhead": "再生ヘッドで分割 (B、すべてのクリップは {0})",+ "tray.splitAtPlayhead": "再生ヘッドで分割 ({0})",+ "tray.splitTool": "分割ツール (B): クリップをクリックした位置で切る","tray.textToSpeech": "テキスト読み上げ","tray.turnOffPreviewAxis": "プレビュー軸をオフにする (S)","tray.turnOnPreviewAxis": "プレビュー軸をオンにする (S)",diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.jsonindex 3e5fe0cf..e7122ef7 100644--- a/src/crates/concat/locales/ko.json+++ b/src/crates/concat/locales/ko.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "플레이어가 다듬기를 따라감: 재생 헤드가 다듬는 가장자리를 따라 움직입니다","tray.previewAxisOptions": "미리보기 축 옵션","tray.redo": "다시 실행 ({0})",- "tray.splitAtPlayhead": "재생 헤드에서 나누기 (B, 모든 클립은 {0})",+ "tray.splitAtPlayhead": "재생 헤드에서 나누기 ({0})",+ "tray.splitTool": "자르기 도구 (B): 클립을 클릭한 곳에서 자릅니다","tray.textToSpeech": "텍스트 음성 변환","tray.turnOffPreviewAxis": "미리보기 축 끄기 (S)","tray.turnOnPreviewAxis": "미리보기 축 켜기 (S)",diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.jsonindex ab368185..b29b6ddf 100644--- a/src/crates/concat/locales/pt-BR.json+++ b/src/crates/concat/locales/pt-BR.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "O player acompanha o corte: a agulha segue a borda que você arrasta","tray.previewAxisOptions": "Opções do eixo de prévia","tray.redo": "Refazer ({0})",- "tray.splitAtPlayhead": "Dividir no cursor (B, ou {0} para todos os clipes)",+ "tray.splitAtPlayhead": "Dividir no cursor ({0})",+ "tray.splitTool": "Ferramenta de corte (B): clique em um clipe para cortá-lo ali","tray.textToSpeech": "Texto para fala","tray.turnOffPreviewAxis": "Desligar o eixo de prévia (S)","tray.turnOnPreviewAxis": "Ligar o eixo de prévia (S)",diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.jsonindex 12499889..8d378cdc 100644--- a/src/crates/concat/locales/ru.json+++ b/src/crates/concat/locales/ru.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "Плеер следует за подрезкой: курсор движется вместе с краем, который вы подрезаете","tray.previewAxisOptions": "Параметры оси предпросмотра","tray.redo": "Повторить ({0})",- "tray.splitAtPlayhead": "Разрезать по курсору (B, или {0} для всех клипов)",+ "tray.splitAtPlayhead": "Разрезать по курсору ({0})",+ "tray.splitTool": "Инструмент разрезания (B): щелчок по клипу режет его в этом месте","tray.textToSpeech": "Озвучить текст","tray.turnOffPreviewAxis": "Выключить ось предпросмотра (S)","tray.turnOnPreviewAxis": "Включить ось предпросмотра (S)",diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.jsonindex cf81028b..a0067503 100644--- a/src/crates/concat/locales/tr.json+++ b/src/crates/concat/locales/tr.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "Oynatıcı kırpmayı izler: oynatma kafası kırptığınız kenarla birlikte hareket eder","tray.previewAxisOptions": "Önizleme ekseni seçenekleri","tray.redo": "Yinele ({0})",- "tray.splitAtPlayhead": "Playhead konumunda böl (B, her klip için {0})",+ "tray.splitAtPlayhead": "Playhead konumunda böl ({0})",+ "tray.splitTool": "Kesme aracı (B): bir klibe tıklayınca orada keser","tray.textToSpeech": "Metinden konuşmaya","tray.turnOffPreviewAxis": "Önizleme eksenini kapat (S)","tray.turnOnPreviewAxis": "Önizleme eksenini aç (S)",diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.jsonindex 324b428c..0d9e5a56 100644--- a/src/crates/concat/locales/zh-Hans.json+++ b/src/crates/concat/locales/zh-Hans.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "播放器跟随修剪:播放头随你修剪的边缘移动","tray.previewAxisOptions": "预览坐标轴选项","tray.redo": "重做 ({0})",- "tray.splitAtPlayhead": "在播放头处分割(B,或用 {0} 分割所有片段)",+ "tray.splitAtPlayhead": "在播放头处分割({0})",+ "tray.splitTool": "分割工具(B):点击片段即在该处切开","tray.textToSpeech": "文字转语音","tray.turnOffPreviewAxis": "关闭预览坐标轴 (S)","tray.turnOnPreviewAxis": "打开预览坐标轴 (S)",diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.jsonindex 38061069..4c619e1a 100644--- a/src/crates/concat/locales/zh-TW.json+++ b/src/crates/concat/locales/zh-TW.json@@ -970,7 +970,8 @@"tray.playerFollowsResizePlayhead": "播放器跟隨修剪:播放磁頭隨你修剪的邊緣移動","tray.previewAxisOptions": "預覽座標軸選項","tray.redo": "重做 ({0})",- "tray.splitAtPlayhead": "在播放磁頭處分割(B,或用 {0} 分割所有片段)",+ "tray.splitAtPlayhead": "在播放磁頭處分割({0})",+ "tray.splitTool": "分割工具(B):點擊片段即在該處切開","tray.textToSpeech": "文字轉語音","tray.turnOffPreviewAxis": "關閉預覽座標軸 (S)","tray.turnOnPreviewAxis": "打開預覽座標軸 (S)",diff --git a/src/crates/concat/src/lib.rs b/src/crates/concat/src/lib.rsindex 2e4bdbe0..5c3c7739 100644--- a/src/crates/concat/src/lib.rs+++ b/src/crates/concat/src/lib.rs@@ -877,6 +877,9 @@ pub fn run() -> Result<(), slint::PlatformError> {edge: i32| {state.clip_pressed(id.as_str(), additive, edge);}));+ editor.on_clip_split(on_lanes!(|state, id: SharedString, seconds: f32| {+ state.split_clip_at(&id, seconds);+ }));editor.on_clip_dragged(on_lanes!(|state, seconds: f32, pixels: f32| {state.clip_dragged(seconds, pixels);}));diff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rsindex 76ec8bf1..fef9c5ee 100644--- a/src/crates/concat/src/studio.rs+++ b/src/crates/concat/src/studio.rs@@ -5921,6 +5921,30 @@ impl Studio {}}+ /// The split tool pressed clip `id` at `seconds`: one cut, on the+ /// frame nearest the press, unless it is within a frame of either end+ /// or the lane is locked.+ /// https://github.com/jub0t/Concat/issues/241+ pub fn split_clip_at(&mut self, id: &str, seconds: f32) {+ let Some(clip) = self.clip(id).cloned() else {+ return;+ };+ if self.locked(&clip.track_id) {+ return;+ }+ let fps = f64::from(self.frame_rate().max(1.0));+ let at = (f64::from(seconds) * fps).round() / fps;+ let edge = f64::from(MIN_DURATION);+ if at <= clip.start + edge || at >= clip.start + clip.duration - edge {+ return;+ }+ self.flush_commit();+ self.apply(Command::SplitClips {+ clip_ids: vec![id.to_owned()],+ time: at,+ });+ }+/// Delete: the selection goes, and the hole stays unless the timeline/// is magnetic.pub fn delete_selected(&mut self) {@@ -8647,7 +8671,7 @@ impl Studio {"split",t("studio.splitAtPlayhead"),Glyph::Split,- "S",+ &platform::keys(&["Control", "B"]),straddled && !locked,),action(@@ -9247,6 +9271,14 @@ impl Studio {let at = self.playhead;self.split_at(at, true);}+ // B: the razor, on and off.+ "split-tool" => {+ self.lanes.tool = if self.lanes.tool == TimelineTool::Split {+ TimelineTool::Select+ } else {+ TimelineTool::Split+ };+ }"select-all" => self.select_all(),// The phone's way out of the clip tools: nothing selected, the// way a press on an empty lane leaves it.diff --git a/src/crates/concat/ui/app.slint b/src/crates/concat/ui/app.slintindex fe98b27f..e36f3d82 100644--- a/src/crates/concat/ui/app.slint+++ b/src/crates/concat/ui/app.slint@@ -562,11 +562,10 @@ export component App inherits Window {}// Lower-cased, so Caps Lock leaves the letters alone.let letter = event.text.to-lowercase();- // B splits the selected clips at the playhead, or every clip- // when nothing is selected; the chord B above splits every clip- // either way. There was a razor tool on B and this split on S,- // and the two did the same thing by different pointers.- if (letter == "b") { Editor.shortcut("split-selected"); return accept; }+ // B is the razor: the split tool, on and off, the key every+ // editor cuts with. The chord B above splits at the playhead.+ // https://github.com/jub0t/Concat/issues/241+ if (letter == "b") { Editor.shortcut("split-tool"); return accept; }if (letter == "n") { Editor.shortcut("snap"); return accept; }if (letter == "s") { Editor.shortcut("preview-axis"); return accept; }if (letter == "m") { Editor.shortcut("mute"); return accept; }diff --git a/src/crates/concat/ui/editor.slint b/src/crates/concat/ui/editor.slintindex 46b78575..fbd074dc 100644--- a/src/crates/concat/ui/editor.slint+++ b/src/crates/concat/ui/editor.slint@@ -360,6 +360,8 @@ export global Editor {/// A ruler diamond was dragged: every key at `from` moves to `to`.callback key-mark-moved(from: float, to: float);callback clip-pressed(id: string, additive: bool, edge: int);+ /// The split tool pressed a clip: cut it at `seconds`.+ callback clip-split(id: string, seconds: float);callback clip-dragged(seconds: float, pixels: length);callback clip-released();in-out property <[MenuItemData]> menu-items;diff --git a/src/crates/concat/ui/timeline/lanes.slint b/src/crates/concat/ui/timeline/lanes.slintindex 2bc4dbae..0bad2eb1 100644--- a/src/crates/concat/ui/timeline/lanes.slint+++ b/src/crates/concat/ui/timeline/lanes.slint@@ -130,6 +130,8 @@ component Clip inherits Rectangle {/// A press landed: the caller resolves the selection before any drag.callback pressed(additive: bool, edge: int);+ /// A press with the split tool: cut here, `x` into the clip.+ callback split-at(x: length);/// Window-space delta since the press: seconds across, pixels down. Not/// lanes down — the lanes differ in height, so which row a drag has/// reached is a question only the side holding the heights can answer.@@ -517,7 +519,8 @@ component Clip inherits Rectangle {// the same fix, as the workspace splitters.touch := TouchArea {enabled: !root.locked;- mouse-cursor: root.edge-at >= 0 ? MouseCursor.ew-resize : MouseCursor.grab;+ mouse-cursor: root.tool == TimelineTool.split ? MouseCursor.crosshair+ : root.edge-at >= 0 ? MouseCursor.ew-resize : MouseCursor.grab;changed mouse-x => {if (self.has-hover && !self.pressed) { root.hovered(self.mouse-x); }@@ -541,6 +544,12 @@ component Clip inherits Rectangle {}if (event.kind == PointerEventKind.down&& event.button == PointerEventButton.left) {+ // The split tool cuts where the press lands and starts no+ // gesture: nothing is selected or moved by it.+ if (root.tool == TimelineTool.split) {+ root.split-at(self.mouse-x);+ return;+ }self.origin-x = self.absolute-position.x + self.mouse-x;self.origin-y = self.absolute-position.y + self.mouse-y;root.pressed(event.modifiers.shift || event.modifiers.control@@ -959,6 +968,8 @@ export component Lanes inherits Rectangle {}}callback clip-pressed(id: string, additive: bool, edge: int);+ /// The split tool pressed a clip: cut it at `seconds` on the timeline.+ callback clip-split(id: string, seconds: float);callback clip-dragged(seconds: float, pixels: length);callback clip-released();/// Right-click on a clip. The caller fills the menu and bumps `menu-token`;@@ -1291,6 +1302,9 @@ export component Lanes inherits Rectangle {root.clip-dragging = true;root.clip-pressed(entry.id, additive, edge);}+ split-at(x) => {+ root.clip-split(entry.id, entry.start + x / root.px-per-second);+ }// The clip reports its delta from the press; a view that has// scrolled since then is added, so the clip stays under the// pointer while the edge scrolls it along.diff --git a/src/crates/concat/ui/timeline/model.slint b/src/crates/concat/ui/timeline/model.slintindex 833922f6..ffa3defc 100644--- a/src/crates/concat/ui/timeline/model.slint+++ b/src/crates/concat/ui/timeline/model.slint@@ -21,6 +21,8 @@ export enum ClipKind { video, audio, image, text, filter }export enum TimelineTool {/// grab, move, trim, band-selectselect,+ /// click a clip to cut it where the pointer is; B turns it on and off+ split,}/// One tab. A project holds several timelines the way it holds sequences indiff --git a/src/crates/concat/ui/timeline/tray.slint b/src/crates/concat/ui/timeline/tray.slintindex 20881720..650e03e7 100644--- a/src/crates/concat/ui/timeline/tray.slint+++ b/src/crates/concat/ui/timeline/tray.slint@@ -159,6 +159,19 @@ export component TimelineTray inherits Rectangle {icon-size: 16px;clicked => { root.split(); }}+ // And the razor, a tool rather than a verb: on, a click on a clip+ // cuts it where the pointer is. B turns it on and off.+ // https://github.com/jub0t/Concat/issues/241+ TrayButton {+ glyph: Glyph.razor;+ label: I18n.t("tray.splitTool");+ icon-size: 16px;+ checked: root.tool == TimelineTool.split;+ clicked => {+ root.tool-changed(root.tool == TimelineTool.split+ ? TimelineTool.select : TimelineTool.split);+ }+ }TrayButton {glyph: Glyph.merge;// The reason a blocked Merge is blocked rides on the button ratherdiff --git a/src/crates/concat/ui/workspace/seat.slint b/src/crates/concat/ui/workspace/seat.slintindex 2b9f6e81..cb4e4998 100644--- a/src/crates/concat/ui/workspace/seat.slint+++ b/src/crates/concat/ui/workspace/seat.slint@@ -413,6 +413,7 @@ export component Seat inherits Rectangle {Editor.blur();Editor.clip-pressed(id, additive, edge);}+ clip-split(id, seconds) => { Editor.clip-split(id, seconds); }clip-dragged(seconds, pixels) => { Editor.clip-dragged(seconds, pixels); }clip-released => { Editor.clip-released(); }menu-items: Editor.menu-items;diff --git a/src/crates/concat/ui/workspace/timeline-pane.slint b/src/crates/concat/ui/workspace/timeline-pane.slintindex 5d17bea3..5d817f43 100644--- a/src/crates/concat/ui/workspace/timeline-pane.slint+++ b/src/crates/concat/ui/workspace/timeline-pane.slint@@ -97,6 +97,7 @@ export component TimelinePane inherits Rectangle {/// A press on an empty stretch of lane; see Editor.blur.callback floor-pressed();callback clip-pressed(id: string, additive: bool, edge: int);+ callback clip-split(id: string, seconds: float);callback clip-dragged(seconds: float, pixels: length);callback clip-released();in property <[MenuItemData]> menu-items;@@ -418,6 +419,7 @@ export component TimelinePane inherits Rectangle {hover-ended => { root.hover-ended(); }floor-pressed => { root.floor-pressed(); }clip-pressed(id, additive, edge) => { root.clip-pressed(id, additive, edge); }+ clip-split(id, seconds) => { root.clip-split(id, seconds); }clip-dragged(seconds, pixels) => { root.clip-dragged(seconds, pixels); }clip-released => { root.clip-released(); }menu-items: root.menu-items;