替换窗口时附带之前窗口的状态信息

This commit is contained in:
fangxiang 2022-04-08 11:34:55 +08:00
parent 2c13c31f7a
commit 191793fbf3
4 changed files with 65 additions and 33 deletions

View File

@ -14,7 +14,7 @@ export class MultimediaWindowEntity extends BaseEntity {
volume: number = 80;
muted: boolean = false;
playing: boolean = false;
paused: boolean = false;
play_speed: number = 1;
polling: boolean = false;
polling_uuid: string = "";

View File

@ -2,7 +2,7 @@ import { Protocol } from "./WSProtocol";
export default class WindowOtherStateChangeNotifyEntity extends Protocol.PacketEntity {
window_id: number = 0;
playing = false;
paused = false;
muted = false;
volume = 80;
polling = false;

View File

@ -28,7 +28,7 @@
round
flag
size="lg"
v-if="!selected_window?.playing"
v-if="selected_window?.paused"
:disable="!can_pause_window || plan_running"
icon="play_arrow"
@click="play"
@ -156,6 +156,7 @@ export default defineComponent({
);
if (window) {
selected_window.value = window;
console.log(window);
const signal_source = GlobalData.getInstance().signal_source.find(
(element) =>
element && element.uuid == window.signal_source_table_uuid

View File

@ -518,8 +518,8 @@ export default defineComponent({
$store.commit("setWindowPropertys", [
{
window,
property_name: "playing",
value: temp.playing,
property_name: "paused",
value: temp.paused,
},
{
window,
@ -708,7 +708,7 @@ export default defineComponent({
const y = dom.offsetTop / wall.value.clientHeight;
const width = dom.offsetWidth / wall.value.clientWidth;
const height = dom.offsetHeight / wall.value.clientHeight;
console.log(type);
switch (type) {
case "polling":
GlobalData.getInstance()
@ -743,7 +743,7 @@ export default defineComponent({
break;
}
} else if (dom.classList.contains("window_flag")) {
//
//
const rep_uuid = dom.getAttribute("uuid");
if (rep_uuid) {
let window = $store.state.windows.find(
@ -758,39 +758,68 @@ export default defineComponent({
let height = window.height;
client.closeWindow(window.window_id);
setTimeout(() => {
switch (type) {
case "polling":
const open_window_request =
new Protocol.OpenPollingRequestEntity(
uuid,
x,
y,
width,
height
);
open_window_request.muted = window.muted;
open_window_request.volume = window.volume;
open_window_request.paused = window.paused;
open_window_request.play_speed = window.play_speed;
console.log(window);
//setTimeout(() => {
switch (type) {
case "polling":
{
const open_polling_request =
new Protocol.OpenPollingRequestEntity(
uuid,
x,
y,
width,
height
);
open_polling_request.muted = window.muted;
open_polling_request.volume = window.volume;
open_polling_request.paused = window.paused;
open_polling_request.play_speed = window.play_speed;
GlobalData.getInstance()
.getCurrentClient()
?.openPolling(
new Protocol.OpenPollingRequestEntity(
uuid,
x,
y,
width,
height
)
?.openPolling(open_polling_request);
}
break;
case "signal_source":
{
const open_window_request =
new Protocol.OpenWindowRequestEntity(
uuid,
x,
y,
width,
height
);
break;
case "signal_source":
open_window_request.muted = window.muted;
open_window_request.volume = window.volume;
open_window_request.paused = window.paused;
open_window_request.play_speed = window.play_speed;
if (signal_sources.length) {
const signal_source = signal_sources[0];
if (signal_source) {
client?.openWindow(
new Protocol.OpenWindowRequestEntity(
signal_source.uuid,
x,
y,
width,
height
)
);
client?.openWindow(open_window_request);
}
}
break;
}
}, 100);
}
break;
}
//}, 100);
}
}
}
@ -1040,6 +1069,7 @@ export default defineComponent({
}
},
async repliceWindow(window_id: number) {
// ,
if (!wall.value) {
return;
}
@ -1113,9 +1143,10 @@ export default defineComponent({
old_window.width,
old_window.height
);
open_window_request.muted = old_window.muted;
open_window_request.volume = old_window.volume;
open_window_request.paused = !old_window.playing;
open_window_request.paused = old_window.paused;
open_window_request.play_speed = old_window.play_speed;
GlobalData.getInstance()