The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.
Rust ffmpegfree-video-editormodel-context-protocolnon-linear-editoroffline-firstopen-source-video-editorself-hostedvideo-editingvideo-editing-automationvideo-editing-softwarevideo-editing-toolsvideo-editorvoice-cloningyoutube-automationyoutube-shorts
feat(meters): a ruler with ticks and numbers, wider bars, the clip light over the bars, a peak readout
Jareer948b6db90448
diff --git a/src/crates/concat/locales/de.json b/src/crates/concat/locales/de.jsonindex 740a71ce..cb799f1c 100644--- a/src/crates/concat/locales/de.json+++ b/src/crates/concat/locales/de.json@@ -662,6 +662,7 @@"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}","paneSwitcher.addAPanel": "Panel hinzufügen",diff --git a/src/crates/concat/locales/en.json b/src/crates/concat/locales/en.jsonindex ddf710eb..af042419 100644--- a/src/crates/concat/locales/en.json+++ b/src/crates/concat/locales/en.json@@ -662,6 +662,7 @@"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}","paneSwitcher.addAPanel": "Add a panel",diff --git a/src/crates/concat/locales/es.json b/src/crates/concat/locales/es.jsonindex 6f1fc84e..ba44de4e 100644--- a/src/crates/concat/locales/es.json+++ b/src/crates/concat/locales/es.json@@ -662,6 +662,7 @@"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}","paneSwitcher.addAPanel": "Añadir un panel",diff --git a/src/crates/concat/locales/fa.json b/src/crates/concat/locales/fa.jsonindex 1dcbb5b5..6a5f855d 100644--- a/src/crates/concat/locales/fa.json+++ b/src/crates/concat/locales/fa.json@@ -662,6 +662,7 @@"meters.clipLight": "چراغ کلیپ: وقتی میکس به حداکثر سطح برسد قرمز میشود.","meters.clipped": "میکس کلیپ شد: یک نمونه به حداکثر سطح رسید. برای پاک کردن کلیک کنید.","meters.meters": "سطحسنج",+ "meters.peak": "اوج: بلندترین سطح لحظهٔ اخیر، به dB زیر مقیاس کامل.","modal.copied": "کپی شد","monitor.previewFailed": "پیشنمایش ناموفق بود: {0}","paneSwitcher.addAPanel": "افزودن پنل",diff --git a/src/crates/concat/locales/fr.json b/src/crates/concat/locales/fr.jsonindex 92adbad0..70adff32 100644--- a/src/crates/concat/locales/fr.json+++ b/src/crates/concat/locales/fr.json@@ -662,6 +662,7 @@"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}","paneSwitcher.addAPanel": "Ajouter un panneau",diff --git a/src/crates/concat/locales/hr.json b/src/crates/concat/locales/hr.jsonindex 413716f1..24a49b7f 100644--- a/src/crates/concat/locales/hr.json+++ b/src/crates/concat/locales/hr.json@@ -662,6 +662,7 @@"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}","paneSwitcher.addAPanel": "Dodaj ploču",diff --git a/src/crates/concat/locales/it.json b/src/crates/concat/locales/it.jsonindex 1a9fc113..79b819c4 100644--- a/src/crates/concat/locales/it.json+++ b/src/crates/concat/locales/it.json@@ -662,6 +662,7 @@"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}","paneSwitcher.addAPanel": "Aggiungi un pannello",diff --git a/src/crates/concat/locales/ja.json b/src/crates/concat/locales/ja.jsonindex d805ceed..8fea217d 100644--- a/src/crates/concat/locales/ja.json+++ b/src/crates/concat/locales/ja.json@@ -662,6 +662,7 @@"meters.clipLight": "クリップランプ : ミックスがフルスケールに達すると赤くなります。","meters.clipped": "ミックスがクリップしました : サンプルがフルスケールに達しました。クリックで解除。","meters.meters": "メーター",+ "meters.peak": "ピーク:直前の最大レベル。フルスケールからの dB。","modal.copied": "コピーしました","monitor.previewFailed": "プレビューに失敗しました : {0}","paneSwitcher.addAPanel": "パネルを追加",diff --git a/src/crates/concat/locales/ko.json b/src/crates/concat/locales/ko.jsonindex a6ae16f6..0da48b0e 100644--- a/src/crates/concat/locales/ko.json+++ b/src/crates/concat/locales/ko.json@@ -662,6 +662,7 @@"meters.clipLight": "클립 표시등: 믹스가 최대치에 도달하면 빨간색이 됩니다.","meters.clipped": "믹스가 클리핑되었습니다: 샘플이 최대치에 도달했습니다. 클릭하여 지우기.","meters.meters": "미터",+ "meters.peak": "피크: 직전 순간의 최대 레벨, 풀 스케일 아래 dB.","modal.copied": "복사됨","monitor.previewFailed": "미리보기 실패: {0}","paneSwitcher.addAPanel": "패널 추가",diff --git a/src/crates/concat/locales/pt-BR.json b/src/crates/concat/locales/pt-BR.jsonindex 6c4cabbc..b8519e6b 100644--- a/src/crates/concat/locales/pt-BR.json+++ b/src/crates/concat/locales/pt-BR.json@@ -662,6 +662,7 @@"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}","paneSwitcher.addAPanel": "Adicionar um painel",diff --git a/src/crates/concat/locales/ru.json b/src/crates/concat/locales/ru.jsonindex 067ea8c3..08797eac 100644--- a/src/crates/concat/locales/ru.json+++ b/src/crates/concat/locales/ru.json@@ -662,6 +662,7 @@"meters.clipLight": "Индикатор перегрузки: загорается красным, когда микс достигает полной шкалы.","meters.clipped": "Микс перегружен: сэмпл достиг полной шкалы. Нажмите, чтобы сбросить.","meters.meters": "Индикаторы",+ "meters.peak": "Пик: самый громкий уровень последнего мгновения, в дБ ниже полной шкалы.","modal.copied": "Скопировано","monitor.previewFailed": "Просмотр не удался: {0}","paneSwitcher.addAPanel": "Добавить панель",diff --git a/src/crates/concat/locales/tr.json b/src/crates/concat/locales/tr.jsonindex cf91118c..87769e37 100644--- a/src/crates/concat/locales/tr.json+++ b/src/crates/concat/locales/tr.json@@ -662,6 +662,7 @@"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}","paneSwitcher.addAPanel": "Panel ekle",diff --git a/src/crates/concat/locales/zh-Hans.json b/src/crates/concat/locales/zh-Hans.jsonindex 7cdd5429..1c94fdd9 100644--- a/src/crates/concat/locales/zh-Hans.json+++ b/src/crates/concat/locales/zh-Hans.json@@ -662,6 +662,7 @@"meters.clipLight": "削波指示灯:混音达到满刻度时变红。","meters.clipped": "混音削波:有采样达到满刻度。点击清除。","meters.meters": "电平表",+ "meters.peak": "峰值:最近一刻达到的最大电平,以低于满刻度的 dB 计。","modal.copied": "已复制","monitor.previewFailed": "预览失败:{0}","paneSwitcher.addAPanel": "添加面板",diff --git a/src/crates/concat/locales/zh-TW.json b/src/crates/concat/locales/zh-TW.jsonindex aadeb5b0..4f7d765f 100644--- a/src/crates/concat/locales/zh-TW.json+++ b/src/crates/concat/locales/zh-TW.json@@ -662,6 +662,7 @@"meters.clipLight": "削波指示燈:混音達到滿刻度時變紅。","meters.clipped": "混音削波:有取樣達到滿刻度。點擊清除。","meters.meters": "電平表",+ "meters.peak": "峰值:最近一刻達到的最大電平,以低於滿刻度的 dB 計。","modal.copied": "已拷貝","monitor.previewFailed": "預覽失敗:{0}","paneSwitcher.addAPanel": "加入面板",diff --git a/src/crates/concat/src/dock.rs b/src/crates/concat/src/dock.rsindex 471d363b..7a95e733 100644--- a/src/crates/concat/src/dock.rs+++ b/src/crates/concat/src/dock.rs@@ -14,11 +14,13 @@ 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 bars and its scale.-pub const METERS_MIN_W: f32 = 64.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.045;+const METERS_SHARE: f32 = 0.055;pub enum Dock {/// One view, filling its box.diff --git a/src/crates/concat/ui/primitives/level-meter.slint b/src/crates/concat/ui/primitives/level-meter.slintindex f22e3d5d..49f4a035 100644--- a/src/crates/concat/ui/primitives/level-meter.slint+++ b/src/crates/concat/ui/primitives/level-meter.slint@@ -20,6 +20,9 @@ export component LevelMeter inherits Rectangle {in property <bool> vertical;/// track thickness; defaults to 6px horizontal, 8px verticalin property <length> thickness: root.vertical ? 8px : 6px;+ /// The corners' radius: a soft square rather than a pill, held to half+ /// the thickness so a thin bar is still a pill.+ in property <length> corner: 4px;/// True while the pointer is over the meter. The caller uses this to run/// the feed only while someone is looking at it — see the note on the@@ -41,7 +44,7 @@ export component LevelMeter inherits Rectangle {width: root.vertical ? root.thickness : root.width;height: root.vertical ? root.height : root.thickness;background: Theme.well;- border-radius: (root.vertical ? self.width : self.height) / 2;+ border-radius: Math.min(root.corner, (root.vertical ? self.width : self.height) / 2);clip: true;// reveal windowdiff --git a/src/crates/concat/ui/workspace/meters-pane.slint b/src/crates/concat/ui/workspace/meters-pane.slintindex e9d16fdf..e5ccda7a 100644--- a/src/crates/concat/ui/workspace/meters-pane.slint+++ b/src/crates/concat/ui/workspace/meters-pane.slint@@ -4,11 +4,19 @@// 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, and a light at the-// top that stays red once the mix has clipped, until it is clicked.+// 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.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";@@ -35,7 +43,36 @@ export component MetersPane inherits Pane {/// The scale's floor, in dB: the meters' 0 is this, their 1 is 0 dB.property <float> floor-db: -60;- property <[float]> marks: [0, -6, -12, -24, -36, -48];+ /// A tick every three decibels, the whole way down.+ property <[int]> ticks: [0, -3, -6, -9, -12, -15, -18, -21, -24, -27, -30, -33, -36, -39, -42, -45, -48, -51, -54, -57, -60];+ /// The ticks that carry a number: every six to -24, every twelve below.+ property <[int]> labelled: [0, -6, -12, -18, -24, -36, -48, -60];++ /// The ruler's width: the numbers, a gap, and the ticks.+ 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;+ property <length> pair-w: 2 * root.bar-w + root.bar-gap;++ /// The decibels a meter value stands for.+ pure function db-of(value: float) -> float {+ return root.floor-db + value * (0 - root.floor-db);+ }+ /// Where `db` sits down a ruler `height` tall.+ pure function y-of(db: float, height: length) -> length {+ return (1 - (db - root.floor-db) / (0 - root.floor-db)) * height;+ }+ /// The held peak of the two sides, as a whole number of decibels, or a+ /// dash when neither side holds one.+ pure function peak-text() -> string {+ if (Meters.hold-left < 0 && Meters.hold-right < 0) {+ return "–";+ }+ return "\{Math.round(root.db-of(Math.max(Meters.hold-left, Meters.hold-right)))}";+ }VerticalLayout {// The other panes' bar height, and only the switcher in it: the@@ -63,17 +100,24 @@ export component MetersPane inherits Pane {}VerticalLayout {- padding: 8px;- spacing: 6px;+ padding-left: 6px;+ padding-right: 6px;+ padding-top: 8px;+ padding-bottom: 8px;+ spacing: 4px;- // The clip light: red once the mix has hit full scale, until- // clicked.+ // 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: 30px;- height: 8px;- border-radius: 2px;+ 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;@@ -89,57 +133,120 @@ export component MetersPane inherits Pane {}}- // The bars, and the scale beside them.+ // 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 {vertical-stretch: 1;alignment: center;- spacing: 3px;+ spacing: root.bar-gap;scale := Rectangle {- width: 20px;- for db in root.marks: Text {+ width: root.scale-w;++ // A hairline the ticks grow from, on the ruler's inner+ // edge against the bars.+ Rectangle {+ x: parent.width - 1px;+ y: 0;+ width: 1px;+ height: parent.height;+ background: Theme.line;+ }+ for db in root.ticks: Rectangle {+ property <bool> major: Math.mod(db, 6) == 0;x: parent.width - self.width;- y: (1 - (db - root.floor-db) / (0 - root.floor-db)) * parent.height- - self.height / 2;- text: "\{-db}";- color: Theme.fg-dim;+ y: Fmt.clamp(root.y-of(db, parent.height) / 1px, 0, parent.height / 1px - 1) * 1px;+ width: self.major ? root.tick-w : root.tick-w / 2;+ height: 1px;+ background: self.major ? Theme.fg-dim : Theme.line-strong;+ }+ for db in root.labelled: Text {+ x: parent.width - root.tick-w - 3px - self.width;+ // Centred on its tick, and held inside the ruler at+ // either end so 0 and -60 are whole.+ y: Fmt.clamp(+ (root.y-of(db, parent.height) - self.height / 2) / 1px,+ 0, (parent.height - self.height) / 1px) * 1px;+ text: "\{db}";+ color: db == 0 ? Theme.fg-muted : Theme.fg-dim;font-family: Theme.font-technical;font-size: Theme.fs-xs;}}LevelMeter {vertical: true;- thickness: 10px;+ thickness: root.bar-w;value: Meters.left;peak: Meters.hold-left;}LevelMeter {vertical: true;- thickness: 10px;+ thickness: root.bar-w;value: Meters.right;peak: Meters.hold-right;}}+ // The legend: the unit under the ruler, a name under each bar.HorizontalLayout {alignment: center;- spacing: 3px;- Rectangle { width: 20px; }+ spacing: root.bar-gap;+ Rectangle {+ width: root.scale-w;+ Text {+ x: parent.width - root.tick-w - 3px - self.width;+ text: "dB";+ color: Theme.fg-dim;+ font-family: Theme.font-technical;+ font-size: Theme.fs-xs;+ }+ }Text {- width: 10px;+ width: root.bar-w;text: "L";- color: Theme.fg-dim;+ color: Theme.fg-muted;font-size: Theme.fs-xs;+ font-weight: Theme.weight-title;horizontal-alignment: center;}Text {- width: 10px;+ width: root.bar-w;text: "R";- color: Theme.fg-dim;+ color: Theme.fg-muted;font-size: Theme.fs-xs;+ font-weight: Theme.weight-title;horizontal-alignment: center;}}++ // The held peak as a number, under the pair: the loudest the+ // last moment reached, in whole decibels below full scale.+ HorizontalLayout {+ alignment: center;+ spacing: root.bar-gap;+ Rectangle { width: root.scale-w; }+ peak := Rectangle {+ width: root.pair-w;+ height: 18px;+ border-radius: Theme.r-xs;+ background: Theme.well;+ Text {+ width: parent.width;+ height: parent.height;+ text: root.peak-text();+ color: Meters.clipped ? Theme.danger : Theme.fg;+ font-family: Theme.font-technical;+ font-size: Theme.fs-xs;+ horizontal-alignment: center;+ vertical-alignment: center;+ }+ peak-touch := TouchArea { }+ Tip {+ text: I18n.t("meters.peak");+ active: peak-touch.has-hover;+ }+ }+ }}}}