From c9659e777bf4a0d48607230c59b610c754934ac2 Mon Sep 17 00:00:00 2001 From: fangxiang Date: Wed, 19 Oct 2022 12:40:04 +0800 Subject: [PATCH] =?UTF-8?q?special=5Fvideo=20HDMI=E9=87=87=E9=9B=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=AE=A3=E4=BC=A0=E3=80=82=E5=8F=B3=E9=94=AE=E5=BC=80?= =?UTF-8?q?=E7=AA=97=E5=A2=9E=E5=8A=A0=E6=97=8B=E8=BD=AC=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E3=80=82=E5=9B=BE=E7=89=87=E4=BF=A1=E5=8F=B7=E6=BA=90=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=97=8B=E8=BD=AC=E5=8F=82=E6=95=B0=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 6 ++ src/components/SignalSourceDialog.vue | 3 +- src/components/SignalSourceTree.vue | 61 +++++++++++++ src/components/UpgradeDialog.vue | 2 +- src/entities/ApplicationConfigEntity.ts | 1 + src/entities/WSProtocol.ts | 17 ++++ src/i18n/en-US/index.ts | 1 + src/i18n/zh-CN/index.ts | 1 + src/pad/ContentWall.vue | 91 ++++++++++++++------ src/pages/WallPage.vue | 108 ++++++++++++++++-------- 10 files changed, 231 insertions(+), 60 deletions(-) diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index d2d2432..fd5624f 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1115,6 +1115,12 @@ export default class ClientConnection { ); } + public async setHdmiRotation(rotation: number) { + this.ws?.send( + JSON.stringify(new Protocol.SetHDMIRotationRequestEntity(rotation)) + ); + } + public async getTimingTasks() { try { return await this.doRpc( diff --git a/src/components/SignalSourceDialog.vue b/src/components/SignalSourceDialog.vue index d76a34a..d45b0ba 100644 --- a/src/components/SignalSourceDialog.vue +++ b/src/components/SignalSourceDialog.vue @@ -137,7 +137,8 @@ diff --git a/src/components/SignalSourceTree.vue b/src/components/SignalSourceTree.vue index d15cb00..9451a03 100644 --- a/src/components/SignalSourceTree.vue +++ b/src/components/SignalSourceTree.vue @@ -77,6 +77,41 @@ + + + {{ $t("rotation") }} + + + + + + + + {{ n }}° + + + + + + + { + try { + const response = await GlobalData.getInstance() + .getCurrentClient() + ?.addSignalSource(signal_source); - if (response && response.success) { - if ( - target_rect && - !isNaN(target_rect.x) && - !isNaN(target_rect.y) && - !isNaN(target_rect.w) && - !isNaN(target_rect.h) - ) { - const open_window_request = - new Protocol.OpenWindowRequestEntity( - response.uuid, - target_rect.x, - target_rect.y, - target_rect.w, - target_rect.h - ); - GlobalData.getInstance() - .getCurrentClient() - ?.openWindow(open_window_request); + if (response && response.success) { + if ( + target_rect && + !isNaN(target_rect.x) && + !isNaN(target_rect.y) && + !isNaN(target_rect.w) && + !isNaN(target_rect.h) + ) { + const open_window_request = + new Protocol.OpenWindowRequestEntity( + response.uuid, + target_rect.x, + target_rect.y, + target_rect.w, + target_rect.h + ); + GlobalData.getInstance() + .getCurrentClient() + ?.openWindow(open_window_request); + } } - } - } catch {} + } catch {} + }; + + if ($store.state.isSpecialVideo()) { + $q.dialog({ + title: $t.t("open window"), + message: $t.t("please select window rotation") + ":", + options: { + type: "radio", + model: "0", + items: [ + { label: "0°", value: "0" }, + { label: "90°", value: "90" }, + { label: "180°", value: "180" }, + { label: "270°", value: "270" }, + ], + }, + ok: { + label: $t.t("ok"), + noCaps: true, + flat: true, + }, + cancel: { + label: $t.t("cancel"), + noCaps: true, + flat: true, + }, + persistent: true, + }).onOk(async (data) => { + let temp_rotation = parseInt(data); + if (isNaN(temp_rotation) || temp_rotation == Infinity) { + temp_rotation = 0; + } + entity.rotation = temp_rotation; + do_open_local_source(entity); + }); + } else { + do_open_local_source(entity); + } } } }, diff --git a/src/pages/WallPage.vue b/src/pages/WallPage.vue index 9cad214..50203c6 100644 --- a/src/pages/WallPage.vue +++ b/src/pages/WallPage.vue @@ -1181,44 +1181,86 @@ export default defineComponent({ entity.name = file.name; entity.local_file_flag = true; entity.group_uuid = ""; - try { - const response = await GlobalData.getInstance() - .getCurrentClient() - ?.addSignalSource(entity); - if (response && response.success) { - const cell_width = 1.0 / $store.state.wall_col; - const cell_height = 1.0 / $store.state.wall_row; - const col = Math.floor( - last_context_menu_pos_x.value / - wall.value.offsetWidth / - cell_width - ); - const row = Math.floor( - last_context_menu_pos_y.value / - wall.value.offsetHeight / - cell_height - ); + const do_open_local_source = async ( + signal_source: SignalSourceEntity + ) => { + try { + const response = await GlobalData.getInstance() + .getCurrentClient() + ?.addSignalSource(signal_source); + if (wall.value && response && response.success) { + const cell_width = 1.0 / $store.state.wall_col; + const cell_height = 1.0 / $store.state.wall_row; - const x = col * cell_width; - const y = row * cell_height; - - if (!isNaN(x) && !isNaN(y)) { - const open_window_request = - new Protocol.OpenWindowRequestEntity( - response.uuid, - x, - y, - cell_width, + const col = Math.floor( + last_context_menu_pos_x.value / + wall.value.offsetWidth / + cell_width + ); + const row = Math.floor( + last_context_menu_pos_y.value / + wall.value.offsetHeight / cell_height - ); + ); - GlobalData.getInstance() - .getCurrentClient() - ?.openWindow(open_window_request); + const x = col * cell_width; + const y = row * cell_height; + + if (!isNaN(x) && !isNaN(y)) { + const open_window_request = + new Protocol.OpenWindowRequestEntity( + response.uuid, + x, + y, + cell_width, + cell_height + ); + + GlobalData.getInstance() + .getCurrentClient() + ?.openWindow(open_window_request); + } } - } - } catch {} + } catch {} + }; + + if ($store.state.isSpecialVideo()) { + $q.dialog({ + title: $t.t("open window"), + message: $t.t("please select window rotation") + ":", + options: { + type: "radio", + model: "0", + items: [ + { label: "0°", value: "0" }, + { label: "90°", value: "90" }, + { label: "180°", value: "180" }, + { label: "270°", value: "270" }, + ], + }, + ok: { + label: $t.t("ok"), + noCaps: true, + flat: true, + }, + cancel: { + label: $t.t("cancel"), + noCaps: true, + flat: true, + }, + persistent: true, + }).onOk(async (data) => { + let temp_rotation = parseInt(data); + if (isNaN(temp_rotation) || temp_rotation == Infinity) { + temp_rotation = 0; + } + entity.rotation = temp_rotation; + do_open_local_source(entity); + }); + } else { + do_open_local_source(entity); + } } } },