From 6119276d45912933cc0065a7c8d475ff48e7449d Mon Sep 17 00:00:00 2001 From: jgk Date: Wed, 14 Apr 2021 14:04:31 +0200 Subject: [PATCH] Remove fade out, temporary fix to sound bug --- data/music/firstCompo.mid | Bin 8950 -> 8950 bytes src/Sound.hs | 16 ++++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/data/music/firstCompo.mid b/data/music/firstCompo.mid index ee4fd8a8faa5b3be34138de8f122c65b8b027bf3..42411e4c5a8cb4ad4c70219988955ff6c67c6f91 100644 GIT binary patch delta 853 zcmez7`ptC%2VcEmW4l^E- w;Co6OT2Ifw$KufX0gQW4)YoHAdRSaa8;5#On4ax`iPVmP(bjOYm*5&f00x!GcK`qY delta 853 zcmez7`ptC%2VZ?aW4l^E- w;Co6OT2Ifw$KufX0gQW4)YoHAdRSaa8;5#On4ax`iPVmP(KcYSm*5&f05S2`{{R30 diff --git a/src/Sound.hs b/src/Sound.hs index 1d160966d..fdadf5886 100644 --- a/src/Sound.hs +++ b/src/Sound.hs @@ -106,16 +106,17 @@ decrementTimer s = case _soundTime s of & soundStatus .~ FadingOut) Nothing -> return s -applyPosition = return +--applyPosition = return ---applyPosition :: Sound -> IO Sound ---applyPosition s = case _soundPos s of --- Nothing -> return s --- Just (a,d) -> Mix.effectPosition (fromJust $ _soundChannel s) a d --- >> return (s & soundPos .~ Nothing) +applyPosition :: Sound -> IO Sound +applyPosition s = case _soundPos s of + Nothing -> return s + Just (a,d) -> Mix.effectPosition (fromJust $ _soundChannel s) a d + >> return (s & soundPos .~ Nothing) fadeOutMaybe :: Maybe Mix.Channel -> Int -> IO () -fadeOutMaybe (Just x) fadeT = Mix.fadeOut (fromIntegral fadeT + 1) x +--fadeOutMaybe (Just x) fadeT = Mix.fadeOut (fromIntegral fadeT + 1) x +fadeOutMaybe (Just x) fadeT = Mix.halt x fadeOutMaybe _ _ = return () cleanupHalted :: Sound -> MaybeT IO Sound @@ -161,7 +162,6 @@ setChannelPos a i = do Behind the scenes, scales a float [0,1] to an Int [0..128]. -} setSoundVolume :: Float -> IO () ---setSoundVolume x = Mix.setVolume (round (x * 128)) Mix.AllChannels setSoundVolume x = Mix.setVolume (round (x * 128)) Mix.AllChannels {- | Set the music volume.