From c08010af876d740b71020893b38de5b62b835785 Mon Sep 17 00:00:00 2001 From: lightscape-jm Date: Wed, 18 Nov 2026 23:30:58 -0600 Subject: [PATCH] feat(clip): Mark this frame opens the frame shown in Annotate Part of #1205 (step 2). In Cut a clip, Mark this frame (F), under the picture, takes the frame shown at the playhead or on the start or end handle, as a full-size PNG from the same seek as the picture, and opens it in Annotate, named after the video and the frame's time. The marked copy is saved next to the video. HDR frames are tone-mapped where FFmpeg has zscale, and Annotate says the colours may look washed out where it doesn't. The time beside Play now shows the time of the frame in the picture, and the label on the picture is gone. Co-Authored-By: Claude Opus 5.5 --- docs/ARCHITECTURE.md | 7 + src/Filee.App/App.axaml.cs | 1 + src/Filee.App/Assets/i18n/ar.json | 6 + src/Filee.App/Assets/i18n/bn-BD.json | 6 + src/Filee.App/Assets/i18n/de.json | 6 + src/Filee.App/Assets/i18n/en.json | 6 + src/Filee.App/Assets/i18n/es.json | 6 + src/Filee.App/Assets/i18n/fa.json | 6 + src/Filee.App/Assets/i18n/fr.json | 6 + src/Filee.App/Assets/i18n/hi.json | 6 + src/Filee.App/Assets/i18n/id.json | 6 + src/Filee.App/Assets/i18n/it.json | 6 + src/Filee.App/Assets/i18n/ja.json | 6 + src/Filee.App/Assets/i18n/ko.json | 6 + src/Filee.App/Assets/i18n/mn.json | 6 + src/Filee.App/Assets/i18n/ne.json | 6 + src/Filee.App/Assets/i18n/pl.json | 6 + src/Filee.App/Assets/i18n/pt-BR.json | 6 + src/Filee.App/Assets/i18n/pt-PT.json | 6 + src/Filee.App/Assets/i18n/ru.json | 6 + src/Filee.App/Assets/i18n/th.json | 6 + src/Filee.App/Assets/i18n/tr.json | 6 + src/Filee.App/Assets/i18n/vi.json | 6 + src/Filee.App/Assets/i18n/zh-CN.json | 6 + src/Filee.App/Assets/i18n/zh-TW.json | 6 + src/Filee.App/Services/AppHost.cs | 2 + src/Filee.App/Services/MarkedFrames.cs | 149 ++++++++ src/Filee.App/Services/VideoFrameSource.cs | 9 + src/Filee.App/Services/WindowService.cs | 71 +++- src/Filee.App/ViewModels/AnnotateViewModel.cs | 75 +++- .../ViewModels/ClipWindowViewModel.cs | 157 +++++++- src/Filee.App/Views/AnnotateWindow.axaml | 5 + src/Filee.App/Views/AnnotateWindow.axaml.cs | 5 + src/Filee.App/Views/ClipWindow.axaml | 136 +++++-- src/Filee.App/Views/ClipWindow.axaml.cs | 6 + src/Filee.Engines/Media/MediaEncoding.cs | 31 +- src/Filee.Engines/Media/VideoFrames.cs | 37 +- tests/Filee.App.Tests/AnnotateWindowTests.cs | 337 ++++++++++++++++ tests/Filee.App.Tests/ClipWindowTests.cs | 359 +++++++++++++++++- tests/Filee.App.Tests/MarkedFramesTests.cs | 187 +++++++++ tests/Filee.App.Tests/RenderTests.cs | 10 +- tests/Filee.Engines.Tests/ExactSeekTests.cs | 148 ++++++++ 42 files changed, 1794 insertions(+), 76 deletions(-) create mode 100644 src/Filee.App/Services/MarkedFrames.cs create mode 100644 tests/Filee.App.Tests/MarkedFramesTests.cs diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index c04b128c3..249790668 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -473,6 +473,13 @@ hidden and Save starts the M4R conversion of that part (`AskedRingtone.Apply`). between parts. A copy's `-ss` is checked where FFmpeg's own copy lands, since each demuxer seeks its own way (an MP4 by decode time, a WMV by a key frame a second), and its end is put where no frame shown before its last is missing. The file header of `KeyFrames.cs` lists the FFmpeg behaviours, and the versions, that this allows for. +- Mark this frame (F, under the picture, #1205) writes the frame in the large picture as a full-size PNG + (`MediaEncoding.StillAt`, found as the picture is, with HDR tone-mapped where FFmpeg has zscale) into a work folder + of its own (`App/Services/MarkedFrames`) and opens it in Annotate (`WindowService.AnnotateFrame`), or adds it there + as the next picture. Annotate saves it where it saves "next to the source", with the video's folder as the source's, + and never replaces or trashes the frame; the frame goes once its marked copy is saved, cancelled or skipped, when + Annotate closes with it unsaved, and when Filee quits. Annotate sits above the clip window, which stays on top, while + frames from it wait. The time beside Play is the time of the frame in the picture. ## Crop video diff --git a/src/Filee.App/App.axaml.cs b/src/Filee.App/App.axaml.cs index bb3ebaa06..440bf099b 100644 --- a/src/Filee.App/App.axaml.cs +++ b/src/Filee.App/App.axaml.cs @@ -235,6 +235,7 @@ private void Start(IClassicDesktopStyleApplicationLifetime desktop) AppHost.Get().Dispose(); AppHost.Get().Dispose(); AppHost.Get().DisposeAsync().AsTask().Wait(TimeSpan.FromSeconds(5)); + AppHost.Get().Dispose(); Filee.App.ViewModels.OllamaModelManagerViewModel.StopFileeStartedServer(); }; diff --git a/src/Filee.App/Assets/i18n/ar.json b/src/Filee.App/Assets/i18n/ar.json index 19b5ed81d..269ad7400 100644 --- a/src/Filee.App/Assets/i18n/ar.json +++ b/src/Filee.App/Assets/i18n/ar.json @@ -395,6 +395,12 @@ "clip.fast": "سريع، دون إعادة ترميز", "clip.fast_hint": "ينسخ الفيديو كما هو: ينتهي في لحظة دون فقدان الجودة، لكن المقطع يبدأ من الإطار المفتاحي الذي يسبق البداية (حتى بضع ثوانٍ قبلها). أوقفه للقص بدقة عند الإطارات المختارة (يعيد الترميز ويستغرق وقتًا أطول).", "clip.hint_keys": "المسافة للتشغيل · C للقص · Del للاقتطاع (فراغ)، Shift+Del للضم فورًا · اسحب عبر الأجزاء أو Ctrl / Shift+نقر لتحديد عدة أجزاء، Ctrl+A للكل · اسحب حافة الجزء لاستعادته أو تقصيره · ← → بمقدار 0.1 ث، ومع Shift ثانية · S / E / P البداية أو النهاية أو المؤشر · Ctrl+Z للتراجع · Z للتكبير · Enter للحفظ · Esc للإغلاق", + "clip.hint_keys_frame": "المسافة للتشغيل · C للقص · Del للاقتطاع (فراغ)، Shift+Del للضم فورًا · اسحب عبر الأجزاء أو Ctrl / Shift+نقر لتحديد عدة أجزاء، Ctrl+A للكل · اسحب حافة الجزء لاستعادته أو تقصيره · ← → بمقدار 0.1 ث، ومع Shift ثانية · S / E / P البداية أو النهاية أو المؤشر · F للتعليق على الإطار · Ctrl+Z للتراجع · Z للتكبير · Enter للحفظ · Esc للإغلاق", + "clip.mark_frame": "التعليق على هذا الإطار", + "clip.mark_frame_hint": "فتح هذا الإطار في «تعليقات» للرسم عليه (F)", + "clip.marking_frame": "جارٍ أخذ الإطار…", + "clip.mark_frame_hdr": "تعذّر تحويل ألوان فيديو HDR هذا، لذا قد يبدو الإطار باهتًا", + "clip.mark_frame_failed": "تعذّر أخذ هذا الإطار", "clip.playhead": "مؤشر التشغيل", "clip.play": "تشغيل مع الصوت (المسافة)", "clip.pause": "إيقاف مؤقت (المسافة)", diff --git a/src/Filee.App/Assets/i18n/bn-BD.json b/src/Filee.App/Assets/i18n/bn-BD.json index 11c166f86..1709a9570 100644 --- a/src/Filee.App/Assets/i18n/bn-BD.json +++ b/src/Filee.App/Assets/i18n/bn-BD.json @@ -409,6 +409,12 @@ "clip.fast": "দ্রুত, পুনঃএনকোডিং ছাড়া", "clip.fast_hint": "ভিডিওটি যেমন আছে তেমনই কপি করে: পলকের মধ্যে শেষ হয় এবং গুণমান নষ্ট হয় না, তবে শুরুর ঠিক আগের কী-ফ্রেম থেকে ক্লিপটি শুরু হয় (কয়েক সেকেন্ড আগে পর্যন্ত)। সুনির্দিষ্ট ফ্রেমে কাটতে এটি বন্ধ করুন (পুনরায় এনকোড করে, বেশি সময় নেয়)।", "clip.hint_keys": "Space চালায় · C কাটে · Del কেটে ফেলে (গ্যাপ রাখে), Shift+Del গ্যাপ পূরণ করে · একাধিক অংশ নির্বাচন করতে ড্র্যাগ করুন বা Ctrl / Shift+ক্লিক করুন, সব নির্বাচনে Ctrl+A · ট্রিম করতে অংশের প্রান্ত ড্র্যাগ করুন · ← → ০.১ সেকেন্ড, Shift দিয়ে ১ সেকেন্ড · S / E / P শুরু, শেষ বা প্লেহেড · Ctrl+Z পূর্বাবস্থায় আনে · Z জুম করে · Enter সংরক্ষণ করে · Esc বন্ধ করে", + "clip.hint_keys_frame": "Space চালায় · C কাটে · Del কেটে ফেলে (গ্যাপ রাখে), Shift+Del গ্যাপ পূরণ করে · একাধিক অংশ নির্বাচন করতে ড্র্যাগ করুন বা Ctrl / Shift+ক্লিক করুন, সব নির্বাচনে Ctrl+A · ট্রিম করতে অংশের প্রান্ত ড্র্যাগ করুন · ← → ০.১ সেকেন্ড, Shift দিয়ে ১ সেকেন্ড · S / E / P শুরু, শেষ বা প্লেহেড · F ফ্রেমে টীকা দেয় · Ctrl+Z পূর্বাবস্থায় আনে · Z জুম করে · Enter সংরক্ষণ করে · Esc বন্ধ করে", + "clip.mark_frame": "এই ফ্রেমে টীকা দিন", + "clip.mark_frame_hint": "এই ফ্রেমটি “টীকা যোগ করুন”-এ খুলে এর উপর আঁকুন (F)", + "clip.marking_frame": "ফ্রেম নেওয়া হচ্ছে…", + "clip.mark_frame_hdr": "এই HDR ভিডিওর রং রূপান্তর করা যায়নি, তাই ফ্রেমটি ফ্যাকাশে দেখাতে পারে", + "clip.mark_frame_failed": "এই ফ্রেমটি নেওয়া যায়নি", "clip.playhead": "প্লেহেড", "clip.play": "শব্দসহ চালান (Space)", "clip.pause": "বিরতি দিন (Space)", diff --git a/src/Filee.App/Assets/i18n/de.json b/src/Filee.App/Assets/i18n/de.json index a0752b95e..9b0ace21f 100644 --- a/src/Filee.App/Assets/i18n/de.json +++ b/src/Filee.App/Assets/i18n/de.json @@ -395,6 +395,12 @@ "clip.fast": "Schnell, ohne erneutes Kodieren", "clip.fast_hint": "Kopiert das Video unverändert: schnell und verlustfrei. Der Clip beginnt jedoch am Schlüsselbild vor dem gewählten Beginn (bis zu wenige Sekunden früher). Deaktivieren, um genau an den gewählten Bildern zu schneiden (kodiert erneut und dauert länger).", "clip.hint_keys": "Leertaste spielt ab · C teilt · Entf schneidet heraus (mit Lücke), Umschalt+Entf schließt die Lücke · zum Mehrfachauswählen über Abschnitte ziehen oder Strg / Umschalt+klicken, Strg+A wählt alle · Abschnitt am Rand kürzen · ← → um 0,1 s, Umschalt um 1 s · S / E / P für Beginn, Ende oder Abspielposition · Strg+Z macht rückgängig · Z zoomt · Eingabe speichert · Esc schließt", + "clip.hint_keys_frame": "Leertaste spielt ab · C teilt · Entf schneidet heraus (mit Lücke), Umschalt+Entf schließt die Lücke · zum Mehrfachauswählen über Abschnitte ziehen oder Strg / Umschalt+klicken, Strg+A wählt alle · Abschnitt am Rand kürzen · ← → um 0,1 s, Umschalt um 1 s · S / E / P für Beginn, Ende oder Abspielposition · F beschriftet das Einzelbild · Strg+Z macht rückgängig · Z zoomt · Eingabe speichert · Esc schließt", + "clip.mark_frame": "Einzelbild beschriften", + "clip.mark_frame_hint": "Dieses Einzelbild in „Beschriften“ öffnen, um darauf zu zeichnen (F)", + "clip.marking_frame": "Einzelbild wird übernommen…", + "clip.mark_frame_hdr": "Die Farben dieses HDR-Videos ließen sich nicht umwandeln, das Einzelbild kann daher blass wirken", + "clip.mark_frame_failed": "Dieses Einzelbild ließ sich nicht übernehmen", "clip.playhead": "Abspielposition", "clip.play": "Mit Ton abspielen (Leertaste)", "clip.pause": "Pause (Leertaste)", diff --git a/src/Filee.App/Assets/i18n/en.json b/src/Filee.App/Assets/i18n/en.json index 3fd090bcc..ee3695e87 100644 --- a/src/Filee.App/Assets/i18n/en.json +++ b/src/Filee.App/Assets/i18n/en.json @@ -404,6 +404,12 @@ "clip.fast": "Fast, no re-encoding", "clip.fast_hint": "Copies the video as it is: done in a moment and nothing is lost, but the clip begins at the key frame before the start (up to a few seconds early). Turn off to cut exactly at the chosen frames (encodes again, takes longer).", "clip.hint_keys": "Space plays · C cuts · Del cuts out (a gap), Shift+Del closes up · drag across pieces or Ctrl / Shift+click to select several, Ctrl+A all · drag a piece's edge to trim it · ← → by 0.1 s, Shift by 1 s · S / E / P start, end or playhead · Ctrl+Z undoes · Z zooms · Enter saves · Esc closes", + "clip.hint_keys_frame": "Space plays · C cuts · Del cuts out (a gap), Shift+Del closes up · drag across pieces or Ctrl / Shift+click to select several, Ctrl+A all · drag a piece's edge to trim it · ← → by 0.1 s, Shift by 1 s · S / E / P start, end or playhead · F marks the frame · Ctrl+Z undoes · Z zooms · Enter saves · Esc closes", + "clip.mark_frame": "Mark this frame", + "clip.mark_frame_hint": "Open this frame in Annotate to draw on it (F)", + "clip.marking_frame": "Taking the frame…", + "clip.mark_frame_hdr": "This HDR video's colours couldn't be converted, so the frame may look washed out", + "clip.mark_frame_failed": "Couldn't take this frame", "clip.playhead": "Playhead", "clip.play": "Play with sound (Space)", "clip.pause": "Pause (Space)", diff --git a/src/Filee.App/Assets/i18n/es.json b/src/Filee.App/Assets/i18n/es.json index 92e0d4239..8bb5430bd 100644 --- a/src/Filee.App/Assets/i18n/es.json +++ b/src/Filee.App/Assets/i18n/es.json @@ -395,6 +395,12 @@ "clip.fast": "Rápido, sin recodificar", "clip.fast_hint": "Copia el vídeo tal cual: listo al instante y sin pérdida, pero el clip empieza en el fotograma clave anterior al inicio (hasta unos segundos antes). Desactívalo para cortar exactamente en los fotogramas elegidos (vuelve a codificar, tarda más).", "clip.hint_keys": "Espacio reproduce · C corta · Supr quita (hueco), Mayús+Supr cierra · arrastra sobre los fragmentos o Ctrl / Mayús+clic para elegir varios, Ctrl+A todos · arrastra el borde de un fragmento para recuperar o recortar · ← → 0,1 s, Mayús 1 s · S / E / P inicio, fin o cabezal · Ctrl+Z deshace · Z acerca · Intro guarda · Esc cierra", + "clip.hint_keys_frame": "Espacio reproduce · C corta · Supr quita (hueco), Mayús+Supr cierra · arrastra sobre los fragmentos o Ctrl / Mayús+clic para elegir varios, Ctrl+A todos · arrastra el borde de un fragmento para recuperar o recortar · ← → 0,1 s, Mayús 1 s · S / E / P inicio, fin o cabezal · F anota el fotograma · Ctrl+Z deshace · Z acerca · Intro guarda · Esc cierra", + "clip.mark_frame": "Anotar este fotograma", + "clip.mark_frame_hint": "Abrir este fotograma en «Anotar» para dibujar sobre él (F)", + "clip.marking_frame": "Tomando el fotograma…", + "clip.mark_frame_hdr": "No se pudieron convertir los colores de este vídeo HDR, así que el fotograma puede verse desvaído", + "clip.mark_frame_failed": "No se pudo tomar este fotograma", "clip.playhead": "Cabezal", "clip.play": "Reproducir con sonido (Espacio)", "clip.pause": "Pausa (Espacio)", diff --git a/src/Filee.App/Assets/i18n/fa.json b/src/Filee.App/Assets/i18n/fa.json index 925321759..a5c0bfebf 100644 --- a/src/Filee.App/Assets/i18n/fa.json +++ b/src/Filee.App/Assets/i18n/fa.json @@ -409,6 +409,12 @@ "clip.fast": "سریع، بدون انکود مجدد", "clip.fast_hint": "ویدیو را همان‌طور که هست کپی می‌کند: در یک لحظه انجام می‌شود و هیچ کیفیتی از دست نمی‌رود، اما کلیپ از فریم کلیدی قبل از شروع آغاز می‌شود (تا چند ثانیه زودتر). این گزینه را خاموش کنید تا دقیقاً از فریم‌های انتخابی برش داده شود (نیاز به انکود مجدد دارد و بیشتر طول می‌کشد).", "clip.hint_keys": "Space پخش می‌کند · C برش می‌دهد · Del حذف می‌کند (شکاف)، Shift+Del جمع می‌کند · کشیدن روی تکه‌ها یا Ctrl/Shift+کلیک برای انتخاب چندگانه، Ctrl+A برای همه · لبه یک تکه را برای برش تنظیم کنید · ← → برای ۰.۱ ثانیه، Shift برای ۱ ثانیه · S / E / P شروع، پایان یا نشانگر · Ctrl+Z واگرد · Z بزرگ‌نمایی · Enter ذخیره · Esc بستن", + "clip.hint_keys_frame": "Space پخش می‌کند · C برش می‌دهد · Del حذف می‌کند (شکاف)، Shift+Del جمع می‌کند · کشیدن روی تکه‌ها یا Ctrl/Shift+کلیک برای انتخاب چندگانه، Ctrl+A برای همه · لبه یک تکه را برای برش تنظیم کنید · ← → برای ۰.۱ ثانیه، Shift برای ۱ ثانیه · S / E / P شروع، پایان یا نشانگر · F یادداشت‌گذاری روی فریم · Ctrl+Z واگرد · Z بزرگ‌نمایی · Enter ذخیره · Esc بستن", + "clip.mark_frame": "یادداشت‌گذاری روی این فریم", + "clip.mark_frame_hint": "باز کردن این فریم در «یادداشت‌گذاری» برای کشیدن روی آن (F)", + "clip.marking_frame": "در حال گرفتن فریم…", + "clip.mark_frame_hdr": "رنگ‌های این ویدیوی HDR تبدیل نشد، پس ممکن است فریم رنگ‌پریده به نظر برسد", + "clip.mark_frame_failed": "گرفتن این فریم ممکن نشد", "clip.playhead": "نشانگر پخش", "clip.play": "پخش با صدا (Space)", "clip.pause": "توقف (Space)", diff --git a/src/Filee.App/Assets/i18n/fr.json b/src/Filee.App/Assets/i18n/fr.json index fcc70ae58..82eb10545 100644 --- a/src/Filee.App/Assets/i18n/fr.json +++ b/src/Filee.App/Assets/i18n/fr.json @@ -404,6 +404,12 @@ "clip.fast": "Rapide, sans réencodage", "clip.fast_hint": "Copie la vidéo telle quelle : c'est instantané et sans perte, mais l'extrait commence à l'image clé avant le début (jusqu'à quelques secondes plus tôt). Désactivez pour couper exactement aux images choisies (réencode, plus long).", "clip.hint_keys": "Espace lit · C coupe · Suppr retire (laisse un vide), Maj+Suppr resserre · glissez sur les morceaux ou Ctrl / Maj+clic pour en choisir plusieurs, Ctrl+A tous · tirez le bord d'un morceau pour le rogner · ← → de 0,1 s, Maj de 1 s · S / E / P début, fin ou tête de lecture · Ctrl+Z annule · Z zoome · Entrée enregistre · Échap ferme", + "clip.hint_keys_frame": "Espace lit · C coupe · Suppr retire (laisse un vide), Maj+Suppr resserre · glissez sur les morceaux ou Ctrl / Maj+clic pour en choisir plusieurs, Ctrl+A tous · tirez le bord d'un morceau pour le rogner · ← → de 0,1 s, Maj de 1 s · S / E / P début, fin ou tête de lecture · F annote l'image · Ctrl+Z annule · Z zoome · Entrée enregistre · Échap ferme", + "clip.mark_frame": "Annoter cette image", + "clip.mark_frame_hint": "Ouvrir cette image dans Annoter pour dessiner dessus (F)", + "clip.marking_frame": "Capture de l'image…", + "clip.mark_frame_hdr": "Les couleurs de cette vidéo HDR n'ont pas pu être converties : l'image peut paraître délavée", + "clip.mark_frame_failed": "Impossible de capturer cette image", "clip.playhead": "Tête de lecture", "clip.play": "Lire avec le son (Espace)", "clip.pause": "Pause (Espace)", diff --git a/src/Filee.App/Assets/i18n/hi.json b/src/Filee.App/Assets/i18n/hi.json index 2ed15a5f9..d4109048f 100644 --- a/src/Filee.App/Assets/i18n/hi.json +++ b/src/Filee.App/Assets/i18n/hi.json @@ -395,6 +395,12 @@ "clip.fast": "तेज़, बिना री-एन्कोड", "clip.fast_hint": "वीडियो को जैसा है वैसा कॉपी करता है: पल भर में और बिना गुणवत्ता खोए, पर क्लिप शुरुआत से पहले वाले की फ़्रेम से शुरू होती है (कुछ सेकंड पहले तक)। चुने गए फ़्रेम पर ठीक-ठीक काटने के लिए बंद करें (दोबारा एन्कोड होता है, ज़्यादा समय लगता है)।", "clip.hint_keys": "Space चलाए · C काटे · Del हटाए (खाली जगह), Shift+Del तुरंत जोड़े · कई चुनने के लिए टुकड़ों पर खींचें या Ctrl / Shift+क्लिक, Ctrl+A सभी · वापस लाने या छाँटने के लिए किनारा खींचें · ← → 0.1 से., Shift से 1 से. · S / E / P शुरुआत, अंत या प्लेहेड · Ctrl+Z पूर्ववत · Z ज़ूम · Enter सहेजे · Esc बंद करे", + "clip.hint_keys_frame": "Space चलाए · C काटे · Del हटाए (खाली जगह), Shift+Del तुरंत जोड़े · कई चुनने के लिए टुकड़ों पर खींचें या Ctrl / Shift+क्लिक, Ctrl+A सभी · वापस लाने या छाँटने के लिए किनारा खींचें · ← → 0.1 से., Shift से 1 से. · S / E / P शुरुआत, अंत या प्लेहेड · F फ़्रेम पर टिप्पणी · Ctrl+Z पूर्ववत · Z ज़ूम · Enter सहेजे · Esc बंद करे", + "clip.mark_frame": "इस फ़्रेम पर टिप्पणी", + "clip.mark_frame_hint": "इस फ़्रेम को “टिप्पणी” में खोलकर उस पर बनाएँ (F)", + "clip.marking_frame": "फ़्रेम लिया जा रहा है…", + "clip.mark_frame_hdr": "इस HDR वीडियो के रंग बदले नहीं जा सके, इसलिए फ़्रेम फीका दिख सकता है", + "clip.mark_frame_failed": "यह फ़्रेम नहीं लिया जा सका", "clip.playhead": "प्लेहेड", "clip.play": "आवाज़ के साथ चलाएँ (Space)", "clip.pause": "रोकें (Space)", diff --git a/src/Filee.App/Assets/i18n/id.json b/src/Filee.App/Assets/i18n/id.json index cd3b82390..1d3abf313 100644 --- a/src/Filee.App/Assets/i18n/id.json +++ b/src/Filee.App/Assets/i18n/id.json @@ -395,6 +395,12 @@ "clip.fast": "Cepat, tanpa pengodean ulang", "clip.fast_hint": "Menyalin video apa adanya: selesai dalam sekejap tanpa penurunan kualitas, tetapi klip dimulai dari keyframe sebelum titik awal (bisa lebih awal beberapa detik). Matikan untuk memotong tepat di bingkai yang dipilih (mengodekan ulang, butuh waktu lebih lama).", "clip.hint_keys": "Spasi memutar · C memotong · Del memotong (meninggalkan celah), Shift+Del merapatkan · seret melintasi bagian atau Ctrl / Shift+klik untuk memilih beberapa, Ctrl+A semua · seret tepi bagian untuk memangkas · ← → per 0,1 detik, Shift per 1 detik · S / E / P titik awal, akhir, atau playhead · Ctrl+Z urungkan · Z zoom · Enter simpan · Esc tutup", + "clip.hint_keys_frame": "Spasi memutar · C memotong · Del memotong (meninggalkan celah), Shift+Del merapatkan · seret melintasi bagian atau Ctrl / Shift+klik untuk memilih beberapa, Ctrl+A semua · seret tepi bagian untuk memangkas · ← → per 0,1 detik, Shift per 1 detik · S / E / P titik awal, akhir, atau playhead · F anotasi bingkai · Ctrl+Z urungkan · Z zoom · Enter simpan · Esc tutup", + "clip.mark_frame": "Anotasi bingkai ini", + "clip.mark_frame_hint": "Buka bingkai ini di Anotasi untuk menggambar di atasnya (F)", + "clip.marking_frame": "Mengambil bingkai…", + "clip.mark_frame_hdr": "Warna video HDR ini tidak dapat dikonversi, jadi bingkai mungkin tampak pudar", + "clip.mark_frame_failed": "Bingkai ini tidak dapat diambil", "clip.playhead": "Playhead", "clip.play": "Putar dengan suara (Spasi)", "clip.pause": "Jeda (Spasi)", diff --git a/src/Filee.App/Assets/i18n/it.json b/src/Filee.App/Assets/i18n/it.json index d630ede32..fe92d7798 100644 --- a/src/Filee.App/Assets/i18n/it.json +++ b/src/Filee.App/Assets/i18n/it.json @@ -394,6 +394,12 @@ "clip.fast": "Veloce, senza ricodifica", "clip.fast_hint": "Copia il video così com'è: fatto in un attimo e senza perdite, ma la clip inizia dal keyframe precedente all'inizio (fino a qualche secondo prima). Disattiva per tagliare esattamente sui fotogrammi scelti (ricodifica, richiede più tempo).", "clip.hint_keys": "Spazio riproduce · C taglia · Canc taglia via (lascia un vuoto), Maiusc+Canc richiude · trascina sui pezzi o Ctrl / Maiusc+clic per selezionarne più di uno, Ctrl+A tutti · trascina il bordo di un pezzo per rifilarlo · ← → di 0,1 s, Maiusc di 1 s · S / E / P inizio, fine o indicatore di riproduzione · Ctrl+Z annulla · Z zoom · Invio salva · Esc chiude", +"clip.hint_keys_frame": "Spazio riproduce · C taglia · Canc taglia via (lascia un vuoto), Maiusc+Canc richiude · trascina sui pezzi o Ctrl / Maiusc+clic per selezionarne più di uno, Ctrl+A tutti · trascina il bordo di un pezzo per rifilarlo · ← → di 0,1 s, Maiusc di 1 s · S / E / P inizio, fine o indicatore di riproduzione · F annota il fotogramma · Ctrl+Z annulla · Z zoom · Invio salva · Esc chiude", +"clip.mark_frame": "Annota questo fotogramma", +"clip.mark_frame_hint": "Apri questo fotogramma in Annota per disegnarci sopra (F)", +"clip.marking_frame": "Acquisizione del fotogramma…", +"clip.mark_frame_hdr": "Non è stato possibile convertire i colori di questo video HDR, quindi il fotogramma può apparire sbiadito", +"clip.mark_frame_failed": "Impossibile acquisire questo fotogramma", "clip.playhead": "Indicatore di riproduzione", "clip.play": "Riproduci con audio (Spazio)", "clip.pause": "Pausa (Spazio)", diff --git a/src/Filee.App/Assets/i18n/ja.json b/src/Filee.App/Assets/i18n/ja.json index 648347088..a1dde251d 100644 --- a/src/Filee.App/Assets/i18n/ja.json +++ b/src/Filee.App/Assets/i18n/ja.json @@ -395,6 +395,12 @@ "clip.fast": "高速(再エンコードなし)", "clip.fast_hint": "動画をそのままコピーします。すぐに終わり画質も落ちませんが、クリップは開始位置の前のキーフレームから始まります(最大数秒早く)。オフにすると選んだフレームで正確に切り出します(再エンコードするため時間がかかります)。", "clip.hint_keys": "Space で再生 · C でカット · Del で切り取り(空白)、Shift+Del で詰める · 区間をドラッグか Ctrl / Shift+クリックで複数選択、Ctrl+A ですべて · 区間の端をドラッグで戻す・詰める · ← → で 0.1 秒、Shift で 1 秒 · S / E / P で開始・終了・再生ヘッド · Ctrl+Z で元に戻す · Z でズーム · Enter で保存 · Esc で閉じる", + "clip.hint_keys_frame": "Space で再生 · C でカット · Del で切り取り(空白)、Shift+Del で詰める · 区間をドラッグか Ctrl / Shift+クリックで複数選択、Ctrl+A ですべて · 区間の端をドラッグで戻す・詰める · ← → で 0.1 秒、Shift で 1 秒 · S / E / P で開始・終了・再生ヘッド · F でフレームに注釈 · Ctrl+Z で元に戻す · Z でズーム · Enter で保存 · Esc で閉じる", + "clip.mark_frame": "このフレームに注釈", + "clip.mark_frame_hint": "このフレームを「注釈」で開いて書き込む(F)", + "clip.marking_frame": "フレームを取り込み中…", + "clip.mark_frame_hdr": "このHDR動画の色を変換できなかったため、フレームが白っぽく見えることがあります", + "clip.mark_frame_failed": "このフレームを取り込めませんでした", "clip.playhead": "再生ヘッド", "clip.play": "音声付きで再生(Space)", "clip.pause": "一時停止(Space)", diff --git a/src/Filee.App/Assets/i18n/ko.json b/src/Filee.App/Assets/i18n/ko.json index 6ef7553ab..09770a574 100644 --- a/src/Filee.App/Assets/i18n/ko.json +++ b/src/Filee.App/Assets/i18n/ko.json @@ -404,6 +404,12 @@ "clip.fast": "빠르게, 재인코딩 없이", "clip.fast_hint": "영상을 그대로 복사합니다. 금방 끝나고 화질 손실이 없지만, 클립은 시작 지점 앞의 키 프레임에서 시작합니다(최대 몇 초 일찍). 끄면 고른 프레임에서 정확히 자릅니다(다시 인코딩하므로 더 오래 걸림).", "clip.hint_keys": "Space 재생 · C 자르기 · Del 잘라내기(빈 자리), Shift+Del 바로 붙이기 · 조각을 끌어 지나가거나 Ctrl / Shift+클릭으로 여러 개 선택, Ctrl+A 전체 · 조각 가장자리를 끌어 되돌리거나 다듬기 · ← → 0.1초, Shift는 1초 · S / E / P 시작, 끝, 재생 헤드 · Ctrl+Z 실행 취소 · Z 확대 · Enter 저장 · Esc 닫기", + "clip.hint_keys_frame": "Space 재생 · C 자르기 · Del 잘라내기(빈 자리), Shift+Del 바로 붙이기 · 조각을 끌어 지나가거나 Ctrl / Shift+클릭으로 여러 개 선택, Ctrl+A 전체 · 조각 가장자리를 끌어 되돌리거나 다듬기 · ← → 0.1초, Shift는 1초 · S / E / P 시작, 끝, 재생 헤드 · F 프레임에 주석 · Ctrl+Z 실행 취소 · Z 확대 · Enter 저장 · Esc 닫기", + "clip.mark_frame": "이 프레임에 주석", + "clip.mark_frame_hint": "이 프레임을 “주석”에서 열어 그 위에 그리기 (F)", + "clip.marking_frame": "프레임을 가져오는 중…", + "clip.mark_frame_hdr": "이 HDR 동영상의 색을 변환할 수 없어 프레임이 바래 보일 수 있어요", + "clip.mark_frame_failed": "이 프레임을 가져올 수 없어요", "clip.playhead": "재생 헤드", "clip.play": "소리와 함께 재생 (Space)", "clip.pause": "일시 정지 (Space)", diff --git a/src/Filee.App/Assets/i18n/mn.json b/src/Filee.App/Assets/i18n/mn.json index 89063a2b6..ecd8c90ee 100644 --- a/src/Filee.App/Assets/i18n/mn.json +++ b/src/Filee.App/Assets/i18n/mn.json @@ -394,6 +394,12 @@ "clip.fast": "Хурдан, дахин кодлохгүй", "clip.fast_hint": "Видеог байгаагаар нь хуулна: хормын дотор дуусаж чанар алдахгүй, гэхдээ хэсэг нь эхлэлийн өмнөх тулгуур кадраас (хэдэн секундийн өмнөөс) эхэлнэ. Яг сонгосон кадраар таслах бол унтраана уу (дахин кодлох тул удаан болно).", "clip.hint_keys": "Space тоглуулна · C зүснэ · Del хасна (зай үлдээнэ), Shift+Del зайг арилгана · хэсгүүдийг чирэх эсвэл Ctrl / Shift+товшиж олноор сонгоно, Ctrl+A бүгдийг · ирмэгээс чирж тайрна · ← → 0.1 с-ээр, Shift 1 с-ээр · S / E / P эхлэл, төгсгөл эсвэл заагч · Ctrl+Z буцаана · Z томруулна · Enter хадгална · Esc хаана", + "clip.hint_keys_frame": "Space тоглуулна · C зүснэ · Del хасна (зай үлдээнэ), Shift+Del зайг арилгана · хэсгүүдийг чирэх эсвэл Ctrl / Shift+товшиж олноор сонгоно, Ctrl+A бүгдийг · ирмэгээс чирж тайрна · ← → 0.1 с-ээр, Shift 1 с-ээр · S / E / P эхлэл, төгсгөл эсвэл заагч · F кадрт тэмдэглэнэ · Ctrl+Z буцаана · Z томруулна · Enter хадгална · Esc хаана", + "clip.mark_frame": "Энэ кадрт тэмдэглэгээ хийх", + "clip.mark_frame_hint": "Энэ кадрыг “Тэмдэглэгээ хийх”-д нээж дээр нь зурах (F)", + "clip.marking_frame": "Кадрыг авч байна…", + "clip.mark_frame_hdr": "Энэ HDR видеоны өнгийг хөрвүүлж чадсангүй, тиймээс кадр бүдэг харагдаж магадгүй", + "clip.mark_frame_failed": "Энэ кадрыг авч чадсангүй", "clip.playhead": "Тоглуулах заагч", "clip.play": "Дуутай тоглуулах (Space)", "clip.pause": "Түр зогсоох (Space)", diff --git a/src/Filee.App/Assets/i18n/ne.json b/src/Filee.App/Assets/i18n/ne.json index 4b25a1b72..1b37ac7b2 100644 --- a/src/Filee.App/Assets/i18n/ne.json +++ b/src/Filee.App/Assets/i18n/ne.json @@ -395,6 +395,12 @@ "clip.fast": "छिटो, फेरि इन्कोड नगरी", "clip.fast_hint": "भिडियो जस्ताको तस्तै प्रतिलिपि गर्छ: एकै छिनमा हुन्छ र केही गुम्दैन, तर क्लिप सुरुभन्दा अघिको की फ्रेमबाट सुरु हुन्छ (केही सेकेन्डसम्म अघि)। छानिएकै फ्रेममा ठ्याक्कै काट्न यो बन्द गर्नुहोस् (फेरि इन्कोड हुन्छ, बढी समय लाग्छ)।", "clip.hint_keys": "Space बजाउँछ · C काट्छ · Del हटाउँछ (खाली ठाउँ रहन्छ), Shift+Del जोड्छ · धेरै छान्न टुक्राहरूमाथि तान्नुहोस् वा Ctrl / Shift+क्लिक, Ctrl+A सबै · छाँट्न टुक्राको किनारा तान्नुहोस् · ← → 0.1 से, Shift 1 से · S / E / P सुरु, अन्त्य वा प्लेहेड · Ctrl+Z पूर्वावस्था · Z जुम · Enter सेभ · Esc बन्द", + "clip.hint_keys_frame": "Space बजाउँछ · C काट्छ · Del हटाउँछ (खाली ठाउँ रहन्छ), Shift+Del जोड्छ · धेरै छान्न टुक्राहरूमाथि तान्नुहोस् वा Ctrl / Shift+क्लिक, Ctrl+A सबै · छाँट्न टुक्राको किनारा तान्नुहोस् · ← → 0.1 से, Shift 1 से · S / E / P सुरु, अन्त्य वा प्लेहेड · F फ्रेममा टिप्पणी · Ctrl+Z पूर्वावस्था · Z जुम · Enter सेभ · Esc बन्द", + "clip.mark_frame": "यो फ्रेममा टिप्पणी", + "clip.mark_frame_hint": "यो फ्रेमलाई “टिप्पणी” मा खोलेर त्यसमा कोर्नुहोस् (F)", + "clip.marking_frame": "फ्रेम लिँदै…", + "clip.mark_frame_hdr": "यो HDR भिडियोका रङ बदल्न सकिएन, त्यसैले फ्रेम फिक्का देखिन सक्छ", + "clip.mark_frame_failed": "यो फ्रेम लिन सकिएन", "clip.playhead": "प्लेहेड", "clip.play": "आवाजसहित बजाउनुहोस् (Space)", "clip.pause": "रोक्नुहोस् (Space)", diff --git a/src/Filee.App/Assets/i18n/pl.json b/src/Filee.App/Assets/i18n/pl.json index 665c48cbc..155899337 100644 --- a/src/Filee.App/Assets/i18n/pl.json +++ b/src/Filee.App/Assets/i18n/pl.json @@ -404,6 +404,12 @@ "clip.fast": "Szybko, bez ponownego kodowania", "clip.fast_hint": "Kopiuje wideo bez zmian: gotowe w chwilę i bez utraty jakości, ale klip zaczyna się od klatki kluczowej przed początkiem (do kilku sekund wcześniej). Wyłącz, aby ciąć dokładnie w wybranych klatkach (koduje ponownie, trwa dłużej).", "clip.hint_keys": "Spacja odtwarza · C tnie · Del wycina (luka), Shift+Del zsuwa · przeciągnij po fragmentach lub Ctrl / Shift+klik, by zaznaczyć kilka, Ctrl+A wszystkie · przeciągnij krawędź fragmentu, by przywrócić lub przyciąć · ← → o 0,1 s, z Shift o 1 s · S / E / P początek, koniec lub głowica · Ctrl+Z cofa · Z przybliża · Enter zapisuje · Esc zamyka", + "clip.hint_keys_frame": "Spacja odtwarza · C tnie · Del wycina (luka), Shift+Del zsuwa · przeciągnij po fragmentach lub Ctrl / Shift+klik, by zaznaczyć kilka, Ctrl+A wszystkie · przeciągnij krawędź fragmentu, by przywrócić lub przyciąć · ← → o 0,1 s, z Shift o 1 s · S / E / P początek, koniec lub głowica · F adnotuje klatkę · Ctrl+Z cofa · Z przybliża · Enter zapisuje · Esc zamyka", + "clip.mark_frame": "Adnotuj tę klatkę", + "clip.mark_frame_hint": "Otwórz tę klatkę w Adnotacjach, by na niej rysować (F)", + "clip.marking_frame": "Pobieram klatkę…", + "clip.mark_frame_hdr": "Nie udało się przekształcić kolorów tego filmu HDR, więc klatka może wyglądać na wyblakłą", + "clip.mark_frame_failed": "Nie udało się pobrać tej klatki", "clip.playhead": "Głowica", "clip.play": "Odtwórz z dźwiękiem (Spacja)", "clip.pause": "Pauza (Spacja)", diff --git a/src/Filee.App/Assets/i18n/pt-BR.json b/src/Filee.App/Assets/i18n/pt-BR.json index 21b875205..8a981d4dd 100644 --- a/src/Filee.App/Assets/i18n/pt-BR.json +++ b/src/Filee.App/Assets/i18n/pt-BR.json @@ -404,6 +404,12 @@ "clip.fast": "Rápido, sem recodificar", "clip.fast_hint": "Copia o vídeo como está: pronto num instante e sem perda, mas o clipe começa no quadro-chave antes do início (até alguns segundos antes). Desative para cortar exatamente nos quadros escolhidos (recodifica, demora mais).", "clip.hint_keys": "Espaço reproduz · C corta · Del remove (deixa um vão), Shift+Del fecha na hora · arraste sobre os trechos ou Ctrl / Shift+clique para escolher vários, Ctrl+A todos · arraste a borda de um trecho para recuperar ou aparar · ← → 0,1 s, Shift 1 s · S / E / P início, fim ou cursor · Ctrl+Z desfaz · Z aproxima · Enter salva · Esc fecha", + "clip.hint_keys_frame": "Espaço reproduz · C corta · Del remove (deixa um vão), Shift+Del fecha na hora · arraste sobre os trechos ou Ctrl / Shift+clique para escolher vários, Ctrl+A todos · arraste a borda de um trecho para recuperar ou aparar · ← → 0,1 s, Shift 1 s · S / E / P início, fim ou cursor · F anota o quadro · Ctrl+Z desfaz · Z aproxima · Enter salva · Esc fecha", + "clip.mark_frame": "Anotar este quadro", + "clip.mark_frame_hint": "Abrir este quadro no Anotar para desenhar sobre ele (F)", + "clip.marking_frame": "Capturando o quadro…", + "clip.mark_frame_hdr": "Não foi possível converter as cores deste vídeo HDR, então o quadro pode parecer desbotado", + "clip.mark_frame_failed": "Não foi possível capturar este quadro", "clip.playhead": "Cursor", "clip.play": "Reproduzir com som (Espaço)", "clip.pause": "Pausar (Espaço)", diff --git a/src/Filee.App/Assets/i18n/pt-PT.json b/src/Filee.App/Assets/i18n/pt-PT.json index dd67b7f9e..d2e0abccd 100644 --- a/src/Filee.App/Assets/i18n/pt-PT.json +++ b/src/Filee.App/Assets/i18n/pt-PT.json @@ -404,6 +404,12 @@ "clip.fast": "Rápido, sem recodificar", "clip.fast_hint": "Copia o vídeo tal como está: fica pronto num instante e sem perda de qualidade, mas o excerto começa no fotograma-chave anterior ao início (até alguns segundos antes). Desativa para cortar exatamente nos fotogramas escolhidos (volta a codificar e demora mais).", "clip.hint_keys": "Espaço reproduz · C corta · Del remove (deixa um espaço vazio), Shift+Del remove e fecha o espaço · arrasta sobre os segmentos ou usa Ctrl / Shift+clique para selecionar vários, Ctrl+A todos · arrasta a extremidade de um segmento para o aparar · ← → 0,1 s, com Shift 1 s · S / E / P início, fim ou cursor · Ctrl+Z anula · Z aplica zoom · Enter guarda · Esc fecha", + "clip.hint_keys_frame": "Espaço reproduz · C corta · Del remove (deixa um espaço vazio), Shift+Del remove e fecha o espaço · arrasta sobre os segmentos ou usa Ctrl / Shift+clique para selecionar vários, Ctrl+A todos · arrasta a extremidade de um segmento para o aparar · ← → 0,1 s, com Shift 1 s · S / E / P início, fim ou cursor · F anota o fotograma · Ctrl+Z anula · Z aplica zoom · Enter guarda · Esc fecha", + "clip.mark_frame": "Anotar este fotograma", + "clip.mark_frame_hint": "Abrir este fotograma em Anotar para desenhar sobre ele (F)", + "clip.marking_frame": "A capturar o fotograma…", + "clip.mark_frame_hdr": "Não foi possível converter as cores deste vídeo HDR, por isso o fotograma pode parecer desbotado", + "clip.mark_frame_failed": "Não foi possível capturar este fotograma", "clip.playhead": "Cursor", "clip.play": "Reproduzir com som (Espaço)", "clip.pause": "Pausar (Espaço)", diff --git a/src/Filee.App/Assets/i18n/ru.json b/src/Filee.App/Assets/i18n/ru.json index 62df4192b..7abf1ce37 100644 --- a/src/Filee.App/Assets/i18n/ru.json +++ b/src/Filee.App/Assets/i18n/ru.json @@ -404,6 +404,12 @@ "clip.fast": "Быстро, без перекодирования", "clip.fast_hint": "Копирует видео как есть: мгновенно и без потери качества, но клип начинается с ключевого кадра перед началом (до нескольких секунд раньше). Выключите, чтобы резать точно по выбранным кадрам (с перекодированием, дольше).", "clip.hint_keys": "Пробел — играть · C — разрезать · Del — вырезать (пустота), Shift+Del — сразу сдвинуть · протяните по кускам или Ctrl / Shift+клик — выбрать несколько, Ctrl+A — все · тяните край куска, чтобы вернуть или подрезать · ← → на 0,1 с, Shift — на 1 с · S / E / P — начало, конец или указатель · Ctrl+Z — отменить · Z — приблизить · Enter — сохранить · Esc — закрыть", + "clip.hint_keys_frame": "Пробел — играть · C — разрезать · Del — вырезать (пустота), Shift+Del — сразу сдвинуть · протяните по кускам или Ctrl / Shift+клик — выбрать несколько, Ctrl+A — все · тяните край куска, чтобы вернуть или подрезать · ← → на 0,1 с, Shift — на 1 с · S / E / P — начало, конец или указатель · F — пометки на кадре · Ctrl+Z — отменить · Z — приблизить · Enter — сохранить · Esc — закрыть", + "clip.mark_frame": "Пометки на этом кадре", + "clip.mark_frame_hint": "Открыть этот кадр в «Пометках», чтобы рисовать на нём (F)", + "clip.marking_frame": "Снимаю кадр…", + "clip.mark_frame_hdr": "Цвета этого HDR-видео не удалось преобразовать, поэтому кадр может выглядеть блёклым", + "clip.mark_frame_failed": "Не удалось снять этот кадр", "clip.playhead": "Указатель", "clip.play": "Воспроизвести со звуком (Пробел)", "clip.pause": "Пауза (Пробел)", diff --git a/src/Filee.App/Assets/i18n/th.json b/src/Filee.App/Assets/i18n/th.json index fc17c57d4..45799ec98 100644 --- a/src/Filee.App/Assets/i18n/th.json +++ b/src/Filee.App/Assets/i18n/th.json @@ -395,6 +395,12 @@ "clip.fast": "เร็ว ไม่เข้ารหัสใหม่", "clip.fast_hint": "คัดลอกวิดีโอตามเดิม: เสร็จในพริบตาและไม่สูญเสียคุณภาพ แต่คลิปจะเริ่มที่คีย์เฟรมก่อนจุดเริ่ม (เร็วกว่าได้ถึงไม่กี่วินาที) ปิดตัวเลือกนี้เพื่อตัดตรงเฟรมที่เลือกพอดี (เข้ารหัสใหม่ ใช้เวลานานกว่า)", "clip.hint_keys": "Space เล่น · C ตัด · Del ตัดออก (เว้นช่องว่าง), Shift+Del ปิดช่องว่าง · ลากผ่านหลายชิ้นหรือ Ctrl / Shift+คลิกเพื่อเลือกหลายชิ้น, Ctrl+A เลือกทั้งหมด · ลากขอบชิ้นเพื่อตัดแต่ง · ← → ทีละ 0.1 วินาที, Shift ทีละ 1 วินาที · S / E / P จุดเริ่ม จุดสิ้นสุด หรือหัวเล่น · Ctrl+Z เลิกทำ · Z ซูม · Enter บันทึก · Esc ปิด", + "clip.hint_keys_frame": "Space เล่น · C ตัด · Del ตัดออก (เว้นช่องว่าง), Shift+Del ปิดช่องว่าง · ลากผ่านหลายชิ้นหรือ Ctrl / Shift+คลิกเพื่อเลือกหลายชิ้น, Ctrl+A เลือกทั้งหมด · ลากขอบชิ้นเพื่อตัดแต่ง · ← → ทีละ 0.1 วินาที, Shift ทีละ 1 วินาที · S / E / P จุดเริ่ม จุดสิ้นสุด หรือหัวเล่น · F ใส่คำอธิบายเฟรม · Ctrl+Z เลิกทำ · Z ซูม · Enter บันทึก · Esc ปิด", + "clip.mark_frame": "ใส่คำอธิบายเฟรมนี้", + "clip.mark_frame_hint": "เปิดเฟรมนี้ใน “ใส่คำอธิบาย” เพื่อวาดลงบนเฟรม (F)", + "clip.marking_frame": "กำลังจับภาพเฟรม…", + "clip.mark_frame_hdr": "แปลงสีของวิดีโอ HDR นี้ไม่ได้ เฟรมจึงอาจดูซีด", + "clip.mark_frame_failed": "จับภาพเฟรมนี้ไม่ได้", "clip.playhead": "หัวเล่น", "clip.play": "เล่นพร้อมเสียง (Space)", "clip.pause": "หยุดชั่วคราว (Space)", diff --git a/src/Filee.App/Assets/i18n/tr.json b/src/Filee.App/Assets/i18n/tr.json index 32bfaa63a..a1b4d02d1 100644 --- a/src/Filee.App/Assets/i18n/tr.json +++ b/src/Filee.App/Assets/i18n/tr.json @@ -395,6 +395,12 @@ "clip.fast": "Hızlı, yeniden kodlama yok", "clip.fast_hint": "Videoyu olduğu gibi kopyalar: bir anda biter ve hiçbir şey kaybolmaz, ancak klip başlangıçtan önceki anahtar karede başlar (birkaç saniyeye kadar erken). Tam seçilen karelerden kesmek için kapatın (yeniden kodlar, daha uzun sürer).", "clip.hint_keys": "Boşluk oynatır · C keser · Del parçayı çıkarır (boşluk kalır), Shift+Del boşluğu kapatır · birden fazla seçmek için parçaların üzerinden sürükleyin veya Ctrl / Shift+tıklayın, Ctrl+A hepsini seçer · kırpmak için parçanın kenarını sürükleyin · ← → 0,1 sn, Shift ile 1 sn · S / E / P başlangıç, bitiş veya oynatma çubuğu · Ctrl+Z geri alır · Z yakınlaştırır · Enter kaydeder · Esc kapatır", + "clip.hint_keys_frame": "Boşluk oynatır · C keser · Del parçayı çıkarır (boşluk kalır), Shift+Del boşluğu kapatır · birden fazla seçmek için parçaların üzerinden sürükleyin veya Ctrl / Shift+tıklayın, Ctrl+A hepsini seçer · kırpmak için parçanın kenarını sürükleyin · ← → 0,1 sn, Shift ile 1 sn · S / E / P başlangıç, bitiş veya oynatma çubuğu · F kareye not ekler · Ctrl+Z geri alır · Z yakınlaştırır · Enter kaydeder · Esc kapatır", + "clip.mark_frame": "Bu kareye not ekle", + "clip.mark_frame_hint": "Üzerine çizmek için bu kareyi Not ekle'de aç (F)", + "clip.marking_frame": "Kare alınıyor…", + "clip.mark_frame_hdr": "Bu HDR videonun renkleri dönüştürülemedi, bu yüzden kare soluk görünebilir", + "clip.mark_frame_failed": "Bu kare alınamadı", "clip.playhead": "Oynatma çubuğu", "clip.play": "Sesli oynat (Boşluk)", "clip.pause": "Duraklat (Boşluk)", diff --git a/src/Filee.App/Assets/i18n/vi.json b/src/Filee.App/Assets/i18n/vi.json index a69d4b970..a7dbc37a4 100644 --- a/src/Filee.App/Assets/i18n/vi.json +++ b/src/Filee.App/Assets/i18n/vi.json @@ -404,6 +404,12 @@ "clip.fast": "Nhanh, không mã hóa lại", "clip.fast_hint": "Sao chép video nguyên trạng: xong ngay và không mất gì, nhưng đoạn sẽ bắt đầu ở khung hình chính trước điểm bắt đầu (sớm hơn tối đa vài giây). Tắt để cắt chính xác tại các khung hình đã chọn (mã hóa lại, mất nhiều thời gian hơn).", "clip.hint_keys": "Space để phát · C để cắt · Del để cắt bỏ (để lại khoảng trống), Shift+Del để khép lại · kéo qua các đoạn hoặc Ctrl / Shift+nhấp để chọn nhiều, Ctrl+A để chọn tất cả · kéo mép một đoạn để cắt tỉa · ← → mỗi lần 0,1 giây, Shift mỗi lần 1 giây · S / E / P điểm bắt đầu, điểm kết thúc hoặc đầu phát · Ctrl+Z để hoàn tác · Z để thu phóng · Enter để lưu · Esc để đóng", + "clip.hint_keys_frame": "Space để phát · C để cắt · Del để cắt bỏ (để lại khoảng trống), Shift+Del để khép lại · kéo qua các đoạn hoặc Ctrl / Shift+nhấp để chọn nhiều, Ctrl+A để chọn tất cả · kéo mép một đoạn để cắt tỉa · ← → mỗi lần 0,1 giây, Shift mỗi lần 1 giây · S / E / P điểm bắt đầu, điểm kết thúc hoặc đầu phát · F để chú thích khung hình · Ctrl+Z để hoàn tác · Z để thu phóng · Enter để lưu · Esc để đóng", + "clip.mark_frame": "Chú thích khung hình này", + "clip.mark_frame_hint": "Mở khung hình này trong Chú thích để vẽ lên (F)", + "clip.marking_frame": "Đang lấy khung hình…", + "clip.mark_frame_hdr": "Không chuyển đổi được màu của video HDR này nên khung hình có thể trông nhợt nhạt", + "clip.mark_frame_failed": "Không lấy được khung hình này", "clip.playhead": "Đầu phát", "clip.play": "Phát có âm thanh (Space)", "clip.pause": "Tạm dừng (Space)", diff --git a/src/Filee.App/Assets/i18n/zh-CN.json b/src/Filee.App/Assets/i18n/zh-CN.json index 82e3e8470..7b87e013b 100644 --- a/src/Filee.App/Assets/i18n/zh-CN.json +++ b/src/Filee.App/Assets/i18n/zh-CN.json @@ -404,6 +404,12 @@ "clip.fast": "快速,不重新编码", "clip.fast_hint": "按原样复制视频:瞬间完成且无画质损失,但片段从开始位置之前的关键帧开始(最多提前几秒)。关闭后会在所选帧处精确剪切(需要重新编码,耗时更长)。", "clip.hint_keys": "空格 播放 · C 剪切 · Del 剪掉(留空白),Shift+Del 立即合拢 · 在片段上拖动或 Ctrl / Shift+单击可多选,Ctrl+A 全选 · 拖动片段边缘可恢复或修剪 · ← → 移动 0.1 秒,Shift 1 秒 · S / E / P 开始、结束或播放头 · Ctrl+Z 撤销 · Z 缩放 · Enter 保存 · Esc 关闭", + "clip.hint_keys_frame": "空格 播放 · C 剪切 · Del 剪掉(留空白),Shift+Del 立即合拢 · 在片段上拖动或 Ctrl / Shift+单击可多选,Ctrl+A 全选 · 拖动片段边缘可恢复或修剪 · ← → 移动 0.1 秒,Shift 1 秒 · S / E / P 开始、结束或播放头 · F 批注此帧 · Ctrl+Z 撤销 · Z 缩放 · Enter 保存 · Esc 关闭", + "clip.mark_frame": "批注此帧", + "clip.mark_frame_hint": "在“批注”中打开此帧并在上面绘制(F)", + "clip.marking_frame": "正在获取帧…", + "clip.mark_frame_hdr": "无法转换此 HDR 视频的颜色,此帧可能显得发白", + "clip.mark_frame_failed": "无法获取此帧", "clip.playhead": "播放头", "clip.play": "带声音播放(空格)", "clip.pause": "暂停(空格)", diff --git a/src/Filee.App/Assets/i18n/zh-TW.json b/src/Filee.App/Assets/i18n/zh-TW.json index aeda0c1c2..6d136ffea 100644 --- a/src/Filee.App/Assets/i18n/zh-TW.json +++ b/src/Filee.App/Assets/i18n/zh-TW.json @@ -404,6 +404,12 @@ "clip.fast": "快速,不重新編碼", "clip.fast_hint": "按原樣複製影片:瞬間完成且畫質無損,但片段會從開始位置之前的關鍵影格開始(最多提早幾秒)。關閉後會在所選影格精確剪輯(需要重新編碼,耗時較長)。", "clip.hint_keys": "空白鍵 播放 · C 剪開 · Del 剪掉(留空白),Shift+Del 立即合攏 · 在片段上拖曳或 Ctrl / Shift+按一下可多選,Ctrl+A 全選 · 拖曳片段邊緣可修剪 · ← → 移動 0.1 秒,Shift 1 秒 · S / E / P 開始、結束或播放頭 · Ctrl+Z 復原 · Z 縮放 · Enter 儲存 · Esc 關閉", + "clip.hint_keys_frame": "空白鍵 播放 · C 剪開 · Del 剪掉(留空白),Shift+Del 立即合攏 · 在片段上拖曳或 Ctrl / Shift+按一下可多選,Ctrl+A 全選 · 拖曳片段邊緣可修剪 · ← → 移動 0.1 秒,Shift 1 秒 · S / E / P 開始、結束或播放頭 · F 註解此影格 · Ctrl+Z 復原 · Z 縮放 · Enter 儲存 · Esc 關閉", + "clip.mark_frame": "註解此影格", + "clip.mark_frame_hint": "在「註解」中開啟此影格並在上面繪製(F)", + "clip.marking_frame": "正在擷取影格…", + "clip.mark_frame_hdr": "無法轉換此 HDR 影片的色彩,影格可能顯得泛白", + "clip.mark_frame_failed": "無法擷取此影格", "clip.playhead": "播放頭", "clip.play": "帶聲音播放(空白鍵)", "clip.pause": "暫停(空白鍵)", diff --git a/src/Filee.App/Services/AppHost.cs b/src/Filee.App/Services/AppHost.cs index 40075a6a3..ec51d911d 100644 --- a/src/Filee.App/Services/AppHost.cs +++ b/src/Filee.App/Services/AppHost.cs @@ -66,6 +66,8 @@ public static IServiceProvider Build(string? dataDirectory = null, UserDataStore services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); + // "Mark this frame": the frames on their way to Annotate, deleted once marked (and when Filee quits). + services.AddSingleton(sp => new MarkedFrames(JobQueue.DefaultWorkRoot, sp.GetRequiredService())); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); diff --git a/src/Filee.App/Services/MarkedFrames.cs b/src/Filee.App/Services/MarkedFrames.cs new file mode 100644 index 000000000..922739030 --- /dev/null +++ b/src/Filee.App/Services/MarkedFrames.cs @@ -0,0 +1,149 @@ +// The frames "Mark this frame" takes in Cut a clip (#1205) on their way to Annotate: each is a PNG named after its +// video and its time, in a work folder of its own (swept after a crash like a job's). Annotate's output rules read the +// video's folder as the frame's own (so its marked copy goes next to the video unless they name another folder), and +// it never trashes the frame as an "original". A frame goes once its marked copy is saved, cancelled or skipped, when +// Annotate leaves it unsaved, and when Filee quits; a failed save keeps it for "Try again". + +using System.Collections.Concurrent; +using System.Globalization; +using Filee.Core.Conversion; +using Filee.Core.Presets; + +namespace Filee.App.Services; + +public sealed class MarkedFrames : IDisposable +{ + private readonly string _root; + private readonly JobQueue? _queue; + + /// Each frame and the video it was taken from. + private readonly ConcurrentDictionary _videos = new(Filee.Core.Platform.FileSystemPaths.Comparer); + + /// Where the frames' folders go (). + /// Says when a frame's marked copy is saved. + public MarkedFrames(string workRoot, JobQueue? queue = null) + { + _root = workRoot; + _queue = queue; + if (queue is not null) + queue.JobFinished += OnJobFinished; + } + + /// + /// The frame's file name: the video's name and the frame's time to the millisecond ("Site walk 1m43.400s.png"), as + /// a frame number alone can mislead in variable frame rate video, and a colon can't be in a file name on Windows. + /// + public static string NameFor(string video, double seconds) + { + var ms = double.IsFinite(seconds) ? (long)Math.Round(Math.Max(0, seconds) * 1000, MidpointRounding.AwayFromZero) : 0; + var (hours, minutes) = (ms / 3_600_000, ms / 60_000 % 60); + var rest = string.Create(CultureInfo.InvariantCulture, $"{ms / 1000 % 60:00}.{ms % 1000:000}s"); + var time = hours > 0 ? string.Create(CultureInfo.InvariantCulture, $"{hours}h{minutes:00}m{rest}") + : string.Create(CultureInfo.InvariantCulture, $"{minutes}m{rest}"); + return $"{Shortened(Path.GetFileNameWithoutExtension(video))} {time}.png"; + } + + /// + /// The longest a video's name may be in a frame's name, in UTF-8 bytes: with the time, Annotate's " Annotated" and + /// a " (99)" for a name already taken, the marked copy's name stays within the 255 bytes a file name may have. + /// + private const int MaxNameBytes = 200; + + /// , cut to whole characters within . + private static string Shortened(string name) + { + if (System.Text.Encoding.UTF8.GetByteCount(name) <= MaxNameBytes) + return name; + var kept = new System.Text.StringBuilder(); + var bytes = 0; + var characters = StringInfo.GetTextElementEnumerator(name); + while (characters.MoveNext()) + { + var character = characters.GetTextElement(); + bytes += System.Text.Encoding.UTF8.GetByteCount(character); + if (bytes > MaxNameBytes) + break; + kept.Append(character); + } + return kept.ToString().TrimEnd(); + } + + /// + /// A path for the frame at of , in a new folder of its own. + /// + public string NewPath(string video, double seconds) + { + var folder = Path.Combine(_root, Guid.NewGuid().ToString("N")[..10]); + Directory.CreateDirectory(folder); + var path = Path.Combine(folder, NameFor(video, seconds)); + _videos[path] = video; + return path; + } + + /// The video was taken from; null for any other picture. + public string? VideoOf(string frame) => _videos.GetValueOrDefault(frame); + + /// + /// Annotate's conversion of : for a frame, "next to the source" is next to its video, and + /// there is no "original" to replace or trash (that would only be the frame); any other picture's as it is. A frame + /// marked again finds its first marked copy there: "skip" would lose the new marks with the frame, so it gets a + /// name of its own instead. + /// + public Preset Apply(string source, Preset conversion) + { + if (VideoOf(source) is not { } video) + return conversion; + var copy = conversion.Clone(); + copy.Output.SourceFolder = Path.GetDirectoryName(Path.GetFullPath(video)); + copy.Output.ReplaceOriginal = false; + copy.Output.TrashOriginalAfterConvert = false; + if (copy.Output.Conflict == ConflictPolicy.Skip) + copy.Output.Conflict = ConflictPolicy.Rename; + return copy; + } + + /// + /// is one of these frames and still wanted: false once it is discarded, and for every + /// frame once Filee quits. + /// + public bool IsWanted(string frame) => !_quit && _videos.ContainsKey(frame); + + private volatile bool _quit; + + /// Deletes and its folder; anything that isn't a frame is left alone. + public void Discard(string frame) + { + if (!_videos.ContainsKey(frame)) + return; + // A folder still open somewhere (on Windows, while a program reads the file) stays known, so the next try + // takes it, at the latest when Filee quits; failing that, the sweep at a later start + // (JobQueue.DeleteStaleWorkFolders). + var folder = Path.GetDirectoryName(frame)!; + Filee.Engines.Archives.ArchiveFiles.TryDeleteFolder(folder); + if (!Directory.Exists(folder)) + _videos.TryRemove(frame, out _); + } + + /// + /// A frame whose marked copy was saved, or whose saving was cancelled or skipped, is no longer needed; a failed one + /// stays for "Try again" (until Filee quits). + /// + internal void OnJobFinished(ConversionJob job) + { + foreach (var file in job.Files) + if (file.State is FileState.Done or FileState.Cancelled or FileState.Skipped) + Discard(file.SourcePath); + } + + private void OnJobFinished(object? sender, ConversionJob job) => OnJobFinished(job); + + /// Filee quits: every frame goes, and one still being taken is no longer wanted. + public void Dispose() + { + _quit = true; + if (_queue is not null) + _queue.JobFinished -= OnJobFinished; + foreach (var frame in _videos.Keys) + Discard(frame); + } +} diff --git a/src/Filee.App/Services/VideoFrameSource.cs b/src/Filee.App/Services/VideoFrameSource.cs index 4f984f152..09f2082ec 100644 --- a/src/Filee.App/Services/VideoFrameSource.cs +++ b/src/Filee.App/Services/VideoFrameSource.cs @@ -15,6 +15,12 @@ public interface IVideoFrameSource /// Writes the frame at as a JPEG; false when there is none. Task WriteFrameAsync(string path, double seconds, string output, int maxHeight, CancellationToken cancellationToken); + /// + /// Writes the frame at as a PNG at the size the video is shown at ("Mark this frame"): + /// the frame shows at that time. + /// + Task WriteStillAsync(string path, double seconds, string output, CancellationToken cancellationToken); + /// /// The loudness of the sound from to seconds in /// steps (0 to 1); empty without sound. @@ -43,6 +49,9 @@ public Task ProbeAsync(string path, CancellationToken cancellation public Task WriteFrameAsync(string path, double seconds, string output, int maxHeight, CancellationToken cancellationToken) => VideoFrames.WriteFrameAsync(path, seconds, output, maxHeight, cancellationToken); + public Task WriteStillAsync(string path, double seconds, string output, CancellationToken cancellationToken) => + VideoFrames.WriteStillAsync(path, seconds, output, cancellationToken); + public Task ReadLoudnessAsync(string path, double start, double end, int count, string workFolder, CancellationToken cancellationToken) => ClipPreview.ReadLoudnessAsync(path, start, end, count, workFolder, cancellationToken); diff --git a/src/Filee.App/Services/WindowService.cs b/src/Filee.App/Services/WindowService.cs index 4ebdd4eda..23d161102 100644 --- a/src/Filee.App/Services/WindowService.cs +++ b/src/Filee.App/Services/WindowService.cs @@ -448,16 +448,19 @@ private void ShowClipWindow(IReadOnlyList files, Preset preset, PixelPoi var log = services.GetService>(); var vm = new ClipWindowViewModel(videos, preset, loc, store, new FfmpegFrameSource(), path => ClipTool.TargetFor(FormatRegistry.Detect(path)?.Id ?? ClipTool.FallbackTarget, catalog.CreatePlanner()), - (path, conversion) => conversions.Start([path], conversion), log, ringtone); + (path, conversion) => conversions.Start([path], conversion), log, ringtone, + services.GetRequiredService(), AnnotateFrame); var win = new ClipWindow { DataContext = vm }; win.PositionOnScreen(near); win.Closed += (_, _) => { if (_clipWindow == win) _clipWindow = null; + KeepAnnotateAboveClip(); trimmer.Request(); }; _clipWindow = win; + KeepAnnotateAboveClip(); win.Show(); win.Activate(); } @@ -560,32 +563,90 @@ public void ShowHideWindow(IReadOnlyList files, Preset preset, PixelPoin /// /// Opens the "Annotate" window on the pictures among the files. Each picture is written by an ordinary conversion, - /// shown in the toast. + /// shown in the toast; for a frame from "Mark this frame", "next to the source" is next to its video + /// (). /// - public void ShowAnnotateWindow(IReadOnlyList files, Preset preset) + public void ShowAnnotateWindow(IReadOnlyList files, Preset preset) => OpenAnnotateWindow(files, preset); + + private AnnotateViewModel? OpenAnnotateWindow(IReadOnlyList files, Preset preset) { var pictures = files.Where(f => FormatRegistry.Detect(f) is { } format && HideService.CanOpen(format.Id)).ToList(); if (pictures.Count == 0) - return; + return null; _annotateWindow?.Close(); var conversions = services.GetRequiredService(); + var marks = services.GetRequiredService(); var planner = services.GetRequiredService().CreatePlanner(); var vm = new AnnotateViewModel(pictures, preset, loc, services.GetRequiredService(), path => AnnotateTool.TargetFor(FormatRegistry.Detect(path)?.Id ?? "", planner), - (path, conversion) => conversions.Start([path], conversion), services.GetService>()); + (path, conversion) => conversions.Start([path], marks.Apply(path, conversion)), services.GetService>()); var win = new AnnotateWindow { DataContext = vm }; PrepareWindow(win); win.Closed += (_, _) => { if (_annotateWindow == win) _annotateWindow = null; + // Frames left unsaved aren't needed any more; a picture of one's own is left alone. + foreach (var file in vm.UnsavedFiles) + marks.Discard(file); trimmer.Request(); }; _annotateWindow = win; + vm.PictureSkipped += marks.Discard; // nor is a frame skipped: there is no way back to it + vm.PropertyChanged += (_, e) => + { + if (e.PropertyName is nameof(AnnotateViewModel.CurrentIndex) or nameof(AnnotateViewModel.IsFinished) && _annotateWindow == win) + KeepAnnotateAboveClip(); + }; + if (pictures.Any(file => marks.VideoOf(file) is not null)) + KeepAnnotateAboveClip(); // above the clip window from the start, not a moment after win.Show(); win.Activate(); + return vm; + } + + /// + /// "Mark this frame" in Cut a clip: opens in Annotate with under + /// it, or, while Annotate is open on pictures still to mark, adds it as the next one, so the picture being marked + /// isn't lost. Annotate comes up over the clip window, which stays on top. + /// + internal void AnnotateFrame(string frame, string? note = null) + { + if (_annotateWindow is { DataContext: AnnotateViewModel { IsDone: false } open } window) + { + open.Add(frame, note); + KeepAnnotateAboveClip(); + if (window.WindowState == WindowState.Minimized) + window.WindowState = WindowState.Normal; + window.Activate(); + return; + } + var tool = services.GetRequiredService().FindPreset(BuiltInData.AnnotateId) is { IsAnnotateTool: true } saved + ? saved : BuiltInData.AnnotatePresets().Single(); + if (OpenAnnotateWindow([frame], tool) is { } opened) + opened.SetNote(frame, note); + else + services.GetRequiredService().Discard(frame); // nothing can open it: it isn't needed + } + + /// + /// Annotate sits above the clip window, which stays on top, while it holds frames from it still to mark; otherwise + /// it is an ordinary window. Applied when a frame arrives, when Annotate moves to another picture and when a clip + /// window opens or closes. + /// + private void KeepAnnotateAboveClip() + { + if (_annotateWindow is not { DataContext: AnnotateViewModel vm } window) + return; + window.Topmost = AnnotateOnTop(_clipWindow is not null, vm.RemainingFiles, services.GetRequiredService()); } + /// + /// The rule of : a clip window is open, and frames from it wait. + /// + internal static bool AnnotateOnTop(bool clipWindowOpen, IEnumerable unsaved, MarkedFrames marks) => + clipWindowOpen && unsaved.Any(file => marks.VideoOf(file) is not null); + /// /// Opens the "Add background" window on the pictures among the files. Each picture is written by an ordinary /// conversion, shown in the toast. diff --git a/src/Filee.App/ViewModels/AnnotateViewModel.cs b/src/Filee.App/ViewModels/AnnotateViewModel.cs index 468d57aa5..b27105af4 100644 --- a/src/Filee.App/ViewModels/AnnotateViewModel.cs +++ b/src/Filee.App/ViewModels/AnnotateViewModel.cs @@ -17,7 +17,10 @@ namespace Filee.App.ViewModels; public sealed partial class AnnotateViewModel : ObservableObject, IDisposable { - private readonly IReadOnlyList _files; + /// + /// The pictures, in order; "Mark this frame" can add one while the window is open (). + /// + private readonly List _files; private readonly Preset _preset; private readonly ILocalizer _loc; private readonly UserDataStore _store; @@ -27,12 +30,12 @@ public sealed partial class AnnotateViewModel : ObservableObject, IDisposable private bool _closed; /// How each picture went: saved, skipped or failed (none yet while it is open). - private readonly CropItemState?[] _outcomes; + private readonly List _outcomes; public AnnotateViewModel(IReadOnlyList files, Preset tool, ILocalizer loc, UserDataStore store, Func targetFor, Action export, ILogger? log = null) { - _files = files; + _files = [.. files]; _preset = tool; _loc = loc; _store = store; @@ -42,7 +45,7 @@ public AnnotateViewModel(IReadOnlyList files, Preset tool, ILocalizer lo _color = AnnotateTool.Colors.Contains(tool.Image.AnnotationColor) ? tool.Image.AnnotationColor! : AnnotateTool.Colors[0]; _width = tool.Image.AnnotationWidth; _hasMultipleFiles = files.Count > 1; - _outcomes = new CropItemState?[files.Count]; + _outcomes = [.. Enumerable.Repeat(null, files.Count)]; Swatches = [.. AnnotateTool.Colors.Select((c, i) => new AnnotateSwatch(c, AnnotateTool.ColorNameKeys[i], this) { Name = loc[AnnotateTool.ColorNameKeys[i]] })]; Marks.Changed += OnMarksChanged; loc.LanguageChanged += OnLanguageChanged; @@ -69,6 +72,15 @@ public AnnotateViewModel(IReadOnlyList files, Preset tool, ILocalizer lo [ObservableProperty] private Avalonia.PixelSize _pictureSize; [ObservableProperty] private string _statusNotice = ""; + /// A note about the picture shown (), or empty. + [ObservableProperty] private string _pictureNote = ""; + + /// The notes given with pictures, by path. + private readonly Dictionary _notes = []; + + /// Where the next added picture goes: after the one shown, and after those added before it. + private int _addAt = -1; + /// /// All pictures are done and some could not be opened or saved: the window stays open on and /// until it is closed (as "Pixelate / blur" does). @@ -121,6 +133,9 @@ public AnnotateViewModel(IReadOnlyList files, Preset tool, ILocalizer lo public event Action? CloseRequested; + /// A picture was skipped: there is no way back to it (one whose save failed isn't). + public event Action? PictureSkipped; + partial void OnModeChanged(AnnotateMode value) { // A drawing tool leaves the selection: what it draws gets selected instead. @@ -210,6 +225,55 @@ public void EditText(int index, string text) // ───────── Pictures and saving ───────── + /// + /// Adds as the next picture ("Mark this frame" again while the window is open): the picture + /// being marked stays, with its marks, and frames added one after another keep their order. + /// + public void Add(string path, string? note = null) + { + if (IsDone) + return; + _addAt = Math.Max(_addAt, CurrentIndex + 1); + _files.Insert(_addAt, path); + _outcomes.Insert(_addAt, null); + for (var i = 0; i < _problemFiles.Count; i++) + if (_problemFiles[i] >= _addAt) + _problemFiles[i]++; + _addAt++; + SetNote(path, note); + HasMultipleFiles = true; + CounterText = _loc.Format("crop.page_counter", CurrentIndex + 1, _files.Count); + OnPropertyChanged(nameof(SaveText)); + } + + /// A note shown under the picture while is open (null: none). + public void SetNote(string path, string? note) + { + if (string.IsNullOrEmpty(note)) + return; + _notes[path] = note; + if (_files[CurrentIndex] == path) + PictureNote = note; + } + + /// + /// The pictures whose marked copy wasn't started: skipped, failed, or not reached when the window closed. + /// + public IReadOnlyList UnsavedFiles => [.. _files.Where((_, i) => _outcomes[i] != CropItemState.Done)]; + + /// The picture shown and those after it: what is still to mark. + public IReadOnlyList RemainingFiles => IsDone ? [] : [.. _files.Skip(CurrentIndex)]; + + /// + /// All pictures are done, or the window is closing or closed: what is added now needs a window of its own. + /// + public bool IsDone => _closing || _closed || IsFinished; + + private bool _closing; + + /// The window has begun to close (Closed may come a moment later): it takes no more pictures. + public void BeginClosing() => _closing = true; + /// /// Opens picture with no marks; past the last one, closes, or shows the summary when a /// picture could not be opened or saved. @@ -227,6 +291,7 @@ public async Task LoadFileAsync(int index) CurrentIndex = index; var path = _files[index]; CurrentFileName = Path.GetFileName(path); + PictureNote = _notes.GetValueOrDefault(path, ""); CounterText = _loc.Format("crop.page_counter", index + 1, _files.Count); OnPropertyChanged(nameof(SaveText)); Marks.Reset(); @@ -293,6 +358,8 @@ private async Task SkipAsync() if (IsBusy || IsFinished) return; _outcomes[CurrentIndex] ??= CropItemState.Skipped; + if (_outcomes[CurrentIndex] == CropItemState.Skipped) + PictureSkipped?.Invoke(_files[CurrentIndex]); await LoadFileAsync(CurrentIndex + 1); } diff --git a/src/Filee.App/ViewModels/ClipWindowViewModel.cs b/src/Filee.App/ViewModels/ClipWindowViewModel.cs index 83a8e330f..dd96ae7f8 100644 --- a/src/Filee.App/ViewModels/ClipWindowViewModel.cs +++ b/src/Filee.App/ViewModels/ClipWindowViewModel.cs @@ -85,6 +85,22 @@ public sealed partial class ClipWindowViewModel : ObservableObject, IDisposable private readonly string _workFolder; private readonly bool _ringtone; + /// + /// Where "Mark this frame" puts the frames it takes, and Annotate, which opens them (the frame and a note about + /// it); null: no marking. + /// + private readonly MarkedFrames? _marks; + private readonly Action? _annotate; + + /// + /// Cancelled when the window closes, unless it closed after the last video (F, then Enter): a frame being taken + /// still opens after Save or Skip moves on, and after the last one. + /// + private readonly CancellationTokenSource _markCts = new(); + + /// The window closed after the last video, which keeps a frame being taken. + private bool _keepsMarking; + private CancellationTokenSource _fileCts = new(); private CancellationTokenSource? _previewCts; private CancellationTokenSource? _playCts; @@ -113,6 +129,7 @@ public sealed partial class ClipWindowViewModel : ObservableObject, IDisposable /// Reading the video (its length): the timeline and the buttons wait. [ObservableProperty] [NotifyPropertyChangedFor(nameof(CanEdit))] + [NotifyCanExecuteChangedFor(nameof(MarkFrameCommand))] private bool _isLoading; [ObservableProperty] @@ -126,12 +143,14 @@ public sealed partial class ClipWindowViewModel : ObservableObject, IDisposable [NotifyPropertyChangedFor(nameof(StartText))] [NotifyPropertyChangedFor(nameof(PreviewTime))] [NotifyPropertyChangedFor(nameof(PreviewLabel))] + [NotifyPropertyChangedFor(nameof(FrameTimeText))] private double _start; [ObservableProperty] [NotifyPropertyChangedFor(nameof(EndText))] [NotifyPropertyChangedFor(nameof(PreviewTime))] [NotifyPropertyChangedFor(nameof(PreviewLabel))] + [NotifyPropertyChangedFor(nameof(FrameTimeText))] private double _end; /// How long the clip plays (its pieces at their speeds, without those cut out). @@ -144,6 +163,8 @@ public sealed partial class ClipWindowViewModel : ObservableObject, IDisposable [NotifyPropertyChangedFor(nameof(IsEndActive))] [NotifyPropertyChangedFor(nameof(PreviewTime))] [NotifyPropertyChangedFor(nameof(PreviewLabel))] + [NotifyPropertyChangedFor(nameof(FrameTimeText))] + [NotifyPropertyChangedFor(nameof(IsMarkerFrame))] private ClipHandle _activeHandle; /// Where the playhead stands in the video: where the blade cuts and playing starts. @@ -151,6 +172,7 @@ public sealed partial class ClipWindowViewModel : ObservableObject, IDisposable [NotifyPropertyChangedFor(nameof(PlayheadText))] [NotifyPropertyChangedFor(nameof(PreviewTime))] [NotifyPropertyChangedFor(nameof(PreviewLabel))] + [NotifyPropertyChangedFor(nameof(FrameTimeText))] private double _playhead; /// The pieces between the start and the end (a copy, new after each change). @@ -207,6 +229,11 @@ public sealed partial class ClipWindowViewModel : ObservableObject, IDisposable [ObservableProperty] [NotifyPropertyChangedFor(nameof(IsSoundOnly))] [NotifyPropertyChangedFor(nameof(TimelineHeight))] + [NotifyPropertyChangedFor(nameof(ShowsMarkFrame))] + [NotifyPropertyChangedFor(nameof(FrameTimeText))] + [NotifyPropertyChangedFor(nameof(IsMarkerFrame))] + [NotifyPropertyChangedFor(nameof(PreviewLabel))] + [NotifyCanExecuteChangedFor(nameof(MarkFrameCommand))] private bool _hasPicture = true; /// The loudness of the sound over the video (0 to 1), empty until read or without sound. @@ -253,6 +280,13 @@ public sealed partial class ClipWindowViewModel : ObservableObject, IDisposable [NotifyPropertyChangedFor(nameof(IsBusy))] private bool _isFindingSilence; + /// "Mark this frame" is taking the frame at full size. + [ObservableProperty] + [NotifyPropertyChangedFor(nameof(BusyText))] + [NotifyPropertyChangedFor(nameof(IsBusy))] + [NotifyCanExecuteChangedFor(nameof(MarkFrameCommand))] + private bool _isMarkingFrame; + /// A short note after an action (silences removed, nowhere to cut), shown for a moment. [ObservableProperty] [NotifyPropertyChangedFor(nameof(HasMessage))] @@ -266,6 +300,7 @@ public sealed partial class ClipWindowViewModel : ObservableObject, IDisposable [ObservableProperty] [NotifyPropertyChangedFor(nameof(IsEditing))] [NotifyPropertyChangedFor(nameof(CanEdit))] + [NotifyCanExecuteChangedFor(nameof(MarkFrameCommand))] private bool _isFinished; [ObservableProperty] private string _summary = ""; @@ -295,9 +330,10 @@ public sealed partial class ClipWindowViewModel : ObservableObject, IDisposable public string BusyText => IsBuffering ? _loc["clip.preparing"] : IsFindingSilence ? _loc["clip.finding_silence"] : IsAddingMusic ? _loc["clip.loading_music"] + : IsMarkingFrame ? _loc["clip.marking_frame"] : ""; - public bool IsBusy => IsBuffering || IsFindingSilence || IsAddingMusic; + public bool IsBusy => IsBuffering || IsFindingSilence || IsAddingMusic || IsMarkingFrame; /// "3 pieces selected" when several are, else empty. public string SelectionText => SelectedIndices.Count > 1 ? _loc.Format("clip.selected_count", SelectedIndices.Count) : ""; @@ -317,6 +353,21 @@ public sealed partial class ClipWindowViewModel : ObservableObject, IDisposable public string LengthText => ClipRange.Display(Length); public string DurationText => ClipRange.Display(Duration); public string PlayheadText => ClipRange.Display(Playhead); + + /// + /// The time beside Play: the time of the frame in the large picture, so of the frame "Mark this frame" takes: the + /// start's, or the clip's last frame for the end, while that handle is chosen (), else + /// the playhead's; a sound, with no picture, always the playhead's. + /// + public string FrameTimeText => IsMarkerFrame ? ClipRange.Display(PreviewTime) : PlayheadText; + + /// + /// The picture shows the start's or the end's frame: the time beside Play is tinted as that field is. + /// + public bool IsMarkerFrame => HasPicture && ActiveHandle is ClipHandle.Start or ClipHandle.End; + + /// "Mark this frame" under the picture: a video's frames, with Annotate to open them in. + public bool ShowsMarkFrame => HasPicture && _marks is not null && _annotate is not null && !_ringtone; public string ViewStartText => ClipRange.Display(ViewStart); public string ViewEndText => ClipRange.Display(ViewEnd); public bool Can15 => Duration > QuickLengths[0]; @@ -482,13 +533,12 @@ public double PreviewTime } } - /// "Start 0:12.4" over the large picture. - public string PreviewLabel => ActiveHandle switch - { - ClipHandle.Start => $"{_loc["clip.start"]} {StartText}", - ClipHandle.End => $"{_loc["clip.end"]} {EndText}", - _ => $"{_loc["clip.playhead"]} {PlayheadText}", - }; + /// + /// "Start 0:12.4": which frame the large picture shows, what a screen reader says for the time beside Play. + /// + public string PreviewLabel => IsMarkerFrame + ? $"{_loc[ActiveHandle == ClipHandle.Start ? "clip.start" : "clip.end"]} {FrameTimeText}" + : $"{_loc["clip.playhead"]} {PlayheadText}"; /// "15 s", "30 s", "60 s" on the quick length buttons. public string Length15Text => _loc.Format("clip.seconds", QuickLengths[0]); @@ -505,10 +555,17 @@ public double PreviewTime /// /// is a ringtone preset () and the window only picks the part of each sound. /// + /// Where "Mark this frame" writes its frames; used with . + /// + /// Opens a frame "Mark this frame" took in Annotate, with a note about it; null: the window offers no marking. + /// public ClipWindowViewModel(IReadOnlyList files, Preset tool, ILocalizer loc, UserDataStore store, IVideoFrameSource frames, - Func targetFor, Action export, ILogger? log = null, bool ringtone = false) + Func targetFor, Action export, ILogger? log = null, bool ringtone = false, + MarkedFrames? marks = null, Action? annotate = null) { _ringtone = ringtone; + _marks = marks; + _annotate = annotate; _files = files; _tool = tool; _loc = loc; @@ -1417,9 +1474,77 @@ public async Task SkipAsync() await LoadFileAsync(CurrentIndex + 1); } - /// Close (Esc). Clips already started go on in the toast. + // ───────────────────────── Mark this frame ───────────────────────── + + private bool CanMarkFrame() => ShowsMarkFrame && CanEdit && !IsMarkingFrame && !_closed; + + /// + /// "Mark this frame" (F): the frame in the large picture at the size the video is shown at, opened in Annotate. + /// While the clip plays, playing stops first, on the frame shown. The window stays open, to mark more; a frame + /// being taken still opens when the window moves to the next video or closes (F, then Enter). + /// + [RelayCommand(CanExecute = nameof(CanMarkFrame))] + public async Task MarkFrameAsync() + { + if (!CanMarkFrame() || _marks is null || _annotate is null) + return; + StopPlaying(); + var video = _files[CurrentIndex]; + var seconds = PreviewTime; + string? frame = null; + void Discard() + { + if (frame is not null) + _marks.Discard(frame); + } + void Fail() + { + Discard(); + if (!_closed) + ShowMessage(_loc["clip.mark_frame_failed"]); + } + IsMarkingFrame = true; + try + { + frame = _marks.NewPath(video, seconds); + var still = await _frames.WriteStillAsync(video, seconds, frame, _markCts.Token); + // Dropped meanwhile: the window closed, or Filee is quitting and took the frames. + if (_markCts.IsCancellationRequested || !_marks.IsWanted(frame)) + Discard(); + else if (still.Written) + // Said in Annotate, which opens over this window. + _annotate(frame, still.ColorsNotConverted ? _loc["clip.mark_frame_hdr"] : null); + else + { + // FFmpeg said why in the log; the window may have closed (F, then Enter) and can't say it. + _log?.LogWarning("Could not mark the frame at {Seconds} s of {File}", seconds, video); + Fail(); + } + } + catch (OperationCanceledException) when (_markCts.IsCancellationRequested) + { + Discard(); + } + catch (Exception ex) when (ex is not OutOfMemoryException) + { + _log?.LogError(ex, "Could not mark the frame at {Seconds} s of {File}", seconds, video); + Fail(); + } + finally + { + IsMarkingFrame = false; + } + } + + /// + /// Close (Esc). Clips already started go on in the toast; a frame still being taken is dropped, unless the window + /// shows the summary after the last video. + /// [RelayCommand] - public void Cancel() + public void Cancel() => Close(); + + /// Closes the window. + private void Close() { Shutdown(); CloseRequested?.Invoke(); @@ -1539,12 +1664,16 @@ private void AddProblem(string path, string key) StatusNotice = line; } - /// Closes after the last file, or stays open on the summary when a file could not be opened. + /// + /// Closes after the last file, or stays open on the summary when a file could not be opened. Either way, a frame + /// still being taken opens in Annotate, also when the summary is then closed. + /// private void Finish() { + _keepsMarking = true; if (Problems.Count == 0) { - Cancel(); + Close(); return; } IsLoading = false; @@ -1578,6 +1707,8 @@ private void Shutdown() if (_closed) return; _closed = true; + if (!_keepsMarking) + _markCts.Cancel(); _playCts?.Cancel(); _detailCts?.Cancel(); _fileCts.Cancel(); diff --git a/src/Filee.App/Views/AnnotateWindow.axaml b/src/Filee.App/Views/AnnotateWindow.axaml index d5819e2f6..0cea91262 100644 --- a/src/Filee.App/Views/AnnotateWindow.axaml +++ b/src/Filee.App/Views/AnnotateWindow.axaml @@ -135,6 +135,11 @@ + + + { + if (!e.Cancel) + vm.BeginClosing(); + }; Closed += (_, _) => vm.Dispose(); }; } diff --git a/src/Filee.App/Views/ClipWindow.axaml b/src/Filee.App/Views/ClipWindow.axaml index 827c5c60c..44a871aa2 100644 --- a/src/Filee.App/Views/ClipWindow.axaml +++ b/src/Filee.App/Views/ClipWindow.axaml @@ -1,8 +1,8 @@ + the middle, with "Mark this frame" under it; floating on the stage the file chip (top left), maximize and close + (top right), and at the bottom a card with the start, length and end, the timeline of the video with the clip + between two handles, and the toolbar pill with the quick lengths, the fast / exact choice, Skip and "Save clip". + After the last file, when a file could not be opened, a card with what went wrong. --> M2 11h2v2H2z M5.5 8h2v8h-2z M9 5h2v14H9z M17 8h2v8h-2z M20 11h2v2h-2z M12.6 11.3h2.8v1.4h-2.8z M12,3V12.26C11.5,12.09 11,12 10.5,12C8,12 6,14 6,16.5C6,19 8,21 10.5,21C13,21 15,19 15,16.5V6H19V3H12Z M12,4L9.91,6.09L12,8.18M4.27,3L3,4.27L7.73,9H3V15H7L12,20V13.27L16.25,17.53C15.58,18.04 14.83,18.46 14,18.7V20.77C15.38,20.45 16.63,19.82 17.68,18.96L19.73,21L21,19.73L12,10.73M19,12C19,12.94 18.8,13.82 18.46,14.64L19.97,16.15C20.62,14.91 21,13.5 21,12C21,7.72 18,4.14 14,3.23V5.29C16.89,6.15 19,8.83 19,12M16.5,12C16.5,10.23 15.5,8.71 14,7.97V10.18L16.45,12.63C16.5,12.43 16.5,12.21 16.5,12Z + + M7 16C7.55 16 8 16.45 8 17C8 18.1 7.1 19 6 19C5.83 19 5.67 19 5.5 18.95C5.81 18.4 6 17.74 6 17C6 16.45 6.45 16 7 16M18.67 3C18.41 3 18.16 3.1 17.96 3.29L9 12.25L11.75 15L20.71 6.04C21.1 5.65 21.1 5 20.71 4.63L19.37 3.29C19.17 3.09 18.92 3 18.67 3M7 14C5.34 14 4 15.34 4 17C4 18.31 2.84 19 2 19C2.92 20.22 4.5 21 6 21C8.21 21 10 19.21 10 17C10 15.34 8.66 14 7 14Z M13,20V4H15.03V20H13M10,20V4H12.03V20H10M5,8L9.03,12L5,16V13H2V11H5V8M20,16L16,12L20,8V11H23V13H20V16Z @@ -112,6 +114,36 @@ + + + + + + + + +