Skip to content

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

feat(timeline): detach audio moves from the tray to the clip's own menu

Jareer6b24610a1d32
diff --git a/engine/crates/concat/locales/de.json b/engine/crates/concat/locales/de.json
index 0c9298e7..f2f67d12 100644
--- a/engine/crates/concat/locales/de.json
+++ b/engine/crates/concat/locales/de.json
@@ -126,6 +126,8 @@
"Default title": "Standardtitel",
"Delay": "Verzögerung",
"Delete": "Löschen",
+ "Detach audio": "Audio trennen",
+ "Reattach audio": "Audio wieder anhängen",
"Delete clip": "Clip löschen",
"Delete selected": "Auswahl löschen",
"Delete {0} clips": "{0} Clips löschen",
@@ -352,8 +354,6 @@
"Project": "Projekt",
"Project saved": "Projekt gespeichert",
"Pulse": "Puls",
- "Put the detached sound back on its picture": "Den getrennten Ton wieder zum Bild legen",
- "Put this clip's sound on its own lane": "Den Ton dieses Clips auf eine eigene Spur legen",
"Quality": "Qualität",
"Quarter": "Viertel",
"Radio": "Radio",
@@ -401,7 +401,6 @@
"Select (A or V)": "Auswahl (A oder V)",
"Select a clip on the timeline first": "Wähle zuerst einen Clip auf der Zeitleiste",
"Select a video or image clip on the timeline first": "Wähle zuerst einen Video- oder Bildclip auf der Zeitleiste",
- "Select one video clip to detach its sound": "Wähle einen Videoclip, um seinen Ton zu trennen",
"Select the clip the transition leads into": "Wähle den Clip, in den der Übergang führt",
"Select two clips to merge": "Wähle zwei Clips zum Zusammenführen",
"SemiBold": "Halbfett",
diff --git a/engine/crates/concat/locales/en.json b/engine/crates/concat/locales/en.json
index 0f4ab5f0..1de7ced8 100644
--- a/engine/crates/concat/locales/en.json
+++ b/engine/crates/concat/locales/en.json
@@ -167,6 +167,7 @@
"Delete {0} clips": "Delete {0} clips",
"Depth": "Depth",
"Destination": "Destination",
+ "Detach audio": "Detach audio",
"Detail": "Detail",
"DETAILS": "DETAILS",
"Digicam": "Digicam",
@@ -455,8 +456,6 @@
"Pulse": "Pulse",
"Punch": "Punch",
"Pure black and pure white, cut at one level of brightness.": "Pure black and pure white, cut at one level of brightness.",
- "Put the detached sound back on its picture": "Put the detached sound back on its picture",
- "Put this clip's sound on its own lane": "Put this clip's sound on its own lane",
"Quality": "Quality",
"Quarter": "Quarter",
"Radio": "Radio",
@@ -470,6 +469,7 @@
"Razor (B)": "Razor (B)",
"Read a script aloud at the playhead": "Read a script aloud at the playhead",
"Read this title aloud": "Read this title aloud",
+ "Reattach audio": "Reattach audio",
"Recent": "Recent",
"Recommended": "Recommended",
"Red and blue pulled apart, the colour fringing of a cheap lens.": "Red and blue pulled apart, the colour fringing of a cheap lens.",
@@ -513,7 +513,6 @@
"Select a clip on the timeline first": "Select a clip on the timeline first",
"Select a video or image clip on the timeline first": "Select a video or image clip on the timeline first",
"Select folder containing media files": "Select folder containing media files",
- "Select one video clip to detach its sound": "Select one video clip to detach its sound",
"Select the clip the transition leads into": "Select the clip the transition leads into",
"Select two clips to merge": "Select two clips to merge",
"SemiBold": "SemiBold",
diff --git a/engine/crates/concat/locales/es.json b/engine/crates/concat/locales/es.json
index 8efe131b..21bb4c35 100644
--- a/engine/crates/concat/locales/es.json
+++ b/engine/crates/concat/locales/es.json
@@ -126,6 +126,8 @@
"Default title": "Título predeterminado",
"Delay": "Retardo",
"Delete": "Eliminar",
+ "Detach audio": "Separar audio",
+ "Reattach audio": "Volver a unir el audio",
"Delete clip": "Eliminar clip",
"Delete selected": "Eliminar la selección",
"Delete {0} clips": "Eliminar {0} clips",
@@ -352,8 +354,6 @@
"Project": "Proyecto",
"Project saved": "Proyecto guardado",
"Pulse": "Pulso",
- "Put the detached sound back on its picture": "Devolver el sonido separado a su imagen",
- "Put this clip's sound on its own lane": "Poner el sonido de este clip en su propia pista",
"Quality": "Calidad",
"Quarter": "Un cuarto",
"Radio": "Radio",
@@ -401,7 +401,6 @@
"Select (A or V)": "Seleccionar (A o V)",
"Select a clip on the timeline first": "Selecciona primero un clip en la línea de tiempo",
"Select a video or image clip on the timeline first": "Selecciona primero un clip de vídeo o imagen en la línea de tiempo",
- "Select one video clip to detach its sound": "Selecciona un clip de vídeo para separar su sonido",
"Select the clip the transition leads into": "Selecciona el clip al que lleva la transición",
"Select two clips to merge": "Selecciona dos clips para unirlos",
"SemiBold": "Seminegrita",
diff --git a/engine/crates/concat/locales/fr.json b/engine/crates/concat/locales/fr.json
index 7b04ca51..f037f943 100644
--- a/engine/crates/concat/locales/fr.json
+++ b/engine/crates/concat/locales/fr.json
@@ -126,6 +126,8 @@
"Default title": "Titre par défaut",
"Delay": "Délai",
"Delete": "Supprimer",
+ "Detach audio": "Détacher l'audio",
+ "Reattach audio": "Rattacher l'audio",
"Delete clip": "Supprimer le clip",
"Delete selected": "Supprimer la sélection",
"Delete {0} clips": "Supprimer {0} clips",
@@ -352,8 +354,6 @@
"Project": "Projet",
"Project saved": "Projet enregistré",
"Pulse": "Pulsation",
- "Put the detached sound back on its picture": "Remettre le son détaché sur son image",
- "Put this clip's sound on its own lane": "Mettre le son de ce clip sur sa propre piste",
"Quality": "Qualité",
"Quarter": "Quart",
"Radio": "Radio",
@@ -401,7 +401,6 @@
"Select (A or V)": "Sélection (A ou V)",
"Select a clip on the timeline first": "Sélectionnez d'abord un clip sur la timeline",
"Select a video or image clip on the timeline first": "Sélectionnez d'abord un clip vidéo ou image sur la timeline",
- "Select one video clip to detach its sound": "Sélectionnez un clip vidéo pour détacher son son",
"Select the clip the transition leads into": "Sélectionnez le clip vers lequel mène la transition",
"Select two clips to merge": "Sélectionnez deux clips à fusionner",
"SemiBold": "Demi-gras",
diff --git a/engine/crates/concat/locales/hr.json b/engine/crates/concat/locales/hr.json
index 9ae6fa5c..f22434ed 100644
--- a/engine/crates/concat/locales/hr.json
+++ b/engine/crates/concat/locales/hr.json
@@ -160,6 +160,8 @@
"Default title": "Zadani naslov",
"Delay": "Kašnjenje",
"Delete": "Obriši",
+ "Detach audio": "Odvoji zvuk",
+ "Reattach audio": "Ponovno spoji zvuk",
"Delete clip": "Obriši klip",
"Delete selected": "Obriši odabrano",
"Delete {0} clips": "Obriši {0} klipova",
@@ -449,8 +451,6 @@
"Pulse": "Puls",
"Punch": "Udarac",
"Pure black and pure white, cut at one level of brightness.": "Čista crna i čista bijela, rezane na jednoj razini svjetline.",
- "Put the detached sound back on its picture": "Vratite odvojeni zvuk natrag na njegovu sliku",
- "Put this clip's sound on its own lane": "Stavite zvuk ovog klipa na vlastitu traku",
"Quality": "Kvaliteta",
"Quarter": "Četvrtina",
"Radio": "Radio",
@@ -505,7 +505,6 @@
"Select (A or V)": "Odabir (A ili V)",
"Select a clip on the timeline first": "Prvo odaberite klip na vremenskoj liniji",
"Select a video or image clip on the timeline first": "Prvo odaberite video ili slikovni klip na vremenskoj liniji",
- "Select one video clip to detach its sound": "Odaberite jedan video klip da mu odvojite zvuk",
"Select the clip the transition leads into": "Odaberite klip u koji prijelaz ulazi",
"Select two clips to merge": "Odaberite dva klipa za spajanje",
"SemiBold": "Polupodebljano",
diff --git a/engine/crates/concat/locales/it.json b/engine/crates/concat/locales/it.json
index 4d844607..d1d65439 100644
--- a/engine/crates/concat/locales/it.json
+++ b/engine/crates/concat/locales/it.json
@@ -126,6 +126,8 @@
"Default title": "Titolo predefinito",
"Delay": "Ritardo",
"Delete": "Elimina",
+ "Detach audio": "Separa l'audio",
+ "Reattach audio": "Ricollega l'audio",
"Delete clip": "Elimina clip",
"Delete selected": "Elimina la selezione",
"Delete {0} clips": "Elimina {0} clip",
@@ -352,8 +354,6 @@
"Project": "Progetto",
"Project saved": "Progetto salvato",
"Pulse": "Pulsazione",
- "Put the detached sound back on its picture": "Rimetti il suono separato sulla sua immagine",
- "Put this clip's sound on its own lane": "Metti il suono di questa clip su una traccia propria",
"Quality": "Qualità",
"Quarter": "Un quarto",
"Radio": "Radio",
@@ -401,7 +401,6 @@
"Select (A or V)": "Seleziona (A o V)",
"Select a clip on the timeline first": "Seleziona prima una clip sulla timeline",
"Select a video or image clip on the timeline first": "Seleziona prima una clip video o immagine sulla timeline",
- "Select one video clip to detach its sound": "Seleziona una clip video per separarne il suono",
"Select the clip the transition leads into": "Seleziona la clip in cui porta la transizione",
"Select two clips to merge": "Seleziona due clip da unire",
"SemiBold": "Semigrassetto",
diff --git a/engine/crates/concat/locales/ja.json b/engine/crates/concat/locales/ja.json
index d0c13be6..42374fc1 100644
--- a/engine/crates/concat/locales/ja.json
+++ b/engine/crates/concat/locales/ja.json
@@ -126,6 +126,8 @@
"Default title": "デフォルトのタイトル",
"Delay": "ディレイ",
"Delete": "削除",
+ "Detach audio": "音声を分離",
+ "Reattach audio": "音声を再結合",
"Delete clip": "クリップを削除",
"Delete selected": "選択項目を削除",
"Delete {0} clips": "{0} 個のクリップを削除",
@@ -352,8 +354,6 @@
"Project": "プロジェクト",
"Project saved": "プロジェクトを保存しました",
"Pulse": "パルス",
- "Put the detached sound back on its picture": "分離した音声を映像に戻す",
- "Put this clip's sound on its own lane": "このクリップの音声を別のレーンに置く",
"Quality": "品質",
"Quarter": "1/4",
"Radio": "ラジオ",
@@ -401,7 +401,6 @@
"Select (A or V)": "選択 (A または V)",
"Select a clip on the timeline first": "まずタイムラインでクリップを選択してください",
"Select a video or image clip on the timeline first": "まずタイムラインで映像または画像のクリップを選択してください",
- "Select one video clip to detach its sound": "音声を分離するには映像クリップを一つ選択してください",
"Select the clip the transition leads into": "トランジションの先になるクリップを選択してください",
"Select two clips to merge": "結合するクリップを二つ選択してください",
"SemiBold": "セミボールド",
diff --git a/engine/crates/concat/locales/ko.json b/engine/crates/concat/locales/ko.json
index 5a282905..78146d63 100644
--- a/engine/crates/concat/locales/ko.json
+++ b/engine/crates/concat/locales/ko.json
@@ -126,6 +126,8 @@
"Default title": "기본 자막",
"Delay": "지연",
"Delete": "삭제",
+ "Detach audio": "오디오 분리",
+ "Reattach audio": "오디오 다시 연결",
"Delete clip": "클립 삭제",
"Delete selected": "선택 항목 삭제",
"Delete {0} clips": "클립 {0}개 삭제",
@@ -352,8 +354,6 @@
"Project": "프로젝트",
"Project saved": "프로젝트를 저장했습니다",
"Pulse": "펄스",
- "Put the detached sound back on its picture": "분리한 소리를 영상에 다시 붙이기",
- "Put this clip's sound on its own lane": "이 클립의 소리를 별도 레인에 놓기",
"Quality": "품질",
"Quarter": "1/4",
"Radio": "라디오",
@@ -401,7 +401,6 @@
"Select (A or V)": "선택 (A 또는 V)",
"Select a clip on the timeline first": "먼저 타임라인에서 클립을 선택하세요",
"Select a video or image clip on the timeline first": "먼저 타임라인에서 영상 또는 이미지 클립을 선택하세요",
- "Select one video clip to detach its sound": "소리를 분리할 영상 클립 하나를 선택하세요",
"Select the clip the transition leads into": "전환이 이어지는 클립을 선택하세요",
"Select two clips to merge": "합칠 클립 두 개를 선택하세요",
"SemiBold": "세미볼드",
diff --git a/engine/crates/concat/locales/pt-BR.json b/engine/crates/concat/locales/pt-BR.json
index 91fea308..a229a98d 100644
--- a/engine/crates/concat/locales/pt-BR.json
+++ b/engine/crates/concat/locales/pt-BR.json
@@ -126,6 +126,8 @@
"Default title": "Título padrão",
"Delay": "Atraso",
"Delete": "Excluir",
+ "Detach audio": "Separar áudio",
+ "Reattach audio": "Reanexar áudio",
"Delete clip": "Excluir clipe",
"Delete selected": "Excluir seleção",
"Delete {0} clips": "Excluir {0} clipes",
@@ -352,8 +354,6 @@
"Project": "Projeto",
"Project saved": "Projeto salvo",
"Pulse": "Pulso",
- "Put the detached sound back on its picture": "Devolver o som separado à sua imagem",
- "Put this clip's sound on its own lane": "Colocar o som deste clipe em uma faixa própria",
"Quality": "Qualidade",
"Quarter": "Um quarto",
"Radio": "Rádio",
@@ -401,7 +401,6 @@
"Select (A or V)": "Selecionar (A ou V)",
"Select a clip on the timeline first": "Selecione primeiro um clipe na linha do tempo",
"Select a video or image clip on the timeline first": "Selecione primeiro um clipe de vídeo ou imagem na linha do tempo",
- "Select one video clip to detach its sound": "Selecione um clipe de vídeo para separar o som",
"Select the clip the transition leads into": "Selecione o clipe para o qual a transição leva",
"Select two clips to merge": "Selecione dois clipes para unir",
"SemiBold": "Seminegrito",
diff --git a/engine/crates/concat/locales/ru.json b/engine/crates/concat/locales/ru.json
index 56c67666..e1db1be5 100644
--- a/engine/crates/concat/locales/ru.json
+++ b/engine/crates/concat/locales/ru.json
@@ -126,6 +126,8 @@
"Default title": "Титр по умолчанию",
"Delay": "Задержка",
"Delete": "Удалить",
+ "Detach audio": "Отделить звук",
+ "Reattach audio": "Присоединить звук обратно",
"Delete clip": "Удалить клип",
"Delete selected": "Удалить выбранное",
"Delete {0} clips": "Удалить клипы: {0}",
@@ -352,8 +354,6 @@
"Project": "Проект",
"Project saved": "Проект сохранён",
"Pulse": "Пульс",
- "Put the detached sound back on its picture": "Вернуть отделённый звук к его картинке",
- "Put this clip's sound on its own lane": "Вынести звук этого клипа на отдельную дорожку",
"Quality": "Качество",
"Quarter": "Четверть",
"Radio": "Радио",
@@ -401,7 +401,6 @@
"Select (A or V)": "Выделение (A или V)",
"Select a clip on the timeline first": "Сначала выберите клип на таймлайне",
"Select a video or image clip on the timeline first": "Сначала выберите видео или изображение на таймлайне",
- "Select one video clip to detach its sound": "Выберите один видеоклип, чтобы отделить его звук",
"Select the clip the transition leads into": "Выберите клип, в который ведёт переход",
"Select two clips to merge": "Выберите два клипа для объединения",
"SemiBold": "Полужирный",
diff --git a/engine/crates/concat/locales/tr.json b/engine/crates/concat/locales/tr.json
index 3789e874..0a01e648 100644
--- a/engine/crates/concat/locales/tr.json
+++ b/engine/crates/concat/locales/tr.json
@@ -126,6 +126,8 @@
"Default title": "Varsayılan yazı",
"Delay": "Gecikme",
"Delete": "Sil",
+ "Detach audio": "Sesi ayır",
+ "Reattach audio": "Sesi yeniden bağla",
"Delete clip": "Klibi sil",
"Delete selected": "Seçilenleri sil",
"Delete {0} clips": "{0} klibi sil",
@@ -352,8 +354,6 @@
"Project": "Proje",
"Project saved": "Proje kaydedildi",
"Pulse": "Nabız",
- "Put the detached sound back on its picture": "Ayrılan sesi görüntüsüne geri koy",
- "Put this clip's sound on its own lane": "Bu klibin sesini kendi şeridine koy",
"Quality": "Kalite",
"Quarter": "Çeyrek",
"Radio": "Radyo",
@@ -401,7 +401,6 @@
"Select (A or V)": "Seç (A veya V)",
"Select a clip on the timeline first": "Önce zaman çizelgesinde bir klip seçin",
"Select a video or image clip on the timeline first": "Önce zaman çizelgesinde bir video veya görüntü klibi seçin",
- "Select one video clip to detach its sound": "Sesini ayırmak için tek bir video klibi seçin",
"Select the clip the transition leads into": "Geçişin götürdüğü klibi seçin",
"Select two clips to merge": "Birleştirmek için iki klip seçin",
"SemiBold": "Yarı kalın",
diff --git a/engine/crates/concat/locales/zh-Hans.json b/engine/crates/concat/locales/zh-Hans.json
index c69c3a52..78c7dfd9 100644
--- a/engine/crates/concat/locales/zh-Hans.json
+++ b/engine/crates/concat/locales/zh-Hans.json
@@ -126,6 +126,8 @@
"Default title": "默认字幕",
"Delay": "延迟",
"Delete": "删除",
+ "Detach audio": "分离音频",
+ "Reattach audio": "重新附加音频",
"Delete clip": "删除片段",
"Delete selected": "删除所选",
"Delete {0} clips": "删除 {0} 个片段",
@@ -352,8 +354,6 @@
"Project": "项目",
"Project saved": "项目已保存",
"Pulse": "脉动",
- "Put the detached sound back on its picture": "把分离的声音放回画面",
- "Put this clip's sound on its own lane": "把此片段的声音放到单独的轨道",
"Quality": "质量",
"Quarter": "1/4",
"Radio": "收音机",
@@ -401,7 +401,6 @@
"Select (A or V)": "选择 (A 或 V)",
"Select a clip on the timeline first": "请先在时间线上选择一个片段",
"Select a video or image clip on the timeline first": "请先在时间线上选择一个视频或图片片段",
- "Select one video clip to detach its sound": "请选择一个视频片段以分离其声音",
"Select the clip the transition leads into": "请选择转场所进入的片段",
"Select two clips to merge": "请选择两个片段以合并",
"SemiBold": "半粗",
diff --git a/engine/crates/concat/locales/zh-TW.json b/engine/crates/concat/locales/zh-TW.json
index dacbdb17..3289d8f9 100644
--- a/engine/crates/concat/locales/zh-TW.json
+++ b/engine/crates/concat/locales/zh-TW.json
@@ -160,6 +160,8 @@
"Default title": "預設標題",
"Delay": "延遲時間",
"Delete": "刪除",
+ "Detach audio": "分離音訊",
+ "Reattach audio": "重新附加音訊",
"Delete clip": "刪除片段",
"Delete selected": "刪除所選內容",
"Delete {0} clips": "刪除 {0} 個片段",
@@ -449,8 +451,6 @@
"Pulse": "脈動",
"Punch": "強烈感",
"Pure black and pure white, cut at one level of brightness.": "以指定亮度為分界,將畫面轉為純黑與純白。",
- "Put the detached sound back on its picture": "將分離的音訊重新接回影像",
- "Put this clip's sound on its own lane": "將此片段的音訊放到獨立軌道",
"Quality": "品質",
"Quarter": "四分之一",
"Radio": "收音機",
@@ -505,7 +505,6 @@
"Select (A or V)": "選取(A 或 V)",
"Select a clip on the timeline first": "請先在時間軸上選取片段",
"Select a video or image clip on the timeline first": "請先選取時間軸上的影片或圖片片段",
- "Select one video clip to detach its sound": "請選取一個影片片段以分離音訊",
"Select the clip the transition leads into": "請選取轉場結束後接續的片段",
"Select two clips to merge": "請選取兩個要合併的片段",
"SemiBold": "半粗體",
diff --git a/engine/crates/concat/src/lib.rs b/engine/crates/concat/src/lib.rs
index 90bfe1e7..1455f961 100644
--- a/engine/crates/concat/src/lib.rs
+++ b/engine/crates/concat/src/lib.rs
@@ -1013,16 +1013,6 @@ pub fn run() -> Result<(), slint::PlatformError> {
editor.on_speak(on_window!(|state| {
state.speech_open();
}));
- editor.on_detach_audio(on_window!(|state| {
- if let Some(clip_id) = state.sole_selection() {
- state.apply(concat_project::Command::DetachAudio { clip_id });
- }
- }));
- editor.on_reattach_audio(on_window!(|state| {
- if let Some(clip_id) = state.sole_selection() {
- state.apply(concat_project::Command::ReattachAudio { clip_id });
- }
- }));
app.on_captions_closed(on_window!(|state| {
state.captions.open = false;
diff --git a/engine/crates/concat/src/studio.rs b/engine/crates/concat/src/studio.rs
index e466ac45..65fcf797 100644
--- a/engine/crates/concat/src/studio.rs
+++ b/engine/crates/concat/src/studio.rs
@@ -4797,13 +4797,21 @@ impl Studio {
/// What the tray's sound and word tools may do to the selection: one
/// clip with sound for Captions to start on, one title for Speak to
- /// read, one video clip whose sound is on it to detach, or whose sound
- /// is off it to put back. The first two are hints - both sheets open
- /// without them - and the last two are gates.
- fn sound_tools(&self) -> (bool, bool, bool, bool) {
+ /// read. Hints, not gates - both sheets open without them.
+ fn sound_tools(&self) -> (bool, bool) {
let Some(clip) = self.sole_selection().and_then(|id| self.clip(&id)) else {
- return (false, false, false, false);
+ return (false, false);
};
+ (
+ self.clip_has_sound(clip),
+ clip.kind == model::ClipKind::Text,
+ )
+ }
+
+ /// Where a clip's sound is: whether it is a video clip whose sound is
+ /// still on its picture, to take off, and whether it is a picture whose
+ /// sound is off it - or that sound itself - to put back.
+ fn sound_placement(&self, clip: &Clip) -> (bool, bool) {
let detached = self
.timeline()
.clips
@@ -4811,8 +4819,6 @@ impl Studio {
.any(|other| other.detached_from.as_deref() == Some(clip.id.as_str()));
let video = clip.kind == model::ClipKind::Video;
(
- self.clip_has_sound(clip),
- clip.kind == model::ClipKind::Text,
video && !detached,
(video && detached)
|| (clip.kind == model::ClipKind::Audio && clip.detached_from.is_some()),
@@ -6038,11 +6044,9 @@ impl Studio {
editor.set_tool(self.tool);
editor.set_snap(self.snap);
editor.set_selected_count(self.selection.len() as i32);
- let (sound_selected, title_selected, can_detach, can_reattach) = self.sound_tools();
+ let (sound_selected, title_selected) = self.sound_tools();
editor.set_sound_selected(sound_selected);
editor.set_title_selected(title_selected);
- editor.set_can_detach(can_detach);
- editor.set_can_reattach(can_reattach);
editor.set_merge_blocked_because(match self.merge_blocked() {
Some(reason) => reason.into(),
None => SharedString::new(),
@@ -7066,6 +7070,29 @@ impl Studio {
),
rule(),
];
+ // One slot, two verbs: the sound is either on its picture or off it.
+ // Shown on every video clip, so the verb is where a person looks for
+ // it, and greyed rather than gone when the file has no sound.
+ let (can_detach, can_reattach) = self.sound_placement(clip);
+ if can_reattach {
+ rows.push(action(
+ "reattach",
+ t("Reattach audio"),
+ Glyph::Merge,
+ "",
+ !locked,
+ ));
+ rows.push(rule());
+ } else if clip.kind == model::ClipKind::Video {
+ rows.push(action(
+ "detach",
+ t("Detach audio"),
+ Glyph::Waveform,
+ "",
+ !locked && can_detach && self.clip_has_sound(clip),
+ ));
+ rows.push(rule());
+ }
let audible = clip.kind != model::ClipKind::Image;
rows.push(check(
"mute",
@@ -7464,6 +7491,16 @@ impl Studio {
self.split_at(at, true);
}
"freeze" => self.freeze_at_playhead(),
+ "detach" => {
+ self.apply(Command::DetachAudio {
+ clip_id: id.to_owned(),
+ });
+ }
+ "reattach" => {
+ self.apply(Command::ReattachAudio {
+ clip_id: id.to_owned(),
+ });
+ }
"mute" => {
let volume = if clip.volume <= 0.0 { 1.0 } else { 0.0 };
self.apply(Command::UpdateClip {
diff --git a/engine/crates/concat/ui/editor.slint b/engine/crates/concat/ui/editor.slint
index 898cdc25..0c8d52c1 100644
--- a/engine/crates/concat/ui/editor.slint
+++ b/engine/crates/concat/ui/editor.slint
@@ -233,14 +233,10 @@ export global Editor {
in-out property <int> selected-count;
in-out property <string> merge-blocked-because;
/// What the selection offers the tray's sound and word tools: one clip
- /// with sound for Captions to start on, one title for Speak to read,
- /// one video clip whose sound is on it to detach, or whose sound is off
- /// it to put back. The first two are hints - both sheets open without
- /// them - and the last two are gates.
+ /// with sound for Captions to start on, one title for Speak to read.
+ /// Hints, not gates - both sheets open without them.
in-out property <bool> sound-selected;
in-out property <bool> title-selected;
- in-out property <bool> can-detach;
- in-out property <bool> can-reattach;
in-out property <float> playhead;
in-out property <float> frame-rate;
in-out property <float> scroll-left;
@@ -255,12 +251,11 @@ export global Editor {
callback split();
callback merge();
callback delete-selected();
- /// The tray's tools for a clip's sound and words. The first two open a
- /// sheet; the last two are the edit itself.
+ /// The tray's tools for a clip's sound and words; each opens a sheet.
+ /// Taking a clip's sound off its picture, and putting it back, are rows
+ /// of the clip's own menu - see `clip-context`.
callback captions();
callback speak();
- callback detach-audio();
- callback reattach-audio();
callback add-track();
callback zoom-to-fit(width: length);
callback zoom(factor: float, anchor-seconds: float);
diff --git a/engine/crates/concat/ui/timeline/tray.slint b/engine/crates/concat/ui/timeline/tray.slint
index 8f3f93e5..d8d7fb74 100644
--- a/engine/crates/concat/ui/timeline/tray.slint
+++ b/engine/crates/concat/ui/timeline/tray.slint
@@ -53,8 +53,6 @@ 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;
- in property <bool> can-detach;
- in property <bool> can-reattach;
/// hh:mm:ss:ff at the playhead, formatted by the caller
in property <string> readout;
@@ -65,8 +63,6 @@ export component TimelineTray inherits Rectangle {
callback delete-selected();
callback captions();
callback speak();
- callback detach();
- callback reattach();
callback add-track();
callback fit();
callback zoom(factor: float);
@@ -180,21 +176,6 @@ export component TimelineTray inherits Rectangle {
icon-size: 16px;
clicked => { root.speak(); }
}
- // One slot, two verbs: the sound is either on its picture or off it.
- if !root.can-reattach: IconButton {
- glyph: Glyph.waveform;
- label: root.can-detach ? I18n.t("Put this clip's sound on its own lane")
- : I18n.t("Select one video clip to detach its sound");
- icon-size: 16px;
- enabled: root.can-detach;
- clicked => { root.detach(); }
- }
- if root.can-reattach: IconButton {
- glyph: Glyph.merge;
- label: I18n.t("Put the detached sound back on its picture");
- icon-size: 16px;
- clicked => { root.reattach(); }
- }
Rectangle { horizontal-stretch: 1; }
diff --git a/engine/crates/concat/ui/workspace/seat.slint b/engine/crates/concat/ui/workspace/seat.slint
index 6593c155..15b8719e 100644
--- a/engine/crates/concat/ui/workspace/seat.slint
+++ b/engine/crates/concat/ui/workspace/seat.slint
@@ -304,8 +304,6 @@ export component Seat inherits Rectangle {
merge-blocked-because: Editor.merge-blocked-because;
sound-selected: Editor.sound-selected;
title-selected: Editor.title-selected;
- can-detach: Editor.can-detach;
- can-reattach: Editor.can-reattach;
playhead: Editor.playhead;
frame-rate: Editor.frame-rate;
scroll-left: Editor.scroll-left;
@@ -323,8 +321,6 @@ export component Seat inherits Rectangle {
delete-selected => { Editor.delete-selected(); }
captions => { Editor.captions(); }
speak => { Editor.speak(); }
- detach => { Editor.detach-audio(); }
- reattach => { Editor.reattach-audio(); }
add-track => { Editor.add-track(); }
zoom-to-fit(width) => { Editor.zoom-to-fit(width); }
zoom(factor, anchor) => { Editor.zoom(factor, anchor); }
diff --git a/engine/crates/concat/ui/workspace/timeline-pane.slint b/engine/crates/concat/ui/workspace/timeline-pane.slint
index 09fef9a0..b519081d 100644
--- a/engine/crates/concat/ui/workspace/timeline-pane.slint
+++ b/engine/crates/concat/ui/workspace/timeline-pane.slint
@@ -40,8 +40,6 @@ export component TimelinePane inherits Rectangle {
in property <string> merge-blocked-because;
in property <bool> sound-selected;
in property <bool> title-selected;
- in property <bool> can-detach;
- in property <bool> can-reattach;
callback tool-changed(tool: TimelineTool);
callback snap-changed(snap: bool);
@@ -50,8 +48,6 @@ export component TimelinePane inherits Rectangle {
callback delete-selected();
callback captions();
callback speak();
- callback detach();
- callback reattach();
callback add-track();
callback zoom-to-fit(width: length);
callback zoom(factor: float, anchor-seconds: float);
@@ -183,8 +179,6 @@ export component TimelinePane inherits Rectangle {
merge-blocked-because: root.merge-blocked-because;
sound-selected: root.sound-selected;
title-selected: root.title-selected;
- can-detach: root.can-detach;
- can-reattach: root.can-reattach;
readout: Fmt.frames-timecode(root.playhead, root.frame-rate);
tool-changed(tool) => { root.tool-changed(tool); }
@@ -194,8 +188,6 @@ export component TimelinePane inherits Rectangle {
delete-selected => { root.delete-selected(); }
captions => { root.captions(); }
speak => { root.speak(); }
- detach => { root.detach(); }
- reattach => { root.reattach(); }
add-track => { root.add-track(); }
fit => { root.zoom-to-fit(lanes.width); }
// No anchor from a button: a wheel zooms about the pointer and a