Skip to content

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

feat(timeline): the VU meters sit at the timeline's right edge, with a tray button to show or hide them

Jareer5f653e6b452d
diff --git a/src/crates/concat/locales/ar.json b/src/crates/concat/locales/ar.json
index aef3451c..eba89d1d 100644
--- a/src/crates/concat/locales/ar.json
+++ b/src/crates/concat/locales/ar.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "تأثيرات الفيديو",
"meters.clipLight": "ضوء القصّ: يتحوّل إلى الأحمر عندما يبلغ المزيج الحد الأقصى.",
"meters.clipped": "حدث قصّ في المزيج: بلغت عيّنة الحد الأقصى. انقر للمسح.",
- "meters.meters": "المقاييس",
"meters.peak": "الذروة: أعلى مستوى بلغته اللحظة الأخيرة، بالديسيبل تحت الحد الأقصى.",
"modal.copied": "تم النسخ",
"monitor.previewFailed": "فشلت المعاينة: {0}",
diff --git a/src/crates/concat/locales/bn.json b/src/crates/concat/locales/bn.json
index c7ae5d7f..21fa9e68 100644
--- a/src/crates/concat/locales/bn.json
+++ b/src/crates/concat/locales/bn.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "ভিডিও ইফেক্ট",
"meters.clipLight": "ক্লিপ লাইট: মিক্স পূর্ণ স্কেলে পৌঁছালে লাল হয়।",
"meters.clipped": "মিক্স ক্লিপ হয়েছে: একটি স্যাম্পল পূর্ণ স্কেলে পৌঁছেছে। মুছতে ক্লিক করুন।",
- "meters.meters": "মিটারস",
"meters.peak": "পিক: শেষ মুহূর্তে যতটা জোরে পৌঁছেছিল, পূর্ণ স্কেলের নিচে dB-এ।",
"modal.copied": "কপি করা হয়েছে",
"monitor.previewFailed": "প্রিভিউ ব্যর্থ: {0}",
diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.json
index 3eb516d1..6c99e7c3 100644
--- a/src/crates/concat/locales/de.json
+++ b/src/crates/concat/locales/de.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Videoeffekte",
"meters.clipLight": "Übersteuerungsanzeige: wird rot, wenn der Mix Vollaussteuerung erreicht.",
"meters.clipped": "Der Mix hat übersteuert: ein Sample hat Vollaussteuerung erreicht. Zum Zurücksetzen klicken.",
- "meters.meters": "Pegel",
"meters.peak": "Spitze: der lauteste Wert des letzten Moments, in dB unter Vollaussteuerung.",
"modal.copied": "Kopiert",
"monitor.previewFailed": "Vorschau fehlgeschlagen: {0}",
diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.json
index f7dff8bb..eed1c7d2 100644
--- a/src/crates/concat/locales/en.json
+++ b/src/crates/concat/locales/en.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Video Effects",
"meters.clipLight": "Clip light: turns red when the mix reaches full scale.",
"meters.clipped": "The mix clipped: a sample reached full scale. Click to clear.",
- "meters.meters": "Meters",
"meters.peak": "Peak: the loudest the last moment reached, in dB below full scale.",
"modal.copied": "Copied",
"monitor.previewFailed": "Preview failed: {0}",
@@ -675,12 +674,14 @@
"tray.deleteSelected": "Delete selected",
"tray.freezeMirrorRotateSelected": "Freeze, mirror or rotate the selected clip",
"tray.generateCaptions": "Generate Captions",
+ "tray.hideMeters": "Hide the level meters",
"tray.magneticTimelineDeletingTrimming": "Magnetic timeline: deleting and trimming close the gap",
"tray.panTool": "Pan tool (H)",
"tray.playerFollowsResizePlayhead": "Player follows the resize: the playhead rides the edge you trim",
"tray.previewAxisOptions": "Preview axis options",
"tray.recordVoiceover": "Record Voiceover",
"tray.redo": "Redo ({0})",
+ "tray.showMeters": "Show the level meters: how loud the timeline plays",
"tray.splitAtPlayhead": "Split at playhead ({0})",
"tray.splitTool": "Split tool (B): click a clip to cut it there",
"tray.stopRecording": "Stop Recording",
diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.json
index dca21757..3bf38eff 100644
--- a/src/crates/concat/locales/es.json
+++ b/src/crates/concat/locales/es.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Efectos de vídeo",
"meters.clipLight": "Indicador de saturación: se pone rojo cuando la mezcla llega a escala completa.",
"meters.clipped": "La mezcla saturó: una muestra llegó a escala completa. Haz clic para borrar.",
- "meters.meters": "Medidores",
"meters.peak": "Pico: lo más alto que llegó el último momento, en dB por debajo de la escala completa.",
"modal.copied": "Copiado",
"monitor.previewFailed": "La vista previa falló: {0}",
diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.json
index b0487f0c..deb97d4e 100644
--- a/src/crates/concat/locales/fa.json
+++ b/src/crates/concat/locales/fa.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "افکت‌های ویدئویی",
"meters.clipLight": "چراغ کلیپ: وقتی میکس به حداکثر سطح برسد قرمز می‌شود.",
"meters.clipped": "میکس کلیپ شد: یک نمونه به حداکثر سطح رسید. برای پاک کردن کلیک کنید.",
- "meters.meters": "سطح‌سنج",
"meters.peak": "اوج: بلندترین سطح لحظهٔ اخیر، به dB زیر مقیاس کامل.",
"modal.copied": "کپی شد",
"monitor.previewFailed": "پیش‌نمایش ناموفق بود: {0}",
diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.json
index b162b160..9b88971e 100644
--- a/src/crates/concat/locales/fr.json
+++ b/src/crates/concat/locales/fr.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Effets vidéo",
"meters.clipLight": "Témoin de saturation : devient rouge quand le mixage atteint la pleine échelle.",
"meters.clipped": "Le mixage a saturé : un échantillon a atteint la pleine échelle. Cliquez pour effacer.",
- "meters.meters": "Vumètres",
"meters.peak": "Crête : le niveau le plus fort du dernier instant, en dB sous la pleine échelle.",
"modal.copied": "Copié",
"monitor.previewFailed": "L'aperçu a échoué : {0}",
diff --git a/src/crates/concat/locales/he.json b/src/crates/concat/locales/he.json
index a011a2ad..8ed6126c 100644
--- a/src/crates/concat/locales/he.json
+++ b/src/crates/concat/locales/he.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "אפקטי וידאו",
"meters.clipLight": "נורית קליפינג: הופכת לאדומה כשהמיקס מגיע לסקאלה המלאה.",
"meters.clipped": "המיקס נקטע: דגימה הגיעה לסקאלה המלאה. יש ללחוץ לניקוי.",
- "meters.meters": "מדים",
"meters.peak": "שיא: הרמה הגבוהה ביותר שהרגע האחרון הגיע אליה, ב-dB מתחת לסקאלה המלאה.",
"modal.copied": "הועתק",
"monitor.previewFailed": "התצוגה המקדימה נכשלה: {0}",
diff --git a/src/crates/concat/locales/hi.json b/src/crates/concat/locales/hi.json
index ea5d0a42..81d3dde3 100644
--- a/src/crates/concat/locales/hi.json
+++ b/src/crates/concat/locales/hi.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "वीडियो इफ़ेक्ट",
"meters.clipLight": "क्लिप लाइट: मिक्स के फ़ुल स्केल पर पहुंचने पर लाल हो जाती है।",
"meters.clipped": "मिक्स क्लिप हुआ: एक सैंपल फ़ुल स्केल पर पहुंच गया। साफ़ करने के लिए क्लिक करें।",
- "meters.meters": "मीटर",
"meters.peak": "पीक: पिछले पल में पहुंचा सबसे ऊंचा स्तर, फ़ुल स्केल से नीचे dB में।",
"modal.copied": "कॉपी हो गया",
"monitor.previewFailed": "प्रीव्यू विफल: {0}",
diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.json
index 05a6ec55..6595afd3 100644
--- a/src/crates/concat/locales/hr.json
+++ b/src/crates/concat/locales/hr.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Video efekti",
"meters.clipLight": "Svjetlo odrezivanja: postaje crveno kad miks dosegne punu razinu.",
"meters.clipped": "Miks je odrezan: uzorak je dosegao punu razinu. Kliknite za brisanje.",
- "meters.meters": "Mjerači",
"meters.peak": "Vrh: najglasnije što je zadnji trenutak dosegnuo, u dB ispod pune skale.",
"modal.copied": "Kopirano",
"monitor.previewFailed": "Pregled nije uspio: {0}",
diff --git a/src/crates/concat/locales/id.json b/src/crates/concat/locales/id.json
index c28b927f..984a212f 100644
--- a/src/crates/concat/locales/id.json
+++ b/src/crates/concat/locales/id.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Efek Video",
"meters.clipLight": "Lampu clipping: menyala merah saat mix mencapai skala penuh.",
"meters.clipped": "Mix mengalami clipping: satu sampel mencapai skala penuh. Klik untuk menghapus.",
- "meters.meters": "Meter",
"meters.peak": "Puncak: tingkat paling keras yang dicapai sesaat terakhir, dalam dB di bawah skala penuh.",
"modal.copied": "Disalin",
"monitor.previewFailed": "Pratinjau gagal: {0}",
diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.json
index 4d1b8f1a..d3fc77d6 100644
--- a/src/crates/concat/locales/it.json
+++ b/src/crates/concat/locales/it.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Effetti video",
"meters.clipLight": "Spia di clip: diventa rossa quando il mix raggiunge il fondo scala.",
"meters.clipped": "Il mix è andato in clip: un campione ha raggiunto il fondo scala. Fai clic per azzerare.",
- "meters.meters": "Indicatori",
"meters.peak": "Picco: il livello più alto raggiunto nell’ultimo istante, in dB sotto il fondo scala.",
"modal.copied": "Copiato",
"monitor.previewFailed": "Anteprima fallita: {0}",
diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.json
index 84d3b024..a45856f3 100644
--- a/src/crates/concat/locales/ja.json
+++ b/src/crates/concat/locales/ja.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "ビデオエフェクト",
"meters.clipLight": "クリップランプ : ミックスがフルスケールに達すると赤くなります。",
"meters.clipped": "ミックスがクリップしました : サンプルがフルスケールに達しました。クリックで解除。",
- "meters.meters": "メーター",
"meters.peak": "ピーク:直前の最大レベル。フルスケールからの dB。",
"modal.copied": "コピーしました",
"monitor.previewFailed": "プレビューに失敗しました : {0}",
diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.json
index e3597901..c06b2835 100644
--- a/src/crates/concat/locales/ko.json
+++ b/src/crates/concat/locales/ko.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "비디오 효과",
"meters.clipLight": "클립 표시등: 믹스가 최대치에 도달하면 빨간색이 됩니다.",
"meters.clipped": "믹스가 클리핑되었습니다: 샘플이 최대치에 도달했습니다. 클릭하여 지우기.",
- "meters.meters": "미터",
"meters.peak": "피크: 직전 순간의 최대 레벨, 풀 스케일 아래 dB.",
"modal.copied": "복사됨",
"monitor.previewFailed": "미리보기 실패: {0}",
diff --git a/src/crates/concat/locales/nl.json b/src/crates/concat/locales/nl.json
index a6965547..c186485c 100644
--- a/src/crates/concat/locales/nl.json
+++ b/src/crates/concat/locales/nl.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Video-effecten",
"meters.clipLight": "Cliplampje: wordt rood als de mix volle schaal bereikt.",
"meters.clipped": "De mix clipte: een sample bereikte volle schaal. Klik om te wissen.",
- "meters.meters": "Niveaumeters",
"meters.peak": "Piek: het luidste dat het laatste moment bereikte, in dB onder volle schaal.",
"modal.copied": "Gekopieerd",
"monitor.previewFailed": "Voorvertoning mislukt: {0}",
diff --git a/src/crates/concat/locales/pl.json b/src/crates/concat/locales/pl.json
index 00eaf804..59e49134 100644
--- a/src/crates/concat/locales/pl.json
+++ b/src/crates/concat/locales/pl.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Efekty wideo",
"meters.clipLight": "Wskaźnik przesterowania: zmienia kolor na czerwony, gdy miks osiąga pełną skalę.",
"meters.clipped": "Miks się przesterował: próbka osiągnęła pełną skalę. Kliknij, aby wyczyścić.",
- "meters.meters": "Wskaźniki",
"meters.peak": "Szczyt: najgłośniejszy poziom z ostatniej chwili, w dB poniżej pełnej skali.",
"modal.copied": "Skopiowano",
"monitor.previewFailed": "Podgląd nie powiódł się: {0}",
diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.json
index 4f7cee0e..ce292276 100644
--- a/src/crates/concat/locales/pt-BR.json
+++ b/src/crates/concat/locales/pt-BR.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Efeitos de vídeo",
"meters.clipLight": "Luz de clipe: fica vermelha quando a mixagem atinge o fundo de escala.",
"meters.clipped": "A mixagem clipou: uma amostra atingiu o fundo de escala. Clique para limpar.",
- "meters.meters": "Medidores",
"meters.peak": "Pico: o mais alto que o último momento chegou, em dB abaixo da escala cheia.",
"modal.copied": "Copiado",
"monitor.previewFailed": "A pré-visualização falhou: {0}",
diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.json
index 97d4c945..6e5e512f 100644
--- a/src/crates/concat/locales/ru.json
+++ b/src/crates/concat/locales/ru.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Видеоэффекты",
"meters.clipLight": "Индикатор перегрузки: загорается красным, когда микс достигает полной шкалы.",
"meters.clipped": "Микс перегружен: сэмпл достиг полной шкалы. Нажмите, чтобы сбросить.",
- "meters.meters": "Индикаторы",
"meters.peak": "Пик: самый громкий уровень последнего мгновения, в дБ ниже полной шкалы.",
"modal.copied": "Скопировано",
"monitor.previewFailed": "Просмотр не удался: {0}",
diff --git a/src/crates/concat/locales/th.json b/src/crates/concat/locales/th.json
index 28ffe51d..e5a2ff98 100644
--- a/src/crates/concat/locales/th.json
+++ b/src/crates/concat/locales/th.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "เอฟเฟกต์วิดีโอ",
"meters.clipLight": "ไฟคลิป: เปลี่ยนเป็นสีแดงเมื่อมิกซ์ถึงสเกลเต็ม",
"meters.clipped": "มิกซ์เกิดคลิปปิง: มีแซมเปิลถึงสเกลเต็ม คลิกเพื่อล้าง",
- "meters.meters": "มิเตอร์",
"meters.peak": "พีก: ระดับดังสุดที่ช่วงล่าสุดไปถึง เป็น dB ต่ำกว่าสเกลเต็ม",
"modal.copied": "คัดลอกแล้ว",
"monitor.previewFailed": "แสดงตัวอย่างไม่สำเร็จ: {0}",
diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.json
index 8dc0f60c..8a7cc329 100644
--- a/src/crates/concat/locales/tr.json
+++ b/src/crates/concat/locales/tr.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Video efektleri",
"meters.clipLight": "Kırpma ışığı: miks tam ölçeğe ulaştığında kırmızı olur.",
"meters.clipped": "Miks kırpıldı: bir örnek tam ölçeğe ulaştı. Temizlemek için tıklayın.",
- "meters.meters": "Ölçerler",
"meters.peak": "Tepe: son anın ulaştığı en yüksek seviye, tam ölçeğin altında dB olarak.",
"modal.copied": "Kopyalandı",
"monitor.previewFailed": "Önizleme başarısız: {0}",
diff --git a/src/crates/concat/locales/uk.json b/src/crates/concat/locales/uk.json
index 65c2c916..4d7e9c2b 100644
--- a/src/crates/concat/locales/uk.json
+++ b/src/crates/concat/locales/uk.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Відеоефекти",
"meters.clipLight": "Індикатор перевантаження: стає червоним, коли мікс досягає повної шкали.",
"meters.clipped": "Мікс перевантажено: семпл досяг повної шкали. Клацніть, щоб скинути.",
- "meters.meters": "Індикатори",
"meters.peak": "Пік: найгучніше значення за останню мить, у дБ нижче повної шкали.",
"modal.copied": "Скопійовано",
"monitor.previewFailed": "Помилка перегляду: {0}",
diff --git a/src/crates/concat/locales/ur.json b/src/crates/concat/locales/ur.json
index 74ee5eb8..701c0d89 100644
--- a/src/crates/concat/locales/ur.json
+++ b/src/crates/concat/locales/ur.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "ویڈیو ایفیکٹس",
"meters.clipLight": "کلپ لائٹ: مکس کے پورے اسکیل تک پہنچنے پر سرخ ہو جاتی ہے۔",
"meters.clipped": "مکس کلپ ہو گیا: ایک سیمپل پورے اسکیل تک پہنچا۔ صاف کرنے کے لیے کلک کریں۔",
- "meters.meters": "میٹرز",
"meters.peak": "چوٹی: پچھلے لمحے کی سب سے بلند سطح، پورے اسکیل سے نیچے dB میں۔",
"modal.copied": "کاپی ہو گیا",
"monitor.previewFailed": "پیش منظر ناکام: {0}",
diff --git a/src/crates/concat/locales/vi.json b/src/crates/concat/locales/vi.json
index 7a2d5080..a7f88725 100644
--- a/src/crates/concat/locales/vi.json
+++ b/src/crates/concat/locales/vi.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "Hiệu ứng video",
"meters.clipLight": "Đèn báo clip: chuyển đỏ khi mức trộn đạt toàn thang.",
"meters.clipped": "Âm thanh bị vượt ngưỡng: một mẫu đã chạm mức tối đa. Nhấp để xóa cảnh báo.",
- "meters.meters": "Đồng hồ mức âm thanh",
"meters.peak": "Đỉnh: mức lớn nhất trong khoảnh khắc vừa qua, tính bằng dB dưới mức tối đa.",
"modal.copied": "Đã sao chép",
"monitor.previewFailed": "Xem trước thất bại: {0}",
diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.json
index 3bceff85..f43426f8 100644
--- a/src/crates/concat/locales/zh-Hans.json
+++ b/src/crates/concat/locales/zh-Hans.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "视频效果",
"meters.clipLight": "削波指示灯:混音达到满刻度时变红。",
"meters.clipped": "混音削波:有采样达到满刻度。点击清除。",
- "meters.meters": "电平表",
"meters.peak": "峰值:最近一刻达到的最大电平,以低于满刻度的 dB 计。",
"modal.copied": "已复制",
"monitor.previewFailed": "预览失败:{0}",
diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.json
index 9c22740e..77cf26ce 100644
--- a/src/crates/concat/locales/zh-TW.json
+++ b/src/crates/concat/locales/zh-TW.json
@@ -301,7 +301,6 @@
"mediaPane.videoEffects": "影片效果",
"meters.clipLight": "削波指示燈:混音達到滿刻度時變紅。",
"meters.clipped": "混音削波:有取樣達到滿刻度。點擊清除。",
- "meters.meters": "電平表",
"meters.peak": "峰值:最近一刻達到的最大電平,以低於滿刻度的 dB 計。",
"modal.copied": "已拷貝",
"monitor.previewFailed": "預覽失敗:{0}",
diff --git a/src/crates/concat/src/chips.rs b/src/crates/concat/src/chips.rs
index 5d51a0ed..4de26607 100644
--- a/src/crates/concat/src/chips.rs
+++ b/src/crates/concat/src/chips.rs
@@ -45,8 +45,6 @@ pub fn pane_glyph(slug: &str) -> &'static str {
"M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2Z \
M7 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0 M21 15l-3.086-3.086a2 2 0 0 0-2.828 0L6 21"
}
- // lucide/chart-no-axes-column
- "meters" => "M5 21v-6 M12 21V3 M19 21V9",
// lucide/diamond
"keyframes" => "M12 2.5l9.5 9.5-9.5 9.5-9.5-9.5z",
// lucide/sliders-horizontal
diff --git a/src/crates/concat/src/dock.rs b/src/crates/concat/src/dock.rs
index 7a95e733..ddcea79b 100644
--- a/src/crates/concat/src/dock.rs
+++ b/src/crates/concat/src/dock.rs
@@ -14,13 +14,6 @@ pub const SEAT_MIN_H: f32 = 140.0;
pub const SEAT_MIN_GRAB: f32 = 64.0;
/// The gutter between the halves of a split, and the margin round the lot.
pub const SEAT_GAP: f32 = 8.0;
-/// The VU meters' column needs only its ruler, its two bars and the
-/// padding round them: 26 + 14 + 14 and two gaps of 4, in 6px of padding
-/// a side (see meters-pane.slint).
-pub const METERS_MIN_W: f32 = 76.0;
-/// The meters' share of the bottom row in the default layout: a slim
-/// column beside the timeline, at its full height.
-const METERS_SHARE: f32 = 0.055;
pub enum Dock {
/// One view, filling its box.
@@ -137,6 +130,14 @@ impl Dock {
walk(self, index, &mut seen, &mut path).then_some(path)
}
+ /// Whether a view of this kind is anywhere in the tree.
+ pub fn contains(&self, kind: PaneKind) -> bool {
+ match self {
+ Dock::Leaf(held) => *held == kind,
+ Dock::Split { first, second, .. } => first.contains(kind) || second.contains(kind),
+ }
+ }
+
pub fn kind_at(&self, index: usize) -> Option<PaneKind> {
match self.at(&self.leaf_path(index)?) {
Dock::Leaf(kind) => Some(*kind),
@@ -273,13 +274,9 @@ pub fn default_dock() -> Dock {
second: Dock::leaf(PaneKind::Inspector),
}),
}),
- // The timeline, and the VU meters in a slim column beside it.
- second: Box::new(Dock::Split {
- columns: true,
- ratio: 1.0 - METERS_SHARE,
- first: Dock::leaf(PaneKind::Timeline),
- second: Dock::leaf(PaneKind::Meters),
- }),
+ // The timeline, whose VU meters are a column at its own right edge
+ // (see vu-meter.slint) rather than a seat of their own.
+ second: Dock::leaf(PaneKind::Timeline),
}
}
diff --git a/src/crates/concat/src/lib.rs b/src/crates/concat/src/lib.rs
index 4873a940..10f5caa1 100644
--- a/src/crates/concat/src/lib.rs
+++ b/src/crates/concat/src/lib.rs
@@ -84,7 +84,7 @@ mod wayland_drop {
}
}
-use dock::{Dock, METERS_MIN_W, SEAT_MIN_GRAB, SEAT_MIN_H, SEAT_MIN_W};
+use dock::{Dock, SEAT_MIN_GRAB, SEAT_MIN_H, SEAT_MIN_W};
use host::{Host, Shell};
use panes::Msg;
use panes::captions::CaptionsMsg;
@@ -723,31 +723,16 @@ fn start(project: Option<std::path::PathBuf>, smoke: bool) -> Result<(), slint::
let Some(path) = state.dock.split_path(held) else {
return;
};
- // A side that is only the meters may be as narrow as its bars;
- // every other seat keeps the width its controls need.
- let narrow = |node: &Dock| matches!(node, Dock::Leaf(PaneKind::Meters));
- let (first_narrow, second_narrow) = match state.dock.at(&path) {
- Dock::Split { first, second, .. } => (narrow(first), narrow(second)),
- Dock::Leaf(_) => (false, false),
- };
let Dock::Split { columns, ratio, .. } = state.dock.at_mut(&path) else {
return;
};
let wanted = if *columns { SEAT_MIN_W } else { SEAT_MIN_H };
- let side = |is_narrow: bool| {
- if is_narrow && *columns {
- METERS_MIN_W
- } else if wanted * 2.0 <= extent {
- wanted
- } else {
- SEAT_MIN_GRAB.min(extent / 2.0)
- }
- };
- let (low, high) = (
- side(first_narrow) / extent,
- 1.0 - side(second_narrow) / extent,
- );
- *ratio = (from + delta / extent).clamp(low, high.max(low));
+ let floor = if wanted * 2.0 <= extent {
+ wanted
+ } else {
+ SEAT_MIN_GRAB.min(extent / 2.0)
+ } / extent;
+ *ratio = (from + delta / extent).clamp(floor, 1.0 - floor);
}));
// ── the bin ──
@@ -940,6 +925,9 @@ fn start(project: Option<std::path::PathBuf>, smoke: bool) -> Result<(), slint::
editor.on_trim_follow_changed(on_window!(|state, on: bool| {
state.handle(Msg::Timeline(TimelineMsg::TrimFollowChanged(on)));
}));
+ editor.on_meters_shown_changed(on_window!(|state, on: bool| {
+ state.handle(Msg::Timeline(TimelineMsg::MetersShownChanged(on)));
+ }));
editor.on_preview_axis_changed(on_window!(|state, on: bool| {
state.handle(Msg::Timeline(TimelineMsg::PreviewAxisChanged(on)));
}));
diff --git a/src/crates/concat/src/meters.rs b/src/crates/concat/src/meters.rs
index cc19afb2..ee978569 100644
--- a/src/crates/concat/src/meters.rs
+++ b/src/crates/concat/src/meters.rs
@@ -6,12 +6,16 @@
//! a steady rate, the loudest of the last moment held as a line, and the
//! clip light latched until it is clicked.
//!
-//! The timer runs only while something plays, and for the moment after it
-//! takes the bars to fall; it stops itself once they are down.
+//! The timer runs only while something plays and the meters are on
+//! screen, and for the moment after it takes the bars to fall; it stops
+//! itself once they are down. Put away - the tray's meter button, a dock
+//! with no timeline in it, the phone shell, which has none - they cost
+//! nothing: no timer, and no property changing thirty times a second.
use slint::ComponentHandle;
-use crate::ui::Meters;
+use crate::studio::Studio;
+use crate::ui::{Meters, PaneKind};
/// The meters' floor in dB: their 0. Their 1 is 0 dB.
const FLOOR_DB: f32 = -60.0;
@@ -66,22 +70,48 @@ pub struct MeterFeed {
left: Side,
right: Side,
pub clipped: bool,
+ /// The window is a phone's, whose shell has no meters to feed.
+ pub phone: bool,
timer: slint::Timer,
}
-impl MeterFeed {
- /// Something started playing: the meters follow it.
- pub fn wake(&self) {
- if self.timer.running() {
+impl Studio {
+ /// Whether anything can see the meters: the tray's switch is on, and
+ /// a timeline - whose right edge they sit on - is in the dock.
+ pub fn meters_shown(&self) -> bool {
+ !self.meters.phone && self.prefs.meters_shown() && self.dock.contains(PaneKind::Timeline)
+ }
+
+ fn rolling(&self) -> bool {
+ self.playing || self.source.as_ref().is_some_and(|source| source.playing)
+ }
+
+ /// Something started playing, or the meters came into view while it
+ /// plays: they follow it. Nothing happens when nobody can see them.
+ pub fn wake_meters(&self) {
+ if self.meters.timer.running() || !self.rolling() || !self.meters_shown() {
return;
}
- self.timer.start(slint::TimerMode::Repeated, TICK, || {
+ // The peaks playback kept while nobody was reading them belong to
+ // some earlier moment; the first tick is to show this one.
+ let _ = self.host.playback.take_levels();
+ self.meters.timer.start(slint::TimerMode::Repeated, TICK, || {
crate::host::Shell::with(|shell, app| {
let mut studio = shell.studio.borrow_mut();
- let rolling =
- studio.playing || studio.source.as_ref().is_some_and(|source| source.playing);
+ let rolling = studio.rolling();
+ let shown = studio.meters_shown();
let (left, right) = studio.host.playback.take_levels();
let feed = &mut studio.meters;
+ if !shown {
+ // Put away mid-play: the bars drop to the floor now,
+ // so they are not found standing where they were when
+ // the meters are shown again, and the timer stops.
+ feed.left = Side::default();
+ feed.right = Side::default();
+ feed.publish(&app);
+ feed.timer.stop();
+ return;
+ }
feed.left.tick(left, TICK.as_secs_f32());
feed.right.tick(right, TICK.as_secs_f32());
feed.clipped |= left >= 1.0 || right >= 1.0;
@@ -92,6 +122,9 @@ impl MeterFeed {
});
});
}
+}
+
+impl MeterFeed {
/// The clip light was clicked.
pub fn clear_clip(&mut self, app: &crate::ui::App) {
diff --git a/src/crates/concat/src/panes/timeline.rs b/src/crates/concat/src/panes/timeline.rs
index 70c5bff3..578fcf83 100644
--- a/src/crates/concat/src/panes/timeline.rs
+++ b/src/crates/concat/src/panes/timeline.rs
@@ -61,6 +61,8 @@ pub enum TimelineMsg {
/// The tray's preview axis button: the monitor follows the pointer.
/// A preference, remembered.
TrimFollowChanged(bool),
+ /// The tray's meter button: the VU meters shown or put away.
+ MetersShownChanged(bool),
PreviewAxisChanged(bool),
/// The button's menu: whether the sound under the pointer plays too.
PreviewAxisAudioChanged(bool),
@@ -145,6 +147,11 @@ impl TimelinePane {
studio.prefs.trim_follow = on;
studio.prefs.save(&studio.host.dirs);
}
+ TimelineMsg::MetersShownChanged(on) => {
+ studio.prefs.vu_meters = Some(on);
+ studio.prefs.save(&studio.host.dirs);
+ studio.wake_meters();
+ }
TimelineMsg::PreviewAxisChanged(on) => {
studio.prefs.preview_axis = on;
studio.prefs.save(&studio.host.dirs);
diff --git a/src/crates/concat/src/prefs.rs b/src/crates/concat/src/prefs.rs
index 542aa2b2..f8eaf647 100644
--- a/src/crates/concat/src/prefs.rs
+++ b/src/crates/concat/src/prefs.rs
@@ -87,6 +87,10 @@ pub struct Preferences {
/// default: a burst of sound on every pass of the pointer is a lot to
/// ask of a room.
pub preview_axis_audio: bool,
+ /// The VU meters at the timeline's right edge. `None` is shown: how
+ /// loud the cut plays is worth seeing before anyone thinks to ask, and
+ /// the tray's meter button puts them away.
+ pub vu_meters: Option<bool>,
/// Where model downloads look first: a `SourcePreference` by name.
/// Absent is automatic.
pub download_source: Option<String>,
@@ -141,6 +145,11 @@ impl Default for VoiceoverPrefs {
}
impl Preferences {
+ /// Whether the timeline shows its VU meters; see `vu_meters`.
+ pub fn meters_shown(&self) -> bool {
+ self.vu_meters.unwrap_or(true)
+ }
+
/// Which of `names` — the theme's accents, in its order — the remembered
/// accent is. The first when nothing is remembered, and the first when
/// the name is one the list no longer has: it is the default, and a
diff --git a/src/crates/concat/src/source.rs b/src/crates/concat/src/source.rs
index 5b35c4ee..d07210cb 100644
--- a/src/crates/concat/src/source.rs
+++ b/src/crates/concat/src/source.rs
@@ -151,7 +151,6 @@ impl Studio {
}
source.playing = true;
self.host.playback.play(source.time);
- self.meters.wake();
source.timer.start(
slint::TimerMode::Repeated,
std::time::Duration::from_millis(16),
@@ -176,6 +175,7 @@ impl Studio {
});
},
);
+ self.wake_meters();
}
/// The monitor's timecode moved through the source.
diff --git a/src/crates/concat/src/studio.rs b/src/crates/concat/src/studio.rs
index 75594ad4..8873c3ec 100644
--- a/src/crates/concat/src/studio.rs
+++ b/src/crates/concat/src/studio.rs
@@ -2887,7 +2887,7 @@ impl Studio {
self.playing = true;
log::debug!("playback: playing from {:.3}s", self.playhead);
self.host.playback.play(f64::from(self.playhead));
- self.meters.wake();
+ self.wake_meters();
// The clock is the audio device's. This looks at it far more often
// than any timeline's frame rate and acts only when the frame under
// it changes, so each frame is asked for within a few milliseconds of
@@ -7961,12 +7961,16 @@ impl Studio {
let out = self.dock_layout();
sync(&models.seats, out.seats);
sync(&models.dividers, out.dividers);
+ // A timeline put back while something plays brings its meters
+ // with it; one taken away stops them at their next tick.
+ self.wake_meters();
}
/// The window is a phone's: the lanes keep the playhead at their middle
/// and glide under it. See `platform::phone` and `TimelinePane::centred`.
pub fn set_phone(&mut self, phone: bool) {
self.lanes.centred = phone;
+ self.meters.phone = phone;
let playhead = self.playhead;
self.lanes.recentre(playhead);
}
@@ -8235,6 +8239,7 @@ impl Studio {
editor.set_snap(self.lanes.snap);
editor.set_magnetic(self.prefs.magnetic);
editor.set_trim_follow(self.prefs.trim_follow);
+ editor.set_meters_shown(self.prefs.meters_shown());
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);
diff --git a/src/crates/concat/ui/app.slint b/src/crates/concat/ui/app.slint
index fc65805b..c34bfa97 100644
--- a/src/crates/concat/ui/app.slint
+++ b/src/crates/concat/ui/app.slint
@@ -42,7 +42,7 @@ import { ParamFormat } from "inspector/controls.slint";
import { ToastData, ToastLayer } from "primitives/toast.slint";
import { TooltipLayer } from "primitives/tooltip.slint";
import { FontSearch } from "inspector/font-picker.slint";
-import { Meters } from "workspace/meters-pane.slint";
+import { Meters } from "timeline/vu-meter.slint";
import { Workspace } from "workspace/workspace.slint";
import {
ClipData, ClipField, ClipKeyData, ClipKind, ClipTextField, DropData, Keyframes,
diff --git a/src/crates/concat/ui/editor.slint b/src/crates/concat/ui/editor.slint
index 7730a86f..67f2a15e 100644
--- a/src/crates/concat/ui/editor.slint
+++ b/src/crates/concat/ui/editor.slint
@@ -303,6 +303,9 @@ export global Editor {
/// Trim follow: the playhead rides a clip edge while it is dragged. A
/// remembered preference, which Rust owns.
in-out property <bool> trim-follow;
+ /// The VU meters at the timeline's right edge. A remembered
+ /// preference, which Rust owns; the tray's meter button flips it.
+ in-out property <bool> meters-shown: true;
/// 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
@@ -348,6 +351,7 @@ export global Editor {
callback magnetic-changed(on: bool);
callback pan-changed(on: bool);
callback trim-follow-changed(on: bool);
+ callback meters-shown-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,
diff --git a/src/crates/concat/ui/timeline/tray.slint b/src/crates/concat/ui/timeline/tray.slint
index c5d25643..ab3c5f4e 100644
--- a/src/crates/concat/ui/timeline/tray.slint
+++ b/src/crates/concat/ui/timeline/tray.slint
@@ -183,6 +183,8 @@ export component TimelineTray inherits Rectangle {
/// with the take's level beside it.
in property <bool> recording;
in property <float> record-level;
+ /// The VU meters at the lanes' right edge are shown.
+ in property <bool> meters-shown: true;
callback tool-changed(tool: TimelineTool);
callback snap-changed(snap: bool);
@@ -209,6 +211,7 @@ export component TimelineTray inherits Rectangle {
callback add-track(bottom: bool);
callback fit();
callback zoom(factor: float);
+ callback meters-shown-changed(on: bool);
height: 40px;
background: Theme.panel;
@@ -452,5 +455,17 @@ export component TimelineTray inherits Rectangle {
icon-size: 14px;
clicked => { root.zoom(1 / 1.4); }
}
+
+ Divider { }
+
+ // The VU meters, shown or put away. Last on the row, so it sits
+ // over the column it switches.
+ TrayButton {
+ glyph: Glyph.meter;
+ label: root.meters-shown ? I18n.t("tray.hideMeters") : I18n.t("tray.showMeters");
+ icon-size: 16px;
+ checked: root.meters-shown;
+ clicked => { root.meters-shown-changed(!root.meters-shown); }
+ }
}
}
diff --git a/src/crates/concat/ui/workspace/meters-pane.slint b/src/crates/concat/ui/timeline/vu-meter.slint
similarity index 74%
rename from src/crates/concat/ui/workspace/meters-pane.slint
rename to src/crates/concat/ui/timeline/vu-meter.slint
index e5ccda7a..cbb70e61 100644
--- a/src/crates/concat/ui/workspace/meters-pane.slint
+++ b/src/crates/concat/ui/timeline/vu-meter.slint
@@ -2,28 +2,31 @@
// SPDX-FileCopyrightText: 2026 Jareer and Concat contributors
// The VU meters: how loud the timeline plays, left and right, while it
-// plays. A slim column beside the timeline by default. Each bar is the
-// peak level on a decibel scale - 0 dB at the top, -60 at the foot -
-// with the loudest of the last moment held as a line, a clip light over
-// the bars that stays red once the mix has clipped, until it is clicked,
-// and under them the held peak as a number.
+// plays. A slim column at the timeline's right edge, the height of the
+// lanes, where CapCut and Premiere keep theirs: beside the sound it
+// measures, and not a panel of its own to find a seat for. The tray's
+// meter button shows and hides it.
+//
+// Each bar is the peak level on a decibel scale - 0 dB at the top, -60 at
+// the foot - with the loudest of the last moment held as a line, a clip
+// light over the bars that stays red once the mix has clipped, until it
+// is clicked, and under them the held peak as a number.
//
// The column reads as one instrument: the scale is a ruler down the left
// with a tick every three decibels and a number every six to -24 and
// every twelve below, where the ear stops caring about the odd decibel;
-// the light sits over the two bars it speaks for and nothing else; the
-// legend under the bars names them and the unit.
+// the light sits in the band beside the lanes' ruler, over the two bars
+// it speaks for; the legend under the bars names them and the unit.
import { I18n } from "../i18n.slint";
import { Theme } from "../theme/theme.slint";
import { Fmt } from "../util.slint";
import { LevelMeter } from "../primitives/level-meter.slint";
import { Tip } from "../primitives/tooltip.slint";
-import { Pane } from "pane.slint";
-import { PaneKind, PaneSwitcher } from "pane-switcher.slint";
/// The levels, published by Rust (concat's meters.rs) thirty times a second
-/// while anything plays. Each is `0..1` on the meter's decibel scale.
+/// while anything plays and the column is shown. Each is `0..1` on the
+/// meter's decibel scale.
export global Meters {
in property <float> left;
in property <float> right;
@@ -35,11 +38,10 @@ export global Meters {
callback clip-cleared();
}
-export component MetersPane inherits Pane {
- in property <int> pane-seat;
- in property <bool> pane-removable;
- callback pane-picked(kind: PaneKind);
- callback pane-removed();
+export component VuMeter inherits Rectangle {
+ /// The lanes' ruler band: the clip light sits in a band this tall, so
+ /// the bars start where the lanes do.
+ in property <length> ruler-height: 28px;
/// The scale's floor, in dB: the meters' 0 is this, their 1 is 0 dB.
property <float> floor-db: -60;
@@ -52,9 +54,10 @@ export component MetersPane inherits Pane {
property <length> scale-w: 26px;
property <length> tick-w: 6px;
/// One bar's width, and the gap between the two. The light over them
- /// and the legend under them are sized to the pair.
- property <length> bar-w: 14px;
- property <length> bar-gap: 4px;
+ /// and the readout under them are sized to the pair. Slimmer than the
+ /// old pane's: every pixel here is one the lanes do not get.
+ property <length> bar-w: 10px;
+ property <length> bar-gap: 3px;
property <length> pair-w: 2 * root.bar-w + root.bar-gap;
/// The decibels a meter value stands for.
@@ -74,11 +77,27 @@ export component MetersPane inherits Pane {
return "\{Math.round(root.db-of(Math.max(Meters.hold-left, Meters.hold-right)))}";
}
+ background: Theme.panel;
+ clip: true;
+
+ // The hairline against the lanes, the way the header column has one.
+ Rectangle {
+ x: 0;
+ y: 0;
+ width: 1px;
+ height: parent.height;
+ background: Theme.line;
+ }
+
VerticalLayout {
- // The other panes' bar height, and only the switcher in it: the
- // column is too narrow for a name, and the bars say what it is.
+ padding-left: 1px;
+
+ // The ruler's band, and the clip light in it: red once the mix has
+ // hit full scale, until clicked. The empty box on the left is the
+ // scale's width, so the light lines up with the bars and not with
+ // the column.
Rectangle {
- height: 52px;
+ height: root.ruler-height;
Rectangle {
y: parent.height - 1px;
height: 1px;
@@ -86,53 +105,36 @@ export component MetersPane inherits Pane {
}
HorizontalLayout {
alignment: center;
+ spacing: root.bar-gap;
+ Rectangle { width: root.scale-w; }
VerticalLayout {
alignment: center;
- PaneSwitcher {
- kind: PaneKind.meters;
- seat: root.pane-seat;
- removable: root.pane-removable;
- picked(kind) => { root.pane-picked(kind); }
- removed => { root.pane-removed(); }
+ light := Rectangle {
+ width: root.pair-w;
+ height: 6px;
+ border-radius: 3px;
+ background: Meters.clipped ? Theme.danger : Theme.field;
+ border-width: 1px;
+ border-color: Meters.clipped ? Theme.danger : Theme.line;
+
+ light-touch := TouchArea {
+ mouse-cursor: pointer;
+ clicked => { Meters.clip-cleared(); }
+ }
+ Tip {
+ text: Meters.clipped ? I18n.t("meters.clipped") : I18n.t("meters.clipLight");
+ active: light-touch.has-hover;
+ }
}
}
}
}
VerticalLayout {
- padding-left: 6px;
- padding-right: 6px;
padding-top: 8px;
padding-bottom: 8px;
spacing: 4px;
- // The clip light, over the pair of bars it speaks for: red once
- // the mix has hit full scale, until clicked. The empty box on
- // the left is the ruler's width, so the light lines up with the
- // bars and not with the column.
- HorizontalLayout {
- alignment: center;
- spacing: root.bar-gap;
- Rectangle { width: root.scale-w; }
- light := Rectangle {
- width: root.pair-w;
- height: 6px;
- border-radius: 3px;
- background: Meters.clipped ? Theme.danger : Theme.field;
- border-width: 1px;
- border-color: Meters.clipped ? Theme.danger : Theme.line;
-
- light-touch := TouchArea {
- mouse-cursor: pointer;
- clicked => { Meters.clip-cleared(); }
- }
- Tip {
- text: Meters.clipped ? I18n.t("meters.clipped") : I18n.t("meters.clipLight");
- active: light-touch.has-hover;
- }
- }
- }
-
// The ruler and the bars. The ruler's foot and head are the
// bars' own, so a number sits level with the tick it names.
HorizontalLayout {
@@ -140,7 +142,7 @@ export component MetersPane inherits Pane {
alignment: center;
spacing: root.bar-gap;
- scale := Rectangle {
+ Rectangle {
width: root.scale-w;
// A hairline the ticks grow from, on the ruler's inner
@@ -225,7 +227,7 @@ export component MetersPane inherits Pane {
alignment: center;
spacing: root.bar-gap;
Rectangle { width: root.scale-w; }
- peak := Rectangle {
+ Rectangle {
width: root.pair-w;
height: 18px;
border-radius: Theme.r-xs;
diff --git a/src/crates/concat/ui/workspace/pane-switcher.slint b/src/crates/concat/ui/workspace/pane-switcher.slint
index 62144850..88c0f8d9 100644
--- a/src/crates/concat/ui/workspace/pane-switcher.slint
+++ b/src/crates/concat/ui/workspace/pane-switcher.slint
@@ -39,8 +39,6 @@ export enum PaneKind {
timeline,
/// the selected clip's keys: a dopesheet and a curve editor
keyframes,
- /// the VU meters: how loud the timeline plays, left and right
- meters,
}
export global Panes {
@@ -62,7 +60,6 @@ export global Panes {
: kind == PaneKind.preview ? I18n.t("common.preview")
: kind == PaneKind.inspector ? I18n.t("paneSwitcher.inspector")
: kind == PaneKind.keyframes ? I18n.t("common.keyframes")
- : kind == PaneKind.meters ? I18n.t("meters.meters")
: I18n.t("paneSwitcher.timeline");
}
@@ -74,7 +71,6 @@ export global Panes {
: kind == PaneKind.preview ? "preview"
: kind == PaneKind.inspector ? "inspector"
: kind == PaneKind.keyframes ? "keyframes"
- : kind == PaneKind.meters ? "meters"
: "timeline";
}
@@ -87,7 +83,6 @@ export global Panes {
: kind == PaneKind.preview ? Glyph.image
: kind == PaneKind.inspector ? Glyph.settings
: kind == PaneKind.keyframes ? Glyph.keyframe
- : kind == PaneKind.meters ? Glyph.meter
: Glyph.rows;
}
}
@@ -252,14 +247,14 @@ export component PaneSwitcher inherits Rectangle {
"pane:\{root.seat}:\{Panes.label(root.kind)}:\{Panes.id(root.kind)}";
property <length> menu-w: 168px;
- /// Six view rows, then the rule and the row that removes the panel, then
+ /// Five view rows, then the rule and the row that removes the panel, then
/// the surface's own padding. Summed here because a PopupWindow is sized
/// by whoever places it — the same rule the context menu follows, and the
/// same reason: a layout cannot report its height back up before it has
/// somewhere to be laid out. When the Keyframes row arrived this still
/// said four, and the row that removes the panel was the one under the
/// clip.
- property <length> list-h: 6 * 26px + 9px + 26px + 8px;
+ property <length> list-h: 5 * 26px + 9px + 26px + 8px;
/// The whole list when the window has room for it under the button, and
/// the room otherwise, with the rest reached by scrolling. Never under
/// three rows: shorter than that is not a list worth scrolling, and
@@ -399,11 +394,6 @@ export component PaneSwitcher inherits Rectangle {
current: root.kind == PaneKind.keyframes;
chosen => { menu.close(); root.picked(PaneKind.keyframes); }
}
- SwitchRow {
- kind: PaneKind.meters;
- current: root.kind == PaneKind.meters;
- chosen => { menu.close(); root.picked(PaneKind.meters); }
- }
SwitchRow {
kind: PaneKind.timeline;
current: root.kind == PaneKind.timeline;
@@ -435,7 +425,7 @@ export component AddPaneButton inherits Rectangle {
property <length> menu-w: 168px;
/// Five view rows and the surface's padding; held to the room under the
/// button the way the seat's own menu is.
- property <length> list-h: 6 * 26px + 8px;
+ property <length> list-h: 5 * 26px + 8px;
property <length> menu-h: Math.min(root.list-h, Math.max(3 * 26px + 8px,
Panes.room-below(root.absolute-position.y + root.height + 4px)));
@@ -507,10 +497,6 @@ export component AddPaneButton inherits Rectangle {
kind: PaneKind.keyframes;
chosen => { menu.close(); root.added(PaneKind.keyframes); }
}
- SwitchRow {
- kind: PaneKind.meters;
- chosen => { menu.close(); root.added(PaneKind.meters); }
- }
SwitchRow {
kind: PaneKind.timeline;
chosen => { menu.close(); root.added(PaneKind.timeline); }
diff --git a/src/crates/concat/ui/workspace/seat.slint b/src/crates/concat/ui/workspace/seat.slint
index 19511aa0..0034e8c8 100644
--- a/src/crates/concat/ui/workspace/seat.slint
+++ b/src/crates/concat/ui/workspace/seat.slint
@@ -11,7 +11,6 @@ import { MediaPane, SourcePreview } from "media-pane.slint";
import { PreviewPane } from "preview-pane.slint";
import { TimelinePane } from "timeline-pane.slint";
import { KeyframesPane } from "keyframes-pane.slint";
-import { MetersPane } from "meters-pane.slint";
// One box of the workspace, showing whichever view its `kind` names.
//
@@ -335,18 +334,6 @@ export component Seat inherits Rectangle {
}
}
- if root.kind == PaneKind.meters: MetersPane {
- x: 0;
- y: 0;
- width: root.width;
- height: root.height;
-
- pane-picked(kind) => { root.picked(kind); }
- pane-seat: root.index;
- pane-removable: Editor.seats.length > 1;
- pane-removed => { root.removed(); }
- }
-
if root.kind == PaneKind.keyframes: KeyframesPane {
x: 0;
y: 0;
@@ -385,6 +372,7 @@ export component Seat inherits Rectangle {
magnetic: Editor.magnetic;
pan-mode: Editor.pan-mode;
trim-follow: Editor.trim-follow;
+ meters-shown: Editor.meters-shown;
preview-axis: Editor.preview-axis;
preview-axis-audio: Editor.preview-axis-audio;
selected-count: Editor.selected-count;
@@ -416,6 +404,7 @@ export component Seat inherits Rectangle {
magnetic-changed(on) => { Editor.magnetic-changed(on); }
pan-changed(on) => { Editor.pan-changed(on); }
trim-follow-changed(on) => { Editor.trim-follow-changed(on); }
+ meters-shown-changed(on) => { Editor.meters-shown-changed(on); }
preview-axis-changed(on) => { Editor.preview-axis-changed(on); }
preview-axis-audio-changed(on) => { Editor.preview-axis-audio-changed(on); }
clip-verb(action) => { Editor.shortcut(action); }
diff --git a/src/crates/concat/ui/workspace/timeline-pane.slint b/src/crates/concat/ui/workspace/timeline-pane.slint
index cd1a3d4a..ed337296 100644
--- a/src/crates/concat/ui/workspace/timeline-pane.slint
+++ b/src/crates/concat/ui/workspace/timeline-pane.slint
@@ -16,9 +16,10 @@ import { TimelineTabs } from "../timeline/tabs.slint";
import { TimelineTray } from "../timeline/tray.slint";
import { TrackHeaders } from "../timeline/track-header.slint";
import { Lanes } from "../timeline/lanes.slint";
+import { VuMeter } from "../timeline/vu-meter.slint";
// The timeline pane: tabs, tray, and then the lane grid — a fixed header
-// column beside the lanes themselves.
+// column beside the lanes themselves, and the VU meters at their far edge.
//
// No PaneHeader, unlike the other three panes. The timeline owns its whole
// interior: a title strip above the tabs would be a third bar over a panel
@@ -55,6 +56,8 @@ export component TimelinePane inherits Rectangle {
in property <bool> recording;
in property <float> record-level;
in property <bool> reversible;
+ /// The VU meters at the grid's right edge; the tray's meter button.
+ in property <bool> meters-shown: true;
callback tool-changed(tool: TimelineTool);
callback snap-changed(snap: bool);
@@ -63,6 +66,7 @@ export component TimelinePane inherits Rectangle {
callback trim-follow-changed(on: bool);
callback preview-axis-changed(on: bool);
callback preview-axis-audio-changed(on: bool);
+ callback meters-shown-changed(on: bool);
/// The preview axis: the pointer over the lanes, and then not.
callback hovered(seconds: float);
callback hover-ended();
@@ -166,6 +170,9 @@ export component TimelinePane inherits Rectangle {
property <length> headers-w: Math.max(0px,
Math.min(root.header-width, root.width / 2));
in property <length> ruler-height: 28px;
+ /// The meters' column: the ruler, two bars and their gaps, a few
+ /// pixels of air, and nothing when they are put away.
+ property <length> meters-w: root.meters-shown ? 60px : 0px;
/// Clamped here rather than only where it is written, so a pane dragged
/// taller than its own track stack cannot stay parked past the end. The
@@ -326,6 +333,7 @@ export component TimelinePane inherits Rectangle {
freezable: root.freezable;
recording: root.recording;
record-level: root.record-level;
+ meters-shown: root.meters-shown;
tool-changed(tool) => { root.tool-changed(tool); }
snap-changed(snap) => { root.snap-changed(snap); }
@@ -333,6 +341,7 @@ export component TimelinePane inherits Rectangle {
pan-changed(on) => { root.pan-changed(on); }
trim-follow-changed(on) => { root.trim-follow-changed(on); }
preview-axis-changed(on) => { root.preview-axis-changed(on); }
+ meters-shown-changed(on) => { root.meters-shown-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
@@ -408,7 +417,7 @@ export component TimelinePane inherits Rectangle {
lanes := Lanes {
x: root.headers-w + 1px;
y: 0;
- width: Math.max(0px, parent.width - root.headers-w - 1px);
+ width: Math.max(0px, parent.width - root.headers-w - 1px - root.meters-w);
height: parent.height;
tracks: root.tracks;
@@ -486,6 +495,17 @@ export component TimelinePane inherits Rectangle {
root.scrolled(Math.max(0, (offset / 1px) * root.seconds-per-pixel));
}
}
+
+ // The VU meters, the height of the grid and outside the lanes'
+ // scroll: how loud the cut plays is not a place along it. Only
+ // built while shown, so a hidden meter is no element at all.
+ if root.meters-shown: VuMeter {
+ x: parent.width - root.meters-w;
+ y: 0;
+ width: root.meters-w;
+ height: parent.height;
+ ruler-height: root.ruler-height;
+ }
}
}
}