From 65652c56053960a4d3696115dbbebced013af68a Mon Sep 17 00:00:00 2001 From: Taylor Whatley <32211852+1whatleytay@users.noreply.github.com> Date: Fri, 1 Nov 2024 11:12:16 -0400 Subject: [PATCH] Enable Midi playback again --- src-backend/src/syscall.rs | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src-backend/src/syscall.rs b/src-backend/src/syscall.rs index abacfb8..b067719 100644 --- a/src-backend/src/syscall.rs +++ b/src-backend/src/syscall.rs @@ -586,22 +586,19 @@ impl SyscallDelegate { return Completed; } - // let state_clone = self.state.clone(); - - Failure("MIDI Playback is disabled on this version. This is a bug. Please file a bug at https://github.com/1whatleytay/saturn.".into()) - // tokio::spawn(async move { - // let install = { - // let mut lock = state_clone.lock().unwrap(); - // - // lock.midi.install(request.instrument) - // }; - // - // if install.await { - // state_clone.lock().unwrap().midi.play(&request, false) - // } - // }); - - // Completed + let state_clone = self.state.clone(); + + let install = { + let mut lock = state_clone.lock().unwrap(); + + lock.midi.install(request.instrument) + }; + + if install.await { + state_clone.lock().unwrap().midi.play(&request, false) + } + + Completed } async fn sleep_for_duration(&self, time: u64) {