HDMI采集右键菜单添加音频采集选项
This commit is contained in:
parent
0032e8c17c
commit
3ad93689d1
|
@ -1180,6 +1180,16 @@ export default class ClientConnection {
|
|||
}
|
||||
}
|
||||
|
||||
public async setHdmiInAudioDevice(index: number, type: string) {
|
||||
try {
|
||||
return await this.doRpc<Protocol.SetHdmiInAudioDeviceResponseEntity>(
|
||||
new Protocol.SetHdmiInAudioDeviceRequestEntity(index, type)
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
public async getCityList(language?: string) {
|
||||
try {
|
||||
return await this.doRpc<Protocol.GetCityListResponseEntity>(
|
||||
|
|
|
@ -112,6 +112,53 @@
|
|||
</q-list>
|
||||
</q-menu>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-ripple
|
||||
v-if="
|
||||
hw_version == 2 &&
|
||||
prop.node.item_data?.window_type == 'EwindowType::HdmiIn'
|
||||
"
|
||||
>
|
||||
<q-item-section>
|
||||
{{ $t("hdmi audio frequency acquisition device") }}
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-icon name="keyboard_arrow_right" />
|
||||
</q-item-section>
|
||||
<q-menu
|
||||
@before-show="updateCurrentHdmiAudioDevice"
|
||||
anchor="top end"
|
||||
self="top start"
|
||||
>
|
||||
<q-list>
|
||||
<q-item
|
||||
v-close-popup
|
||||
v-for="item in [
|
||||
{
|
||||
label: 'hdmi internal',
|
||||
value: '',
|
||||
},
|
||||
{
|
||||
label: '3.5mm',
|
||||
value: '3.5mm',
|
||||
},
|
||||
]"
|
||||
:key="item.value"
|
||||
clickable
|
||||
@click="setHdmiInAudioDevice(1, item.value)"
|
||||
>
|
||||
<q-item-section>{{ $t(item.label) }}</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-icon
|
||||
v-if="item.value == current_hdmi_audio_device"
|
||||
name="done"
|
||||
/>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
v-if="
|
||||
|
@ -238,10 +285,12 @@ export default defineComponent({
|
|||
const $t = useI18n();
|
||||
|
||||
const lossy_pic = ref(false);
|
||||
const hw_version = ref(1);
|
||||
|
||||
const content_height = ref(0);
|
||||
|
||||
const current_hdmi_rotation = ref(0);
|
||||
const current_hdmi_audio_device = ref("");
|
||||
|
||||
const refresh_content_height = () => {
|
||||
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 {
|
||||
|
|
|
@ -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 = "";
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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",
|
||||
};
|
||||
|
|
|
@ -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声音采集设备",
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue