|
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
|
import { invoke } from '@tauri-apps/api/core'; |
|
|
|
|
import { useEffect, useRef, useState } from "react"; |
|
|
|
|
import SpeechRecognition, { useSpeechRecognition } from 'react-speech-recognition'; |
|
|
|
|
|
|
|
|
|
@ -49,6 +50,7 @@ export function FreeFlow(){ |
|
|
|
|
const [cuelist, setCuelist] = useState([]); |
|
|
|
|
const [currentCue, setCurrentCue] = useState(null); |
|
|
|
|
const [nextCue, setNextCue] = useState(null); |
|
|
|
|
const [localIP, setLocalIP] = useState(null); |
|
|
|
|
|
|
|
|
|
const [chatWelcome, setChatWelcome] = useState(null); |
|
|
|
|
const [audioInput, setAudioInput] = useState(true); |
|
|
|
|
@ -648,13 +650,22 @@ export function FreeFlow(){ |
|
|
|
|
|
|
|
|
|
onOscMessageReceived(onOsc); // Set up OSC message listener |
|
|
|
|
|
|
|
|
|
invoke('get_ip').then((ip)=>{ |
|
|
|
|
console.log('Local IP address:', ip); |
|
|
|
|
setLocalIP(ip); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
},[]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<main className="items-start"> |
|
|
|
|
<section className="flex-1 flex flex-col gap-2 self-stretch overflow-hidden"> |
|
|
|
|
<DebugControl/> |
|
|
|
|
<div className="bg-purple-300 text-3xl flex flex-row justify-between px-4 items-center gap-1"> |
|
|
|
|
<span className='font-bold'>PC {data?.id}</span> |
|
|
|
|
<span className="">{localIP || '...'}</span> |
|
|
|
|
</div> |
|
|
|
|
<DebugControl/> |
|
|
|
|
<div className="w-full p-2 grid grid-cols-4 gap-2 items-stretch justify-center *:max-h-[5rem]"> |
|
|
|
|
<div className="bg-gray-100 text-4xl font-bold mb-4 flex justify-center items-center"> |
|
|
|
|
{refCurrentCue.current?.name} |
|
|
|
|
@ -670,6 +681,7 @@ export function FreeFlow(){ |
|
|
|
|
/> |
|
|
|
|
{/* <Light ref={refLight} /> */} |
|
|
|
|
<VoiceAnalysis/> |
|
|
|
|
|
|
|
|
|
{/* <div className="flex flex-col"> |
|
|
|
|
<label className="text-center">Voice</label> |
|
|
|
|
<button className={`${voice==Voice.ONYX && 'bg-gray-300'}`} onClick={() => setVoice(Voice.ONYX)}>Onyx</button> |
|
|
|
|
@ -685,6 +697,8 @@ export function FreeFlow(){ |
|
|
|
|
saveHistory(history); |
|
|
|
|
}}>Save Log</button> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
<div className="flex-1 overflow-y-auto"> |
|
|
|
|
<table className="border-collapse **:border-y w-full **:p-2 text-sm"> |
|
|
|
|
|