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); + } } } },