From 4a87f411ca27189414e8db7de6bf10baf8bc321b Mon Sep 17 00:00:00 2001 From: David Ogborn Date: Wed, 20 Nov 2024 16:27:03 -0500 Subject: [PATCH] fix to setAudioOutputs terminal pathway --- client/src/Estuary/Render/RenderEngine.hs | 2 -- client/src/Estuary/Render/RenderEnvironment.hs | 2 +- client/src/Estuary/Widgets/Terminal.hs | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/client/src/Estuary/Render/RenderEngine.hs b/client/src/Estuary/Render/RenderEngine.hs index 3d786c55..5af2d755 100644 --- a/client/src/Estuary/Render/RenderEngine.hs +++ b/client/src/Estuary/Render/RenderEngine.hs @@ -402,8 +402,6 @@ defineZoneExoLang r z (rName,txt,eTime) options = do let d = TextProgram (Live (rName,txt,eTime) L3) rEnv <- ask liftIO $ do - n <- getAudioOutputs $ mainBus rEnv - (RenderEnvironment.setNchnls rEnv) n -- TODO: possibly other options need to be sent to renderer as well let okCb z' _ = do RenderEnvironment.clearZoneError rEnv z' RenderEnvironment.setBaseRenderer rEnv z' rName diff --git a/client/src/Estuary/Render/RenderEnvironment.hs b/client/src/Estuary/Render/RenderEnvironment.hs index e6cb4940..71be2163 100644 --- a/client/src/Estuary/Render/RenderEnvironment.hs +++ b/client/src/Estuary/Render/RenderEnvironment.hs @@ -91,7 +91,7 @@ initialRenderEnvironment s t0System cvs = do audioInput' <- newIORef $ getPunctualInput mb aOut <- getMainBusInput mb audioOutput' <- newIORef aOut - nchnls' <- newIORef (numberOfOutputs aOut) + nchnls' <- newIORef 2 putStrLn "finished initialRenderEnvironment" return $ RenderEnvironment { mainBus = mb, diff --git a/client/src/Estuary/Widgets/Terminal.hs b/client/src/Estuary/Widgets/Terminal.hs index 6589b2ef..538265e4 100644 --- a/client/src/Estuary/Widgets/Terminal.hs +++ b/client/src/Estuary/Widgets/Terminal.hs @@ -229,6 +229,7 @@ runCommand _ _ Terminal.MaxAudioOutputs = do -- attempt to set a specific number of audio output channels runCommand rEnv _ (Terminal.SetAudioOutputs n) = do liftIO $ setAudioOutputs (webDirt rEnv) (mainBus rEnv) n + setNchnls rEnv n n' <- liftAudioIO channelCount pure [ logText $ "audioOutputs = " <> showt n' ]