From 829047585a58f34431a76ceb2d308d5392ab230d Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sun, 31 Oct 2021 23:19:32 +0100 Subject: [PATCH] Get manual zoom to work --- src/common/mixins/ComputeActionsMixin.js | 41 ++-------- .../mixins/LegacyComputeActionsMixin.js | 37 +++++++++ src/csui/PlayerUiPanels/VideoSettings.vue | 78 +++++++------------ src/ext/lib/video-transform/Resizer.ts | 64 +++++++++------ src/ext/lib/video-transform/Zoom.ts | 44 ++++++++--- 5 files changed, 145 insertions(+), 119 deletions(-) create mode 100644 src/common/mixins/LegacyComputeActionsMixin.js diff --git a/src/common/mixins/ComputeActionsMixin.js b/src/common/mixins/ComputeActionsMixin.js index 9c5bd2f..65399fb 100644 --- a/src/common/mixins/ComputeActionsMixin.js +++ b/src/common/mixins/ComputeActionsMixin.js @@ -1,37 +1,6 @@ export default { - computed: { - scopeActions: function() { - return this.settings?.active.actions?.filter(x => { - if (! x.scopes) { - console.error('This action does not have a scope.', x); - return false; - } - return x.scopes[this.scope] && x.scopes[this.scope].show - }) || []; - }, - extensionActions: function(){ - return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-ExtensionMode') || []; - }, - aardActions: function(){ - return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-autoar-mode') || []; - }, - aspectRatioActions: function(){ - return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-ar') || []; - }, - cropModePersistenceActions: function() { - return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-ar-persistence') || []; - }, - stretchActions: function(){ - return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-stretch') || []; - }, - keyboardActions: function() { - return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-keyboard') || []; - }, - alignmentActions: function() { - return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-alignment') || []; - }, - otherActions: function() { - return this.scopeActions.filter(x => x.cmd.length > 1) || []; - } - } -} \ No newline at end of file + // computed: { + // aspectRatioActions: this.settings?.active.commands.crop, + // stretchActions: this.settings?.active.commands.stretch + // } +} diff --git a/src/common/mixins/LegacyComputeActionsMixin.js b/src/common/mixins/LegacyComputeActionsMixin.js new file mode 100644 index 0000000..9c5bd2f --- /dev/null +++ b/src/common/mixins/LegacyComputeActionsMixin.js @@ -0,0 +1,37 @@ +export default { + computed: { + scopeActions: function() { + return this.settings?.active.actions?.filter(x => { + if (! x.scopes) { + console.error('This action does not have a scope.', x); + return false; + } + return x.scopes[this.scope] && x.scopes[this.scope].show + }) || []; + }, + extensionActions: function(){ + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-ExtensionMode') || []; + }, + aardActions: function(){ + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-autoar-mode') || []; + }, + aspectRatioActions: function(){ + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-ar') || []; + }, + cropModePersistenceActions: function() { + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-ar-persistence') || []; + }, + stretchActions: function(){ + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-stretch') || []; + }, + keyboardActions: function() { + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-keyboard') || []; + }, + alignmentActions: function() { + return this.scopeActions.filter(x => x.cmd.length === 1 && x.cmd[0].action === 'set-alignment') || []; + }, + otherActions: function() { + return this.scopeActions.filter(x => x.cmd.length > 1) || []; + } + } +} \ No newline at end of file diff --git a/src/csui/PlayerUiPanels/VideoSettings.vue b/src/csui/PlayerUiPanels/VideoSettings.vue index 7f5c25b..07c297d 100644 --- a/src/csui/PlayerUiPanels/VideoSettings.vue +++ b/src/csui/PlayerUiPanels/VideoSettings.vue @@ -1,33 +1,33 @@