diff --git a/i18n/en/Editor.resx b/i18n/en/Editor.resx
index 2de00b56..4e0abcf9 100644
--- a/i18n/en/Editor.resx
+++ b/i18n/en/Editor.resx
@@ -4,5 +4,236 @@
2.0System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ Analyse
+ Analysis queued
+ {0}invariant
+ Source
+ Back
+ Add keyframe
+ Aspect
+ Horizontal centre
+ Vertical centre
+ Crop bottom
+ Crop left
+ Crop right
+ Crop top
+ Keyframes
+ Keyframe {0} of {1} · {2}
+ {0} keyframe
+ {0} keyframes
+ Horizontal placement
+ Vertical placement
+ Remove keyframe
+ Zoom
+ cloud cover %
+ Flicker
+ change after correction
+ frame-to-frame change
+ 0 %
+ 100 %
+ 50 %
+ Luminance
+ measured luminance
+ Not analysed yet
+ horizontal path
+ vertical path
+ video frames per photo
+ sky region
+ stars per Mpx
+ exposure steps as received
+ Chart
+ target curve
+ Waveform
+ luma of frame {0}Pick a sequence in the Library
+ This sequence is no longer in the archive.long
+ Jobs cannot run until the archive index is open.long
+ The settings of this sequence cannot be read.long
+ The settings of this sequence were changed elsewhere at the same time.long
+ about {0}
+ Add to queue
+ Batch…
+ {0} bppinvariant
+ Choose folder…
+ Codec
+ Colour
+ Container
+ Rec.709 {0}-bitinvariant
+ Encoder
+ Auto
+ File name
+ {0} fpsinvariant
+ Frame rate
+ hardware
+ Height
+ Previous renders: {0} · last {1}long
+ Previous renders: {0} · last {1}long
+ history
+ In batch
+ {0} Mb/sinvariant
+ No renders yet
+ Output · {0}
+ Export preset
+ Quality
+ Quality {0}
+ Recommended
+ Render now
+ Resolution
+ Result
+ show file
+ Save to
+ Sequence exports/
+ Estimated size
+ software
+ Estimated time
+ No encoder here
+ Width
+ Deflicker
+ flicker {0} %
+ Holy grail
+ max step {0} EV
+ Exposure offset
+ Regions
+ Strength
+ Colour temperature
+ Transitions
+ White balance smoothing
+ Deflicker window
+ Filmstrip
+ Balanced
+ Best
+ Draft
+ finvariant
+ Exposure
+ Flags
+ ISOinvariant
+ #invariant
+ Size
+ Decode
+ Time
+ Exclude
+ Exclude frame
+ excluded
+ Excluded
+ None
+ black
+ corrupt
+ duplicate
+ missing
+ unreadable
+ white
+ hero
+ Hero frame
+ Not set
+ Frame {0}
+ Include
+ Include frame
+ No warnings
+ {0} preview
+ Set hero
+ Warnings
+ Opening sequence
+ Cut: pause or gap
+ Keyframe
+ Exposure step {0} EV
+ Step {0} EV not received
+ Motion blur
+ crop {0} %
+ Flow quality
+ pan {0} px/frame
+ shake {0} px
+ Shutter angle
+ Path smoothing
+ Stabilise
+ {0}: {1} → {2}invariant
+ {0} setting changed
+ {0} settings changed
+ Nothing to change
+ Optimise all
+ Optimise section
+ Preview
+ 1:1invariant
+ Preview 10 s
+ Compare
+ Crop mask
+ Crop result
+ Exit full screen
+ Full screen
+ output {0}
+ {0} of {1}
+ Pause
+ Play
+ Regions
+ Shot data
+ This frame cannot be read.
+ Vectors
+ original | corrected
+ Auto
+ Horizon
+ Luminance
+ Render · {0}
+ Render finished
+ Render queued
+ Show in folder
+ Render
+ Reset
+ Back to Auto
+ Changes not saved
+ Retry
+ Sections
+ f/{0}invariant
+ {0} mminvariant
+ ISO {0}invariant
+ {0} sinvariant
+ Length
+ Mean
+ Median
+ Stacking
+ No star field found
+ Star field found
+ Star trails
+ {0:N0} frame
+ {0:N0} frames
+ {0} s interval
+ source {0}
+ {0} warning
+ {0} warnings
+ Camera
+ Export
+ Exposure
+ Frames
+ Motion
+ Stack
+ Time
+ Speed curve
+ Fit to duration
+ Timing
+ output {0} %
+ {0:N0} frame → {1} · {2} fpslong
+ {0:N0} frames → {1} · {2} fpslong
+ Render plan
+ Playback rate
+ source {0} %
+ Adaptive
+ Constant
+ Interpolated
+ Remapped
+ Discard change
+ Keep editing
+ The last change to {0} could not be saved: {1}long
+ Unsaved change
+ Centred
+ {0}°invariant
+ {0} EVinvariant
+ {0} fpsinvariant
+ {0:N0} frame
+ {0:N0} frames
+ {0}–{1} Kinvariant
+ None
+ {0}invariant
+ Off
+ On
+ {0} pxinvariant
+ {0}invariant
+ {0}×invariant
diff --git a/i18n/en/Export.resx b/i18n/en/Export.resx
index 34850b65..bd544a1a 100644
--- a/i18n/en/Export.resx
+++ b/i18n/en/Export.resx
@@ -4,6 +4,22 @@
2.0System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ APNGinvariant
+ AV1invariant
+ GIFinvariant
+ H.264 Highinvariant
+ HEVC Maininvariant
+ HEVC Main10invariant
+ JPEGinvariant
+ Linear DNG
+ MJPEGinvariant
+ PNGinvariant
+ TIFF 16-bitinvariant
+ APNGinvariant
+ AVIinvariant
+ GIFinvariant
+ Image sequence
+ MP4invariant{0}-bit output is not available with this encoder; encoding at {1}-bit.long; {0} requested bit depth; {1} bit depth usedBit rate capped at {1} bit/s, the maximum of level {0}.long; {0} codec level name; {1} maximum bit rate in bit/sNo {0} encoder on this PC; H.264 is used instead.long; {0} codec name
diff --git a/i18n/en/Tooltips.resx b/i18n/en/Tooltips.resx
index ba7e3fda..c5736197 100644
--- a/i18n/en/Tooltips.resx
+++ b/i18n/en/Tooltips.resx
@@ -20,6 +20,124 @@
DismissOpen the folder with the log filesReturn to the advisor's value
+ Read every frame again and refresh the analysis · Ctrl+Shift+A
+ Read every frame again and refresh the analysis · about {0} · Ctrl+Shift+A
+ An analysis of this sequence is already queued or running
+ Auto: no advice yet, the engine’s default applies; Analyse lets the advisor decide
+ Back to Library
+ An analysis or render of this sequence is running; settings wait until it ends
+ Add a keyframe at the current frame
+ Output aspect ratio; a preset with a fixed size uses its own
+ Horizontal centre of the selected keyframe’s view
+ Vertical centre of the selected keyframe’s view
+ Cuts this share of the frame on that side; aspect and placement then apply inside the crop
+ Zoom keyframes over the sequence: double-click adds · drag moves · Delete removes · arrows nudge
+ This frame already has a keyframe; select it on the curve to edit it
+ Virtual-camera keyframes: zoom and framing at chosen frames, eased in between
+ Select a keyframe on the curve first
+ Moves the crop left or right inside the frame
+ Moves the crop up or down inside the frame
+ Remove the selected keyframe
+ Zoom of the selected keyframe; 1 shows the whole crop, more zooms in and softens
+ Frame-to-frame brightness change before and after the correction
+ Measured luminance against the target curve, sky region and exposure steps
+ Video frames each photo is shown for, cuts marked · click shows that frame
+ Click or drag to show that frame
+ Luma waveform of the frame on screen: exposure and clipping at a glance
+ Luma of the corrected frame across the picture: white at the top, black at the bottom
+ Add this render to the queue and keep editing
+ Apply this sequence preset to every section · {0}
+ Queue every ticked preset as one job; the sequence is prepared once
+ Tick presets on the cards first
+ Average bit rate; more keeps detail and gradients, files grow
+ Video or image codec; 10-bit HEVC keeps sky gradients clean
+ Rec.709 colour; 10-bit avoids banding in skies, HDR is not offered
+ MP4, AVI, GIF, APNG or a folder of images; the codec list follows
+ Encoder on this PC; Auto prefers hardware
+ Where renders go: {0}
+ Frames per second of the video file
+ Auto: the preset’s {0} fps
+ Return to the preset’s frame rate
+ Output height in pixels; empty follows the width · Enter applies, Esc reverts
+ Open Jobs filtered on this sequence
+ Include this preset when Batch queues the render
+ Tokens: {date} {title} {preset} {codec} {width} {height} {fps} · Enter applies, Esc reverts
+ Render with {0}; editing a value makes it Custom
+ Image quality; 95 looks lossless, lower makes smaller files
+ Advisor pick: {0}
+ Enter a size between 16 and 16384 pixels
+ Output width in pixels; empty uses the preset or the source · Enter applies, Esc reverts
+ Removes frame-to-frame brightness flicker; off keeps the camera’s own exposure
+ Turns ISO, shutter and aperture steps into smooth ramps; off keeps the jumps
+ Brightens or darkens the whole video after correction, in stops
+ Sky and landscape get their own curve; off treats the frame as one
+ How much of the measured flicker is removed; 1.0 removes it all
+ Colour temperature range measured over the sequence
+ Frames over which each ISO, shutter or aperture step is spread; 0 keeps the steps
+ Smooths the colour ratios so auto white balance stops flickering while the sunset drift stays
+ Frames used to estimate the flicker-free curve; too short leaves flicker, too long flattens real light changes
+ Click or drag to show a frame; markers show exposure steps, warnings and keyframes
+ Leave this frame out of every render; the photo is not deleted
+ Show the first frame concerned
+ Make this the hero frame; the editor opens on it
+ Use this frame in renders again
+ Sort by this column; click again to reverse
+ Click a row to show the frame
+ Adds blur along the motion like a slower shutter; costs optical flow on every frame
+ Optical flow precision for blur and synthesised frames; Best is the slowest
+ Target shutter angle; 180° is the film look, more smears moving things
+ Frames over which the camera path is smoothed; too high crops more on deliberate pans
+ Removes camera shake by cropping slightly; the crop grows with the shake
+ Not applicable: motion blur is off
+ Not applicable: deflicker is off
+ Not applicable: holy grail is off
+ Not applicable: the frames sit off the daylight locus (night or mixed light)
+ Not applicable: this format is lossless
+ Needs the deep analysis: press Analyse
+ Not applicable: used only by motion blur and interpolated timing
+ Not applicable: stabilisation is off
+ Not applicable: stacking is off
+ Let the advisor set every section from the analysis and list what changed
+ The advisor never stacks on its own: a median erases moving stars
+ Apply the advisor’s heavier choices for this section and list what changed · Ctrl+Z undoes
+ Pause · Space
+ Play the frames · Space; arrows step one frame
+ Show pixels at 1:1 without interpolation · Ctrl+1; Ctrl+0 fits
+ Play ten seconds of the video’s frames with the current settings
+ Wipe compare: original on the left, corrected on the right; drag the line
+ Dim what the output cuts (what I lose)
+ Show the whole frame and darken what the output will cut
+ Hide what the output cuts (how it will look)
+ Close full screen · Esc
+ Full screen at native resolution · Esc closes
+ Show the sky and landscape boundary used by region deflicker
+ Show or hide the shot data
+ Overlay the motion to the next frame measured by the engine
+ Drag the line to compare · drag to pan · wheel zooms · double-click 1:1
+ Render with the selected preset; progress in the job bar · Ctrl+R
+ Fix the file name first: {0}
+ Every frame is excluded: include some in the Frames tab
+ The frame size is unknown: the frames could not be read
+ Working out the render; ready in a moment
+ Show the rendered file in Explorer
+ Choose another preset
+ Return every control of this section to Auto · Ctrl+Z undoes
+ Try to save now; saving is also retried automatically
+ Frames combined into each output frame; trails and smoothing grow with it
+ Median and mean remove noise and moving things; star trails keep the brightest pixels
+ Crop, aspect, virtual camera moves
+ Presets, output, batch, history
+ Deflicker, regions, day-night transitions, white balance
+ Frame table, warnings, exclusions
+ Motion blur, optical flow, stabilisation
+ Median and star-trail stacking
+ Frame rate, timing mode, speed curve
+ Output time to source position: double-click adds a point · drag moves · Delete removes · arrows nudge
+ Scales the timing so the video lasts this long; off keeps the playback rate
+ Constant: one frame per photo; Adaptive: follows capture time; Interpolated: fills gaps; Remapped: follows the curve
+ Photos shown per second of video; more plays the sequence faster
+ Close without the change; the stored settings stay as they were
+ Stay in the editor; saving is retried in the backgroundStop this job; Retry continues later from its last checkpointHide finished jobs from the list; they stay in the historyEvery job
diff --git a/i18n/it/Editor.it.resx b/i18n/it/Editor.it.resx
index a0b523f2..2d7f8f68 100644
--- a/i18n/it/Editor.it.resx
+++ b/i18n/it/Editor.it.resx
@@ -4,5 +4,214 @@
2.0System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ Analizza
+ Analisi in coda
+ Sorgente
+ Indietro
+ Aggiungi chiave
+ Formato
+ Centro orizzontale
+ Centro verticale
+ Ritaglio in basso
+ Ritaglio a sinistra
+ Ritaglio a destra
+ Ritaglio in alto
+ Fotogrammi chiave
+ Chiave {0} di {1} · {2}
+ {0} chiave
+ {0} chiavi
+ Posizione orizzontale
+ Posizione verticale
+ Rimuovi chiave
+ Zoom
+ copertura nuvolosa %
+ Sfarfallio
+ variazione dopo la correzione
+ variazione tra fotogrammi
+ 0%
+ 100%
+ 50%
+ Luminanza
+ luminanza misurata
+ Non ancora analizzata
+ percorso orizzontale
+ percorso verticale
+ fotogrammi video per foto
+ regione del cielo
+ stelle per Mpx
+ salti di esposizione ricevuti
+ Grafico
+ curva obiettivo
+ Forma d’onda
+ luma del fotogramma {0}Scegli una sequenza in Libreria
+ Questa sequenza non è più nell’archivio.
+ I lavori non possono partire finché l’indice dell’archivio non è aperto.
+ Le impostazioni di questa sequenza non sono leggibili.
+ Le impostazioni di questa sequenza sono state modificate altrove nello stesso momento.
+ circa {0}
+ Metti in coda
+ In serie…
+ Scegli cartella…
+ Codec
+ Colore
+ Contenitore
+ Encoder
+ Auto
+ Nome file
+ Fotogrammi/s
+ hardware
+ Altezza
+ Render precedenti: {0} · ultimo {1}
+ Render precedenti: {0} · ultimo {1}
+ cronologia
+ In serie
+ Ancora nessun render
+ Uscita · {0}
+ Preset di esportazione
+ Qualità
+ Qualità {0}
+ Consigliato
+ Renderizza ora
+ Risoluzione
+ Risultato
+ mostra file
+ Salva in
+ exports/ della sequenza
+ Dimensione stimata
+ software
+ Tempo stimato
+ Nessun encoder qui
+ Larghezza
+ Deflicker
+ flicker {0} %
+ Holy grail
+ salto max {0} EV
+ Compensazione
+ Regioni
+ Intensità
+ Temperatura colore
+ Transizioni
+ Bilanciamento uniforme
+ Finestra deflicker
+ Pellicola
+ Bilanciata
+ Massima
+ Bozza
+ Esposizione
+ Note
+ Dimensioni
+ Decodifica
+ Ora
+ Escludi
+ Escludi fotogramma
+ escluso
+ Esclusi
+ Nessuno
+ nero
+ danneggiato
+ duplicato
+ mancante
+ illeggibile
+ bianco
+ copertina
+ Copertina
+ Non impostata
+ Fotogramma {0}
+ Includi
+ Includi fotogramma
+ Nessun avviso
+ anteprima {0}
+ Imposta copertina
+ Avvisi
+ Apertura sequenza
+ Taglio: pausa o vuoto
+ Fotogramma chiave
+ Salto di esposizione {0} EV
+ Salto {0} EV non ricevuto
+ Mosso
+ ritaglio {0} %
+ Qualità del flusso
+ panoramica {0} px/fotogr.
+ tremolio {0} px
+ Angolo otturatore
+ Smussatura percorso
+ Stabilizza
+ {0} impostazione cambiata
+ {0} impostazioni cambiate
+ Niente da cambiare
+ Ottimizza tutto
+ Ottimizza sezione
+ Anteprima
+ Anteprima 10 s
+ Confronta
+ Maschera ritaglio
+ Risultato ritaglio
+ Esci da schermo intero
+ Schermo intero
+ uscita {0}
+ {0} di {1}
+ Pausa
+ Riproduci
+ Regioni
+ Dati di scatto
+ Questo fotogramma non si può leggere.
+ Vettori
+ originale | corretto
+ Auto
+ Orizzonte
+ Luminanza
+ Renderizza · {0}
+ Render completato
+ Render in coda
+ Mostra nella cartella
+ Renderizza
+ Ripristina
+ Torna ad Auto
+ Modifiche non salvate
+ Riprova
+ Sezioni
+ Lunghezza
+ Media
+ Mediana
+ Stacking
+ Nessun campo stellare
+ Campo stellare trovato
+ Scie stellari
+ {0:N0} fotogramma
+ {0:N0} fotogrammi
+ intervallo {0} s
+ sorgente {0}
+ {0} avviso
+ {0} avvisi
+ Inquadratura
+ Esporta
+ Esposizione
+ Fotogrammi
+ Movimento
+ Stacking
+ Tempo
+ Curva di velocità
+ Adatta alla durata
+ Tempi
+ uscita {0} %
+ {0:N0} fotogramma → {1} · {2} fps
+ {0:N0} fotogrammi → {1} · {2} fps
+ Piano di render
+ Velocità
+ sorgente {0} %
+ Adattivo
+ Costante
+ Interpolato
+ Su curva
+ Scarta modifica
+ Continua a modificare
+ L’ultima modifica a {0} non è stata salvata: {1}
+ Modifica non salvata
+ Centrato
+ {0:N0} fotogramma
+ {0:N0} fotogrammi
+ Nessuno
+ Disattivo
+ Attivo
diff --git a/i18n/it/Export.it.resx b/i18n/it/Export.it.resx
index da3ab965..03ca3056 100644
--- a/i18n/it/Export.it.resx
+++ b/i18n/it/Export.it.resx
@@ -4,6 +4,8 @@
2.0System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ DNG lineare
+ Sequenza di immaginiUscita a {0} bit non disponibile con questo encoder; codifica a {1} bit.Bit rate limitato a {1} bit/s, il massimo del livello {0}.Nessun encoder {0} su questo PC; viene usato H.264.
diff --git a/i18n/it/Tooltips.it.resx b/i18n/it/Tooltips.it.resx
index ab58c062..a71de24b 100644
--- a/i18n/it/Tooltips.it.resx
+++ b/i18n/it/Tooltips.it.resx
@@ -20,6 +20,124 @@
ChiudiApri la cartella dei file di logTorna al valore consigliato
+ Rilegge ogni fotogramma e aggiorna l’analisi · Ctrl+Maiusc+A
+ Rilegge ogni fotogramma e aggiorna l’analisi · circa {0} · Ctrl+Maiusc+A
+ Un’analisi di questa sequenza è già in coda o in corso
+ Auto: ancora nessun consiglio, vale il valore predefinito; Analizza lascia decidere al consulente
+ Torna alla Libreria
+ È in corso un’analisi o un render di questa sequenza; le impostazioni attendono la fine
+ Aggiunge una chiave al fotogramma corrente
+ Formato dell’uscita; un preset con dimensioni fisse usa il proprio
+ Centro orizzontale dell’inquadratura della chiave scelta
+ Centro verticale dell’inquadratura della chiave scelta
+ Taglia questa parte del fotogramma su quel lato; formato e posizione valgono poi dentro il ritaglio
+ Fotogrammi chiave dello zoom: doppio clic aggiunge · trascina sposta · Canc rimuove · le frecce spostano di poco
+ Questo fotogramma ha già un fotogramma chiave; selezionalo sulla curva per modificarlo
+ Chiavi della camera virtuale: zoom e inquadratura in fotogrammi scelti, raccordati tra loro
+ Seleziona prima un fotogramma chiave sulla curva
+ Sposta il ritaglio a sinistra o a destra nel fotogramma
+ Sposta il ritaglio in alto o in basso nel fotogramma
+ Rimuove la chiave selezionata
+ Zoom della chiave scelta; 1 mostra tutto il ritaglio, di più ingrandisce e ammorbidisce
+ Variazione di luminosità tra fotogrammi prima e dopo la correzione
+ Luminanza misurata rispetto alla curva obiettivo, regione del cielo e salti di esposizione
+ Fotogrammi video per ogni foto, con i tagli segnati · un clic mostra quel fotogramma
+ Clic o trascina per mostrare quel fotogramma
+ Forma d’onda della luma del fotogramma a schermo: esposizione e clipping a colpo d’occhio
+ Luma del fotogramma corretto lungo l’immagine: bianco in alto, nero in basso
+ Mette in coda questo render; puoi continuare a modificare
+ Applica questo preset di sequenza a tutte le sezioni · {0}
+ Mette in coda i preset spuntati come un unico lavoro; la sequenza si prepara una volta
+ Spunta prima i preset sulle schede
+ Bit rate medio; di più conserva dettagli e sfumature, i file crescono
+ Codec video o immagine; HEVC a 10 bit mantiene pulite le sfumature del cielo
+ Colore Rec.709; 10 bit evitano il banding nel cielo, l’HDR non è disponibile
+ MP4, AVI, GIF, APNG o una cartella di immagini; l’elenco dei codec si adegua
+ Encoder di questo PC; Auto preferisce l’hardware
+ Dove vanno i render: {0}
+ Fotogrammi al secondo del file video
+ Auto: i {0} fps del preset
+ Torna ai fotogrammi al secondo del preset
+ Altezza in pixel; vuoto segue la larghezza · Invio applica, Esc annulla
+ Apre Lavori filtrati su questa sequenza
+ Include questo preset quando In serie mette in coda il render
+ Segnaposto: {date} {title} {preset} {codec} {width} {height} {fps} · Invio applica, Esc annulla
+ Renderizza con {0}; modificare un valore lo rende Personalizzato
+ Qualità dell’immagine; 95 sembra senza perdite, meno fa file più piccoli
+ Scelta del consulente: {0}
+ Inserisci una dimensione tra 16 e 16384 pixel
+ Larghezza in pixel; vuoto usa il preset o la sorgente · Invio applica, Esc annulla
+ Elimina lo sfarfallio di luminosità tra fotogrammi; spento lascia l’esposizione della fotocamera
+ Trasforma i salti di ISO, tempo e diaframma in rampe morbide; spento li lascia
+ Schiarisce o scurisce tutto il video dopo la correzione, in stop
+ Cielo e paesaggio hanno una curva ciascuno; spento tratta il fotogramma come uno
+ Quanto dello sfarfallio misurato viene tolto; 1,0 lo toglie tutto
+ Intervallo di temperatura colore misurato nella sequenza
+ Fotogrammi su cui si distribuisce ogni salto di ISO, tempo o diaframma; 0 lascia i salti
+ Smussa i rapporti di colore: il bilanciamento automatico smette di sfarfallare e la deriva del tramonto resta
+ Fotogrammi usati per stimare la curva senza sfarfallio; troppo corta lo lascia, troppo lunga appiattisce i veri cambi di luce
+ Clic o trascina per mostrare un fotogramma; i segni indicano salti di esposizione, avvisi e fotogrammi chiave
+ Lascia fuori questo fotogramma da ogni render; la foto non viene eliminata
+ Mostra il primo fotogramma interessato
+ Rende questo fotogramma la copertina; l’editor si apre qui
+ Usa di nuovo questo fotogramma nei render
+ Ordina per questa colonna; un altro clic inverte
+ Fai clic su una riga per mostrare il fotogramma
+ Aggiunge mosso lungo il movimento come un tempo più lungo; richiede il flusso ottico su ogni fotogramma
+ Precisione del flusso ottico per mosso e fotogrammi sintetici; Massima è la più lenta
+ Angolo otturatore obiettivo; 180° è l’aspetto cinema, di più impasta ciò che si muove
+ Fotogrammi su cui si smussa il percorso della camera; troppi ritagliano di più nelle panoramiche volute
+ Elimina il tremolio con un leggero ritaglio; il ritaglio cresce col tremolio
+ Non applicabile: il mosso è spento
+ Non applicabile: il deflicker è spento
+ Non applicabile: l’holy grail è spento
+ Non applicabile: i fotogrammi sono fuori dal luogo della luce diurna (notte o luce mista)
+ Non applicabile: questo formato è senza perdite
+ Serve l’analisi approfondita: premi Analizza
+ Non applicabile: serve solo al mosso e ai tempi interpolati
+ Non applicabile: la stabilizzazione è spenta
+ Non applicabile: lo stacking è spento
+ Lascia che il consulente imposti ogni sezione dall’analisi ed elenchi cosa è cambiato
+ Il consulente non fa mai stacking da solo: una mediana cancella le stelle in movimento
+ Applica le scelte più incisive del consulente per questa sezione ed elenca cosa è cambiato · Ctrl+Z annulla
+ Pausa · Spazio
+ Riproduce i fotogrammi · Spazio; le frecce avanzano di uno
+ Mostra i pixel 1:1 senza interpolazione · Ctrl+1; Ctrl+0 adatta
+ Riproduce dieci secondi dei fotogrammi del video con le impostazioni attuali
+ Confronto a tendina: originale a sinistra, corretto a destra; trascina la linea
+ Scurisce ciò che l’uscita taglia (cosa perdo)
+ Mostra tutto il fotogramma e scurisce ciò che l’uscita taglierà
+ Nasconde ciò che l’uscita taglia (come apparirà)
+ Chiudi schermo intero · Esc
+ Schermo intero alla risoluzione nativa · Esc chiude
+ Mostra il confine tra cielo e paesaggio usato dal deflicker per regioni
+ Mostra o nasconde i dati di scatto
+ Sovrappone il movimento verso il fotogramma successivo misurato dal motore
+ Trascina la linea per confrontare · trascina per spostare · la rotellina ingrandisce · doppio clic 1:1
+ Renderizza con il preset scelto; avanzamento nella barra dei lavori · Ctrl+R
+ Correggi prima il nome del file: {0}
+ Tutti i fotogrammi sono esclusi: includine alcuni nella scheda Fotogrammi
+ La dimensione dei fotogrammi è sconosciuta: non è stato possibile leggerli
+ Calcolo del render in corso; pronto tra un attimo
+ Mostra il file del render in Esplora file
+ Scegli un altro preset
+ Riporta in Auto ogni controllo di questa sezione · Ctrl+Z annulla
+ Prova a salvare ora; il salvataggio viene anche ritentato da solo
+ Fotogrammi combinati in ogni fotogramma d’uscita; scie e levigatura crescono con esso
+ Mediana e media tolgono rumore e ciò che si muove; le scie stellari tengono i pixel più luminosi
+ Ritaglio, formato, movimenti della camera virtuale
+ Preset, uscita, serie, cronologia
+ Deflicker, regioni, transizioni giorno-notte, bilanciamento del bianco
+ Tabella dei fotogrammi, avvisi, esclusioni
+ Mosso, flusso ottico, stabilizzazione
+ Stacking a mediana e scie stellari
+ Frequenza fotogrammi, modo dei tempi, curva di velocità
+ Tempo del video verso posizione nella sequenza: doppio clic aggiunge un punto · trascina sposta · Canc rimuove · le frecce spostano di poco
+ Scala i tempi perché il video duri così; spento mantiene la velocità
+ Costante: un fotogramma per foto; Adattivo: segue l’ora di scatto; Interpolato: riempie i vuoti; Su curva: segue la curva
+ Foto mostrate per secondo di video; di più accelera la sequenza
+ Chiude senza la modifica; le impostazioni salvate restano com’erano
+ Resta nell’editor; il salvataggio viene ritentato in backgroundFerma questa attività; Riprova la continua più tardi dall'ultimo punto di ripresaNasconde le attività concluse dall'elenco; restano nella cronologiaTutte le attività
diff --git a/src/Titano.App/DesignTime/SampleData.cs b/src/Titano.App/DesignTime/SampleData.cs
index 348785f7..6f7afad2 100644
--- a/src/Titano.App/DesignTime/SampleData.cs
+++ b/src/Titano.App/DesignTime/SampleData.cs
@@ -1,14 +1,24 @@
using System.IO;
using System.Net;
using Titano.App.About;
+using Titano.App.Editor;
using Titano.App.Infrastructure;
using Titano.App.Server;
using Titano.App.Settings;
+using Titano.Core.Advice;
+using Titano.Core.Analysis;
+using Titano.Core.Analysis.Deep;
+using Titano.Core.Archiving;
using Titano.Core.Codecs.Jpeg;
+using Titano.Core.Diagnostics.Synthetic;
using Titano.Core.Imaging;
+using Titano.Core.Imaging.Decoders;
+using Titano.Core.Metadata;
using Titano.Core.Model;
+using Titano.Core.Project;
using Titano.Core.Video;
using Titano.Data;
+using Titano.Data.Archiving;
using Titano.Data.Jobs;
using Titano.Data.Sync;
using Titano.Protocol;
@@ -195,6 +205,180 @@ public sealed class SampleData
"""{"exposure":{"deflickerWindow":{"isAuto":false,"manual":""" + frames.ToString(System.Globalization.CultureInfo.InvariantCulture) + "}}}";
}
+ ///
+ /// The sequence editor's sample: a second archive holding a synthetic harbour sunset of real JPEG frames with Exif
+ /// (flicker, two received exposure steps, white-balance drift, a horizon), indexed by a scan, analysed (light and
+ /// deep, saved as analysis.json), advised into project.json with one manual value and three camera
+ /// keyframes, and given two past renders.
+ ///
+ /// The sequence id to open in the editor.
+ public async Task FillEditorAsync()
+ {
+ var db = _db ?? throw new InvalidOperationException("OpenEmptyAsync first.");
+ var archives = _services.Archives ?? throw new InvalidOperationException("The archive engine is not attached.");
+ var root = Path.Combine(_services.Environment.DataDirectory, "editor-archive");
+ var archive = await archives.CreateAsync(root, "Editor sample");
+ var sunset = SyntheticSequence.Create(EditorSunset);
+ var folder = Path.Combine(root, "2026", "2026-09-28 Canon EOS R5");
+ Directory.CreateDirectory(folder);
+ for (var i = 0; i < sunset.Count; i++)
+ {
+ using var image = SunsetFrame(sunset, i);
+ var exif = ExifWriter.BuildJpegApp1(sunset.Metadata[i]);
+ File.WriteAllBytes(Path.Combine(folder, $"IMG_{4211 + i:0000}.JPG"), JpegEncoder.Encode(image, new JpegEncodeOptions { Quality = 88, App1Segments = [exif[4..]] }));
+ }
+ await archives.Indexer.ScanAsync(archive, ScanMode.Full, null, _ => ValueTask.CompletedTask, CancellationToken.None);
+ var id = (await db.Sequences.ListLocationsAsync(archive.Id)).Single().Id;
+ await archives.SetSequenceInfoAsync(id, "Harbour sunset", ["sunset", "harbour"], 4, null);
+
+ var source = new LocalSequenceSource(db, id, DecoderFactory.CreateClient(null), null);
+ var content = await source.LoadAsync(CancellationToken.None);
+ var deep = await DeepAnalyzer.AnalyzeAsync(new SunsetFrames(sunset));
+ var sequence = content.Sequence;
+ deep.Save(new ArchivePaths(root).Sequence(sequence.Folder).AnalysisPath);
+ var advice = Advisor.Recommend(content.Light, deep, SequenceContext.FromFrames(content.Frames));
+ // As a user leaves it: the advice applied, one value taken over by hand (Sun track) and a slow push-in.
+ var advised = Advisor.Apply(content.Project, advice);
+ var project = advised with
+ {
+ Exposure = advised.Exposure with { DeflickerStrength = advised.Exposure.DeflickerStrength.WithManual(0.8) },
+ Camera = advised.Camera with { Keyframes = [new CameraKey(0, 0.5, 0.5, 1, 0), new CameraKey(48, 0.6, 0.46, 1.4, 0), new CameraKey(95, 0.64, 0.4, 1.9, 0)] },
+ };
+ await source.SaveProjectAsync(project, content.Project, CancellationToken.None);
+ await db.Sequences.RecordAnalysisAsync(id, SequenceStatus.AnalyzedLight | SequenceStatus.AnalyzedDeep | SequenceStatus.HasWarnings, SequenceStatus.None,
+ advice.Findings.Count(f => f.Severity >= FindingSeverity.Warning), AnalysisSummary.From(deep).ToJson());
+ foreach (var (preset, codec, width, height, daysAgo, bytes) in new[] { ("4K archive", "hevc", 3840, 2160, 7, 2_210_000_000L), ("1080p share", "h264", 1920, 1080, 3, 412_000_000L) })
+ {
+ await db.Renders.InsertAsync(new Render
+ {
+ Id = Guid.CreateVersion7(),
+ SequenceId = id,
+ PresetName = preset,
+ OutputPath = Path.Combine(folder, "exports", $"2026-09-28 Harbour sunset - {preset}.mp4"),
+ Codec = codec,
+ Width = width,
+ Height = height,
+ Fps = 24,
+ DurationSeconds = 5,
+ Bytes = bytes,
+ Created = DateTimeOffset.UtcNow.AddDays(-daysAgo),
+ ProducedBy = "studio-pc",
+ });
+ }
+ return id;
+ }
+
+ /// A deep analysis of half way through: the editor's busy state (settings wait, viewing stays live).
+ public async Task MarkAnalysingAsync(Guid sequenceId)
+ {
+ var db = _db ?? throw new InvalidOperationException("OpenEmptyAsync first.");
+ var now = DateTimeOffset.UtcNow;
+ await db.Jobs.EnqueueAsync(new Job
+ {
+ Id = Guid.CreateVersion7(),
+ Kind = JobKind.DeepAnalyse,
+ TargetIds = [sequenceId],
+ TargetLabel = "Harbour sunset",
+ State = JobState.Running,
+ Priority = JobPriority.User,
+ ProgressDone = 40,
+ ProgressTotal = 96,
+ ItemsPerSecond = 12,
+ NodeId = Environment.MachineName,
+ Attempts = 1,
+ Created = now.AddSeconds(-5),
+ Started = now.AddSeconds(-4),
+ });
+ }
+
+ /// A two-minute sunset at 2 s intervals: darkening scene, flicker, two shutter steps the pixels received, warming light.
+ private static readonly SyntheticSequenceOptions EditorSunset = new()
+ {
+ Width = 600,
+ Height = 400,
+ FrameCount = 96,
+ Seed = 28,
+ Start = new DateTime(2026, 9, 28, 18, 2, 11),
+ IntervalSeconds = 2,
+ StartEv = 0.5,
+ EndEv = -2.5,
+ FlickerEv = 0.12,
+ ExposureSteps = [new SyntheticExposureStep(32, -1), new SyntheticExposureStep(64, -1)],
+ HorizonFraction = 0.62,
+ HorizonWave = 0.02,
+ SkyLevel = 0.32,
+ LandLevel = 0.06,
+ StartKelvin = 5600,
+ EndKelvin = 3200,
+ WhiteBalanceJitter = 0.03,
+ NoiseSigma = 0.002,
+ BaseExposureTime = 1.0 / 125,
+ BaseFNumber = 8,
+ BaseIso = 100,
+ CameraMake = "Canon",
+ CameraModel = "Canon EOS R5",
+ Lens = "RF15-35mm F2.8 L IS USM",
+ };
+
+ ///
+ /// The synthetic frame (its exposure truth: scene, steps, flicker, white balance) coloured as a harbour sunset: a
+ /// blue-to-amber sky gradient normalised to unit luminance, so the measured luminance keeps the truth, and a setting sun.
+ ///
+ private static ImageBuffer SunsetFrame(SyntheticSequence sequence, int index)
+ {
+ var image = sequence.Render(index);
+ var (w, h) = (image.Width, image.Height);
+ var t = index / (double)(sequence.Count - 1);
+ var horizon = sequence.Options.HorizonFraction * h;
+ var (sunX, sunY) = (w * 0.64, h * (0.28 + 0.3 * t));
+ var gain = Math.Pow(2, sequence.SceneEv[index] + sequence.ExposureOffsetEv[index] + sequence.FlickerEv[index]);
+ double[][] sky = [Linear("#2A2F6B"), Linear("#8E3F57"), Linear("#E07A48"), Linear("#F5B45E")];
+ var land = Linear("#3A3540");
+ for (var y = 0; y < h; y++)
+ {
+ double[] colour;
+ if (y < horizon)
+ {
+ var f = y / horizon * (sky.Length - 1);
+ var k = Math.Min((int)f, sky.Length - 2);
+ colour = [.. Enumerable.Range(0, 3).Select(c => sky[k][c] + (sky[k + 1][c] - sky[k][c]) * (f - k))];
+ }
+ else
+ {
+ colour = land;
+ }
+ var luminance = 0.2126 * colour[0] + 0.7152 * colour[1] + 0.0722 * colour[2];
+ for (var x = 0; x < w; x++)
+ {
+ var d = Math.Sqrt((x - sunX) * (x - sunX) + (y - sunY) * (y - sunY));
+ var sun = y < horizon ? gain * 4 * Math.Exp(-d * d / 220) : 0;
+ for (var c = 0; c < 3; c++)
+ {
+ var plane = image.Plane(c);
+ plane[y * w + x] = (float)(plane[y * w + x] * colour[c] / luminance + sun * (c == 0 ? 1.0 : c == 1 ? 0.75 : 0.45));
+ }
+ }
+ }
+ return image;
+ }
+
+ private static double[] Linear(string hex)
+ {
+ var rgb = Convert.FromHexString(hex.TrimStart('#'));
+ return [.. rgb.Select(v => ColorSpace.SrgbToLinear(v / 255.0))];
+ }
+
+ /// The sunset as the deep analysis reads it (the pixels written to the JPEGs, before compression).
+ private sealed class SunsetFrames(SyntheticSequence sequence) : IFrameSource
+ {
+ public int Count => sequence.Count;
+
+ public LightFrame Metadata(int index) => LightFrame.From(sequence.Metadata[index], index);
+
+ public ValueTask LoadAsync(int index, int maxLongEdge, CancellationToken cancellationToken) =>
+ ValueTask.FromResult(SunsetFrame(sequence, index));
+ }
+
private IEnumerable<(Sequence Sequence, string[] Colours, bool Raw)> Sequences(Guid archiveId)
{
var now = new DateTime(2026, 9, 28, 18, 2, 11);
@@ -456,14 +640,14 @@ public sealed class SampleData
lock (_sequences) return Task.FromResult(_sequences[id].Dto);
}
- public Task GetManifestAsync(Guid id, CancellationToken cancellationToken)
+ public Task GetManifestAsync(Guid id, CancellationToken cancellationToken)
{
lock (_sequences)
{
var (dto, settings, frames) = _sequences[id];
var hasProxy = (dto.Status & (long)SequenceStatus.ProxiesBuilt) != 0;
var created = new DateTimeOffset(2026, 9, 20, 21, 0, 0, TimeSpan.Zero);
- return Task.FromResult(new SequenceManifest(id, dto.FramesVersion, dto.SettingsVersion, settings, dto.Tags,
+ return Task.FromResult(new Protocol.SequenceManifest(id, dto.FramesVersion, dto.SettingsVersion, settings, dto.Tags,
[.. frames.Select((frame, i) => new ManifestFrame(frame, i, $"IMG_{i + 1:0000}.JPG", 24_000_000,
Convert.ToHexStringLower(System.Security.Cryptography.SHA256.HashData(BitConverter.GetBytes(i))), hasProxy, true))],
[.. Enumerable.Range(0, dto.RenderedCount).Select(i => new RenderDto(Guid.CreateVersion7(), i == 0 ? "4K HEVC" : "1080p H.264", "hevc",
diff --git a/src/Titano.App/Editor/CameraTab.cs b/src/Titano.App/Editor/CameraTab.cs
new file mode 100644
index 00000000..b346e4ca
--- /dev/null
+++ b/src/Titano.App/Editor/CameraTab.cs
@@ -0,0 +1,339 @@
+using System.Collections.ObjectModel;
+using System.Windows;
+using System.Windows.Input;
+using Titano.App.Infrastructure;
+using Titano.Core.Advice;
+using Titano.Core.Export;
+using Titano.Core.Localization;
+using Titano.Core.Mathematics;
+using Titano.Core.Project;
+using Titano.Ui.Mvvm;
+using Titano.Ui.Visuals;
+
+namespace Titano.App.Editor;
+
+///
+/// Camera (BRIEF §12.3): the free crop of the frame (margins), the output aspect and its placement inside the crop, and
+/// virtual-camera keyframes edited as a zoom curve over the sequence (X = frame, Y = zoom) with the selected keyframe's
+/// framing below.
+///
+public sealed class CameraTab : EditorTab
+{
+ /// Zoom at the top of the curve editor.
+ public const double MaxZoom = 4;
+
+ private int _selectedKey = -1;
+
+ public CameraTab(EditorViewModel editor)
+ : base(editor, "Camera", AdvisorSection.Camera)
+ {
+ var s = editor.Session;
+ Rows =
+ [
+ CropRow(s, CropSide.Left, "Editor.Camera.CropLeft"),
+ CropRow(s, CropSide.Right, "Editor.Camera.CropRight"),
+ CropRow(s, CropSide.Top, "Editor.Camera.CropTop"),
+ CropRow(s, CropSide.Bottom, "Editor.Camera.CropBottom"),
+ new AutoChoiceRow(s, EditorSettings.Aspect, "Editor.Camera.Aspect", "Tooltips.Editor.Camera.Aspect",
+ [
+ new Choice("source", "Editor.Aspect.Source"), new Choice("16:9", "Editor.Aspect.Ratio", "16:9"), new Choice("21:9", "Editor.Aspect.Ratio", "21:9"),
+ new Choice("4:3", "Editor.Aspect.Ratio", "4:3"), new Choice("3:2", "Editor.Aspect.Ratio", "3:2"), new Choice("1:1", "Editor.Aspect.Ratio", "1:1"),
+ new Choice("9:16", "Editor.Aspect.Ratio", "9:16"), new Choice("4:5", "Editor.Aspect.Ratio", "4:5"),
+ ]),
+ new NumberRow(s, "Editor.Camera.OffsetX", "Tooltips.Editor.Camera.OffsetX", -1, 1, 0.05, p => p.Camera.OffsetX,
+ (p, v) => p with { Camera = p.Camera with { OffsetX = v } }, EditorText.Placement),
+ new NumberRow(s, "Editor.Camera.OffsetY", "Tooltips.Editor.Camera.OffsetY", -1, 1, 0.05, p => p.Camera.OffsetY,
+ (p, v) => p with { Camera = p.Camera with { OffsetY = v } }, EditorText.Placement),
+ ];
+ AddKeyCommand = new RelayCommand(AddKey, () => !Editor.IsBusy && Keys.All(k => k.Frame != Editor.CurrentIndex));
+ RemoveKeyCommand = new RelayCommand(RemoveKey, () => !Editor.IsBusy && SelectedKey >= 0);
+ CommitCurveCommand = new RelayCommand(CommitCurve);
+ Refresh();
+ }
+
+ /// Keyframes as curve points: X = frame / (count − 1), Y = (zoom − 1) / ( − 1). Edited in place by the curve editor.
+ public ObservableCollection KeyPoints { get; } = [];
+
+ public int SelectedKey
+ {
+ get => _selectedKey;
+ set
+ {
+ if (!Set(ref _selectedKey, value)) return;
+ OnSelectedKeyChanged();
+ }
+ }
+
+ public bool HasSelectedKey => SelectedKey >= 0 && SelectedKey < Keys.Count;
+
+ /// Framing of the selected keyframe: centre (0–1) and zoom.
+ public double SelectedCenterX
+ {
+ get => HasSelectedKey ? Keys[SelectedKey].CenterX : 0.5;
+ set => EditSelected(k => k with { CenterX = double.Clamp(value, 0, 1) });
+ }
+
+ public double SelectedCenterY
+ {
+ get => HasSelectedKey ? Keys[SelectedKey].CenterY : 0.5;
+ set => EditSelected(k => k with { CenterY = double.Clamp(value, 0, 1) });
+ }
+
+ public double SelectedZoom
+ {
+ get => HasSelectedKey ? Keys[SelectedKey].Zoom : 1;
+ set => EditSelected(k => k with { Zoom = double.Clamp(value, 1, MaxZoom) });
+ }
+
+ public string SelectedZoomText => Loc.L("Editor.Value.Zoom", SelectedZoom.ToString("0.00", Loc.Culture));
+
+ /// "Keyframe 2 of 3 · frame 0413".
+ public string KeyText => HasSelectedKey
+ ? Loc.L("Editor.Camera.KeyOf", SelectedKey + 1, Keys.Count, (Keys[SelectedKey].Frame + 1).ToString("D4", Loc.Culture))
+ : Loc.Plural("Editor.Camera.Keys", Keys.Count);
+
+ public double Playhead => Editor.FrameCount > 1 ? (double)Editor.CurrentIndex / (Editor.FrameCount - 1) : double.NaN;
+
+ public Func XFormatter => x => EditorText.Position((int)double.Round(x * (Editor.FrameCount - 1)), Editor.FrameCount);
+
+ public Func YFormatter { get; } = y => Loc.L("Editor.Value.Zoom", (1 + y * (MaxZoom - 1)).ToString("0.00", Loc.Culture));
+
+ public ICommand AddKeyCommand { get; }
+
+ public ICommand RemoveKeyCommand { get; }
+
+ /// What Add keyframe does, or why it cannot run now.
+ public string AddKeyToolTip => Loc.L(Editor.IsBusy ? "Tooltips.Editor.Busy"
+ : Keys.Any(k => k.Frame == Editor.CurrentIndex) ? "Tooltips.Editor.Camera.KeyExists" : "Tooltips.Editor.Camera.AddKey");
+
+ /// How to edit the keyframe curve, or why it waits.
+ public string CurveToolTip => Loc.L(Editor.IsBusy ? "Tooltips.Editor.Busy" : "Tooltips.Editor.Camera.Curve");
+
+ public string RemoveKeyToolTip => Loc.L(Editor.IsBusy ? "Tooltips.Editor.Busy" : HasSelectedKey ? "Tooltips.Editor.Camera.RemoveKey" : "Tooltips.Editor.Camera.NoKey");
+
+ /// Run by the curve editor after each finished edit.
+ public ICommand CommitCurveCommand { get; }
+
+ /// Keyframes in frame order (the order of ).
+ private List Keys => [.. Editor.Session.Project.Camera.Keyframes.OrderBy(k => k.Frame)];
+
+ public override void Refresh()
+ {
+ base.Refresh();
+ var points = Keys.Select(ToPoint).ToList();
+ if (!points.SequenceEqual(KeyPoints))
+ {
+ KeyPoints.Clear();
+ foreach (var p in points) KeyPoints.Add(p);
+ }
+ if (SelectedKey >= Keys.Count) SelectedKey = Keys.Count - 1;
+ OnSelectedKeyChanged();
+ }
+
+ /// The curve editor finished an edit (add, move, delete): the points become the keyframes, keeping each one's framing.
+ public void CommitCurve()
+ {
+ var old = Keys;
+ var keys = new List();
+ foreach (var point in KeyPoints.OrderBy(p => p.X))
+ {
+ var frame = (int)double.Round(point.X * double.Max(1, Editor.FrameCount - 1));
+ var zoom = 1 + double.Clamp(point.Y, 0, 1) * (MaxZoom - 1);
+ var nearest = old.MinBy(k => int.Abs(k.Frame - frame));
+ keys.Add(nearest is null ? new CameraKey(frame, 0.5, 0.5, zoom, 0) : nearest with { Frame = frame, Zoom = zoom });
+ }
+ Editor.Session.Edit(p => p with { Camera = p.Camera with { Keyframes = [.. keys.DistinctBy(k => k.Frame)] } });
+ }
+
+ public override void OnCurrentFrameChanged()
+ {
+ OnPropertyChanged(nameof(Playhead));
+ OnPropertyChanged(nameof(AddKeyToolTip));
+ }
+
+ public override void OnBusyChanged()
+ {
+ base.OnBusyChanged();
+ OnPropertyChanged(nameof(AddKeyToolTip));
+ OnPropertyChanged(nameof(RemoveKeyToolTip));
+ OnPropertyChanged(nameof(CurveToolTip));
+ }
+
+ /// A margin of the free crop (); all zero = the whole frame.
+ private static NumberRow CropRow(EditorSession session, CropSide side, string headerKey) => new(session, headerKey, "Tooltips.Editor.Camera.Crop", 0,
+ CropMargins.MaxMargin, 0.01, p => CropMargins.Of(p.Camera.Crop)[(int)side],
+ (p, v) => p with { Camera = p.Camera with { Crop = CropMargins.With(p.Camera.Crop, side, v) } }, v => Formatting.Percent(v));
+
+ private Point ToPoint(CameraKey key) => new(Editor.FrameCount > 1 ? (double)key.Frame / (Editor.FrameCount - 1) : 0, (key.Zoom - 1) / (MaxZoom - 1));
+
+ private void AddKey()
+ {
+ var frame = Editor.CurrentIndex;
+ var key = new CameraKey(frame, 0.5, 0.5, 1, 0);
+ Editor.Session.Edit(p => p with { Camera = p.Camera with { Keyframes = [.. p.Camera.Keyframes.Append(key).OrderBy(k => k.Frame)] } });
+ SelectedKey = Keys.FindIndex(k => k.Frame == frame);
+ }
+
+ private void RemoveKey()
+ {
+ if (!HasSelectedKey) return;
+ var frame = Keys[SelectedKey].Frame;
+ Editor.Session.Edit(p => p with { Camera = p.Camera with { Keyframes = [.. p.Camera.Keyframes.Where(k => k.Frame != frame)] } });
+ }
+
+ private void EditSelected(Func change)
+ {
+ if (!HasSelectedKey) return;
+ var index = SelectedKey;
+ Editor.Session.Edit(p =>
+ {
+ var keys = p.Camera.Keyframes.OrderBy(k => k.Frame).ToList();
+ keys[index] = change(keys[index]);
+ return p with { Camera = p.Camera with { Keyframes = keys } };
+ }, "Camera.Key");
+ }
+
+ private void OnSelectedKeyChanged()
+ {
+ OnPropertyChanged(nameof(HasSelectedKey));
+ OnPropertyChanged(nameof(RemoveKeyToolTip));
+ OnPropertyChanged(nameof(SelectedCenterX));
+ OnPropertyChanged(nameof(SelectedCenterY));
+ OnPropertyChanged(nameof(SelectedZoom));
+ OnPropertyChanged(nameof(SelectedZoomText));
+ OnPropertyChanged(nameof(KeyText));
+ }
+}
+
+///
+/// Time (BRIEF §12.3): timing mode, playback rate, fit-to duration, the plan chart (video frames each photo gets, cuts
+/// marked, the plan in numbers) and the time-remap curve (output time → source position, Fritsch–Carlson as the render
+/// evaluates it).
+///
+public sealed class TimeTab : EditorTab
+{
+ private Func? _evaluator;
+ private string? _planText;
+ private IReadOnlyList _planSeries = [];
+ private IReadOnlyList _planMarkers = [];
+
+ public TimeTab(EditorViewModel editor)
+ : base(editor, "Time", AdvisorSection.Timing)
+ {
+ var s = editor.Session;
+ Rows =
+ [
+ new AutoChoiceRow(s, EditorSettings.TimingMode, "Editor.Time.Mode", "Tooltips.Editor.Time.Mode",
+ [
+ new Choice(TimingMode.Constant, "Editor.Timing.Constant"), new Choice(TimingMode.Adaptive, "Editor.Timing.Adaptive"),
+ new Choice(TimingMode.Interpolated, "Editor.Timing.Interpolated"), new Choice(TimingMode.Remapped, "Editor.Timing.Remapped"),
+ ]),
+ new AutoChoiceRow(s, EditorSettings.FrameRate, "Editor.Time.Rate", "Tooltips.Editor.Time.Rate",
+ [.. ExportPresets.FrameRates.Select(r => new Choice(FrameRateText.Format(r), "Editor.Value.Fps", EditorText.FrameRate(r)))]),
+ new NumberRow(s, "Editor.Time.Fit", "Tooltips.Editor.Time.Fit", 0, 600, 5, p => p.Timing.FitToSeconds ?? 0,
+ (p, v) => p with { Timing = p.Timing with { FitToSeconds = v > 0 ? v : null } },
+ v => v > 0 ? Formatting.Duration(TimeSpan.FromSeconds(v)) : Loc.L("Editor.Value.Off")),
+ ];
+ CommitCurveCommand = new RelayCommand(CommitCurve);
+ Refresh();
+ }
+
+ /// Remap control points (output fraction → source fraction), edited in place by the curve editor.
+ public ObservableCollection RemapPoints { get; } = [];
+
+ /// The monotone spline through .
+ public Func? Evaluator { get => _evaluator; private set => Set(ref _evaluator, value); }
+
+ /// Run by the curve editor after each finished edit.
+ public ICommand CommitCurveCommand { get; }
+
+ /// How to edit the remap curve, or why it waits.
+ public string CurveToolTip => Loc.L(Editor.IsBusy ? "Tooltips.Editor.Busy" : "Tooltips.Editor.Time.Curve");
+
+ /// "3,600 frames → 2 min 30 s · 24 fps".
+ public string? PlanText { get => _planText; private set => Set(ref _planText, value); }
+
+ /// Video frames each photo is shown for (0 = skipped by a speed-up, gap = excluded), over the sequence.
+ public IReadOnlyList PlanSeries { get => _planSeries; private set => Set(ref _planSeries, value); }
+
+ /// Cuts of the plan (deliberate pauses, gaps, long exclusion runs).
+ public IReadOnlyList PlanMarkers { get => _planMarkers; private set => Set(ref _planMarkers, value); }
+
+ public IReadOnlyList PlanLegend { get; } = [new(Loc.L("Editor.Chart.Shown"), "Brush.Accent")];
+
+ public Func PlanFormatter { get; } = v => v.ToString("0.#", Loc.Culture);
+
+ public double Playhead => Editor.FrameCount > 1 ? (double)Editor.CurrentIndex / (Editor.FrameCount - 1) : double.NaN;
+
+ public Func XFormatter { get; } = x => Loc.L("Editor.Time.Output", (x * 100).ToString("0", Loc.Culture));
+
+ public Func YFormatter { get; } = y => Loc.L("Editor.Time.Source", (y * 100).ToString("0", Loc.Culture));
+
+ public override void Refresh()
+ {
+ base.Refresh();
+ var curve = Editor.Session.Project.Timing.RemapCurve;
+ var points = curve.Select(p => new Point(p.X, p.Y)).ToList();
+ if (!points.SequenceEqual(RemapPoints))
+ {
+ RemapPoints.Clear();
+ foreach (var p in points) RemapPoints.Add(p);
+ }
+ Evaluator = Spline(points);
+ }
+
+ public override void OnPlanChanged()
+ {
+ if (Editor.Plan is not { } plan)
+ {
+ PlanText = null;
+ PlanSeries = [];
+ PlanMarkers = [];
+ return;
+ }
+ var render = plan.Setup.Plan;
+ PlanText = Loc.Plural("Editor.Time.Plan", render.Frames.Count, Formatting.Duration(TimeSpan.FromSeconds(render.DurationSeconds)),
+ EditorText.FrameRate(render.FrameRate));
+ var shown = new double[Editor.FrameCount];
+ Array.Fill(shown, double.NaN);
+ foreach (var index in render.IncludedFrames) shown[index] = 0;
+ foreach (var frame in render.Frames)
+ {
+ var index = int.Clamp((int)double.Round(frame.SourcePosition), 0, shown.Length - 1);
+ shown[index] = (double.IsNaN(shown[index]) ? 0 : shown[index]) + frame.Slots;
+ }
+ PlanSeries = [new ChartSeries(Loc.L("Editor.Chart.Shown"), shown, "Brush.Accent")];
+ PlanMarkers = [.. render.IncludedFrames.Where(render.IsCutBefore).Select(i => new TimelineMarker(i, MarkerKind.Warning, Loc.L("Editor.Marker.Cut")))];
+ }
+
+ /// The curve editor finished an edit: the points become the remap curve, and the timing mode follows it.
+ public void CommitCurve()
+ {
+ var curve = RemapPoints.OrderBy(p => p.X).Select(p => new CurvePoint(double.Clamp(p.X, 0, 1), double.Clamp(p.Y, 0, 1))).ToList();
+ Editor.Session.Edit(p => p with
+ {
+ Timing = p.Timing with
+ {
+ RemapCurve = curve,
+ Mode = EditorSettings.TimingMode.Effective(p, null) == TimingMode.Remapped ? p.Timing.Mode : p.Timing.Mode.WithManual(TimingMode.Remapped),
+ },
+ });
+ }
+
+ public override void OnCurrentFrameChanged() => OnPropertyChanged(nameof(Playhead));
+
+ public override void OnBusyChanged()
+ {
+ base.OnBusyChanged();
+ OnPropertyChanged(nameof(CurveToolTip));
+ }
+
+ private static Func? Spline(IReadOnlyList points)
+ {
+ if (points.Count < 2) return null;
+ var ordered = points.OrderBy(p => p.X).DistinctBy(p => p.X).ToList();
+ if (ordered.Count < 2) return null;
+ var spline = new MonotoneSpline([.. ordered.Select(p => p.X)], [.. ordered.Select(p => p.Y)]);
+ return x => double.Clamp(spline.Evaluate(x), 0, 1);
+ }
+}
diff --git a/src/Titano.App/Editor/CardColumns.cs b/src/Titano.App/Editor/CardColumns.cs
new file mode 100644
index 00000000..c64190e2
--- /dev/null
+++ b/src/Titano.App/Editor/CardColumns.cs
@@ -0,0 +1,17 @@
+using System.Globalization;
+using System.Windows.Data;
+
+namespace Titano.App.Editor;
+
+/// Columns of the Export tab's preset grid: as many as fit at (four at 1440 px, three at 1200 px).
+public sealed class CardColumns : IValueConverter
+{
+ public const double MinCardWidth = 200;
+
+ public static CardColumns Instance { get; } = new();
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture) =>
+ value is double width && double.IsFinite(width) ? int.Max(1, (int)(width / MinCardWidth)) : 4;
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotSupportedException();
+}
diff --git a/src/Titano.App/Editor/CropMargins.cs b/src/Titano.App/Editor/CropMargins.cs
new file mode 100644
index 00000000..d82ab593
--- /dev/null
+++ b/src/Titano.App/Editor/CropMargins.cs
@@ -0,0 +1,37 @@
+namespace Titano.App.Editor;
+
+/// Margins of the free crop, in the order of (opposites differ in the lowest bit).
+public enum CropSide
+{
+ Left,
+ Right,
+ Top,
+ Bottom,
+}
+
+///
+/// The Camera tab's crop margins over CameraSettings.Crop (a normalised x, y, width, height rectangle, null for the
+/// whole frame): each margin at most , opposite margins leaving at least .
+///
+public static class CropMargins
+{
+ public const double MaxMargin = 0.45;
+
+ public const double MinSize = 0.1;
+
+ /// Left, right, top and bottom margins of (zeros for none or an invalid one, which the render ignores too).
+ public static double[] Of(double[]? crop) => crop is [var x, var y, var w, var h] && double.IsFinite(x + y + w + h)
+ ? [double.Clamp(x, 0, 1), double.Clamp(1 - x - w, 0, 1), double.Clamp(y, 0, 1), double.Clamp(1 - y - h, 0, 1)]
+ : [0, 0, 0, 0];
+
+ /// with one margin changed; null when no margin is left (the whole frame).
+ public static double[]? With(double[]? crop, CropSide side, double value)
+ {
+ var margins = Of(crop);
+ var opposite = (int)side ^ 1;
+ margins[(int)side] = double.Clamp(value, 0, double.Min(MaxMargin, 1 - MinSize - margins[opposite]));
+ if (margins.All(m => m == 0)) return null;
+ var (left, right, top, bottom) = (margins[0], margins[1], margins[2], margins[3]);
+ return [left, top, 1 - left - right, 1 - top - bottom];
+ }
+}
diff --git a/src/Titano.App/Editor/CurveCommit.cs b/src/Titano.App/Editor/CurveCommit.cs
new file mode 100644
index 00000000..5c79f29d
--- /dev/null
+++ b/src/Titano.App/Editor/CurveCommit.cs
@@ -0,0 +1,28 @@
+using System.Windows;
+using System.Windows.Input;
+using Titano.Ui.Visuals;
+
+namespace Titano.App.Editor;
+
+/// Runs a command after every finished edit of a (add, move, delete, nudge).
+public static class CurveCommit
+{
+ public static readonly DependencyProperty CommandProperty = DependencyProperty.RegisterAttached(
+ "Command", typeof(ICommand), typeof(CurveCommit), new PropertyMetadata(null, OnCommandChanged));
+
+ public static ICommand? GetCommand(DependencyObject d) => (ICommand?)d.GetValue(CommandProperty);
+
+ public static void SetCommand(DependencyObject d, ICommand? value) => d.SetValue(CommandProperty, value);
+
+ private static void OnCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ if (d is not CurveEditor editor) return;
+ editor.EditCompleted -= OnEditCompleted;
+ if (e.NewValue is not null) editor.EditCompleted += OnEditCompleted;
+ }
+
+ private static void OnEditCompleted(object sender, RoutedEventArgs e)
+ {
+ if (GetCommand((DependencyObject)sender) is { } command && command.CanExecute(null)) command.Execute(null);
+ }
+}
diff --git a/src/Titano.App/Editor/EditorImages.cs b/src/Titano.App/Editor/EditorImages.cs
new file mode 100644
index 00000000..ce709f30
--- /dev/null
+++ b/src/Titano.App/Editor/EditorImages.cs
@@ -0,0 +1,85 @@
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using Titano.Core.Diagnostics;
+using Titano.Core.Imaging;
+using Titano.Ui.Visuals;
+
+namespace Titano.App.Editor;
+
+/// Linear-light frames as frozen sRGB bitmaps the UI thread can show (created on any thread).
+public static class EditorImages
+{
+ public static BitmapSource ToBitmap(ImageBuffer image)
+ {
+ ArgumentNullException.ThrowIfNull(image);
+ var channels = int.Min(3, image.Channels);
+ var pixels = PixelConvert.ToInterleaved8(image, channels);
+ var format = channels == 1 ? PixelFormats.Gray8 : PixelFormats.Rgb24;
+ var bitmap = BitmapSource.Create(image.Width, image.Height, 96, 96, format, null, pixels, image.Width * channels);
+ bitmap.Freeze();
+ return bitmap;
+ }
+
+ /// A waveform as an opacity mask (white, alpha = density) so the view paints it in a theme brush.
+ public static BitmapSource ToMask(LumaWaveform waveform)
+ {
+ ArgumentNullException.ThrowIfNull(waveform);
+ var pixels = new byte[waveform.Density.Length * 4];
+ for (var i = 0; i < waveform.Density.Length; i++)
+ {
+ var alpha = waveform.Density[i];
+ pixels[4 * i] = pixels[4 * i + 1] = pixels[4 * i + 2] = pixels[4 * i + 3] = alpha;
+ }
+ var bitmap = BitmapSource.Create(waveform.Columns, waveform.Rows, 96, 96, PixelFormats.Pbgra32, null, pixels, waveform.Columns * 4);
+ bitmap.Freeze();
+ return bitmap;
+ }
+}
+
+///
+/// Filmstrip thumbnails decoded through the editor's (embedded previews when large
+/// enough), at most a few at a time so scrolling the strip never floods the decoders.
+///
+public sealed class EditorThumbnails(ISequenceSource source, int count) : IThumbnailSource
+{
+ private readonly SemaphoreSlim _decoders = new(int.Clamp(Environment.ProcessorCount / 2, 2, 6));
+ private int _pending;
+
+ public int Count { get; } = count;
+
+ /// Thumbnails requested and not yet returned (capture and tests wait for them).
+ public int Pending => Volatile.Read(ref _pending);
+
+ public async ValueTask GetAsync(int index, int pixelWidth, CancellationToken cancellationToken)
+ {
+ Interlocked.Increment(ref _pending);
+ try
+ {
+ return await DecodeAsync(index, pixelWidth, cancellationToken);
+ }
+ finally
+ {
+ Interlocked.Decrement(ref _pending);
+ }
+ }
+
+ private async Task DecodeAsync(int index, int pixelWidth, CancellationToken cancellationToken)
+ {
+ await _decoders.WaitAsync(cancellationToken);
+ try
+ {
+ // Long edge for frames up to 16:9 tall or wide; the cache rounds requests, so nearby widths share a decode.
+ using var frame = await source.DecodeAsync(index, int.Clamp(pixelWidth, 32, 512), DecodePurpose.Thumbnail, cancellationToken);
+ return frame is null ? null : EditorImages.ToBitmap(frame);
+ }
+ catch (Exception ex) when (ex is not OperationCanceledException)
+ {
+ Log.Debug("editor", $"No thumbnail for frame {index}: {ex.Message}");
+ return null;
+ }
+ finally
+ {
+ _decoders.Release();
+ }
+ }
+}
diff --git a/src/Titano.App/Editor/EditorMeasures.xaml b/src/Titano.App/Editor/EditorMeasures.xaml
new file mode 100644
index 00000000..cf5f6426
--- /dev/null
+++ b/src/Titano.App/Editor/EditorMeasures.xaml
@@ -0,0 +1,259 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Titano.App/Editor/EditorPanels.xaml b/src/Titano.App/Editor/EditorPanels.xaml
new file mode 100644
index 00000000..0ce71b18
--- /dev/null
+++ b/src/Titano.App/Editor/EditorPanels.xaml
@@ -0,0 +1,443 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Titano.App/Editor/EditorSession.cs b/src/Titano.App/Editor/EditorSession.cs
new file mode 100644
index 00000000..26b79100
--- /dev/null
+++ b/src/Titano.App/Editor/EditorSession.cs
@@ -0,0 +1,211 @@
+using Titano.Core.Advice;
+using Titano.Core.Diagnostics;
+using Titano.Core.Export;
+using Titano.Core.Project;
+using Titano.Core.Video;
+using Titano.Data.Archiving.Jobs;
+using Titano.Data.Processing;
+
+namespace Titano.App.Editor;
+
+///
+/// One sequence open in the editor (BRIEF §12.3): its content, the advisor's view of it (§10.3), the project with undo
+/// and redo, and the actions of every section — edit, Optimise (§10.4), Reset, exclusions and hero, analysis and render
+/// jobs. Every change is saved shortly after it is made (); a change stored meanwhile by
+/// someone else (an analysis job, another client) is merged in. Call from one thread (the UI thread).
+///
+public sealed class EditorSession : IAsyncDisposable
+{
+ public static readonly TimeSpan DefaultSaveDelay = TimeSpan.FromMilliseconds(400);
+
+ /// Sections "Optimise all" walks through, in panel order.
+ public static IReadOnlyList OptimisedSections { get; } =
+ [AdvisorSection.Frames, AdvisorSection.Timing, AdvisorSection.Exposure, AdvisorSection.Motion, AdvisorSection.Camera, AdvisorSection.Export];
+
+ private readonly IReadOnlyList _codecs;
+ private readonly ProjectSaver _saver;
+ private ProjectSettings _basis;
+
+ public EditorSession(ISequenceSource source, SequenceContent content, IReadOnlyList codecs, TimeSpan? saveDelay = null)
+ {
+ ArgumentNullException.ThrowIfNull(source);
+ ArgumentNullException.ThrowIfNull(content);
+ Source = source;
+ _codecs = codecs ?? [];
+ _basis = content.Project;
+ History = new ProjectHistory(content.Project);
+ History.Changed += OnProjectChanged;
+ _saver = new ProjectSaver(SaveAsync, saveDelay ?? DefaultSaveDelay);
+ _saver.Failed += OnSaveFailed;
+ (Content, Context, Advice, Presets) = Analyse(content, _codecs);
+ }
+
+ /// The project changed (edit, undo, redo, Optimise, a merge).
+ public event Action? ProjectChanged;
+
+ /// The sequence was read again (after an analysis): frames, reports, advice and presets.
+ public event Action? ContentChanged;
+
+ /// Saving the project failed (raised once per run of failures; the save is retried until it succeeds).
+ public event Action? SaveFailed;
+
+ public ISequenceSource Source { get; }
+
+ public SequenceContent Content { get; private set; }
+
+ public SequenceContext Context { get; private set; }
+
+ /// The advisor's recommendations and findings for the current analyses.
+ public AdvisorResult Advice { get; private set; }
+
+ /// Sequence presets that fit the content, best first (BRIEF §10.3).
+ public IReadOnlyList Presets { get; private set; }
+
+ public ProjectHistory History { get; }
+
+ public ProjectSettings Project => History.Current;
+
+ /// A change is waiting for its save, being saved, or waiting for a retry after a failed save.
+ public bool HasPendingSave => _saver.HasPendingChanges;
+
+ /// Why the pending change could not be stored; null when the last save succeeded.
+ public Exception? LastSaveError => _saver.LastError;
+
+ /// Applies as an undoable step; false when it changes nothing.
+ /// Consecutive edits with the same key are one undo step (a slider drag).
+ public bool Edit(Func change, string? mergeKey = null)
+ {
+ ArgumentNullException.ThrowIfNull(change);
+ return History.Apply(change(Project), mergeKey);
+ }
+
+ /// The drag or key press behind a run of merged edits ended ().
+ public void EndEditRun() => History.EndRun();
+
+ public bool Undo() => History.Undo();
+
+ public bool Redo() => History.Redo();
+
+ /// "Optimise section": the advisor's heavier decisions for , one undo step; returns what changed.
+ public IReadOnlyList Optimise(AdvisorSection section) => Optimise([section]);
+
+ /// "Optimise all": every section, one undo step.
+ public IReadOnlyList OptimiseAll() => Optimise(OptimisedSections);
+
+ /// "Reset": the section's Auto settings back to Auto.
+ public bool ResetSection(AdvisorSection section) => Edit(p => EditorSettings.ResetSection(p, section));
+
+ /// Adds frames to, or removes them from, the project's exclusions.
+ public bool SetExcluded(IEnumerable frames, bool excluded)
+ {
+ var chosen = frames.Where(i => (uint)i < (uint)Content.Count).ToHashSet();
+ return Edit(p => p with
+ {
+ ExcludedFrames = excluded ? [.. p.ExcludedFrames.Union(chosen).Order()] : [.. p.ExcludedFrames.Where(i => !chosen.Contains(i))],
+ });
+ }
+
+ /// Makes the hero frame (sequence thumbnail).
+ public bool SetHero(int frame) => (uint)frame < (uint)Content.Count && Edit(p => p with { HeroFrame = frame });
+
+ ///
+ /// Applies a sequence preset (BRIEF §10.3) as one undoable step: its timing, exposure, motion, aspect and export
+ /// preset; the user's frames (exclusions, hero), crop, keyframes, remap curve, exposure offset and output naming stay.
+ ///
+ public bool ApplyPreset(SequencePreset preset)
+ {
+ ArgumentNullException.ThrowIfNull(preset);
+ var s = preset.Settings;
+ return Edit(p => p with
+ {
+ Timing = s.Timing with { RemapCurve = p.Timing.RemapCurve, FitToSeconds = p.Timing.FitToSeconds },
+ Exposure = s.Exposure with { ExposureOffsetEv = p.Exposure.ExposureOffsetEv, HighlightKnee = p.Exposure.HighlightKnee },
+ Motion = s.Motion,
+ Camera = p.Camera with { Aspect = s.Camera.Aspect },
+ Export = p.Export with { Preset = s.Export.Preset, Overrides = new ExportOverrides() },
+ });
+ }
+
+ ///
+ /// A render of with the project as it is now (the job embeds it, so a render queued before
+ /// the save lands still renders what the user sees).
+ ///
+ public ArchiveJobRequest RenderRequest(ExportSettings export, bool useProxies = false) =>
+ ProcessingJobs.Render(Content.Sequence, export, Content.SourceWidth, Content.SourceHeight, Project with { Export = export }, useProxies);
+
+ /// The export of the project with preset chosen (own values, no batch).
+ public ExportSettings ExportFor(string presetId) =>
+ Project.Export with { Preset = Project.Export.Preset.WithManual(presetId), Overrides = new ExportOverrides(), Batch = [] };
+
+ public ArchiveJobRequest AnalysisRequest() => ProcessingJobs.DeepAnalysis([Content.Sequence.Id], Content.Sequence.DisplayTitle);
+
+ public Task SubmitAsync(ArchiveJobRequest request, CancellationToken cancellationToken = default) => Source.SubmitAsync(request, cancellationToken);
+
+ /// Reads the sequence again (an analysis finished): new reports and advice, the stored project merged into the open one.
+ public async Task ReloadAsync(CancellationToken cancellationToken = default)
+ {
+ await _saver.FlushAsync();
+ var content = await Source.LoadAsync(cancellationToken);
+ var merged = ProjectMerge.Merge(_basis, Project, content.Project);
+ _basis = content.Project;
+ (Content, Context, Advice, Presets) = Analyse(content, _codecs);
+ History.Replace(merged);
+ ContentChanged?.Invoke();
+ }
+
+ /// Stores pending changes now; false when the save failed (the change stays pending and is retried).
+ public Task FlushAsync() => _saver.FlushAsync();
+
+ ///
+ /// Stores what is pending one last time, stops retrying and releases the source; callers that must not lose an edit
+ /// flush and ask first (SequenceViewModel.ConfirmCloseAsync).
+ ///
+ public async ValueTask DisposeAsync()
+ {
+ History.Changed -= OnProjectChanged;
+ if (!await _saver.FlushAsync()) Log.Warning("editor", $"The last change of {Content.Sequence.DisplayTitle} was not saved", _saver.LastError);
+ _saver.Stop();
+ await Source.DisposeAsync();
+ }
+
+ private static (SequenceContent, SequenceContext, AdvisorResult, IReadOnlyList) Analyse(SequenceContent content,
+ IReadOnlyList codecs)
+ {
+ var context = SequenceContext.FromFrames(content.Frames, codecs);
+ return (content, context, Advisor.Recommend(content.Light, content.Deep, context), SequencePresets.Generate(content.Light, content.Deep, context));
+ }
+
+ private IReadOnlyList Optimise(IReadOnlyList sections)
+ {
+ var settings = Project;
+ var changes = new List();
+ foreach (var section in sections)
+ {
+ var result = Advisor.Optimise(section, settings, Advice);
+ settings = result.Settings;
+ changes.AddRange(result.Changes);
+ }
+ History.Apply(settings);
+ return changes;
+ }
+
+ private void OnSaveFailed(Exception ex, int failures)
+ {
+ Log.Warning("editor", $"Saving the project of {Content.Sequence.DisplayTitle} failed (attempt {failures})", ex);
+ if (failures == 1) SaveFailed?.Invoke(ex);
+ }
+
+ private void OnProjectChanged()
+ {
+ _saver.Schedule(Project);
+ ProjectChanged?.Invoke();
+ }
+
+ private async Task SaveAsync(ProjectSettings project)
+ {
+ var stored = await Source.SaveProjectAsync(project, _basis, CancellationToken.None);
+ _basis = stored;
+ // Someone else's change was merged in: show it without an undo step (edits made since the save are kept).
+ if (!ProjectMerge.SameValues(stored, project)) History.Replace(ProjectMerge.Merge(project, Project, stored));
+ }
+}
diff --git a/src/Titano.App/Editor/EditorSettings.cs b/src/Titano.App/Editor/EditorSettings.cs
new file mode 100644
index 00000000..bfa047bb
--- /dev/null
+++ b/src/Titano.App/Editor/EditorSettings.cs
@@ -0,0 +1,131 @@
+using Titano.Core.Advice;
+using Titano.Core.Analysis;
+using Titano.Core.Analysis.Deep;
+using Titano.Core.Export;
+using Titano.Core.Motion;
+using Titano.Core.Project;
+
+namespace Titano.App.Editor;
+
+/// An advisor-decided setting of the editor, whatever its value type.
+public interface IAutoSetting
+{
+ /// id.
+ string Id { get; }
+
+ AdvisorSection Section { get; }
+
+ bool IsAuto(ProjectSettings project);
+
+ /// Drops the manual value so the advice applies.
+ ProjectSettings Reset(ProjectSettings project);
+}
+
+///
+/// One member of the project (BRIEF §10.4) and the value the engine uses when the advisor has
+/// none (, from the deep analysis when it measured one).
+///
+public sealed class AutoSetting(
+ string id,
+ AdvisorSection section,
+ Func> get,
+ Func, ProjectSettings> set,
+ Func fallback) : IAutoSetting
+ where T : notnull
+{
+ public string Id { get; } = id;
+
+ public AdvisorSection Section { get; } = section;
+
+ public Auto Get(ProjectSettings project) => get(project);
+
+ public bool IsAuto(ProjectSettings project) => get(project).IsAuto;
+
+ /// The advisor's value, else what the engine uses without advice.
+ public T AutoValue(ProjectSettings project, DeepAnalysisReport? deep) => get(project) is { HasAdvice: true, AutoValue: { } advised } ? advised : fallback(project, deep);
+
+ /// The value in force.
+ public T Effective(ProjectSettings project, DeepAnalysisReport? deep) => get(project).Resolve(fallback(project, deep));
+
+ /// Touching the control: the value becomes manual.
+ public ProjectSettings WithManual(ProjectSettings project, T value) => set(project, get(project).WithManual(value));
+
+ public ProjectSettings Reset(ProjectSettings project) => set(project, get(project).Reset());
+}
+
+/// The Auto settings of the editor's sections, in panel order.
+public static class EditorSettings
+{
+ public static readonly AutoSetting TimingMode = new(AdvisorParameters.TimingMode, AdvisorSection.Timing,
+ p => p.Timing.Mode, (p, a) => p with { Timing = p.Timing with { Mode = a } }, (_, _) => Core.Project.TimingMode.Constant);
+
+ /// Playback rate; without a value it equals the export frame rate (DECISIONS: export fps vs playback rate).
+ public static readonly AutoSetting FrameRate = new(AdvisorParameters.FrameRate, AdvisorSection.Timing,
+ p => p.Timing.FrameRate, (p, a) => p with { Timing = p.Timing with { FrameRate = a } },
+ (p, _) => FrameRateText.Format(ExportResolver.Resolve(p.Export).FrameRate));
+
+ public static readonly AutoSetting Deflicker = new(AdvisorParameters.Deflicker, AdvisorSection.Exposure,
+ p => p.Exposure.Deflicker, (p, a) => p with { Exposure = p.Exposure with { Deflicker = a } }, (_, _) => false);
+
+ public static readonly AutoSetting DeflickerWindow = new(AdvisorParameters.DeflickerWindow, AdvisorSection.Exposure,
+ p => p.Exposure.DeflickerWindow, (p, a) => p with { Exposure = p.Exposure with { DeflickerWindow = a } },
+ (_, deep) => deep?.Flicker.RecommendedWindow ?? DeflickerOptions.Default.Window);
+
+ public static readonly AutoSetting DeflickerStrength = new(AdvisorParameters.DeflickerStrength, AdvisorSection.Exposure,
+ p => p.Exposure.DeflickerStrength, (p, a) => p with { Exposure = p.Exposure with { DeflickerStrength = a } }, (_, _) => DeflickerOptions.Default.Strength);
+
+ public static readonly AutoSetting Regions = new(AdvisorParameters.Regions, AdvisorSection.Exposure,
+ p => p.Exposure.Regions, (p, a) => p with { Exposure = p.Exposure with { Regions = a } }, (_, _) => RegionMode.Off);
+
+ public static readonly AutoSetting HolyGrail = new(AdvisorParameters.HolyGrail, AdvisorSection.Exposure,
+ p => p.Exposure.HolyGrail, (p, a) => p with { Exposure = p.Exposure with { HolyGrail = a } }, (_, _) => false);
+
+ public static readonly AutoSetting TransitionLength = new(AdvisorParameters.TransitionLength, AdvisorSection.Exposure,
+ p => p.Exposure.TransitionLength, (p, a) => p with { Exposure = p.Exposure with { TransitionLength = a } },
+ (_, deep) => deep?.Exposure.TransitionLength ?? new HolyGrailOptions().SingleStepTransitionFrames);
+
+ public static readonly AutoSetting WhiteBalance = new(AdvisorParameters.WhiteBalanceSmoothing, AdvisorSection.Exposure,
+ p => p.Exposure.WhiteBalanceSmoothing, (p, a) => p with { Exposure = p.Exposure with { WhiteBalanceSmoothing = a } }, (_, _) => false);
+
+ public static readonly AutoSetting MotionBlur = new(AdvisorParameters.MotionBlur, AdvisorSection.Motion,
+ p => p.Motion.MotionBlur, (p, a) => p with { Motion = p.Motion with { MotionBlur = a } }, (_, _) => false);
+
+ public static readonly AutoSetting ShutterAngle = new(AdvisorParameters.TargetShutterAngle, AdvisorSection.Motion,
+ p => p.Motion.TargetShutterAngle, (p, a) => p with { Motion = p.Motion with { TargetShutterAngle = a } }, (_, _) => 180.0);
+
+ public static readonly AutoSetting FlowQuality = new(AdvisorParameters.FlowQuality, AdvisorSection.Motion,
+ p => p.Motion.FlowQuality, (p, a) => p with { Motion = p.Motion with { FlowQuality = a } }, (_, _) => FlowQualitySetting.Balanced);
+
+ public static readonly AutoSetting Stabilize = new(AdvisorParameters.Stabilize, AdvisorSection.Motion,
+ p => p.Motion.Stabilize, (p, a) => p with { Motion = p.Motion with { Stabilize = a } }, (_, _) => false);
+
+ public static readonly AutoSetting StabilizeSmoothing = new(AdvisorParameters.StabilizeSmoothing, AdvisorSection.Motion,
+ p => p.Motion.StabilizeSmoothing, (p, a) => p with { Motion = p.Motion with { StabilizeSmoothing = a } }, (_, _) => new StabilizerOptions().SmoothingSigma);
+
+ public static readonly AutoSetting Aspect = new(AdvisorParameters.Aspect, AdvisorSection.Camera,
+ p => p.Camera.Aspect, (p, a) => p with { Camera = p.Camera with { Aspect = a } }, (_, _) => "source");
+
+ public static readonly AutoSetting ExportPreset = new(AdvisorParameters.ExportPreset, AdvisorSection.Export,
+ p => p.Export.Preset, (p, a) => p with { Export = p.Export with { Preset = a } }, (_, _) => ExportResolver.DefaultPresetId);
+
+ public static IReadOnlyList All { get; } =
+ [
+ TimingMode, FrameRate, Deflicker, DeflickerWindow, DeflickerStrength, Regions, HolyGrail, TransitionLength, WhiteBalance,
+ MotionBlur, ShutterAngle, FlowQuality, Stabilize, StabilizeSmoothing, Aspect, ExportPreset,
+ ];
+
+ /// "Reset": every Auto setting of back to Auto; stacking (no advice) back to off.
+ public static ProjectSettings ResetSection(ProjectSettings project, AdvisorSection section)
+ {
+ ArgumentNullException.ThrowIfNull(project);
+ foreach (var setting in All)
+ {
+ if (setting.Section == section) project = setting.Reset(project);
+ }
+ return section == AdvisorSection.Stack ? project with { Stack = new StackSettings() } : project;
+ }
+
+ /// True when every Auto setting of is in Auto.
+ public static bool IsSectionAuto(ProjectSettings project, AdvisorSection section) =>
+ All.Where(s => s.Section == section).All(s => s.IsAuto(project));
+}
diff --git a/src/Titano.App/Editor/EditorStyles.xaml b/src/Titano.App/Editor/EditorStyles.xaml
new file mode 100644
index 00000000..dd4dbb9e
--- /dev/null
+++ b/src/Titano.App/Editor/EditorStyles.xaml
@@ -0,0 +1,199 @@
+
+
+
+
+ 17*
+ 10*
+ 9*
+ 12*
+ 320
+
+ 96
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Titano.App/Editor/EditorTab.cs b/src/Titano.App/Editor/EditorTab.cs
new file mode 100644
index 00000000..ef8314ed
--- /dev/null
+++ b/src/Titano.App/Editor/EditorTab.cs
@@ -0,0 +1,92 @@
+using System.Windows.Input;
+using Titano.Core.Advice;
+using Titano.Core.Localization;
+using Titano.Ui.Mvvm;
+
+namespace Titano.App.Editor;
+
+///
+/// One section of the editor (BRIEF §12.3): a tab with its measuring tool below the filmstrip and its settings column on
+/// the right, with "Optimise section" and "Reset". runs after every project change.
+///
+public abstract class EditorTab : LocalizedViewModel
+{
+ protected EditorTab(EditorViewModel editor, string key, AdvisorSection section)
+ {
+ Editor = editor;
+ Key = key;
+ Section = section;
+ OptimiseCommand = new RelayCommand(() => Editor.Optimise(Section), () => CanOptimise && !Editor.IsBusy);
+ ResetCommand = new RelayCommand(() => Editor.Session.ResetSection(Section), () => CanReset && !Editor.IsBusy);
+ }
+
+ public EditorViewModel Editor { get; }
+
+ /// "Frames", "Exposure"… (resource key suffix).
+ public string Key { get; }
+
+ public AdvisorSection Section { get; }
+
+ public string Header => Loc.L("Editor.Tab." + Key);
+
+ public string ToolTip => Loc.L("Tooltips.Editor.Tab." + Key);
+
+ /// Settings rows of the right column (empty for tabs with their own panel).
+ public IReadOnlyList Rows { get; protected init; } = [];
+
+ /// The advisor has heavier decisions for this section (stacking has none).
+ public virtual bool CanOptimise => true;
+
+ public virtual bool CanReset => true;
+
+ /// What Optimise section does, or why it cannot run now.
+ public string OptimiseToolTip => Loc.L(!CanOptimise ? "Tooltips.Editor.OptimiseNone" : Editor.IsBusy ? "Tooltips.Editor.Busy" : "Tooltips.Editor.OptimiseSection");
+
+ public string ResetToolTip => Loc.L(Editor.IsBusy ? "Tooltips.Editor.Busy" : "Tooltips.Editor.ResetSection");
+
+ public ICommand OptimiseCommand { get; }
+
+ public ICommand ResetCommand { get; }
+
+ /// Re-reads the project (any change).
+ public virtual void Refresh()
+ {
+ foreach (var row in Rows) row.Refresh();
+ }
+
+ /// The sequence was read again: new analyses (charts, findings).
+ public virtual void OnContentChanged() => Refresh();
+
+ /// The preview's corrections were prepared for the current settings (target curves).
+ public virtual void OnCorrectionsChanged()
+ {
+ }
+
+ /// The export plan of the project changed (durations, sizes).
+ public virtual void OnPlanChanged()
+ {
+ }
+
+ /// The frame on screen changed (playheads, the frame table, keyframe commands).
+ public virtual void OnCurrentFrameChanged()
+ {
+ }
+
+ /// A job of this sequence started or ended: commands and their tooltips follow.
+ public virtual void OnBusyChanged()
+ {
+ OnPropertyChanged(nameof(OptimiseToolTip));
+ OnPropertyChanged(nameof(ResetToolTip));
+ }
+
+ /// Raises the enabled state of the tab's asynchronous commands (the others follow the command manager).
+ public virtual void RefreshCommands()
+ {
+ }
+
+ public override void Dispose()
+ {
+ foreach (var row in Rows) row.Dispose();
+ base.Dispose();
+ }
+}
diff --git a/src/Titano.App/Editor/EditorText.cs b/src/Titano.App/Editor/EditorText.cs
new file mode 100644
index 00000000..b9830240
--- /dev/null
+++ b/src/Titano.App/Editor/EditorText.cs
@@ -0,0 +1,193 @@
+using System.Collections;
+using System.Globalization;
+using Titano.App.Infrastructure;
+using Titano.Core.Advice;
+using Titano.Core.Export;
+using Titano.Core.Localization;
+using Titano.Core.Model;
+using Titano.Core.Project;
+using Titano.Core.Video;
+
+namespace Titano.App.Editor;
+
+/// The editor's composed texts (header summary, shot data, preset card lines), in the current UI language.
+public static class EditorText
+{
+ private const string Separator = " · ";
+
+ /// "3,600 frames · Canon EOS R5 · 2 s interval · 2 h 00 m · 3 warnings".
+ public static string Summary(SequenceContent content, int warnings)
+ {
+ ArgumentNullException.ThrowIfNull(content);
+ var s = content.Sequence;
+ var parts = new List { Loc.Plural("Editor.Summary.Frames", content.Count) };
+ if (s.CameraModel is { Length: > 0 } camera) parts.Add(camera);
+ if (content.Light.MedianIntervalSeconds is > 0 and var interval) parts.Add(Loc.L("Editor.Summary.Interval", Number(interval)));
+ if (content.Light.CaptureSpan > TimeSpan.Zero) parts.Add(Formatting.Duration(content.Light.CaptureSpan));
+ if (warnings > 0) parts.Add(Loc.Plural("Editor.Summary.Warnings", warnings));
+ return string.Join(Separator, parts);
+ }
+
+ /// "3,600 frames · 24 fps · 2 min 30 s · 3840×2160 · source 8192×5464": what the export makes of the sequence (Export.html header).
+ public static string OutputSummary(SequenceContent content, ExportPlan plan)
+ {
+ ArgumentNullException.ThrowIfNull(content);
+ ArgumentNullException.ThrowIfNull(plan);
+ var render = plan.Setup.Plan;
+ var settings = plan.Setup.Encoder.Settings;
+ var parts = new List
+ {
+ Loc.Plural("Editor.Summary.Frames", content.Count),
+ Loc.L("Editor.Value.Fps", FrameRate(render.FrameRate)),
+ Formatting.Duration(TimeSpan.FromSeconds(render.DurationSeconds)),
+ };
+ if (settings.Width > 0 && settings.Height > 0) parts.Add(Size(settings.Width, settings.Height));
+ if (content.SourceWidth > 0 && content.SourceHeight > 0) parts.Add(Loc.L("Editor.Summary.Source", Size(content.SourceWidth, content.SourceHeight)));
+ return string.Join(Separator, parts);
+ }
+
+ /// "0413 / 3,600 · 18:02:11 · 1/8 s · f/8 · ISO 400 · 24 mm".
+ public static string Shot(Frame frame, int index, int count)
+ {
+ ArgumentNullException.ThrowIfNull(frame);
+ var parts = new List { Position(index, count) };
+ if (frame.CapturedAt is { } at) parts.Add(at.ToString("T", Loc.Culture));
+ if (frame.ExposureTime is > 0 and var t) parts.Add(Shutter(t));
+ if (frame.FNumber is > 0 and var f) parts.Add(Loc.L("Editor.Shot.Aperture", Number(f)));
+ if (frame.Iso is > 0 and var iso) parts.Add(Loc.L("Editor.Shot.Iso", iso));
+ if (frame.FocalLength is > 0 and var mm) parts.Add(Loc.L("Editor.Shot.Focal", Number(mm)));
+ return string.Join(Separator, parts);
+ }
+
+ /// "0413 / 3,600".
+ public static string Position(int index, int count) =>
+ (index + 1).ToString("D4", Loc.Culture) + " / " + count.ToString("N0", Loc.Culture);
+
+ /// "1/250 s", "1/8 s", "2 s".
+ public static string Shutter(double seconds) => seconds >= 0.3
+ ? Loc.L("Editor.Shot.Shutter", Number(seconds))
+ : Loc.L("Editor.Shot.Shutter", "1/" + double.Round(1 / seconds).ToString("0", Loc.Culture));
+
+ /// "MP4 · HEVC Main10 · 3840×2160 · 24 fps".
+ public static string Format(ResolvedExport export, int width, int height)
+ {
+ ArgumentNullException.ThrowIfNull(export);
+ var parts = new List { Loc.L("Export.Container." + VideoCodecInfo.DefaultContainer(export.Codec)), CodecName(export.Codec, export.Profile, export.BitDepth) };
+ if (width > 0 && height > 0) parts.Add(Size(width, height));
+ parts.Add(Loc.L("Editor.Export.Fps", FrameRate(export.FrameRate)));
+ return string.Join(Separator, parts);
+ }
+
+ /// "120 Mb/s · 0.07 bpp · NVENC" for video, "Quality 95 · Titano" for frames.
+ public static string Encoding(ResolvedExport export, long bitRate, string? encoder)
+ {
+ ArgumentNullException.ThrowIfNull(export);
+ var parts = new List();
+ if (!VideoCodecInfo.IsManaged(export.Codec))
+ {
+ parts.Add(BitRate(bitRate));
+ var bpp = export.BitsPerPixel > 0 ? export.BitsPerPixel : ExportPreset.DefaultBitsPerPixel(export.Codec);
+ if (export.BitRate == 0 && bpp > 0) parts.Add(Loc.L("Editor.Export.Bpp", bpp.ToString("0.00", Loc.Culture)));
+ }
+ else if (export.Codec is VideoCodec.Mjpeg or VideoCodec.JpegSequence or VideoCodec.Gif)
+ {
+ parts.Add(Loc.L("Editor.Export.QualityValue", export.Quality));
+ }
+ if (encoder is { Length: > 0 }) parts.Add(encoder);
+ return string.Join(Separator, parts);
+ }
+
+ /// "2.2 GB · about 5 min".
+ public static string Estimate(ExportEstimate estimate)
+ {
+ ArgumentNullException.ThrowIfNull(estimate);
+ return Formatting.Bytes(estimate.Bytes) + Separator + Loc.L("Editor.Export.About", Formatting.Duration(estimate.Time));
+ }
+
+ /// "120 Mb/s".
+ public static string BitRate(long bitsPerSecond) => Loc.L("Editor.Export.Mbps", (bitsPerSecond / 1e6).ToString(bitsPerSecond >= 10_000_000 ? "0" : "0.#", Loc.Culture));
+
+ /// "3840×2160".
+ public static string Size(int width, int height) => width.ToString(Loc.Culture) + "×" + height.ToString(Loc.Culture);
+
+ /// "23.976", "24".
+ public static string FrameRate(Rational rate) => rate.Denominator == 1 ? rate.Numerator.ToString(Loc.Culture) : rate.Value.ToString("0.###", Loc.Culture);
+
+ /// Technical codec name ("H.264 High", "HEVC Main10", "PNG"…).
+ public static string CodecName(VideoCodec codec, CodecProfile profile, int bitDepth) => codec switch
+ {
+ VideoCodec.Hevc when profile == CodecProfile.HevcMain10 || bitDepth > 8 => Loc.L("Export.Codec.HevcMain10"),
+ VideoCodec.Hevc => Loc.L("Export.Codec.Hevc"),
+ VideoCodec.H264 => Loc.L("Export.Codec.H264"),
+ _ => Loc.L("Export.Codec." + codec),
+ };
+
+ /// "+1.0", "−0.7" (EV with a sign).
+ public static string Ev(double ev) => ev.ToString("+0.0;−0.0;0.0", Loc.Culture);
+
+ /// "01:17.2" (minutes, seconds and tenths of a video position).
+ public static string Clock(double seconds)
+ {
+ var t = TimeSpan.FromSeconds(double.Max(0, seconds));
+ return ((int)t.TotalMinutes).ToString("00", Loc.Culture) + ":" + t.Seconds.ToString("00", Loc.Culture) + Loc.Culture.NumberFormat.NumberDecimalSeparator
+ + (t.Milliseconds / 100).ToString(Loc.Culture);
+ }
+
+ /// "Centred", "+0.25" (crop placement −1…1).
+ public static string Placement(double value) => value == 0 ? Loc.L("Editor.Value.Centred") : value.ToString("+0.00;−0.00", Loc.Culture);
+
+ /// The label of an advisor parameter as its control shows it.
+ public static string ParameterLabel(string parameter) => parameter switch
+ {
+ AdvisorParameters.Hero => Loc.L("Editor.Frames.HeroLabel"),
+ AdvisorParameters.Excluded => Loc.L("Editor.Frames.ExcludedLabel"),
+ AdvisorParameters.TimingMode => Loc.L("Editor.Time.Mode"),
+ AdvisorParameters.FrameRate => Loc.L("Editor.Time.Rate"),
+ AdvisorParameters.FitToSeconds => Loc.L("Editor.Time.Fit"),
+ AdvisorParameters.Deflicker => Loc.L("Editor.Exposure.Deflicker"),
+ AdvisorParameters.DeflickerWindow => Loc.L("Editor.Exposure.Window"),
+ AdvisorParameters.DeflickerStrength => Loc.L("Editor.Exposure.Strength"),
+ AdvisorParameters.Regions => Loc.L("Editor.Exposure.Regions"),
+ AdvisorParameters.HolyGrail => Loc.L("Editor.Exposure.HolyGrail"),
+ AdvisorParameters.TransitionLength => Loc.L("Editor.Exposure.Transitions"),
+ AdvisorParameters.WhiteBalanceSmoothing => Loc.L("Editor.Exposure.WhiteBalance"),
+ AdvisorParameters.MotionBlur => Loc.L("Editor.Motion.Blur"),
+ AdvisorParameters.TargetShutterAngle => Loc.L("Editor.Motion.Shutter"),
+ AdvisorParameters.FlowQuality => Loc.L("Editor.Motion.Flow"),
+ AdvisorParameters.Stabilize => Loc.L("Editor.Motion.Stabilize"),
+ AdvisorParameters.StabilizeSmoothing => Loc.L("Editor.Motion.Smoothing"),
+ AdvisorParameters.Aspect => Loc.L("Editor.Camera.Aspect"),
+ AdvisorParameters.OffsetY => Loc.L("Editor.Camera.OffsetY"),
+ AdvisorParameters.ExportPreset => Loc.L("Editor.Export.Preset"),
+ AdvisorParameters.Resolution => Loc.L("Editor.Export.Resolution"),
+ _ => parameter,
+ };
+
+ /// A value of an advisor parameter as its control shows it (the "what changed" toast of Optimise).
+ public static string Value(string parameter, object? value) => (parameter, value) switch
+ {
+ (_, null) => Loc.L("Editor.Value.None"),
+ (AdvisorParameters.Hero, int frame) => Loc.L("Editor.Frames.HeroValue", (frame + 1).ToString("D4", Loc.Culture)),
+ (AdvisorParameters.Aspect, "source") => Loc.L("Editor.Aspect.Source"),
+ (AdvisorParameters.FrameRate, string rate) when FrameRateText.TryParse(rate, out var parsed) => Loc.L("Editor.Value.Fps", FrameRate(parsed)),
+ (AdvisorParameters.FitToSeconds, double seconds) => Formatting.Duration(TimeSpan.FromSeconds(seconds)),
+ (AdvisorParameters.DeflickerWindow or AdvisorParameters.TransitionLength, int frames) => Loc.Plural("Editor.Value.Frames", frames),
+ (AdvisorParameters.DeflickerStrength, double strength) => strength.ToString("0.00", Loc.Culture),
+ (AdvisorParameters.TargetShutterAngle, double degrees) => Loc.L("Editor.Value.Degrees", degrees.ToString("0", Loc.Culture)),
+ (AdvisorParameters.StabilizeSmoothing, double sigma) => Loc.Plural("Editor.Value.Frames", (long)double.Round(sigma)),
+ (AdvisorParameters.OffsetY, double offset) => Placement(offset),
+ (AdvisorParameters.Resolution, string size) => size.Replace('x', '×'),
+ (_, bool on) => Loc.L(on ? "Editor.Value.On" : "Editor.Value.Off"),
+ (_, TimingMode mode) => Loc.L("Editor.Timing." + mode),
+ (_, RegionMode mode) => mode == RegionMode.Off ? Loc.L("Editor.Value.Off") : Loc.L("Editor.Regions." + mode),
+ (_, FlowQualitySetting quality) => Loc.L("Editor.Flow." + quality),
+ (_, string id) when ExportPresets.Find(id) is { } preset => Loc.L(preset.NameKey),
+ (_, string text) => text,
+ (_, double number) => number.ToString("0.##", Loc.Culture),
+ (_, IEnumerable list) => Loc.Plural("Editor.Value.Frames", list.Cast