This commit is contained in:
Clément Le Bihan
2024-01-09 15:03:30 +01:00
parent 9012a6a9d8
commit 8bdf8ce334
3 changed files with 27 additions and 6 deletions
+6
View File
@@ -73,6 +73,7 @@ const PlayView = ({ songId }: PlayViewProps) => {
const songHistory = useQuery(API.getSongHistory(songId));
const [score, setScore] = useState(0); // Between 0 and 100
const getElapsedTime = () => stopwatch.getElapsedRunningTime();
const [readyToPlay, setReadyToPlay] = useState(false);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [midiKeyboardFound, setMidiKeyboardFound] = useState<boolean>();
// first number is the note, the other is the time when pressed on release the key is removed
@@ -396,6 +397,10 @@ const PlayView = ({ songId }: PlayViewProps) => {
onError={() => {
console.log('error from partition magic');
}}
onReady={() => {
console.log('ready from partition magic');
setReadyToPlay(true);
}}
onPlay={onResume}
onPause={onPause}
/>
@@ -404,6 +409,7 @@ const PlayView = ({ songId }: PlayViewProps) => {
score={score}
time={time}
paused={paused}
disabled={playType == null || !readyToPlay}
song={song.data}
onEnd={onEnd}
onPause={() => {