From 30835e94c03466556b0f4283ea8b1934e681097e Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Tue, 23 Nov 2021 01:32:42 +0100 Subject: [PATCH] UI: can set default crop, stretch. (TODO: actually get and use those values) --- src/common/interfaces/SettingsInterface.ts | 18 ++- src/csui/PlayerUiPanels/VideoSettings.vue | 151 ++++++++++++++++++++- src/ext/conf/ExtensionConf.ts | 16 ++- src/ext/lib/Settings.ts | 85 ++++++++---- src/ext/lib/video-transform/Stretcher.ts | 4 +- 5 files changed, 239 insertions(+), 35 deletions(-) diff --git a/src/common/interfaces/SettingsInterface.ts b/src/common/interfaces/SettingsInterface.ts index 5464b51..f70fab4 100644 --- a/src/common/interfaces/SettingsInterface.ts +++ b/src/common/interfaces/SettingsInterface.ts @@ -172,6 +172,10 @@ interface SettingsInterface { restrictions?: RestrictionsSettings; + crop: { + default: any; + }, + zoom: { minLogZoom: number, maxLogZoom: number, @@ -186,6 +190,7 @@ interface SettingsInterface { defaultAr?: any }, stretch: { + default: any; conditionalDifferencePercent: number // black bars less than this wide will trigger stretch // if mode is set to '1'. 1.0=100% }, @@ -283,10 +288,15 @@ interface SettingsInterface { // sites: { [x: string]: { - mode?: ExtensionMode, - autoar?: ExtensionMode, - autoarFallback?: ExtensionMode, - stretch?: StretchType, + defaultCrop?: any, // v6 new + defaultStretch?: any, // v6 new + + // everything 'superseded by' needs to be implemented + // as well as ported from the old settings + mode?: ExtensionMode, // v6 — superseded by defaultCrop + autoar?: ExtensionMode, // v6 — superseded by defaultCrop + autoarFallback?: ExtensionMode, // v6 — deprecated, no replacement + stretch?: StretchType, // v6 — superseded by defaultStretch videoAlignment?: VideoAlignmentType, keyboardShortcutsEnabled?: ExtensionMode, type?: string, diff --git a/src/csui/PlayerUiPanels/VideoSettings.vue b/src/csui/PlayerUiPanels/VideoSettings.vue index 46c1ef6..73b253e 100644 --- a/src/csui/PlayerUiPanels/VideoSettings.vue +++ b/src/csui/PlayerUiPanels/VideoSettings.vue @@ -1,5 +1,8 @@