Clear all warnings
This commit is contained in:
+11
-8
@@ -78,17 +78,17 @@ initialisePlaying sd s = case _soundStatus s of
|
||||
tryPlay :: IM.IntMap Mix.Chunk -> Sound -> MaybeT IO Sound
|
||||
tryPlay sd s = do
|
||||
i <- tryGetChannel s
|
||||
liftIO $ do
|
||||
_ <- liftIO $ do
|
||||
Mix.halt i
|
||||
Mix.playOn i Mix.Once (sd IM.! _soundChunkID s)
|
||||
return $ s
|
||||
& soundChannel ?~ i
|
||||
& soundStatus .~ Playing
|
||||
|
||||
repetitions :: Sound -> Mix.Times
|
||||
repetitions s = case _soundTime s of
|
||||
Nothing -> Mix.Once
|
||||
_ -> Mix.Forever
|
||||
--repetitions :: Sound -> Mix.Times
|
||||
--repetitions s = case _soundTime s of
|
||||
-- Nothing -> Mix.Once
|
||||
-- _ -> Mix.Forever
|
||||
|
||||
tryGetChannel :: Sound -> MaybeT IO Mix.Channel
|
||||
tryGetChannel s = case _soundChannel s of
|
||||
@@ -110,9 +110,12 @@ applyPosition s = case _soundPos s of
|
||||
Just (a,d) -> Mix.effectPosition (fromJust $ _soundChannel s) a d
|
||||
>> return (s & soundPos .~ Nothing)
|
||||
|
||||
fadeOutMaybe :: Maybe Mix.Channel -> Int -> IO ()
|
||||
fadeOutMaybe
|
||||
:: Maybe Mix.Channel
|
||||
-> Int -- ^ fade out time: UNUSED, Mix.fadeOut is buggy
|
||||
-> IO ()
|
||||
--fadeOutMaybe (Just x) fadeT = Mix.fadeOut (fromIntegral fadeT + 1) x
|
||||
fadeOutMaybe (Just x) fadeT = Mix.halt x
|
||||
fadeOutMaybe (Just x) _ = Mix.halt x
|
||||
fadeOutMaybe _ _ = return ()
|
||||
|
||||
cleanupHalted :: Sound -> MaybeT IO Sound
|
||||
@@ -149,7 +152,7 @@ playPositionalSoundQueue chunkMap ns = forM_ ns $ \(n,a) ->
|
||||
|
||||
setChannelPos :: Int16 -> Mix.Channel -> MaybeT IO Mix.Channel
|
||||
setChannelPos a i = do
|
||||
liftIO $ Mix.effectPosition i a 0
|
||||
_ <- liftIO $ Mix.effectPosition i a 0
|
||||
return i
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user