main
reng 3 months ago
parent e162d1138f
commit 53cb699799
  1. 4
      public/cuelist.json
  2. 6
      src-tauri/src/lib.rs
  3. 9
      src/App.jsx
  4. 4
      src/utils/constant.js

@ -13,7 +13,7 @@
"name": "Q2",
"type": "announce",
"description": "announce",
"audioCue": "Q2"
"audioCue": "Q1"
},
{
"id": 3,
@ -40,7 +40,7 @@
"name": "Q5",
"type": "bg",
"description": "(END)",
"audioCue": "Q6",
"audioCue": "Q4",
"status":"end",
"lightCue":"fade_in_light",
"clientCue":"Q6"

@ -46,7 +46,7 @@ async fn send_osc_message(
target: &str,
) -> Result<(), String> {
// print
println!("Sending OSC message: {}", message);
println!("Sending OSC message:{} {} {}", target, key,message);
let sock = UdpSocket::bind(host).await.unwrap();
let remote = SocketAddrV4::from_str(target).unwrap();
@ -74,10 +74,10 @@ async fn setup_osc_server(app_handle: AppHandle) {
loop {
match sock.recv_from(&mut buf).await {
Ok((size, addr)) => {
println!("Received packet with size {} from: {}", size, addr);
//println!("Received packet with size {} from: {}", size, addr);
if let Ok((_, packet)) = rosc::decoder::decode_udp(&buf[..size]) {
if let OscPacket::Message(msg) = packet {
println!("OSC message: {:?}", msg);
//println!("OSC message: {:?}", msg);
app_handle
.emit(

@ -8,7 +8,7 @@ import { Light } from "./utils/light";
const DefaultFadeDuration = 3; // 1 second
const CLIENT_COUNT=12;
const CLIENT_COUNT=13;
const CueType={
Bg: 'bg',
@ -42,7 +42,7 @@ function App() {
key: addr,
message: `${id}#${message}`,
host:'0.0.0.0:0',
target:'192.168.234.255:8000',
target:'192.168.51.255:8000',
});
}
@ -54,7 +54,7 @@ function App() {
key: addr,
message,
host:'0.0.0.0:0',
target:'192.168.234.255:58100',
target:'192.168.51.100:58200',
});
}
@ -63,6 +63,7 @@ function App() {
const addr= message.addr;
const [id, status, name]= message.args[0]?.split('#');
// console.log('receive osc:', id, status,name);
switch(addr){
case OSC_ADDRESS.CLIENT_STATUS:
@ -292,7 +293,7 @@ function App() {
</thead>
<tbody>
{Array.from(Array(CLIENT_COUNT).keys()).map((i) => {
const id=i+1;
const id=(i+1).toString().padStart(2,'0');
const log = clientStatus[id.toString()];
return (
<tr key={id} className="text-left lowercase">

@ -8,8 +8,8 @@ export const OSC_ADDRESS={
CLIENT_DURATION:'/client_duration',
SCS_STOP_ALL:'/ctrl/stop_all',
SCS_FADE_ALL:'/ctrl/fade_all',
SCS_STOP_ALL:'/ctrl/stopall',
SCS_FADE_ALL:'/ctrl/fadeall',
SCS_GO_CUE:'/cue/go',
}
Loading…
Cancel
Save