From 3ad93689d15f17f163f36568e2c8e79aaeeb38df Mon Sep 17 00:00:00 2001 From: fangxiang Date: Tue, 1 Nov 2022 14:11:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?HDMI=E9=87=87=E9=9B=86=E5=8F=B3=E9=94=AE?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=B7=BB=E5=8A=A0=E9=9F=B3=E9=A2=91=E9=87=87?= =?UTF-8?q?=E9=9B=86=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 10 +++ src/components/SignalSourceTree.vue | 93 +++++++++++++++++++++++++ src/entities/ApplicationConfigEntity.ts | 2 + src/entities/WSProtocol.ts | 28 ++++++++ src/i18n/en-US/index.ts | 4 ++ src/i18n/zh-CN/index.ts | 2 + 6 files changed, 139 insertions(+) diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index fd5624f..a156545 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1180,6 +1180,16 @@ export default class ClientConnection { } } + public async setHdmiInAudioDevice(index: number, type: string) { + try { + return await this.doRpc( + new Protocol.SetHdmiInAudioDeviceRequestEntity(index, type) + ); + } catch (e) { + console.error(e); + } + } + public async getCityList(language?: string) { try { return await this.doRpc( diff --git a/src/components/SignalSourceTree.vue b/src/components/SignalSourceTree.vue index eb0d7e7..c962716 100644 --- a/src/components/SignalSourceTree.vue +++ b/src/components/SignalSourceTree.vue @@ -112,6 +112,53 @@ + + + {{ $t("hdmi audio frequency acquisition device") }} + + + + + + + + {{ $t(item.label) }} + + + + + + + { content_height.value = window.innerHeight - 135; @@ -272,6 +321,8 @@ export default defineComponent({ content_height, lossy_pic, current_hdmi_rotation, + hw_version, + current_hdmi_audio_device, loga(a: any) { console.log(a); @@ -432,6 +483,15 @@ export default defineComponent({ lossy_pic.value = GlobalData.getInstance().applicationConfig?.hdmi_in_decode_type_1 == "NV12"; + + const num = parseInt( + GlobalData.getInstance().applicationConfig?.hw_version ?? "1" + ); + if (isNaN(num)) { + hw_version.value = 1; + } else { + hw_version.value = num; + } }, async setHdmiInDecodeType(index: number, type: string) { let success = false; @@ -457,6 +517,39 @@ export default defineComponent({ current_hdmi_rotation.value = GlobalData.getInstance().applicationConfig?.device_hdmi_rotation ?? 0; }, + updateCurrentHdmiAudioDevice() { + current_hdmi_audio_device.value = + GlobalData.getInstance().applicationConfig?.hdmi_in_audio_device_1 ?? + ""; + switch (current_hdmi_audio_device.value) { + case "": + case "3.5mm": + break; + default: + current_hdmi_audio_device.value = ""; + break; + } + }, + async setHdmiInAudioDevice(index: number, device: string) { + let success = false; + + const response = await GlobalData.getInstance() + .getCurrentClient() + ?.setHdmiInAudioDevice(index, device); + + if (response) { + success = response.success; + } + + $q.notify({ + color: success ? "positive" : "negative", + icon: success ? "done" : "warning", + message: + $t.t("set") + (success ? $t.t("success") : $t.t("fail")) + "!", + position: "top", + timeout: 1500, + }); + }, setHDMIRotation(rotation: number) { let success = true; try { diff --git a/src/entities/ApplicationConfigEntity.ts b/src/entities/ApplicationConfigEntity.ts index aa1d236..5b42938 100644 --- a/src/entities/ApplicationConfigEntity.ts +++ b/src/entities/ApplicationConfigEntity.ts @@ -32,6 +32,8 @@ export default class ApplicationConfigEntity { runtime_os: string = ""; registered: boolean = false; hdmi_in_decode_type_1: string | undefined; + hdmi_in_audio_device_1: string | undefined; + hw_version: string | undefined; device_hdmi_output_count = 1; video_suffix_filter: string | null = ""; image_suffix_filter: string | null = ""; diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index 96e1c83..c44919c 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -461,6 +461,9 @@ export namespace Protocol { public static get kSetHDMIRotation() { return Commands.PROTOCOL_PREFIX + "SetHDMIRotation"; } + public static get kRpcSetHdmiInAudioDevice() { + return Commands.PROTOCOL_PREFIX + "RpcSetHdmiInAudioDevice"; + } static _all_commands = new Set([ Commands.kUnKnowCommand, @@ -576,6 +579,7 @@ export namespace Protocol { Commands.kRpcDeleteJointActionEquipment, Commands.kCleanBrowserCache, Commands.kSetHDMIRotation, + Commands.kRpcSetHdmiInAudioDevice, ]); public static get AllCommands() { return this._all_commands; @@ -2835,6 +2839,30 @@ export namespace Protocol { note = ""; } + export class SetHdmiInAudioDeviceRequestEntity extends PacketEntity { + constructor(index: number, device: string, rpc_id = 0) { + super(); + super.command = Commands.kRpcSetHdmiInAudioDevice; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + this.index = index ?? 1; + this.device = device ?? ""; + } + index: number; + device: string; + note: string = ""; + } + + export class SetHdmiInAudioDeviceResponseEntity extends PacketEntity { + constructor() { + super(); + super.flag = PacketEntity.FLAG_RESPONSE; + } + + success = false; + note = ""; + } + export class GetCityListRequestEntity extends PacketEntity { constructor(language?: string, rpc_id = 0) { super(); diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index d7c89f9..d408f98 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -376,4 +376,8 @@ export default { "row multiply column should be less than or equal to ": "Row Multiply Column Should Be Less Than Or Equal To ", "please select window rotation": "Please Select Window Rotation", + "hdmi internal": "HDMI Internal", + set: "Set", + "hdmi audio frequency acquisition device": + "HDMI Audio Frequency Acquisition Device", }; diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index e64f07d..69fd671 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -648,4 +648,6 @@ export default { "row multiply column should be less than or equal to ": "行乘以列的值不能大于", "please select window rotation": "请选择窗口旋转", + "hdmi internal": "HDMI内置", + "hdmi audio frequency acquisition device": "HDMI声音采集设备", }; From 60202749d89e1cd668ae4ec2ab1b82c4b316a38d Mon Sep 17 00:00:00 2001 From: ljqing Date: Fri, 30 Dec 2022 11:02:40 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0EnableBlending,SetBlendin?= =?UTF-8?q?gOverlap=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 28 +++++++++++++++++++ src/entities/WSProtocol.ts | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index 16b3902..32dd11b 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1397,6 +1397,34 @@ export default class ClientConnection { ); } + public async EnableBlending( + enable: boolean + ) { + return await this.doRpc( + new Protocol.EnableBlendingRequestEntity( + enable + ) + ); + } + + public async SetBlendingOverlap( + row: number, + column: number, + location: number, + enable: boolean, + width: number + ) { + return await this.doRpc( + new Protocol.SetBlendingOverlapRequestEntity( + row, + column, + location, + enable, + width + ) + ); + } + public destory() { this.ws?.close(); if (this.ws) { diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index 6ae18fc..2a653dc 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -502,6 +502,12 @@ export namespace Protocol { public static get kSetBlendingGammaParam() { return Commands.PROTOCOL_PREFIX + "SetBlendingGammaParam"; } + public static get kEnableBlending() { + return Commands.PROTOCOL_PREFIX + "EnableBlending"; + } + public static get kSetBlendingOverlap() { + return Commands.PROTOCOL_PREFIX + "SetBlendingOverlap"; + } static _all_commands = new Set([ Commands.kUnKnowCommand, @@ -627,6 +633,8 @@ export namespace Protocol { Commands.kSetBlendingAlphaParam, Commands.kSetBlendingPowerParam, Commands.kSetBlendingGammaParam, + Commands.kEnableBlending, + Commands.kSetBlendingOverlap, ]); public static get AllCommands() { return this._all_commands; @@ -3285,4 +3293,46 @@ export namespace Protocol { location = 0; //0:左融合带,1:上融合带,2:右融合带,3:下融合带 value = 0.0; } + + export class EnableBlendingRequestEntity extends PacketEntity { + constructor( + enable: boolean, + rpc_id = 0 + ) { + super(); + super.command = Commands.kEnableBlending; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.enable = row ?? false; + } + enable = false; + } + + export class SetBlendingOverlapRequestEntity extends PacketEntity { + constructor( + row: number, + column: number, + location: number, + enable: boolean, + width: number, + rpc_id = 0 + ) { + super(); + super.command = Commands.kSetBlendingOverlap; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.row = row ?? 0; + this.column = column ?? 0; + this.location = location ?? 0; + this.enable = row ?? false; + this.width = width ?? 0; + } + row = 0; + column = 0; + location = 0; //0:左融合带,1:上融合带,2:右融合带,3:下融合带 + enable = false; + width = 0; + } } From bc7efd6185ef9eea570b41730ec4558aae74cb77 Mon Sep 17 00:00:00 2001 From: ljqing Date: Fri, 30 Dec 2022 11:03:19 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=BF=BD=E7=95=A5.vs=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 567e1c9..fdb336d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .thumbs.db node_modules .vscode +.vs # Quasar core related directories .quasar