mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-19 16:45:28 +00:00
Footage cache (#3271): the localizer status redraws while busy; the locations field says what it takes
The Disk page's localizer status was drawn only when something else redrew the page, so its queue and the file being copied stood still. While files are queued or copied it is drawn again every half second; idle, not at all. Network Footage Locations shows a hint (and tooltip) that it takes folders or drives separated by ;, translated in the eight catalogs that have the localizer's strings.
This commit is contained in:
1 parent
1aa604789f
commit
83a92c4d1a
2 files changed
+39
-2
No files matched your search
@@ -894,6 +894,7 @@ const JAPANESE: &[(&str, &str)] = &[
|
||||
("UNC paths (\\\\server\\share)", "UNC パス (\\\\server\\share)"),
|
||||
("Network footage: {}", "ネットワークフッテージ: {}"),
|
||||
("Limited by free disk space", "ディスクの空き容量により制限されています"),
|
||||
("Folders or drives, separated by ;", "フォルダーまたはドライブ(; で区切る)"),
|
||||
("Memory & CPU", "メモリとCPU"),
|
||||
("RAM Reserved for Other Applications", "他のアプリケーション用に確保するRAM"),
|
||||
("Cache Budgets", "キャッシュの割り当て"),
|
||||
@@ -2035,6 +2036,7 @@ const SIMPLIFIED_CHINESE: &[(&str, &str)] = &[
|
||||
("UNC paths (\\\\server\\share)", "UNC 路径 (\\\\server\\share)"),
|
||||
("Network footage: {}", "网络素材:{}"),
|
||||
("Limited by free disk space", "受磁盘可用空间限制"),
|
||||
("Folders or drives, separated by ;", "文件夹或驱动器,以 ; 分隔"),
|
||||
("Memory & CPU", "内存和 CPU"),
|
||||
("RAM Reserved for Other Applications", "为其他应用程序保留的内存"),
|
||||
("Cache Budgets", "缓存预算"),
|
||||
@@ -3156,6 +3158,7 @@ const SWEDISH: &[(&str, &str)] = &[
|
||||
("UNC paths (\\\\server\\share)", "UNC-sökvägar (\\\\server\\share)"),
|
||||
("Network footage: {}", "Nätverksmaterial: {}"),
|
||||
("Limited by free disk space", "Begränsas av ledigt diskutrymme"),
|
||||
("Folders or drives, separated by ;", "Mappar eller enheter, åtskilda med ;"),
|
||||
("Memory & CPU", "Minne och processor"),
|
||||
("RAM Reserved for Other Applications", "RAM reserverat för andra program"),
|
||||
("Cache Budgets", "Cachebudgetar"),
|
||||
@@ -4383,6 +4386,7 @@ const TRADITIONAL_CHINESE: &[(&str, &str)] = &[
|
||||
("UNC paths (\\\\server\\share)", "UNC 路徑 (\\\\server\\share)"),
|
||||
("Network footage: {}", "網路素材:{}"),
|
||||
("Limited by free disk space", "受磁碟可用空間限制"),
|
||||
("Folders or drives, separated by ;", "資料夾或磁碟機,以 ; 分隔"),
|
||||
("Memory & CPU", "記憶體和 CPU"),
|
||||
("RAM Reserved for Other Applications", "為其他應用程式保留的記憶體"),
|
||||
("Cache Budgets", "快取預算"),
|
||||
@@ -5879,6 +5883,7 @@ const PORTUGUESE: &[(&str, &str)] = &[
|
||||
("UNC paths (\\\\server\\share)", "Caminhos UNC (\\\\server\\share)"),
|
||||
("Network footage: {}", "Mídia de rede: {}"),
|
||||
("Limited by free disk space", "Limitado pelo espaço livre em disco"),
|
||||
("Folders or drives, separated by ;", "Pastas ou unidades, separadas por ;"),
|
||||
("Create Layers at Composition Start Time", "Criar camadas no tempo inicial da composição"),
|
||||
("Create Split Layers Above Original Layer", "Criar camadas divididas acima da camada original"),
|
||||
("Custom", "Personalizado"),
|
||||
@@ -6865,6 +6870,7 @@ const POLISH: &[(&str, &str)] = &[
|
||||
("UNC paths (\\\\server\\share)", "Ścieżki UNC (\\\\server\\share)"),
|
||||
("Network footage: {}", "Materiał sieciowy: {}"),
|
||||
("Limited by free disk space", "Ograniczone wolnym miejscem na dysku"),
|
||||
("Folders or drives, separated by ;", "Foldery lub dyski, rozdzielone znakiem ;"),
|
||||
("Memory & CPU", "Pamięć i procesor"),
|
||||
("RAM Reserved for Other Applications", "Pamięć RAM zarezerwowana dla innych aplikacji"),
|
||||
("Cache Budgets", "Budżety pamięci podręcznej"),
|
||||
@@ -8777,6 +8783,7 @@ const GEORGIAN: &[(&str, &str)] = &[
|
||||
("UNC paths (\\\\server\\share)", "UNC ბილიკები (\\\\server\\share)"),
|
||||
("Network footage: {}", "ქსელური მასალა: {}"),
|
||||
("Limited by free disk space", "შეზღუდულია დისკის თავისუფალი ადგილით"),
|
||||
("Folders or drives, separated by ;", "საქაღალდეები ან დისკები, გამოყოფილი ;-ით"),
|
||||
("Memory & CPU", "მეხსიერება და CPU"),
|
||||
("RAM Reserved for Other Applications", "სხვა აპლიკაციებისთვის დაჯავშნული RAM"),
|
||||
("Cache Budgets", "ქეშის ლიმიტები"),
|
||||
@@ -9769,6 +9776,7 @@ const FRENCH: &[(&str, &str)] = &[
|
||||
("UNC paths (\\\\server\\share)", "Chemins UNC (\\\\server\\share)"),
|
||||
("Network footage: {}", "Métrage réseau\u{a0}: {}"),
|
||||
("Limited by free disk space", "Limité par l’espace disque libre"),
|
||||
("Folders or drives, separated by ;", "Dossiers ou lecteurs, séparés par\u{a0};"),
|
||||
("Memory & CPU", "Mémoire et CPU"),
|
||||
("RAM Reserved for Other Applications", "Mémoire vive réservée aux autres applications"),
|
||||
("Cache Budgets", "Budgets de cache"),
|
||||
|
||||
@@ -106,7 +106,9 @@ fn page_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, page: &Page, cur: &Value
|
||||
Item::Setting { key, label, kind, live } => {
|
||||
let v = get(key);
|
||||
let id = format!("settings.{key}");
|
||||
let tip = (!live).then(|| tr("Stored, but not used by EffectCraft yet"));
|
||||
let tip = (!live)
|
||||
.then(|| tr("Stored, but not used by EffectCraft yet"))
|
||||
.or_else(|| (key == "disk.networkFootageLocations").then(|| tr(LOCATIONS_HINT)));
|
||||
let mut resp: Option<egui::Response> = None;
|
||||
// What the control is set to, for assistive technology.
|
||||
let mut value_text = String::new();
|
||||
@@ -184,7 +186,11 @@ fn page_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, page: &Page, cur: &Value
|
||||
}
|
||||
Kind::Text | Kind::Path => {
|
||||
let mut s = v.as_str().unwrap_or("").to_string();
|
||||
let r = ui.add(egui::TextEdit::singleline(&mut s).desired_width(if kind == Kind::Path { 230.0 } else { 260.0 }));
|
||||
let mut edit = egui::TextEdit::singleline(&mut s).desired_width(if kind == Kind::Path { 230.0 } else { 260.0 });
|
||||
if key == "disk.networkFootageLocations" {
|
||||
edit = edit.hint_text(tr(LOCATIONS_HINT));
|
||||
}
|
||||
let r = ui.add(edit);
|
||||
value_text = s.clone();
|
||||
if r.changed() {
|
||||
acts.push(Act::Set(key.into(), json!(s)));
|
||||
@@ -248,11 +254,24 @@ fn page_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, page: &Page, cur: &Value
|
||||
}
|
||||
}
|
||||
|
||||
/// The hint of Network Footage Locations: what the field takes.
|
||||
const LOCATIONS_HINT: &str = "Folders or drives, separated by ;";
|
||||
|
||||
/// How soon to draw the localizer's status again: while it has files to copy, every half
|
||||
/// second; idle, not at all.
|
||||
pub(crate) fn localize_repaint(s: &effectcraft_engine::render::LocalizeReport) -> Option<std::time::Duration> {
|
||||
(s.queued > 0 || s.copying.is_some()).then(|| std::time::Duration::from_millis(500))
|
||||
}
|
||||
|
||||
/// Settings ▸ Disk, under Localize Network Footage (#3271): the local copies, what is queued and
|
||||
/// being copied, and which locations count as network. Automation id
|
||||
/// `settings.disk.localizeStatus`, labelled `files=… bytes=… queued=… skipped=…`.
|
||||
fn localize_status_ui(app: &mut EffectcraftApp, ui: &mut egui::Ui, t: &Tokens, s: &effectcraft_engine::render::LocalizeReport) {
|
||||
const GB: f64 = (1u64 << 30) as f64;
|
||||
// (the status changes on its own while files are copied: drawn again until it is idle)
|
||||
if let Some(after) = localize_repaint(s) {
|
||||
ui.ctx().request_repaint_after(after);
|
||||
}
|
||||
let mut lines = vec![tr_args(
|
||||
"Local copies: {} files, {} of {} GB; {} queued, {} skipped",
|
||||
&[&s.files, &format!("{:.1}", s.bytes as f64 / GB), &format!("{:.1}", s.max_bytes as f64 / GB), &s.queued, &s.skipped],
|
||||
@@ -1362,4 +1381,14 @@ mod tests {
|
||||
drop(dc);
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// #3271 review: the localizer's status is drawn again while files are queued or copied,
|
||||
/// and not while it is idle.
|
||||
#[test]
|
||||
fn the_localizer_status_repaints_only_while_busy() {
|
||||
use effectcraft_engine::render::LocalizeReport;
|
||||
assert_eq!(super::localize_repaint(&LocalizeReport::default()), None, "idle");
|
||||
assert!(super::localize_repaint(&LocalizeReport { queued: 2, ..Default::default() }).is_some(), "queued");
|
||||
assert!(super::localize_repaint(&LocalizeReport { copying: Some("x.exr".into()), ..Default::default() }).is_some(), "copying");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user