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

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

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

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