From 4f808506c7267e836c6307ca1e7aa593acc404c5 Mon Sep 17 00:00:00 2001 From: reng Date: Thu, 28 Aug 2025 15:54:23 +0800 Subject: [PATCH] update --- src/App.css | 3 +- src/App.jsx | 154 +++++++++++++++++++++++++++------------------------- 2 files changed, 83 insertions(+), 74 deletions(-) diff --git a/src/App.css b/src/App.css index 85464c2..8d69c33 100644 --- a/src/App.css +++ b/src/App.css @@ -32,4 +32,5 @@ tr{ cursor: ew-resize; background: #15ff00; box-shadow: -80px 0 0 80px #43e5f7; - } \ No newline at end of file + } + diff --git a/src/App.jsx b/src/App.jsx index e8255bf..485059c 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -7,6 +7,7 @@ import { OSC_ADDRESS } from "./utils/constant"; const DefaultFadeDuration = 3; // 1 second +const CLIENT_COUNT=12; const CueType={ Bg: 'bg', @@ -31,11 +32,11 @@ function App() { const refNextCue = useRef(null); - function sendOsc(addr, message){ + function sendOsc(addr, message, id){ invoke('send_osc_message', { key: addr, - message, + message: `${id}#${message}`, host:'0.0.0.0:0', target:'192.168.234.255:8000', }); @@ -97,7 +98,7 @@ function App() { } if(props.clientCue){ - sendOsc(OSC_ADDRESS.PLAYCUE, props.clientCue); + sendOsc(OSC_ADDRESS.PLAYCUE, props.clientCue,'all'); } if(props.lightCue){ @@ -108,7 +109,7 @@ function App() { function stop() { console.log('Stop all'); - sendOsc(OSC_ADDRESS.STOPCUE,''); + sendOsc(OSC_ADDRESS.STOPCUE,'','all'); sendOscToSound(OSC_ADDRESS.SCS_STOP_ALL, ''); } function secondToTime(seconds) { @@ -163,63 +164,63 @@ function App() { },[]); return ( -
-
-
-
{currentCue ? `${currentCue.name}` : 'None'}
-

- {timestamp} -

- - - - { - const value = parseFloat(e.target.value); - setFadeDuration(value); - }}> - {fadeDuration}s - +
+
+
+
{currentCue ? `${currentCue.name}` : 'None'}
+

+ {timestamp} +

+ + + + { + const value = parseFloat(e.target.value); + setFadeDuration(value); + }}> + {fadeDuration}s + +
+ + + + {/* */} + + + + + + + + + + + {cuelist?.map(({id, name, description, type, auto,...props}, index) => ( + + + + + + + + + + ))} + +
IDNameDescriptionTypeAutoDue | Light | AudioclientCue
+ + {type==CueType.Announce && } + {name}{description}{EmojiType[type]}{auto ? '⤵️' : ''}{props.duration} {props.lightCue && `L${props.lightCue}`} {props.audioCue && `S${props.audioCue}`}{props.clientCue || ''}
- - - - {/* */} - - - - - - - - - - - {cuelist?.map(({id, name, description, type, auto,...props}, index) => ( - - - - - - - - - - ))} - -
IDNameDescriptionTypeAutoDue | Light | AudioclientCue
- - {type==CueType.Announce && } - {name}{description}{EmojiType[type]}{auto ? '⤵️' : ''}{props.duration} {props.lightCue && `L${props.lightCue}`} {props.audioCue && `S${props.audioCue}`}{props.clientCue || ''}
- @@ -231,23 +232,30 @@ function App() { - {Object.entries(clientStatus).map(([id, log])=>( - - - - - - + + {<> + + + + } + - ))} + ); + })}
{id}{log[0]?.status}{log[0]?.name}{log[0]?.timestamp} - - - - + {Array.from(Array(CLIENT_COUNT).keys()).map((i) => { + const id=i+1; + const log = clientStatus[id]; + return ( +
{id}{log?.length>0 &&log[0]?.status}{log?.length>0 && log[0]?.name}{log?.length>0 &&log[0]?.timestamp} + + {cuelist?.filter(c=>c.clientCue).map(c=>( + + ))}
-
); }