Skip to content

The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.

feat(timeline): the preview axis, a brighter tray and titles on top

Jareerfea673cceffc
diff --git a/.github/release-notes.sh b/.github/release-notes.sh
index 6d453f7f..39d9c84f 100755
--- a/.github/release-notes.sh
+++ b/.github/release-notes.sh
@@ -63,29 +63,5 @@ cat <<'EOF'
| Android | | | `android-arm64.apk` |
| iOS / iPadOS | | | `ios-arm64.ipa` |
-Every bundle runs with nothing else installed.
-
-- **macOS**: open the `.dmg` and drag Concat to Applications. If macOS says
- the app cannot be checked, right-click it and choose Open once.
-- **Windows**: run the `-setup.exe`; it puts Concat in the Start menu and
- can take it out again. The `.msi` is the same program for an
- administrator to deploy, machine-wide.
-- **Linux**: install the `.deb` or the `.rpm` with your package manager,
- or `chmod +x` the `.AppImage` and run it; no install needed.
-- **Android**: open the `.apk` on the phone and allow the install from
- this source; Android 8.0 or newer, 64-bit.
-- **iOS / iPadOS**: sideload the `.ipa` with AltStore, Sideloadly or
- Xcode's Devices window, which sign it with your Apple ID; iOS 15 or
- newer.
-
`SHA256SUMS` lists each file's checksum.
-
-### Licences
-
-Concat is AGPL-3.0-or-later with a plugin exception
-([LICENSE-EXCEPTIONS.md](https://github.com/jub0t/Concat/blob/main/LICENSE-EXCEPTIONS.md)).
-The bundles carry FFmpeg (GPL, with x264), compile in whisper.cpp (MIT) and
-link sherpa-onnx with espeak-ng (GPL-3.0); Slint is used under its GPL-3.0
-option. Sources and licences:
-[THIRD_PARTY_NOTICES.md](https://github.com/jub0t/Concat/blob/main/THIRD_PARTY_NOTICES.md).
EOF
diff --git a/docs/api/edits.md b/docs/api/edits.md
index b04a527a..29bdfb9d 100644
--- a/docs/api/edits.md
+++ b/docs/api/edits.md
@@ -197,7 +197,7 @@ first line.
| Field | Type | Meaning |
|---|---|---|
| `trackId` | string | *optional*. The lane. Absent picks a free track; a vanished track is **refused** |
-| `above` | bool | *optional*, default `false`. With no `trackId`: land on the first free lane *above* the highest occupied one, minting a lane at the top if needed. What captions use |
+| `above` | bool | *optional*, default `false`. With no `trackId`: land on the first free lane *above* the highest occupied one, minting a lane at the top if needed. What the editor does for its own titles and captions |
| `start` | number | Seconds; floored at 0 |
| `style` | *TextStyle* | *optional*. Only the fields you set; the rest are the window's defaults. `{"content": "Hello"}` is enough |
| `duration` | number | *optional*, default 4 s |
diff --git a/src/crates/concat-project/src/commands/clips.rs b/src/crates/concat-project/src/commands/clips.rs
index 5c3d5cd1..f0ae54bd 100644
--- a/src/crates/concat-project/src/commands/clips.rs
+++ b/src/crates/concat-project/src/commands/clips.rs
@@ -84,7 +84,7 @@ pub(super) fn apply(
Some(id) => id,
None => {
// Every lane above the video is taken: mint one at
- // the top for the caption to land on.
+ // the top for the words to land on.
let id = mint.next("t");
timeline.tracks.push(Track {
id: id.clone(),
@@ -677,9 +677,9 @@ fn first_free_track(timeline: &Timeline, start: f64, duration: f64) -> Option<St
/// duration)`. `None` when every lane above is taken, which is the caller's
/// cue to mint a new one at the top.
///
-/// Captions go through this so they sit over the video, not under it. The
-/// plain `first_free_track` still walks from the bottom, which is what a
-/// title added by hand wants.
+/// Captions and titles go through this so they sit over the video, not
+/// under it. The plain `first_free_track` still walks from the bottom,
+/// which is what a sound or a picture wants.
fn first_free_track_above(timeline: &Timeline, start: f64, duration: f64) -> Option<String> {
let end = start + duration;
let occupied = |track_id: &str| {
diff --git a/src/crates/concat-project/src/commands/mod.rs b/src/crates/concat-project/src/commands/mod.rs
index 861cfb76..88575d12 100644
--- a/src/crates/concat-project/src/commands/mod.rs
+++ b/src/crates/concat-project/src/commands/mod.rs
@@ -299,10 +299,11 @@ pub enum Command {
track_id: Option<String>,
/// When `track_id` is None and this is true, the clip lands on the
/// first free lane *above* the highest one occupied over its span,
- /// minting a new lane at the top when every one above is taken. Set
- /// by the caption run so captions sit over the video rather than
- /// under it; a plain title leaves it false and keeps the old
- /// bottom-first behaviour. Ignored when `track_id` names a track.
+ /// minting a new lane at the top when every one above is taken.
+ /// What the editor sets for a caption and for a title alike, so
+ /// words sit over the video rather than under it; false keeps the
+ /// bottom-first walk of [`Command::AddClipAtFirstFree`]. Ignored
+ /// when `track_id` names a track.
#[serde(default)]
above: bool,
/// Timeline position in seconds, floored at 0.
diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.json
index f12a1f38..38898718 100644
--- a/src/crates/concat/locales/de.json
+++ b/src/crates/concat/locales/de.json
@@ -102,7 +102,12 @@
"Content": "Inhalt",
"CONTENTS": "INHALT",
"Contents": "Inhalt",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
+ "Turn on Preview Axis (S)": "Vorschauachse einschalten (S)",
+ "Turn off Preview Axis (S)": "Vorschauachse ausschalten (S)",
+ "Preview axis options": "Optionen der Vorschauachse",
+ "Preview video and audio": "Video und Ton vorschauen",
+ "Preview video only": "Nur Video vorschauen",
"Show advanced options": "Show advanced options",
"Target bitrate": "Target bitrate",
"Timeline shortcuts": "Timeline shortcuts",
@@ -230,12 +235,12 @@
"General": "Allgemein",
"Generate captions": "Untertitel erzeugen",
"Generate speech": "Sprache erzeugen",
+ "Generated": "Generiert",
"Generating voice": "Stimme wird erzeugt",
"Glow": "Glühen",
"Go to end": "Zum Ende",
"Go to start": "Zum Anfang",
"Green": "Grün",
- "Generated": "Generiert",
"Green Screen": "Greenscreen",
"Half": "Halb",
"Hall": "Saal",
@@ -336,12 +341,12 @@
"not installed": "nicht installiert",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "Hier wurde nichts gefunden, das bleiben könnte, daher wird das Bild wie aufgenommen gezeigt. Versuche ein anderes Motiv oder das manuelle Entfernen.",
"Nothing of that kind in this project.": "Nichts dieser Art in diesem Projekt.",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "Noch nichts vorgelesen. Text zu Sprache legt seine Stimme hier ab.",
"Nothing starred yet — hover a tile and press its star.": "Noch nichts markiert – über eine Kachel fahren und den Stern drücken.",
"Nothing to export": "Nichts zu exportieren",
"Nothing to read yet": "Noch nichts zu lesen",
"Nothing under the playhead": "Nichts unter dem Abspielkopf",
"Nothing was said in that clip": "In diesem Clip wurde nichts gesagt",
- "Nothing read aloud yet. Text to speech puts its voice here.": "Noch nichts vorgelesen. Text zu Sprache legt seine Stimme hier ab.",
"Object": "Objekt",
"off": "aus",
"One repeat, fading.": "Eine Wiederholung, ausklingend.",
diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.json
index e66d8d4f..79168a7f 100644
--- a/src/crates/concat/locales/en.json
+++ b/src/crates/concat/locales/en.json
@@ -594,7 +594,7 @@
"Output": "Output",
"Output · {0}": "Output · {0}",
"Pace": "Pace",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
"Party & Club": "Party & Club",
"Paste": "Paste",
"Pause": "Pause",
@@ -623,7 +623,10 @@
"Posterize": "Posterize",
"Presets": "Presets",
"Preview": "Preview",
+ "Preview axis options": "Preview axis options",
"Preview failed: {0}": "Preview failed: {0}",
+ "Preview video and audio": "Preview video and audio",
+ "Preview video only": "Preview video only",
"Previous frame": "Previous frame",
"Prism Dispersion": "Prism Dispersion",
"Processor": "Processor",
@@ -891,6 +894,8 @@
"Treatments": "Treatments",
"Treble": "Treble",
"Tropical": "Tropical",
+ "Turn off Preview Axis (S)": "Turn off Preview Axis (S)",
+ "Turn on Preview Axis (S)": "Turn on Preview Axis (S)",
"Turns": "Turns",
"Twirl": "Twirl",
"Twist": "Twist",
diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.json
index ec5c68fc..6455b9f2 100644
--- a/src/crates/concat/locales/es.json
+++ b/src/crates/concat/locales/es.json
@@ -102,7 +102,12 @@
"Content": "Contenido",
"CONTENTS": "CONTENIDO",
"Contents": "Contenido",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
+ "Turn on Preview Axis (S)": "Activar el eje de previsualización (S)",
+ "Turn off Preview Axis (S)": "Desactivar el eje de previsualización (S)",
+ "Preview axis options": "Opciones del eje de previsualización",
+ "Preview video and audio": "Previsualizar vídeo y audio",
+ "Preview video only": "Previsualizar solo vídeo",
"Show advanced options": "Show advanced options",
"Target bitrate": "Target bitrate",
"Timeline shortcuts": "Timeline shortcuts",
@@ -230,12 +235,12 @@
"General": "General",
"Generate captions": "Generar subtítulos",
"Generate speech": "Generar voz",
+ "Generated": "Generado",
"Generating voice": "Generando voz",
"Glow": "Resplandor",
"Go to end": "Ir al final",
"Go to start": "Ir al inicio",
"Green": "Verde",
- "Generated": "Generado",
"Green Screen": "Pantalla verde",
"Half": "Media",
"Hall": "Sala",
@@ -336,12 +341,12 @@
"not installed": "no instalado",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "No se encontró nada que conservar, así que la imagen se muestra tal cual. Prueba otro sujeto o la eliminación manual.",
"Nothing of that kind in this project.": "No hay nada de ese tipo en este proyecto.",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "Aún no se ha leído nada. Texto a voz deja aquí su voz.",
"Nothing starred yet — hover a tile and press its star.": "Aún no hay favoritos: pasa el cursor por una tarjeta y pulsa su estrella.",
"Nothing to export": "Nada que exportar",
"Nothing to read yet": "Aún no hay nada que leer",
"Nothing under the playhead": "Nada bajo el cabezal",
"Nothing was said in that clip": "No se dijo nada en ese clip",
- "Nothing read aloud yet. Text to speech puts its voice here.": "Aún no se ha leído nada. Texto a voz deja aquí su voz.",
"Object": "Objeto",
"off": "desactivado",
"One repeat, fading.": "Una repetición que se desvanece.",
diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.json
index 2cb9eddb..c57eca8a 100644
--- a/src/crates/concat/locales/fa.json
+++ b/src/crates/concat/locales/fa.json
@@ -445,7 +445,12 @@
"Output": "خروجی",
"Output · {0}": "خروجی · {0}",
"Pace": "سرعت",
- "Pan tool": "ابزار Pan",
+ "Pan tool (H)": "ابزار Pan (H)",
+ "Turn on Preview Axis (S)": "روشن کردن محور پیش‌نمایش (S)",
+ "Turn off Preview Axis (S)": "خاموش کردن محور پیش‌نمایش (S)",
+ "Preview axis options": "گزینه‌های محور پیش‌نمایش",
+ "Preview video and audio": "پیش‌نمایش ویدیو و صدا",
+ "Preview video only": "پیش‌نمایش فقط ویدیو",
"Paste": "چسباندن",
"Pause": "مکث",
"Peach": "هلویی",
diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.json
index 607c9bc0..4b75917b 100644
--- a/src/crates/concat/locales/fr.json
+++ b/src/crates/concat/locales/fr.json
@@ -102,7 +102,12 @@
"Content": "Contenu",
"CONTENTS": "CONTENU",
"Contents": "Contenu",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
+ "Turn on Preview Axis (S)": "Activer l'axe d'aperçu (S)",
+ "Turn off Preview Axis (S)": "Désactiver l'axe d'aperçu (S)",
+ "Preview axis options": "Options de l'axe d'aperçu",
+ "Preview video and audio": "Aperçu vidéo et audio",
+ "Preview video only": "Aperçu vidéo seule",
"Show advanced options": "Show advanced options",
"Target bitrate": "Target bitrate",
"Timeline shortcuts": "Timeline shortcuts",
@@ -230,12 +235,12 @@
"General": "Général",
"Generate captions": "Générer les sous-titres",
"Generate speech": "Générer la voix",
+ "Generated": "Généré",
"Generating voice": "Génération de la voix",
"Glow": "Lueur",
"Go to end": "Aller à la fin",
"Go to start": "Aller au début",
"Green": "Vert",
- "Generated": "Généré",
"Green Screen": "Fond vert",
"Half": "Moitié",
"Hall": "Salle",
@@ -336,12 +341,12 @@
"not installed": "non installé",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "Rien à garder ici, l'image est donc montrée telle quelle. Essayez un autre sujet ou la suppression manuelle.",
"Nothing of that kind in this project.": "Rien de ce genre dans ce projet.",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "Rien n'a encore été lu. La synthèse vocale dépose sa voix ici.",
"Nothing starred yet — hover a tile and press its star.": "Rien en favori pour l'instant — survolez une vignette et appuyez sur son étoile.",
"Nothing to export": "Rien à exporter",
"Nothing to read yet": "Rien à lire pour l'instant",
"Nothing under the playhead": "Rien sous la tête de lecture",
"Nothing was said in that clip": "Rien n'a été dit dans ce clip",
- "Nothing read aloud yet. Text to speech puts its voice here.": "Rien n'a encore été lu. La synthèse vocale dépose sa voix ici.",
"Object": "Objet",
"off": "désactivé",
"One repeat, fading.": "Une répétition qui s'estompe.",
diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.json
index 28ad721b..777b66c2 100644
--- a/src/crates/concat/locales/hr.json
+++ b/src/crates/concat/locales/hr.json
@@ -128,7 +128,12 @@
"Content": "Sadržaj",
"CONTENTS": "SADRŽAJ",
"Contents": "Sadržaj",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
+ "Turn on Preview Axis (S)": "Uključi os pregleda (S)",
+ "Turn off Preview Axis (S)": "Isključi os pregleda (S)",
+ "Preview axis options": "Mogućnosti osi pregleda",
+ "Preview video and audio": "Pregled videa i zvuka",
+ "Preview video only": "Pregled samo videa",
"Show advanced options": "Show advanced options",
"Target bitrate": "Target bitrate",
"Timeline shortcuts": "Prečaci na traci",
@@ -281,12 +286,12 @@
"General": "Općenito",
"Generate captions": "Generiraj titlove",
"Generate speech": "Generiraj govor",
+ "Generated": "Generirano",
"Generating voice": "Generiranje glasa",
"Glow": "Sjaj",
"Go to end": "Idi na kraj",
"Go to start": "Idi na početak",
"Golden Hour": "Zlatni sat",
- "Generated": "Generirano",
"Grain": "Zrno",
"Green": "Zelena",
"Green Screen": "Zelena pozadina",
@@ -420,12 +425,12 @@
"not installed": "nije instalirano",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "Ništa nije pronađeno za čuvanje, pa se slika prikazuje kako je snimljena. Pokušajte drugi subjekt ili prilagođeno uklanjanje.",
"Nothing of that kind in this project.": "Nema ničega te vrste u ovom projektu.",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "Još ništa nije pročitano naglas. Tekst u govor ovdje ostavlja svoj glas.",
"Nothing starred yet — hover a tile and press its star.": "Još ništa označeno zvjezdicom — prijeđite preko pločice i pritisnite njezinu zvjezdicu.",
"Nothing to caption yet": "Još ništa za titlove",
"Nothing to export": "Ništa za izvoz",
"Nothing to read yet": "Još ništa za čitanje",
"Nothing under the playhead": "Ništa pod playheadom",
- "Nothing read aloud yet. Text to speech puts its voice here.": "Još ništa nije pročitano naglas. Tekst u govor ovdje ostavlja svoj glas.",
"Nothing was said in that clip": "U tom klipu ništa nije rečeno",
"Object": "Objekt",
"off": "isključeno",
diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.json
index 23059204..34617ccf 100644
--- a/src/crates/concat/locales/it.json
+++ b/src/crates/concat/locales/it.json
@@ -102,7 +102,12 @@
"Content": "Contenuto",
"CONTENTS": "CONTENUTO",
"Contents": "Contenuto",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
+ "Turn on Preview Axis (S)": "Attiva l'asse di anteprima (S)",
+ "Turn off Preview Axis (S)": "Disattiva l'asse di anteprima (S)",
+ "Preview axis options": "Opzioni dell'asse di anteprima",
+ "Preview video and audio": "Anteprima video e audio",
+ "Preview video only": "Anteprima solo video",
"Show advanced options": "Show advanced options",
"Target bitrate": "Target bitrate",
"Timeline shortcuts": "Timeline shortcuts",
@@ -230,12 +235,12 @@
"General": "Generale",
"Generate captions": "Genera sottotitoli",
"Generate speech": "Genera voce",
+ "Generated": "Generato",
"Generating voice": "Generazione della voce",
"Glow": "Bagliore",
"Go to end": "Vai alla fine",
"Go to start": "Vai all'inizio",
"Green": "Verde",
- "Generated": "Generato",
"Green Screen": "Green screen",
"Half": "Metà",
"Hall": "Sala",
@@ -336,12 +341,12 @@
"not installed": "non installato",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "Qui non c'è nulla da tenere, quindi l'immagine è mostrata com'è. Prova un altro soggetto o la rimozione manuale.",
"Nothing of that kind in this project.": "Niente di questo tipo in questo progetto.",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "Non è stato ancora letto nulla. La sintesi vocale lascia qui la sua voce.",
"Nothing starred yet — hover a tile and press its star.": "Nessun preferito ancora: passa su una scheda e premi la sua stella.",
"Nothing to export": "Niente da esportare",
"Nothing to read yet": "Ancora niente da leggere",
"Nothing under the playhead": "Niente sotto la testina",
"Nothing was said in that clip": "In quella clip non è stato detto nulla",
- "Nothing read aloud yet. Text to speech puts its voice here.": "Non è stato ancora letto nulla. La sintesi vocale lascia qui la sua voce.",
"Object": "Oggetto",
"off": "disattivato",
"One repeat, fading.": "Una ripetizione che sfuma.",
diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.json
index a3c60858..ac6f6d09 100644
--- a/src/crates/concat/locales/ja.json
+++ b/src/crates/concat/locales/ja.json
@@ -102,7 +102,12 @@
"Content": "内容",
"CONTENTS": "内容",
"Contents": "内容",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
+ "Turn on Preview Axis (S)": "プレビュー軸をオンにする (S)",
+ "Turn off Preview Axis (S)": "プレビュー軸をオフにする (S)",
+ "Preview axis options": "プレビュー軸のオプション",
+ "Preview video and audio": "映像と音声をプレビュー",
+ "Preview video only": "映像のみプレビュー",
"Show advanced options": "Show advanced options",
"Target bitrate": "Target bitrate",
"Timeline shortcuts": "Timeline shortcuts",
@@ -230,12 +235,12 @@
"General": "一般",
"Generate captions": "字幕を生成",
"Generate speech": "音声を生成",
+ "Generated": "生成",
"Generating voice": "音声を生成中",
"Glow": "グロー",
"Go to end": "終端へ",
"Go to start": "先頭へ",
"Green": "緑",
- "Generated": "生成",
"Green Screen": "グリーンスクリーン",
"Half": "1/2",
"Hall": "ホール",
@@ -336,12 +341,12 @@
"not installed": "未インストール",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "残すものが見つからなかったため、画像はそのまま表示されています。別の対象かカスタム削除を試してください。",
"Nothing of that kind in this project.": "この種類のものはこのプロジェクトにありません。",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "まだ何も読み上げていません。テキスト読み上げの音声はここに入ります。",
"Nothing starred yet — hover a tile and press its star.": "まだお気に入りはありません。タイルにカーソルを合わせて星を押してください。",
"Nothing to export": "書き出すものがありません",
"Nothing to read yet": "読み上げる内容がまだありません",
"Nothing under the playhead": "再生ヘッドの下に何もありません",
"Nothing was said in that clip": "そのクリップには発話がありませんでした",
- "Nothing read aloud yet. Text to speech puts its voice here.": "まだ何も読み上げていません。テキスト読み上げの音声はここに入ります。",
"Object": "物体",
"off": "オフ",
"One repeat, fading.": "一回の繰り返しがフェードします。",
diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.json
index 418f33ed..1f541698 100644
--- a/src/crates/concat/locales/ko.json
+++ b/src/crates/concat/locales/ko.json
@@ -102,7 +102,12 @@
"Content": "내용",
"CONTENTS": "내용",
"Contents": "내용",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
+ "Turn on Preview Axis (S)": "미리보기 축 켜기 (S)",
+ "Turn off Preview Axis (S)": "미리보기 축 끄기 (S)",
+ "Preview axis options": "미리보기 축 옵션",
+ "Preview video and audio": "영상과 소리 미리보기",
+ "Preview video only": "영상만 미리보기",
"Show advanced options": "Show advanced options",
"Target bitrate": "Target bitrate",
"Timeline shortcuts": "Timeline shortcuts",
@@ -230,12 +235,12 @@
"General": "일반",
"Generate captions": "자막 생성",
"Generate speech": "음성 생성",
+ "Generated": "생성됨",
"Generating voice": "음성 생성 중",
"Glow": "글로우",
"Go to end": "끝으로",
"Go to start": "처음으로",
"Green": "녹색",
- "Generated": "생성됨",
"Green Screen": "그린 스크린",
"Half": "1/2",
"Hall": "홀",
@@ -336,12 +341,12 @@
"not installed": "설치되지 않음",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "남길 것을 찾지 못해 그림을 촬영한 그대로 보여줍니다. 다른 대상이나 사용자 지정 제거를 시도해 보세요.",
"Nothing of that kind in this project.": "이 프로젝트에 해당 종류의 항목이 없습니다.",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "아직 읽어 준 것이 없습니다. 텍스트 음성 변환의 음성이 여기에 들어옵니다.",
"Nothing starred yet — hover a tile and press its star.": "아직 즐겨찾기가 없습니다. 타일에 마우스를 올리고 별을 누르세요.",
"Nothing to export": "내보낼 것이 없습니다",
"Nothing to read yet": "아직 읽을 내용이 없습니다",
"Nothing under the playhead": "재생 헤드 아래에 아무것도 없습니다",
"Nothing was said in that clip": "그 클립에는 말소리가 없습니다",
- "Nothing read aloud yet. Text to speech puts its voice here.": "아직 읽어 준 것이 없습니다. 텍스트 음성 변환의 음성이 여기에 들어옵니다.",
"Object": "사물",
"off": "끔",
"One repeat, fading.": "한 번 반복하며 사라집니다.",
diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.json
index f5d8d432..9162982b 100644
--- a/src/crates/concat/locales/pt-BR.json
+++ b/src/crates/concat/locales/pt-BR.json
@@ -102,7 +102,12 @@
"Content": "Conteúdo",
"CONTENTS": "CONTEÚDO",
"Contents": "Conteúdo",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
+ "Turn on Preview Axis (S)": "Ligar o eixo de prévia (S)",
+ "Turn off Preview Axis (S)": "Desligar o eixo de prévia (S)",
+ "Preview axis options": "Opções do eixo de prévia",
+ "Preview video and audio": "Prévia de vídeo e áudio",
+ "Preview video only": "Prévia só de vídeo",
"Show advanced options": "Show advanced options",
"Target bitrate": "Target bitrate",
"Timeline shortcuts": "Timeline shortcuts",
@@ -230,12 +235,12 @@
"General": "Geral",
"Generate captions": "Gerar legendas",
"Generate speech": "Gerar fala",
+ "Generated": "Gerado",
"Generating voice": "Gerando voz",
"Glow": "Brilho",
"Go to end": "Ir para o fim",
"Go to start": "Ir para o início",
"Green": "Verde",
- "Generated": "Gerado",
"Green Screen": "Tela verde",
"Half": "Metade",
"Hall": "Salão",
@@ -336,12 +341,12 @@
"not installed": "não instalado",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "Nada foi encontrado para manter, então a imagem é mostrada como gravada. Tente outro assunto ou a remoção manual.",
"Nothing of that kind in this project.": "Nada desse tipo neste projeto.",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "Nada foi lido ainda. Texto para fala deixa sua voz aqui.",
"Nothing starred yet — hover a tile and press its star.": "Nada favoritado ainda — passe o mouse sobre um cartão e toque na estrela.",
"Nothing to export": "Nada para exportar",
"Nothing to read yet": "Nada para ler ainda",
"Nothing under the playhead": "Nada sob o cursor",
"Nothing was said in that clip": "Nada foi dito nesse clipe",
- "Nothing read aloud yet. Text to speech puts its voice here.": "Nada foi lido ainda. Texto para fala deixa sua voz aqui.",
"Object": "Objeto",
"off": "desligado",
"One repeat, fading.": "Uma repetição que se esvai.",
diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.json
index 87269464..20a2e5dc 100644
--- a/src/crates/concat/locales/ru.json
+++ b/src/crates/concat/locales/ru.json
@@ -102,7 +102,12 @@
"Content": "Содержание",
"CONTENTS": "СОДЕРЖИМОЕ",
"Contents": "Содержимое",
- "Pan tool": "Инструмент «Рука»",
+ "Pan tool (H)": "Инструмент «Рука» (H)",
+ "Turn on Preview Axis (S)": "Включить ось предпросмотра (S)",
+ "Turn off Preview Axis (S)": "Выключить ось предпросмотра (S)",
+ "Preview axis options": "Параметры оси предпросмотра",
+ "Preview video and audio": "Предпросмотр видео и звука",
+ "Preview video only": "Предпросмотр только видео",
"Show advanced options": "Показать дополнительные параметры",
"Target bitrate": "Целевой битрейт",
"Timeline shortcuts": "Клавиши таймлайна",
@@ -230,12 +235,12 @@
"General": "Общие",
"Generate captions": "Создать субтитры",
"Generate speech": "Создать речь",
+ "Generated": "Созданное",
"Generating voice": "Создание голоса",
"Glow": "Свечение",
"Go to end": "В конец",
"Go to start": "В начало",
"Green": "Зелёный",
- "Generated": "Созданное",
"Green Screen": "Зелёный экран",
"Half": "Половина",
"Hall": "Зал",
@@ -336,12 +341,12 @@
"not installed": "не установлено",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "Здесь нечего оставить, поэтому кадр показан как снят. Попробуйте другой объект съёмки или ручное удаление.",
"Nothing of that kind in this project.": "В этом проекте ничего такого нет.",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "Пока ничего не озвучено. Озвучивание текста кладёт свой голос сюда.",
"Nothing starred yet — hover a tile and press its star.": "Пока ничего нет — наведите на плитку и нажмите звезду.",
"Nothing to export": "Нечего экспортировать",
"Nothing to read yet": "Пока нечего читать",
"Nothing under the playhead": "Под курсором ничего нет",
"Nothing was said in that clip": "В этом клипе ничего не сказано",
- "Nothing read aloud yet. Text to speech puts its voice here.": "Пока ничего не озвучено. Озвучивание текста кладёт свой голос сюда.",
"Object": "Предмет",
"off": "выкл.",
"One repeat, fading.": "Один повтор, затухающий.",
diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.json
index 37296d2e..2608362f 100644
--- a/src/crates/concat/locales/tr.json
+++ b/src/crates/concat/locales/tr.json
@@ -102,7 +102,12 @@
"Content": "İçerik",
"CONTENTS": "İÇERİK",
"Contents": "İçerik",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
+ "Turn on Preview Axis (S)": "Önizleme eksenini aç (S)",
+ "Turn off Preview Axis (S)": "Önizleme eksenini kapat (S)",
+ "Preview axis options": "Önizleme ekseni seçenekleri",
+ "Preview video and audio": "Video ve sesi önizle",
+ "Preview video only": "Yalnızca videoyu önizle",
"Show advanced options": "Show advanced options",
"Target bitrate": "Target bitrate",
"Timeline shortcuts": "Timeline shortcuts",
@@ -230,12 +235,12 @@
"General": "Genel",
"Generate captions": "Altyazı oluştur",
"Generate speech": "Konuşma oluştur",
+ "Generated": "Oluşturulan",
"Generating voice": "Ses oluşturuluyor",
"Glow": "Parıltı",
"Go to end": "Sona git",
"Go to start": "Başa git",
"Green": "Yeşil",
- "Generated": "Oluşturulan",
"Green Screen": "Yeşil perde",
"Half": "Yarım",
"Hall": "Salon",
@@ -336,12 +341,12 @@
"not installed": "kurulu değil",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "Burada tutulacak bir şey bulunamadı, bu yüzden görüntü çekildiği gibi gösteriliyor. Başka bir konu ya da özel kaldırmayı deneyin.",
"Nothing of that kind in this project.": "Bu projede o türden bir şey yok.",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "Henüz hiçbir şey seslendirilmedi. Metinden konuşma sesini buraya bırakır.",
"Nothing starred yet — hover a tile and press its star.": "Henüz favori yok — bir kartın üzerine gelip yıldızına basın.",
"Nothing to export": "Dışa aktarılacak bir şey yok",
"Nothing to read yet": "Henüz okunacak bir şey yok",
"Nothing under the playhead": "Oynatma imlecinin altında bir şey yok",
"Nothing was said in that clip": "O klipte hiçbir şey söylenmedi",
- "Nothing read aloud yet. Text to speech puts its voice here.": "Henüz hiçbir şey seslendirilmedi. Metinden konuşma sesini buraya bırakır.",
"Object": "Nesne",
"off": "kapalı",
"One repeat, fading.": "Sönen tek bir tekrar.",
diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.json
index bbafbc7f..96073bfd 100644
--- a/src/crates/concat/locales/zh-Hans.json
+++ b/src/crates/concat/locales/zh-Hans.json
@@ -102,7 +102,12 @@
"Content": "内容",
"CONTENTS": "内容",
"Contents": "内容",
- "Pan tool": "Pan tool",
+ "Pan tool (H)": "Pan tool (H)",
+ "Turn on Preview Axis (S)": "开启预览轴 (S)",
+ "Turn off Preview Axis (S)": "关闭预览轴 (S)",
+ "Preview axis options": "预览轴选项",
+ "Preview video and audio": "预览视频和音频",
+ "Preview video only": "仅预览视频",
"Show advanced options": "Show advanced options",
"Target bitrate": "Target bitrate",
"Timeline shortcuts": "Timeline shortcuts",
@@ -230,12 +235,12 @@
"General": "通用",
"Generate captions": "生成字幕",
"Generate speech": "生成语音",
+ "Generated": "已生成",
"Generating voice": "正在生成语音",
"Glow": "发光",
"Go to end": "跳到结尾",
"Go to start": "跳到开头",
"Green": "绿色",
- "Generated": "已生成",
"Green Screen": "绿幕",
"Half": "1/2",
"Hall": "大厅",
@@ -336,12 +341,12 @@
"not installed": "未安装",
"Nothing found to keep here, so the picture shows as shot. Try another subject, or custom removal.": "这里没有找到可保留的内容,因此画面按原样显示。请尝试其他主体或自定义移除。",
"Nothing of that kind in this project.": "此项目中没有该类型的内容。",
+ "Nothing read aloud yet. Text to speech puts its voice here.": "尚未朗读任何内容。文字转语音的声音会放在这里。",
"Nothing starred yet — hover a tile and press its star.": "还没有收藏——将鼠标悬停在卡片上并点击星标。",
"Nothing to export": "没有可导出的内容",
"Nothing to read yet": "还没有可朗读的内容",
"Nothing under the playhead": "播放头下方没有内容",
"Nothing was said in that clip": "该片段中没有说话内容",
- "Nothing read aloud yet. Text to speech puts its voice here.": "尚未朗读任何内容。文字转语音的声音会放在这里。",
"Object": "物体",
"off": "关",
"One repeat, fading.": "一次重复,逐渐消失。",
diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.json
index 96af4b1c..b3269884 100644
--- a/src/crates/concat/locales/zh-TW.json
+++ b/src/crates/concat/locales/zh-TW.json
@@ -592,7 +592,12 @@
"Output": "輸出",
"Output · {0}": "輸出 · {0}",
"Pace": "語速",
- "Pan tool": "平移工具",
+ "Pan tool (H)": "平移工具 (H)",
+ "Turn on Preview Axis (S)": "開啟預覽軸 (S)",
+ "Turn off Preview Axis (S)": "關閉預覽軸 (S)",
+ "Preview axis options": "預覽軸選項",
+ "Preview video and audio": "預覽影片和音訊",
+ "Preview video only": "僅預覽影片",
"Party & Club": "派對與夜店",
"Paste": "貼上",
"Pause": "暫停",
diff --git a/src/crates/concat/src/lib.rs b/src/crates/concat/src/lib.rs
index 4128df1e..8e501042 100644
--- a/src/crates/concat/src/lib.rs
+++ b/src/crates/concat/src/lib.rs
@@ -666,6 +666,20 @@ pub fn run() -> Result<(), slint::PlatformError> {
editor.on_magnetic_changed(on_window!(|state, on: bool| {
state.handle(Msg::Timeline(TimelineMsg::MagneticChanged(on)));
}));
+ editor.on_preview_axis_changed(on_window!(|state, on: bool| {
+ state.handle(Msg::Timeline(TimelineMsg::PreviewAxisChanged(on)));
+ }));
+ editor.on_preview_axis_audio_changed(on_window!(|state, on: bool| {
+ state.handle(Msg::Timeline(TimelineMsg::PreviewAxisAudioChanged(on)));
+ }));
+ // The preview axis: on every move of the pointer across the lanes, so
+ // it publishes the lanes and no more, the way a scrub does.
+ editor.on_hovered(on_lanes!(|state, seconds: f32| {
+ state.handle(Msg::Timeline(TimelineMsg::Hovered(seconds)));
+ }));
+ editor.on_hover_ended(on_lanes!(|state| {
+ state.handle(Msg::Timeline(TimelineMsg::HoverEnded));
+ }));
editor.on_add_track(on_window!(|state| {
state.apply(concat_project::Command::AddTrack);
}));
@@ -969,7 +983,7 @@ pub fn run() -> Result<(), slint::PlatformError> {
.on_release(|| Shell::with(|_, app| app.invoke_blur()));
editor.on_shortcut(move |action: SharedString| match action.as_str() {
"import" | "export" | "settings" | "zoom-in" | "zoom-out" | "start" | "end" | "snap"
- | "magnetic" => {
+ | "magnetic" | "pan" | "preview-axis" => {
Shell::with(|_, app| app.invoke_app_menu_selected(action.clone()));
}
_ => Shell::with(|shell, app| {
@@ -1225,6 +1239,14 @@ pub fn run() -> Result<(), slint::PlatformError> {
"undo" => state.undo(),
"redo" => state.redo(),
"snap" => state.handle(Msg::Timeline(TimelineMsg::SnapToggled)),
+ "pan" => {
+ let on = !state.lanes.pan_mode;
+ state.handle(Msg::Timeline(TimelineMsg::PanChanged(on)))
+ }
+ "preview-axis" => {
+ let on = !state.prefs.preview_axis;
+ state.handle(Msg::Timeline(TimelineMsg::PreviewAxisChanged(on)))
+ }
"magnetic" => state.handle(Msg::Timeline(TimelineMsg::MagneticToggled)),
"sort-added" => state.handle(Msg::Media(MediaMsg::SortChanged(0))),
"sort-name" => state.handle(Msg::Media(MediaMsg::SortChanged(1))),
diff --git a/src/crates/concat/src/panes/monitor.rs b/src/crates/concat/src/panes/monitor.rs
index 1f24f36f..1b990022 100644
--- a/src/crates/concat/src/panes/monitor.rs
+++ b/src/crates/concat/src/panes/monitor.rs
@@ -164,7 +164,8 @@ impl MonitorPane {
(side(width), side(height))
}
- /// Asks the engine for the frame at the playhead, one at a time.
+ /// Asks the engine for the frame at the playhead - or under the pointer,
+ /// while the preview axis has it - one at a time.
fn request(&mut self, studio: &mut Studio) {
if studio.on_start || studio.session.is_none() {
return;
@@ -179,7 +180,7 @@ impl MonitorPane {
return;
};
let spec = FrameSpec {
- time: f64::from(studio.playhead),
+ time: f64::from(studio.preview_time()),
width,
height,
moving: studio.playing,
diff --git a/src/crates/concat/src/panes/timeline.rs b/src/crates/concat/src/panes/timeline.rs
index bc3442a3..d8fc0425 100644
--- a/src/crates/concat/src/panes/timeline.rs
+++ b/src/crates/concat/src/panes/timeline.rs
@@ -58,6 +58,15 @@ pub enum TimelineMsg {
MagneticChanged(bool),
/// The menu's Magnetic row: the other way round.
MagneticToggled,
+ /// The tray's preview axis button: the monitor follows the pointer.
+ /// A preference, remembered.
+ PreviewAxisChanged(bool),
+ /// The button's menu: whether the sound under the pointer plays too.
+ PreviewAxisAudioChanged(bool),
+ /// The pointer is over the lanes at this many seconds.
+ Hovered(f32),
+ /// The pointer left the lanes.
+ HoverEnded,
/// The lanes scrolled sideways, to this many seconds from the start.
Scrolled(f32),
/// The wheel or a pinch: by a factor, about an instant; an anchor
@@ -122,6 +131,19 @@ impl TimelinePane {
studio.prefs.magnetic = !studio.prefs.magnetic;
studio.prefs.save(&studio.host.dirs);
}
+ TimelineMsg::PreviewAxisChanged(on) => {
+ studio.prefs.preview_axis = on;
+ studio.prefs.save(&studio.host.dirs);
+ if !on {
+ studio.end_hover();
+ }
+ }
+ TimelineMsg::PreviewAxisAudioChanged(on) => {
+ studio.prefs.preview_axis_audio = on;
+ studio.prefs.save(&studio.host.dirs);
+ }
+ TimelineMsg::Hovered(seconds) => studio.hover(seconds),
+ TimelineMsg::HoverEnded => studio.end_hover(),
TimelineMsg::Scrolled(seconds) => self.scroll_left = seconds.max(0.0),
TimelineMsg::Zoomed { factor, anchor } => {
let anchor = if anchor < 0.0 {
diff --git a/src/crates/concat/src/prefs.rs b/src/crates/concat/src/prefs.rs
index b998750a..b57d80bb 100644
--- a/src/crates/concat/src/prefs.rs
+++ b/src/crates/concat/src/prefs.rs
@@ -42,6 +42,15 @@ pub struct Preferences {
/// sometimes the point; ⇧⌫ ripples either way.
/// https://github.com/jub0t/Concat/issues/106
pub magnetic: bool,
+ /// The preview axis: the monitor shows the frame under the pointer as
+ /// it crosses the lanes, the playhead staying where it is. Off by
+ /// default: a monitor that jumps with the pointer startles whoever has
+ /// not asked for it, and the tray's button is where they ask.
+ pub preview_axis: bool,
+ /// The preview axis plays the sound under the pointer too. Off by
+ /// default: a burst of sound on every pass of the pointer is a lot to
+ /// ask of a room.
+ pub preview_axis_audio: bool,
/// Video decodes on the platform's own hardware where it has some:
/// VideoToolbox on a Mac. `None` is the platform's default, which is on
/// where the hardware path has been exercised (macOS and iOS) and off
diff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rs
index 6f4e4478..49a4d0ca 100644
--- a/src/crates/concat/src/studio.rs
+++ b/src/crates/concat/src/studio.rs
@@ -612,6 +612,12 @@ pub struct Studio {
pub playhead: f32,
pub playing: bool,
transport: slint::Timer,
+ /// The preview axis: the instant under the pointer while it crosses the
+ /// lanes, which the monitor shows instead of the playhead's. None when
+ /// the pointer is elsewhere, or the axis is off, or the cut is playing.
+ pub hover: Option<f32>,
+ /// Stops the burst of sound a hover with audio plays.
+ hover_hush: slint::Timer,
/// One clip, held for Paste.
pub clipboard: Option<Clip>,
/// The monitor: its frame, and the requests for the next.
@@ -1327,6 +1333,8 @@ impl Studio {
// ~20px a second: a ten-second cut fits a pane at its default width.
playing: false,
transport: slint::Timer::default(),
+ hover: None,
+ hover_hush: slint::Timer::default(),
clipboard: None,
monitor: crate::panes::monitor::MonitorPane::default(),
export: Default::default(),
@@ -1866,6 +1874,9 @@ impl Studio {
if self.playhead >= self.duration() {
self.playhead = 0.0;
}
+ // The transport owns the monitor from here; a frame from under a
+ // pointer that happens to be over the lanes must not stay on it.
+ self.end_hover();
self.playing = true;
self.host.playback.play(f64::from(self.playhead));
// The clock is the audio device's; this follows it at 30 Hz and
@@ -1911,6 +1922,56 @@ impl Studio {
self.request_preview();
}
+ // ── the preview axis ──
+
+ /// The instant the monitor shows: the pointer's while it crosses the
+ /// lanes with the preview axis on, else the playhead's.
+ pub fn preview_time(&self) -> f32 {
+ self.hover.unwrap_or(self.playhead)
+ }
+
+ /// The pointer is over the lanes at `seconds`. Nothing while playing -
+ /// the transport owns the monitor then - and nothing with the axis off.
+ pub fn hover(&mut self, seconds: f32) {
+ if !self.prefs.preview_axis || self.playing {
+ return;
+ }
+ let seconds = seconds.max(0.0);
+ if self.hover == Some(seconds) {
+ return;
+ }
+ self.hover = Some(seconds);
+ if self.prefs.preview_axis_audio {
+ // A burst of the sound under the pointer: the engine plays from
+ // there and is stopped a beat later, then put back where the
+ // playhead is, so the next Play starts where the cut says.
+ self.host.playback.play(f64::from(seconds));
+ let playhead = f64::from(self.playhead);
+ self.hover_hush.start(
+ slint::TimerMode::SingleShot,
+ std::time::Duration::from_millis(120),
+ move || {
+ crate::host::Shell::with(|shell, _| {
+ let studio = shell.studio.borrow();
+ if !studio.playing {
+ studio.host.playback.pause();
+ studio.host.playback.seek(playhead);
+ }
+ });
+ },
+ );
+ }
+ self.request_preview();
+ }
+
+ /// The pointer left the lanes, or the axis went off: the monitor is the
+ /// playhead's again.
+ pub fn end_hover(&mut self) {
+ if self.hover.take().is_some() {
+ self.request_preview();
+ }
+ }
+
// ── the bin ──
/// Gives every media item the row Slint knows it by; see
@@ -2462,13 +2523,16 @@ impl Studio {
),
None => (new_title_style(), None, None),
};
+ // Over the picture, not under it: the first free lane above every
+ // occupied one, minted at the top when there is none. A drop onto a
+ // lane names its track and is placed there regardless.
let add = Command::AddTextClip {
track_id,
start,
style: Some(style),
duration: Some(duration),
offset_y,
- above: false,
+ above: true,
};
match font {
Some((family, path)) => self.apply(Command::Batch {
@@ -5707,6 +5771,8 @@ impl Studio {
editor.set_tool(self.lanes.tool);
editor.set_snap(self.lanes.snap);
editor.set_magnetic(self.prefs.magnetic);
+ editor.set_preview_axis(self.prefs.preview_axis);
+ editor.set_preview_axis_audio(self.prefs.preview_axis_audio);
editor.set_pan_mode(self.lanes.pan_mode);
editor.set_selected_count(self.selection.len() as i32);
// The tray's undo and redo buttons grey out on these; the Edit menu
diff --git a/src/crates/concat/ui/app.slint b/src/crates/concat/ui/app.slint
index 25edaa51..9d5ff444 100644
--- a/src/crates/concat/ui/app.slint
+++ b/src/crates/concat/ui/app.slint
@@ -396,8 +396,13 @@ export component App inherits Window {
// the two did the same thing by different pointers.
if (event.text == "b") { Editor.shortcut("split-selected"); return accept; }
if (event.text == "n") { Editor.shortcut("snap"); return accept; }
+ if (event.text == "s") { Editor.shortcut("preview-axis"); return accept; }
if (event.text == "m") { Editor.shortcut("mute"); return accept; }
- if (event.text == "h") { Editor.shortcut("flip-h"); return accept; }
+ // H is the hand: the pan tool, on and off, the key every
+ // editor's canvas grabs with. Flip horizontal had it and lost
+ // it; that is still on the clip's menu, and J still flips
+ // vertically.
+ if (event.text == "h") { Editor.shortcut("pan"); return accept; }
if (event.text == "j") { Editor.shortcut("flip-v"); return accept; }
if (event.text == "r") { Editor.shortcut("reverse"); return accept; }
return reject;
diff --git a/src/crates/concat/ui/editor.slint b/src/crates/concat/ui/editor.slint
index 5d1a4db0..3889028a 100644
--- a/src/crates/concat/ui/editor.slint
+++ b/src/crates/concat/ui/editor.slint
@@ -246,6 +246,12 @@ export global Editor {
in-out property <bool> magnetic;
/// Hand tool: wheel and drag pan time instead of scrolling the stack.
in-out property <bool> pan-mode: false;
+ /// The preview axis: the monitor shows the frame under the pointer as
+ /// it crosses the lanes, the playhead staying put. A remembered
+ /// preference, which Rust owns; `preview-axis-audio` is whether the
+ /// sound under the pointer plays too.
+ in-out property <bool> preview-axis: false;
+ in-out property <bool> preview-axis-audio;
in-out property <int> selected-count;
/// Whether the history has a step that way: what greys the tray's undo
/// and redo buttons. The Edit menu asks Rust the same question when it
@@ -271,6 +277,12 @@ export global Editor {
callback snap-changed(snap: bool);
callback magnetic-changed(on: bool);
callback pan-changed(on: bool);
+ callback preview-axis-changed(on: bool);
+ callback preview-axis-audio-changed(on: bool);
+ /// The preview axis: the pointer is over the lanes at this instant,
+ /// and then it is not.
+ callback hovered(seconds: float);
+ callback hover-ended();
/// The tray's undo and redo buttons. The keyboard's ⌘Z goes through
/// the Edit menu instead (see App.app-menu-selected); both land on the
/// same two methods of the state.
diff --git a/src/crates/concat/ui/icons.slint b/src/crates/concat/ui/icons.slint
index 92da6080..f232e280 100644
--- a/src/crates/concat/ui/icons.slint
+++ b/src/crates/concat/ui/icons.slint
@@ -95,6 +95,8 @@ export enum Glyph {
trash,
magnet,
fold,
+ /// the preview axis: a hairline with the pointer beside it
+ axis,
waveform,
filter,
eye-off,
@@ -513,6 +515,13 @@ export component Icon inherits Rectangle {
+ " M19 9l-3 3 3 3 M5 15l3-3-3-3";
}
+ // The preview axis: a hairline down the lanes and the pointer beside
+ // it - the frame under the pointer, shown without moving the playhead.
+ if root.glyph == Glyph.axis: Stroked {
+ size: root.size; tint: root.tint; weight: root.weight;
+ commands: "M7 3v18 M11 8l9 4.2-4 1.2-1.6 4z";
+ }
+
// lucide/blend: two circles overlapping, for a filter - a look laid
// over whatever plays under it.
if root.glyph == Glyph.filter: Stroked {
diff --git a/src/crates/concat/ui/primitives/panel.slint b/src/crates/concat/ui/primitives/panel.slint
index 8c8fc9d1..d26bba5a 100644
--- a/src/crates/concat/ui/primitives/panel.slint
+++ b/src/crates/concat/ui/primitives/panel.slint
@@ -203,9 +203,13 @@ export component IconButton inherits Rectangle {
/// button, and nothing else so far. Carries the accent at rest, not only
/// on hover, which is what separates it from `checked`.
in property <bool> accent;
- /// widen past the square default
+ /// widen past the square default; a worded button widens to its word
in property <bool> wide;
in property <length> icon-size: 14px;
+ /// The mark's colour at rest. Muted, so a row of buttons reads as marks
+ /// and not as a row of lights; a tray whose marks should stand out on
+ /// their ground raises it.
+ in property <brush> idle: Theme.fg-muted;
callback clicked();
@@ -220,8 +224,8 @@ export component IconButton inherits Rectangle {
property <brush> tint: root.checked ? Theme.accent
: (root.lit && root.danger) ? Theme.danger
: root.accent ? (root.lit ? Theme.accent-hover : Theme.accent)
- : root.lit ? Theme.fg
- : Theme.fg-muted;
+ : root.lit ? Theme.fg-hot
+ : root.idle;
property <length> side: 26px;
property <bool> ring;
@@ -229,7 +233,7 @@ export component IconButton inherits Rectangle {
// on the cross axis — there is no `align-items: center` — so the root takes
// whatever height the row hands it and the chip centres itself inside,
// which keeps the button honest in a 28px row and a 42px header alike.
- width: root.wide ? 40px : root.side;
+ width: root.wide ? Math.max(40px, caption.preferred-width + 16px) : root.side;
min-height: root.side;
// First in the tree, so the TouchArea below sits above it. A FocusScope
@@ -287,7 +291,10 @@ export component IconButton inherits Rectangle {
// size inside a Rectangle - a Rectangle is not a layout, and nothing
// stretches it - so without these four it is a text-sized box at the
// top left corner, and centring it inside itself moves nothing.
- if root.text != "": Text {
+ // Always in the tree, so a wide button can size itself to the
+ // word: an element behind an `if` cannot be measured from outside.
+ caption := Text {
+ visible: root.text != "";
x: 0;
y: 0;
width: parent.width;
diff --git a/src/crates/concat/ui/theme/dark.slint b/src/crates/concat/ui/theme/dark.slint
index 043d83e0..73839a89 100644
--- a/src/crates/concat/ui/theme/dark.slint
+++ b/src/crates/concat/ui/theme/dark.slint
@@ -241,7 +241,7 @@ export global Dark {
/// as the content of the clip rather than as a second label.
out property <color> clip-body: #ffe4b2b8;
/// The chip a clip wears when effects are live on it.
- out property <color> clip-chip: #00000059;
+ out property <color> clip-chip: #00000040;
/// The centre line under a drawn envelope.
out property <color> wave-centre: #ffffff2e;
/// A fade: the wedge of what is being taken away, and the bright line of
diff --git a/src/crates/concat/ui/theme/light.slint b/src/crates/concat/ui/theme/light.slint
index 26102070..522110d7 100644
--- a/src/crates/concat/ui/theme/light.slint
+++ b/src/crates/concat/ui/theme/light.slint
@@ -177,7 +177,7 @@ export global Light {
out property <color> clip-body: #3a2a10c7;
/// The chip a clip wears when effects are live on it. Still a dark wash:
/// it sits on the header's mark, next to `clip-ink`, not on the body.
- out property <color> clip-chip: #00000059;
+ out property <color> clip-chip: #00000040;
/// The centre line under a drawn envelope.
out property <color> wave-centre: #00000038;
/// A fade: the wedge of what is being taken away, and the line of the
diff --git a/src/crates/concat/ui/timeline/lanes.slint b/src/crates/concat/ui/timeline/lanes.slint
index f2ab6db5..b28f4b33 100644
--- a/src/crates/concat/ui/timeline/lanes.slint
+++ b/src/crates/concat/ui/timeline/lanes.slint
@@ -45,7 +45,7 @@ global Paint {
public pure function badge(kind: ClipKind) -> Glyph {
return kind == ClipKind.audio ? Glyph.music
: kind == ClipKind.image ? Glyph.image
- : kind == ClipKind.text ? Glyph.sparkle
+ : kind == ClipKind.text ? Glyph.text-mark
: kind == ClipKind.filter ? Glyph.filter
: Glyph.film;
}
@@ -136,6 +136,11 @@ component Clip inherits Rectangle {
callback dragged(seconds: float, pixels: length);
callback released();
callback context-requested();
+ /// The pointer over this clip, at this x in it, and then not. For the
+ /// preview axis: a hover belongs to the surface under the pointer, and
+ /// the lanes' floor cannot hear through a clip.
+ callback hovered(x: length);
+ callback hover-ended();
property <color> mark: Paint.mark(root.item.kind);
property <color> well: Paint.well(root.item.kind);
@@ -149,10 +154,16 @@ component Clip inherits Rectangle {
property <bool> all-strip: root.item.kind == ClipKind.text
|| root.item.kind == ClipKind.filter;
property <length> header-h: root.all-strip ? root.height : 17px;
- /// A filter layer wears its mark before its name, the way the look is
- /// told from a title or a sound on the lanes at a glance.
- property <bool> marked: root.item.kind == ClipKind.filter;
+ /// An all-strip clip wears its kind's mark before its name, the way a
+ /// look or a title is told from a sound on the lanes at a glance.
+ property <bool> marked: root.all-strip;
property <length> text-x: root.marked ? 22px : 7px;
+ /// The `fx` chip: a square sized to the strip it sits in, capped so a
+ /// tall filter bar wears a rounded square and not a tall pill. A video
+ /// header is too short for a square the word fits, so there it keeps
+ /// the width it always had and stays a little wider than tall.
+ property <length> chip: Math.min(root.header-h - 5px, 20px);
+ property <length> chip-w: Math.max(root.chip, 14px);
property <length> body-h: Math.max(0px, root.height - root.header-h);
/// The sound band at the foot of a video clip: its file's waveform
/// under its frames, a third of the body and never a sliver, and there
@@ -406,7 +417,7 @@ component Clip inherits Rectangle {
if root.marked && root.width > 20px: Icon {
x: 6px;
y: (parent.height - self.height) / 2;
- glyph: Glyph.filter;
+ glyph: root.badge;
size: 11px;
tint: Theme.clip-ink;
}
@@ -415,7 +426,7 @@ component Clip inherits Rectangle {
x: root.text-x;
y: 0;
width: parent.width - root.text-x - 7px
- - (root.item.fx && root.width > 60px ? 20px : 0px);
+ - (root.item.fx && root.width > 60px ? root.chip-w + 6px : 0px);
height: parent.height;
text: root.item.name;
color: Theme.clip-ink;
@@ -425,7 +436,7 @@ component Clip inherits Rectangle {
}
// A filter layer's ramps run over its whole bar; see Ramps.
- if root.marked: Ramps {
+ if root.item.kind == ClipKind.filter: Ramps {
x: 0;
y: 0;
width: parent.width;
@@ -439,9 +450,9 @@ component Clip inherits Rectangle {
// tellable from a plain one without opening a panel.
if root.item.fx && root.width > 60px: Rectangle {
x: parent.width - self.width - 4px;
- y: 2.5px;
- width: 14px;
- height: parent.height - 5px;
+ y: (parent.height - self.height) / 2;
+ width: root.chip-w;
+ height: root.chip;
border-radius: Theme.r-xs;
background: Theme.clip-chip;
@@ -452,10 +463,11 @@ component Clip inherits Rectangle {
height: parent.height;
text: "fx";
color: Theme.clip-ink;
- // Not a step of the scale: it is sized to the 12px chip it is
+ // Not a step of the scale: it is sized to the chip it is
// centred in, the way a glyph is, and moves with that and not
- // with the type.
- font-size: 9px;
+ // with the type - 9px in a video header's 12px chip, up to
+ // 11px in a filter bar's 20px one.
+ font-size: Math.max(9px, root.chip * 0.55);
horizontal-alignment: center;
vertical-alignment: center;
}
@@ -504,6 +516,13 @@ component Clip inherits Rectangle {
enabled: !root.locked;
mouse-cursor: root.edge-at >= 0 ? MouseCursor.ew-resize : MouseCursor.grab;
+ changed mouse-x => {
+ if (self.has-hover && !self.pressed) { root.hovered(self.mouse-x); }
+ }
+ changed has-hover => {
+ if (!self.has-hover) { root.hover-ended(); }
+ }
+
pointer-event(event) => {
// The right button opens the menu and does nothing else — it must
// not also start a move, or the menu would appear over a clip that
@@ -877,14 +896,48 @@ export component Lanes inherits Rectangle {
in property <float> scroll-left;
/// Hand tool: wheel and drag pan time instead of scrolling the stack.
in property <bool> pan-mode: false;
+ /// The preview axis: a hairline follows the pointer across the lanes
+ /// and the monitor shows the frame under it. Off, the lanes say nothing
+ /// about where the pointer is.
+ in property <bool> preview-axis: false;
/// The zoom: seconds covered by one pixel.
in property <float> seconds-per-pixel: 0.05;
in property <length> track-scroll;
in property <length> ruler-height: 28px;
callback scrubbed(seconds: float);
+ /// The preview axis: the pointer is over the lanes at this instant,
+ /// and then - a beat after it last was - it is not.
+ callback hovered(seconds: float);
+ callback hover-ended();
/// A press on an empty stretch of lane, before the band it may become.
callback floor-pressed();
+
+ /// Where the pointer is, for the preview axis, and whether it is here
+ /// at all. Every surface reports through `hover-at` - the floor, the
+ /// ruler, the hand's pane, each clip - because a hover belongs to the
+ /// surface under the pointer and nothing listens through them.
+ property <length> hover-x;
+ property <bool> hover-on;
+
+ function hover-at(x: length) {
+ if (!root.preview-axis) {
+ return;
+ }
+ hover-off-timer.running = false;
+ root.hover-x = x;
+ root.hover-on = true;
+ root.hovered(Math.max(0, root.seconds-at(x)));
+ }
+ /// A beat later, not at once: the pointer crossing from a clip to the
+ /// floor leaves one surface before it reaches the next, and the
+ /// monitor snapping back to the playhead in between would read as a
+ /// glitch. A hover that arrives inside the beat cancels it.
+ function hover-off() {
+ if (root.hover-on) {
+ hover-off-timer.running = true;
+ }
+ }
callback clip-pressed(id: string, additive: bool, edge: int);
callback clip-dragged(seconds: float, pixels: length);
callback clip-released();
@@ -1092,6 +1145,13 @@ export component Lanes inherits Rectangle {
self.to-x = self.mouse-x;
self.to-y = self.mouse-y;
}
+
+ changed mouse-x => {
+ if (self.has-hover && !self.pressed) { root.hover-at(self.mouse-x); }
+ }
+ changed has-hover => {
+ if (!self.has-hover) { root.hover-off(); }
+ }
}
// ── the clips ────────────────────────────────────────────────────
@@ -1117,6 +1177,8 @@ export component Lanes inherits Rectangle {
pressed(additive, edge) => { root.clip-pressed(entry.id, additive, edge); }
dragged(seconds, pixels) => { root.clip-dragged(seconds, pixels); }
released => { root.clip-released(); }
+ hovered(x) => { root.hover-at(self.x + x); }
+ hover-ended => { root.hover-off(); }
context-requested => {
// Captured before the round trip: by the time the items come
// back the pointer may have moved, and a menu that opens away
@@ -1285,6 +1347,13 @@ export component Lanes inherits Rectangle {
// the two gestures can share one surface.
scrub := TouchArea {
mouse-cursor: pointer;
+
+ changed mouse-x => {
+ if (self.has-hover && !self.pressed) { root.hover-at(self.mouse-x); }
+ }
+ changed has-hover => {
+ if (!self.has-hover) { root.hover-off(); }
+ }
pointer-event(event) => {
if (event.kind == PointerEventKind.down) {
root.scrubbed(Math.max(0, root.seconds-at(self.mouse-x)));
@@ -1312,6 +1381,30 @@ export component Lanes inherits Rectangle {
selected(id) => { root.menu-selected(id); }
}
+ // ── the preview axis ─────────────────────────────────────────────
+ //
+ // A hairline where the pointer is, over the lanes and the ruler, so
+ // the frame the monitor is showing has a place on the timeline. Dim,
+ // and under the playhead: it is where you are looking, not where the
+ // cut is.
+ hover-off-timer := Timer {
+ interval: 80ms;
+ running: false;
+ triggered => {
+ self.running = false;
+ root.hover-on = false;
+ root.hover-ended();
+ }
+ }
+ if root.preview-axis && root.hover-on: Rectangle {
+ x: root.hover-x;
+ y: 0;
+ width: 1px;
+ height: root.height;
+ background: Theme.fg-dim;
+ visible: self.x >= 0px && self.x <= root.width;
+ }
+
// ── the playhead ─────────────────────────────────────────────────
//
// Over everything, ruler included: it is the one thing that must never
@@ -1347,6 +1440,13 @@ export component Lanes inherits Rectangle {
mouse-cursor: pointer;
property <length> last-x: 0px;
+ changed mouse-x => {
+ if (self.has-hover && !self.pressed) { root.hover-at(self.mouse-x); }
+ }
+ changed has-hover => {
+ if (!self.has-hover) { root.hover-off(); }
+ }
+
pointer-event(event) => {
if (event.kind == PointerEventKind.down
&& event.button == PointerEventButton.left) {
diff --git a/src/crates/concat/ui/timeline/tray.slint b/src/crates/concat/ui/timeline/tray.slint
index db7e89a5..0a966d91 100644
--- a/src/crates/concat/ui/timeline/tray.slint
+++ b/src/crates/concat/ui/timeline/tray.slint
@@ -12,7 +12,7 @@ import { TimelineTool } from "model.slint";
// The tool set: add-track first, then undo and redo, then the three edit
// actions, then snapping, then the tools a clip's sound and words need
// - captions, a spoken title, detaching the sound - and the view controls
-// pushed to the far end behind the timecode readout. The metrics: 40px
+// pushed to the far end. The metrics: 40px
// tall, 4px between buttons, an 18px hairline with 4px of air on each side
// between groups. Tight, without crowding a 26px button.
//
@@ -48,11 +48,21 @@ component Divider inherits Rectangle {
}
}
+// The tray's button: an IconButton whose mark is bright at rest. The muted
+// default is for a row that must not compete with what it sits beside; this
+// row sits on its own strip under the lanes, where a muted mark reads as
+// switched off, and a switched-off one has nothing dimmer left to be.
+component TrayButton inherits IconButton {
+ idle: Theme.fg;
+}
+
export component TimelineTray inherits Rectangle {
in property <TimelineTool> tool: TimelineTool.select;
in property <bool> snap: true;
in property <bool> magnetic: false;
in property <bool> pan-mode: false;
+ /// The preview axis: the monitor follows the pointer across the lanes.
+ in property <bool> preview-axis: false;
in property <int> selected-count;
/// Whether the history has a step that way. Rust's answer, read from
/// the editor after every change, so the buttons never guess.
@@ -64,13 +74,16 @@ export component TimelineTray inherits Rectangle {
/// clip's worth of truth, decided by Rust; see the Editor global.
in property <bool> sound-selected;
in property <bool> title-selected;
- /// hh:mm:ss:ff at the playhead, formatted by the caller
- in property <string> readout;
callback tool-changed(tool: TimelineTool);
callback snap-changed(snap: bool);
callback magnetic-changed(on: bool);
callback pan-changed(on: bool);
+ callback preview-axis-changed(on: bool);
+ /// The chevron beside the preview axis: open its menu under the button
+ /// at this x, in the tray's coordinates. The pane hosts the menu; see
+ /// there for why.
+ callback axis-menu-requested(x: length);
callback undo();
callback redo();
callback split();
@@ -100,7 +113,7 @@ export component TimelineTray inherits Rectangle {
padding-bottom: 7px;
spacing: 4px;
- IconButton {
+ TrayButton {
glyph: Glyph.plus;
label: I18n.t("Add track");
icon-size: 14px;
@@ -109,14 +122,14 @@ export component TimelineTray inherits Rectangle {
Divider { }
- IconButton {
+ TrayButton {
glyph: Glyph.undo;
label: I18n.t("Undo (⌘Z)");
icon-size: 16px;
enabled: root.can-undo;
clicked => { root.undo(); }
}
- IconButton {
+ TrayButton {
glyph: Glyph.redo;
label: I18n.t("Redo (⇧⌘Z)");
icon-size: 16px;
@@ -129,13 +142,13 @@ export component TimelineTray inherits Rectangle {
// One way to cut: at the playhead. The razor that cut where you
// clicked is gone - two tools for one edit, and the playhead is
// already where you were looking.
- IconButton {
+ TrayButton {
glyph: Glyph.split;
label: I18n.t("Split at playhead (B, or ⌘B for every clip)");
icon-size: 16px;
clicked => { root.split(); }
}
- IconButton {
+ TrayButton {
glyph: Glyph.merge;
// The reason a blocked Merge is blocked rides on the button rather
// than being spelled out beside it. This tree has no tooltip yet,
@@ -148,7 +161,7 @@ export component TimelineTray inherits Rectangle {
icon-size: 16px;
clicked => { root.merge(); }
}
- IconButton {
+ TrayButton {
glyph: Glyph.trash;
label: I18n.t("Delete selected");
danger: true;
@@ -170,9 +183,9 @@ export component TimelineTray inherits Rectangle {
Divider { }
- IconButton {
+ TrayButton {
glyph: Glyph.hand;
- label: I18n.t("Pan tool");
+ label: I18n.t("Pan tool (H)");
icon-size: 16px;
checked: root.pan-mode;
clicked => { root.pan-changed(!root.pan-mode); }
@@ -180,7 +193,7 @@ export component TimelineTray inherits Rectangle {
Divider { }
- IconButton {
+ TrayButton {
glyph: Glyph.magnet;
label: I18n.t("Snap to edges");
icon-size: 16px;
@@ -190,7 +203,7 @@ export component TimelineTray inherits Rectangle {
// The magnetic timeline, beside the snap it is so often mistaken
// for: snap is where a drag lands, magnetic is that a delete or a
// trim leaves no hole. https://github.com/jub0t/Concat/issues/106
- IconButton {
+ TrayButton {
glyph: Glyph.fold;
label: I18n.t("Magnetic timeline: deleting and trimming close the gap");
icon-size: 16px;
@@ -200,13 +213,13 @@ export component TimelineTray inherits Rectangle {
Divider { }
- IconButton {
+ TrayButton {
glyph: Glyph.text-mark;
label: I18n.t("Generate Captions");
icon-size: 16px;
clicked => { root.captions(); }
}
- IconButton {
+ TrayButton {
glyph: Glyph.volume;
label: I18n.t("Text to Speech");
icon-size: 16px;
@@ -215,27 +228,45 @@ export component TimelineTray inherits Rectangle {
Rectangle { horizontal-stretch: 1; }
- // Fixed width, right-aligned: without it every control to its right
- // shuffles sideways each time the frame digits change.
- Text {
- width: 92px;
- text: root.readout;
- color: Theme.fg-dim;
- font-size: Theme.fs-sm;
- letter-spacing: 0.24px;
- horizontal-alignment: right;
- vertical-alignment: center;
+ // The preview axis: the monitor shows the frame under the pointer
+ // as it crosses the lanes, the playhead staying put. The chevron
+ // beside it chooses whether the sound under the pointer plays too.
+ // Where the timecode readout was: the monitor already reads the
+ // playhead, and a second copy here was one more place to glance
+ // between.
+ // One control in two halves, set flush: the mark toggles, the
+ // chevron beside it opens the menu, and no air between them so
+ // they read as a split button and not as two neighbours.
+ axis := HorizontalLayout {
+ spacing: 0;
+
+ TrayButton {
+ glyph: Glyph.axis;
+ label: root.preview-axis
+ ? I18n.t("Turn off Preview Axis (S)")
+ : I18n.t("Turn on Preview Axis (S)");
+ icon-size: 16px;
+ checked: root.preview-axis;
+ clicked => { root.preview-axis-changed(!root.preview-axis); }
+ }
+ TrayButton {
+ width: 16px;
+ glyph: Glyph.chevron-down;
+ label: I18n.t("Preview axis options");
+ icon-size: 11px;
+ clicked => { root.axis-menu-requested(axis.x); }
+ }
}
Divider { }
- IconButton {
+ TrayButton {
glyph: Glyph.fit;
label: I18n.t("Zoom to fit");
icon-size: 15px;
clicked => { root.fit(); }
}
- IconButton {
+ TrayButton {
glyph: Glyph.minus;
label: I18n.t("Zoom out");
icon-size: 14px;
@@ -243,7 +274,7 @@ export component TimelineTray inherits Rectangle {
// bigger number is more seconds in the same pixel.
clicked => { root.zoom(1.4); }
}
- IconButton {
+ TrayButton {
glyph: Glyph.plus;
label: I18n.t("Zoom in");
icon-size: 14px;
diff --git a/src/crates/concat/ui/util.slint b/src/crates/concat/ui/util.slint
index 1204437a..2dc24027 100644
--- a/src/crates/concat/ui/util.slint
+++ b/src/crates/concat/ui/util.slint
@@ -46,7 +46,7 @@ export global Fmt {
+ ":" + Fmt.pad2(Math.mod(Math.floor(Math.max(0, seconds)), 60));
}
- // hh:mm:ss:ff — the ruler's spelling, and the tray readout's. Both fields
+ // hh:mm:ss:ff — the ruler's spelling. Both fields
// derive from the frame count rather than from the wall clock, which is
// non-drop-frame timecode: at 29.97 a seconds field taken from the clock
// disagrees with its own frame field near the boundaries. NDF runs
diff --git a/src/crates/concat/ui/workspace/seat.slint b/src/crates/concat/ui/workspace/seat.slint
index 33ca262e..88d17ac8 100644
--- a/src/crates/concat/ui/workspace/seat.slint
+++ b/src/crates/concat/ui/workspace/seat.slint
@@ -308,6 +308,8 @@ export component Seat inherits Rectangle {
snap: Editor.snap;
magnetic: Editor.magnetic;
pan-mode: Editor.pan-mode;
+ preview-axis: Editor.preview-axis;
+ preview-axis-audio: Editor.preview-axis-audio;
selected-count: Editor.selected-count;
can-undo: Editor.can-undo;
can-redo: Editor.can-redo;
@@ -328,6 +330,10 @@ export component Seat inherits Rectangle {
snap-changed(snap) => { Editor.snap-changed(snap); }
magnetic-changed(on) => { Editor.magnetic-changed(on); }
pan-changed(on) => { Editor.pan-changed(on); }
+ preview-axis-changed(on) => { Editor.preview-axis-changed(on); }
+ preview-axis-audio-changed(on) => { Editor.preview-axis-audio-changed(on); }
+ hovered(seconds) => { Editor.hovered(seconds); }
+ hover-ended => { Editor.hover-ended(); }
undo => { Editor.undo(); }
redo => { Editor.redo(); }
split => { Editor.split(); }
diff --git a/src/crates/concat/ui/workspace/timeline-pane.slint b/src/crates/concat/ui/workspace/timeline-pane.slint
index ddc12783..37fe91bd 100644
--- a/src/crates/concat/ui/workspace/timeline-pane.slint
+++ b/src/crates/concat/ui/workspace/timeline-pane.slint
@@ -2,10 +2,11 @@
// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors
import { Theme } from "../theme/theme.slint";
-import { Fmt } from "../util.slint";
import { Pane } from "pane.slint";
import { PaneKind, PaneSwitcher } from "pane-switcher.slint";
-import { MenuItemData } from "../primitives/context-menu.slint";
+import { I18n } from "../i18n.slint";
+import { Glyph } from "../icons.slint";
+import { ContextMenu, MenuItemData, MenuMetrics, MenuRow } from "../primitives/context-menu.slint";
import { HairlineSplitter } from "splitter.slint";
import { ThinScrollbar } from "../primitives/scrollbar.slint";
import {
@@ -38,6 +39,8 @@ export component TimelinePane inherits Rectangle {
in property <bool> snap: true;
in property <bool> magnetic: false;
in property <bool> pan-mode: false;
+ in property <bool> preview-axis: false;
+ in property <bool> preview-axis-audio;
in property <int> selected-count;
in property <bool> can-undo;
in property <bool> can-redo;
@@ -49,6 +52,13 @@ export component TimelinePane inherits Rectangle {
callback snap-changed(snap: bool);
callback magnetic-changed(on: bool);
callback pan-changed(on: bool);
+ callback preview-axis-changed(on: bool);
+ callback preview-axis-audio-changed(on: bool);
+ /// The preview axis: the pointer over the lanes, and then not.
+ callback hovered(seconds: float);
+ callback hover-ended();
+ /// Bumped to open the preview axis menu; see ContextMenu.token.
+ property <int> axis-token;
callback undo();
callback redo();
callback split();
@@ -149,6 +159,44 @@ export component TimelinePane inherits Rectangle {
root.stack-h - Math.max(0px, lanes.height - root.ruler-height));
property <length> at: Math.max(0px, Math.min(root.overflow, root.track-scroll));
+ // The preview axis button's menu. Hosted here and not in the tray,
+ // because the surface a ContextMenu opens into is the element it is:
+ // in the tray it would have forty pixels and fold back over the
+ // buttons, and here it has the whole pane below the tray.
+ axis-menu := ContextMenu {
+ x: 0;
+ y: 0;
+ width: parent.width;
+ height: parent.height;
+ items: [
+ {
+ id: "axis-audio",
+ label: I18n.t("Preview video and audio"),
+ kind: MenuRow.action,
+ glyph: Glyph.none,
+ shortcut: "",
+ enabled: true,
+ danger: false,
+ checkable: true,
+ checked: root.preview-axis-audio,
+ },
+ {
+ id: "axis-video",
+ label: I18n.t("Preview video only"),
+ kind: MenuRow.action,
+ glyph: Glyph.none,
+ shortcut: "",
+ enabled: true,
+ danger: false,
+ checkable: true,
+ checked: !root.preview-axis-audio,
+ },
+ ];
+ menu-height: 2 * MenuMetrics.action + MenuMetrics.padding;
+ token: root.axis-token;
+ selected(id) => { root.preview-axis-audio-changed(id == "axis-audio"); }
+ }
+
Pane {
// The one edge kept when the outlines came off. The timeline sits
// under the three panes above it rather than beside anything, so its
@@ -182,23 +230,33 @@ export component TimelinePane inherits Rectangle {
}
}
- TimelineTray {
+ tray := TimelineTray {
tool: root.tool;
snap: root.snap;
magnetic: root.magnetic;
pan-mode: root.pan-mode;
+ preview-axis: root.preview-axis;
selected-count: root.selected-count;
can-undo: root.can-undo;
can-redo: root.can-redo;
merge-blocked-because: root.merge-blocked-because;
sound-selected: root.sound-selected;
title-selected: root.title-selected;
- readout: Fmt.frames-timecode(root.playhead, root.frame-rate);
tool-changed(tool) => { root.tool-changed(tool); }
snap-changed(snap) => { root.snap-changed(snap); }
magnetic-changed(on) => { root.magnetic-changed(on); }
pan-changed(on) => { root.pan-changed(on); }
+ preview-axis-changed(on) => { root.preview-axis-changed(on); }
+ axis-menu-requested(x) => {
+ // Under the button, in the pane's own coordinates: the tray
+ // sits some rows down the pane, and the menu element is the
+ // whole pane.
+ axis-menu.request-x = tray.absolute-position.x - root.absolute-position.x + x;
+ axis-menu.request-y = tray.absolute-position.y - root.absolute-position.y
+ + tray.height;
+ root.axis-token += 1;
+ }
undo => { root.undo(); }
redo => { root.redo(); }
split => { root.split(); }
@@ -271,8 +329,11 @@ export component TimelinePane inherits Rectangle {
track-scroll: root.at;
ruler-height: root.ruler-height;
pan-mode: root.pan-mode;
+ preview-axis: root.preview-axis;
scrubbed(seconds) => { root.scrubbed(seconds); }
+ hovered(seconds) => { root.hovered(seconds); }
+ hover-ended => { root.hover-ended(); }
floor-pressed => { root.floor-pressed(); }
clip-pressed(id, additive, edge) => { root.clip-pressed(id, additive, edge); }
clip-dragged(seconds, pixels) => { root.clip-dragged(seconds, pixels); }