替换窗口时附带之前窗口的状态信息
This commit is contained in:
parent
2c13c31f7a
commit
191793fbf3
|
@ -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 = "";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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":
|
||||
GlobalData.getInstance()
|
||||
.getCurrentClient()
|
||||
?.openPolling(
|
||||
const open_window_request =
|
||||
new Protocol.OpenPollingRequestEntity(
|
||||
uuid,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height
|
||||
)
|
||||
);
|
||||
break;
|
||||
case "signal_source":
|
||||
if (signal_sources.length) {
|
||||
const signal_source = signal_sources[0];
|
||||
if (signal_source) {
|
||||
client?.openWindow(
|
||||
new Protocol.OpenWindowRequestEntity(
|
||||
signal_source.uuid,
|
||||
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(open_polling_request);
|
||||
}
|
||||
|
||||
break;
|
||||
case "signal_source":
|
||||
{
|
||||
const open_window_request =
|
||||
new Protocol.OpenWindowRequestEntity(
|
||||
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;
|
||||
if (signal_sources.length) {
|
||||
const signal_source = signal_sources[0];
|
||||
if (signal_source) {
|
||||
client?.openWindow(open_window_request);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}, 100);
|
||||
//}, 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()
|
||||
|
|
Loading…
Reference in New Issue