diff --git a/i18n/en/Editor.resx b/i18n/en/Editor.resx index c212191c..243ae6ed 100644 --- a/i18n/en/Editor.resx +++ b/i18n/en/Editor.resx @@ -4,8 +4,204 @@ 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.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 + Keyframes + Keyframe {0} of {1} · {2} + {0} keyframe + {0} keyframes + Horizontal placement + Vertical placement + Remove keyframe + Zoom + cloud cover % + measured luminance + Not analysed yet + horizontal path + vertical path + sky region + stars per Mpx + exposure steps as received + target curve 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 + 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 + 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 + 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 + Exit full screen + Full screen + output {0} + {0} of {1} + Play + Regions + Shot data + Vectors + original | corrected + Auto + Horizon + Luminance + Render · {0} + Render queued + Render + Reset + Back to Auto + 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 + {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 + Playback rate + source {0} % + Adaptive + Constant + Interpolated + Remapped + Centred + {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 3477a2d4..d2aac8a4 100644 --- a/i18n/en/Export.resx +++ b/i18n/en/Export.resx @@ -4,6 +4,22 @@ 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.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 used Bit rate capped at {1} bit/s, the maximum of level {0}.long; {0} codec level name; {1} maximum bit rate in bit/s No {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 7ca6cbe4..4709ec9f 100644 --- a/i18n/en/Tooltips.resx +++ b/i18n/en/Tooltips.resx @@ -15,6 +15,97 @@ Dismiss Open the folder with the log files Return to the advisor's value + Read every frame again and refresh the analysis; runs as a background job + 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 + Virtual-camera keyframes: zoom and framing at chosen frames, eased in between + 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 + 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 + 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 to see the renders of 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 + Leave this frame out of every render; the photo is not deleted + Show the first frame concerned + Use the frame as the sequence thumbnail + Use this frame in renders again + 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 + Show the whole frame and darken what the output will cut + 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 + Render with the selected preset; progress in the job bar · Ctrl+R + Choose another preset + Return every control of this section to Auto · Ctrl+Z undoes + 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 + 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 Stop this job; Retry continues later from its last checkpoint Hide finished jobs from the list; they stay in the history Every job diff --git a/i18n/it/Editor.it.resx b/i18n/it/Editor.it.resx index f8da3819..b4b30d0c 100644 --- a/i18n/it/Editor.it.resx +++ b/i18n/it/Editor.it.resx @@ -4,8 +4,183 @@ 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.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 + Fotogrammi chiave + Chiave {0} di {1} · {2} + {0} chiave + {0} chiavi + Posizione orizzontale + Posizione verticale + Rimuovi chiave + Zoom + copertura nuvolosa % + luminanza misurata + Non ancora analizzata + percorso orizzontale + percorso verticale + regione del cielo + stelle per Mpx + salti di esposizione ricevuti + curva obiettivo 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. + circa {0} + Metti in coda + In serie… + Scegli cartella… + Codec + Colore + Contenitore + Encoder + Auto + Nome file + Fotogrammi al secondo + 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 + 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 del bianco + 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 + 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 + Esci da schermo intero + Schermo intero + uscita {0} + {0} di {1} + Riproduci + Regioni + Dati di scatto + Vettori + originale | corretto + Auto + Orizzonte + Luminanza + Renderizza · {0} + Render in coda + Renderizza + Ripristina + Torna ad Auto + Sezioni + Lunghezza + Media + Mediana + Stacking + Nessun campo stellare + Campo stellare trovato + Scie stellari + {0:N0} fotogramma + {0:N0} fotogrammi + intervallo {0} s + {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 + Velocità + sorgente {0} % + Adattivo + Costante + Interpolato + Su curva + 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 27aed9a6..c4a1ce9b 100644 --- a/i18n/it/Export.it.resx +++ b/i18n/it/Export.it.resx @@ -4,6 +4,8 @@ 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + DNG lineare + Sequenza di immagini Uscita 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 c81ad08f..eda5c4e9 100644 --- a/i18n/it/Tooltips.it.resx +++ b/i18n/it/Tooltips.it.resx @@ -15,6 +15,97 @@ Chiudi Apri la cartella dei file di log Torna al valore consigliato + Rilegge ogni fotogramma e aggiorna l’analisi; gira come lavoro in background + 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 + Chiavi della camera virtuale: zoom e inquadratura in fotogrammi scelti, raccordati tra loro + 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 + Mette in coda questo render e continui 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 + 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 per vedere i render di 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 + Lascia fuori questo fotogramma da ogni render; la foto non viene eliminata + Mostra il primo fotogramma interessato + Usa il fotogramma come copertina della sequenza + Usa di nuovo questo fotogramma nei render + 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 + Mostra tutto il fotogramma e scurisce ciò che l’uscita taglierà + 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 + Renderizza con il preset scelto; avanzamento nella barra dei lavori · Ctrl+R + Scegli un altro preset + Riporta in Auto ogni controllo di questa sezione · Ctrl+Z annulla + 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 + Velocità, modo dei tempi, curva di velocità + 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 Ferma questa attività; Riprova la continua più tardi dall'ultimo punto di ripresa Nasconde le attività concluse dall'elenco; restano nella cronologia Tutte le attività diff --git a/src/Titano.App/Editor/CameraTab.cs b/src/Titano.App/Editor/CameraTab.cs index 0ef6c3cc..dd52d241 100644 --- a/src/Titano.App/Editor/CameraTab.cs +++ b/src/Titano.App/Editor/CameraTab.cs @@ -41,6 +41,7 @@ public sealed class CameraTab : EditorTab ]; 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(); } @@ -95,12 +96,16 @@ public sealed class CameraTab : EditorTab public ICommand RemoveKeyCommand { get; } - private IReadOnlyList Keys => Editor.Session.Project.Camera.Keyframes; + /// 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.OrderBy(k => k.Frame).Select(ToPoint).ToList(); + var points = Keys.Select(ToPoint).ToList(); if (!points.SequenceEqual(KeyPoints)) { KeyPoints.Clear(); @@ -113,7 +118,7 @@ public sealed class CameraTab : EditorTab /// 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.OrderBy(k => k.Frame).ToList(); + var old = Keys; var keys = new List(); foreach (var point in KeyPoints.OrderBy(p => p.X)) { @@ -136,7 +141,7 @@ public sealed class CameraTab : EditorTab 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.Select((k, i) => (k, i)).First(t => t.k.Frame == frame).i; + SelectedKey = Keys.FindIndex(k => k.Frame == frame); } private void RemoveKey() @@ -195,6 +200,7 @@ public sealed class TimeTab : EditorTab (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(); } @@ -204,6 +210,9 @@ public sealed class TimeTab : EditorTab /// 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; } + /// "3,600 frames → 2 min 30 s · 24 fps". public string? PlanText { get => _planText; private set => Set(ref _planText, value); } 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/EditorMeasures.xaml b/src/Titano.App/Editor/EditorMeasures.xaml new file mode 100644 index 00000000..21d43e4f --- /dev/null +++ b/src/Titano.App/Editor/EditorMeasures.xaml @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Titano.App/Editor/EditorPanels.xaml b/src/Titano.App/Editor/EditorPanels.xaml new file mode 100644 index 00000000..2d1867f3 --- /dev/null +++ b/src/Titano.App/Editor/EditorPanels.xaml @@ -0,0 +1,427 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +