diff --git a/src/entities/MultimediaWindowEntity.ts b/src/entities/MultimediaWindowEntity.ts index 0a7491b..a09907d 100644 --- a/src/entities/MultimediaWindowEntity.ts +++ b/src/entities/MultimediaWindowEntity.ts @@ -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 = ""; diff --git a/src/entities/WindowOtherStateChangeNotifyEntity.ts b/src/entities/WindowOtherStateChangeNotifyEntity.ts index fdf16f0..71d9f15 100644 --- a/src/entities/WindowOtherStateChangeNotifyEntity.ts +++ b/src/entities/WindowOtherStateChangeNotifyEntity.ts @@ -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; diff --git a/src/pages/MediaControlPage.vue b/src/pages/MediaControlPage.vue index afae1fa..2604583 100644 --- a/src/pages/MediaControlPage.vue +++ b/src/pages/MediaControlPage.vue @@ -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 diff --git a/src/pages/WallPage.vue b/src/pages/WallPage.vue index cc81c8f..854b5ef 100644 --- a/src/pages/WallPage.vue +++ b/src/pages/WallPage.vue @@ -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()