Add first compo

This commit is contained in:
2021-04-14 12:00:12 +02:00
parent c42c5069ea
commit ec7e304b75
15 changed files with 33 additions and 226 deletions
+8 -5
View File
@@ -106,11 +106,13 @@ decrementTimer s = case _soundTime s of
& soundStatus .~ FadingOut)
Nothing -> return s
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 = 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)
fadeOutMaybe :: Maybe Mix.Channel -> Int -> IO ()
fadeOutMaybe (Just x) fadeT = Mix.fadeOut (fromIntegral fadeT + 1) x
@@ -159,6 +161,7 @@ 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.