-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Haskell bindings to SDL2_mixer
--   
--   Haskell bindings to SDL2_mixer
@package sdl2-mixer
@version 1.2.0.0


-- | Exposes a way to automatically generate a foreign import alongside its
--   lifted, inlined MonadIO variant. Use this to simplify the package's
--   SDL.Raw.* modules.
module SDL.Raw.Helper

-- | Given a name <tt>fname</tt>, a name of a C function <tt>cname</tt> and
--   the desired Haskell type <tt>ftype</tt>, this function generates:
--   
--   <ul>
--   <li>A foreign import of <tt>cname</tt>, named as <tt>fname'</tt>.</li>
--   <li>An always-inline MonadIO version of <tt>fname'</tt>, named
--   <tt>fname</tt>.</li>
--   </ul>
liftF :: String -> String -> Q Type -> Q [Dec]


-- | Raw bindings to the <tt>SDL2_mixer</tt> library. No error-handling is
--   done here. For more information about specific function behaviour, see
--   the <tt>SDL2_mixer</tt> documentation.
module SDL.Raw.Mixer
getVersion :: forall m_a97Q. MonadIO m_a97Q => m_a97Q (Ptr Version)
pattern SDL_MIXER_MAJOR_VERSION :: (Eq a, Num a) => a
pattern SDL_MIXER_MINOR_VERSION :: (Eq a, Num a) => a
pattern SDL_MIXER_PATCHLEVEL :: (Eq a, Num a) => a
type InitFlag = CInt
init :: MonadIO m => InitFlag -> m CInt
pattern INIT_FLAC :: (Eq a, Num a) => a
pattern INIT_MOD :: (Eq a, Num a) => a
pattern INIT_MP3 :: (Eq a, Num a) => a
pattern INIT_OGG :: (Eq a, Num a) => a
quit :: forall m_a9fo. MonadIO m_a9fo => m_a9fo ()
type Format = Word16
pattern DEFAULT_FORMAT :: (Eq a, Num a) => a
pattern DEFAULT_FREQUENCY :: (Eq a, Num a) => a
pattern DEFAULT_CHANNELS :: (Eq a, Num a) => a
openAudio :: MonadIO m => CInt -> Format -> CInt -> CInt -> m CInt
pattern AUDIO_U8 :: (Eq a, Num a) => a
pattern AUDIO_S8 :: (Eq a, Num a) => a
pattern AUDIO_U16LSB :: (Eq a, Num a) => a
pattern AUDIO_S16LSB :: (Eq a, Num a) => a
pattern AUDIO_U16MSB :: (Eq a, Num a) => a
pattern AUDIO_S16MSB :: (Eq a, Num a) => a
pattern AUDIO_U16 :: (Eq a, Num a) => a
pattern AUDIO_S16 :: (Eq a, Num a) => a
pattern AUDIO_U16SYS :: (Eq a, Num a) => a
pattern AUDIO_S16SYS :: (Eq a, Num a) => a
closeAudio :: forall m_a9q0. MonadIO m_a9q0 => m_a9q0 ()
querySpec :: MonadIO m => Ptr CInt -> Ptr Format -> Ptr CInt -> m CInt
getNumChunkDecoders :: forall m_a9t4. MonadIO m_a9t4 => m_a9t4 CInt
getChunkDecoder :: MonadIO m => CInt -> m CString
data Chunk
Chunk :: CInt -> Ptr Word8 -> Word32 -> Word8 -> Chunk
[chunkAllocated] :: Chunk -> CInt
[chunkAbuf] :: Chunk -> Ptr Word8
[chunkAlen] :: Chunk -> Word32
[chunkVolume] :: Chunk -> Word8
loadWAV :: MonadIO m => CString -> m (Ptr Chunk)
loadWAV_RW :: MonadIO m => Ptr RWops -> CInt -> m (Ptr Chunk)
quickLoadWAV :: MonadIO m => Ptr Word8 -> m (Ptr Chunk)
quickLoadRaw :: MonadIO m => Ptr Word8 -> m (Ptr Chunk)
pattern MAX_VOLUME :: (Eq a, Num a) => a
volumeChunk :: MonadIO m => Ptr Chunk -> CInt -> m CInt
freeChunk :: MonadIO m => Ptr Chunk -> m ()
allocateChannels :: MonadIO m => CInt -> m CInt
pattern CHANNELS :: (Eq a, Num a) => a
type Channel = CInt
volume :: MonadIO m => Channel -> CInt -> m CInt
playChannel :: MonadIO m => Channel -> Ptr Chunk -> CInt -> m CInt
playChannelTimed :: MonadIO m => Channel -> Ptr Chunk -> CInt -> CInt -> m CInt
fadeInChannel :: MonadIO m => Channel -> Ptr Chunk -> CInt -> CInt -> m CInt
fadeInChannelTimed :: MonadIO m => Channel -> Ptr Chunk -> CInt -> CInt -> CInt -> m CInt
pause :: MonadIO m => Channel -> m ()
resume :: MonadIO m => Channel -> m ()
haltChannel :: MonadIO m => Channel -> m CInt
expireChannel :: MonadIO m => Channel -> CInt -> m CInt
fadeOutChannel :: MonadIO m => Channel -> CInt -> m CInt
channelFinished :: MonadIO m => FunPtr (Channel -> IO ()) -> m ()
wrapChannelCallback :: (Channel -> IO ()) -> IO (FunPtr (Channel -> IO ()))
playing :: MonadIO m => Channel -> m CInt
paused :: MonadIO m => Channel -> m CInt
type Fading = (Word32)
fadingChannel :: MonadIO m => Channel -> m Fading
pattern NO_FADING :: (Eq a, Num a) => a
pattern FADING_OUT :: (Eq a, Num a) => a
pattern FADING_IN :: (Eq a, Num a) => a
getChunk :: MonadIO m => Channel -> m (Ptr Chunk)
reserveChannels :: MonadIO m => CInt -> m CInt
type Tag = CInt
groupChannel :: MonadIO m => Channel -> Tag -> m CInt
groupChannels :: MonadIO m => Channel -> Channel -> Tag -> m CInt
groupCount :: MonadIO m => Tag -> m CInt
groupAvailable :: MonadIO m => Tag -> m CInt
groupOldest :: MonadIO m => Tag -> m CInt
groupNewer :: MonadIO m => Tag -> m CInt
fadeOutGroup :: MonadIO m => Tag -> CInt -> m CInt
haltGroup :: MonadIO m => Tag -> m CInt
getNumMusicDecoders :: forall m_aapi. MonadIO m_aapi => m_aapi CInt
getMusicDecoder :: MonadIO m => CInt -> m CString
data Music
loadMUS :: MonadIO m => CString -> m (Ptr Music)
loadMUS_RW :: MonadIO m => Ptr RWops -> CInt -> m (Ptr Music)
loadMUSType_RW :: MonadIO m => Ptr RWops -> MusicType -> CInt -> m (Ptr Music)
freeMusic :: MonadIO m => Ptr Music -> m ()
playMusic :: MonadIO m => Ptr Music -> CInt -> m CInt
fadeInMusic :: MonadIO m => Ptr Music -> CInt -> CInt -> m CInt
fadeInMusicPos :: MonadIO m => Ptr Music -> CInt -> CInt -> CDouble -> m CInt
hookMusic :: MonadIO m => FunPtr (Ptr () -> Ptr Word8 -> CInt -> IO ()) -> Ptr () -> m ()
volumeMusic :: MonadIO m => CInt -> m CInt
pauseMusic :: forall m_aaLd. MonadIO m_aaLd => m_aaLd ()
resumeMusic :: forall m_aaMa. MonadIO m_aaMa => m_aaMa ()
rewindMusic :: forall m_aaN7. MonadIO m_aaN7 => m_aaN7 ()
setMusicPosition :: MonadIO m => CDouble -> m CInt
setMusicCMD :: MonadIO m => CString -> m CInt
haltMusic :: forall m_aaQH. MonadIO m_aaQH => m_aaQH CInt
fadeOutMusic :: MonadIO m => CInt -> m CInt
wrapMusicCallback :: IO () -> IO (FunPtr (IO ()))
hookMusicFinished :: MonadIO m => FunPtr (IO ()) -> m ()
type MusicType = (Word32)
getMusicType :: MonadIO m => Ptr Music -> m MusicType
pattern MUS_NONE :: (Eq a, Num a) => a
pattern MUS_CMD :: (Eq a, Num a) => a
pattern MUS_WAV :: (Eq a, Num a) => a
pattern MUS_MOD :: (Eq a, Num a) => a
pattern MUS_MID :: (Eq a, Num a) => a
pattern MUS_OGG :: (Eq a, Num a) => a
pattern MUS_MP3 :: (Eq a, Num a) => a
pattern MUS_FLAC :: (Eq a, Num a) => a
playingMusic :: forall m_aaVU. MonadIO m_aaVU => m_aaVU CInt
pausedMusic :: forall m_aaWU. MonadIO m_aaWU => m_aaWU CInt
fadingMusic :: forall m_aaXU. MonadIO m_aaXU => m_aaXU Fading
getMusicHookData :: forall m_aaYX. MonadIO m_aaYX => m_aaYX (Ptr ())
type Effect = Channel -> Ptr () -> CInt -> Ptr () -> IO ()
wrapEffect :: Effect -> IO (FunPtr Effect)
type EffectFinished = Channel -> Ptr () -> IO ()
wrapEffectFinished :: EffectFinished -> IO (FunPtr EffectFinished)
registerEffect :: MonadIO m => Channel -> FunPtr Effect -> FunPtr EffectFinished -> Ptr () -> m CInt
pattern CHANNEL_POST :: (Eq a, Num a) => a
unregisterEffect :: MonadIO m => Channel -> FunPtr Effect -> m CInt
unregisterAllEffects :: MonadIO m => Channel -> m CInt
setPostMix :: MonadIO m => FunPtr (Ptr () -> Ptr Word8 -> CInt -> IO ()) -> Ptr () -> m ()
setPanning :: MonadIO m => Channel -> Word8 -> Word8 -> m CInt
setDistance :: MonadIO m => Channel -> Word8 -> m CInt
setPosition :: MonadIO m => Channel -> Int16 -> Word8 -> m CInt
setReverseStereo :: MonadIO m => Channel -> CInt -> m CInt
setSynchroValue :: MonadIO m => CInt -> m CInt
getSynchroValue :: forall m_abgK. MonadIO m_abgK => m_abgK CInt
setSoundFonts :: MonadIO m => Ptr CString -> m CInt
getSoundFonts :: forall m_abje. MonadIO m_abje => m_abje (Ptr CString)
eachSoundFont :: MonadIO m => FunPtr (CString -> Ptr () -> IO CInt) -> Ptr () -> m CInt
instance GHC.Show.Show SDL.Raw.Mixer.Chunk
instance GHC.Classes.Eq SDL.Raw.Mixer.Chunk
instance Foreign.Storable.Storable SDL.Raw.Mixer.Chunk


-- | Bindings to the <tt>SDL2_mixer</tt> library.
module SDL.Mixer

-- | Initializes the <tt>SDL2_mixer</tt> API.
--   
--   This should be the first function you call after initializing
--   <tt>SDL</tt> itself with <a>InitAudio</a>.
--   
--   Automatically cleans up the API when the inner computation finishes.
withAudio :: (MonadBaseControl IO m, MonadIO m) => Audio -> ChunkSize -> m a -> m a

-- | An audio configuration. Use this with <a>withAudio</a>.
data Audio
Audio :: Int -> Format -> Output -> Audio

-- | A sampling frequency.
[audioFrequency] :: Audio -> Int

-- | An output sample format.
[audioFormat] :: Audio -> Format

-- | <a>Mono</a> or <a>Stereo</a> output.
[audioOutput] :: Audio -> Output

-- | A sample format.
data Format

-- | Unsigned 8-bit samples.
FormatU8 :: Format

-- | Signed 8-bit samples.
FormatS8 :: Format

-- | Unsigned 16-bit samples, in little-endian byte order.
FormatU16_LSB :: Format

-- | Signed 16-bit samples, in little-endian byte order.
FormatS16_LSB :: Format

-- | Unsigned 16-bit samples, in big-endian byte order.
FormatU16_MSB :: Format

-- | signed 16-bit samples, in big-endian byte order.
FormatS16_MSB :: Format

-- | Unsigned 16-bit samples, in system byte order.
FormatU16_Sys :: Format

-- | Signed 16-bit samples, in system byte order.
FormatS16_Sys :: Format

-- | The number of sound channels in output.
data Output
Mono :: Output
Stereo :: Output

-- | A default <a>Audio</a> configuration.
--   
--   Same as <a>def</a>.
--   
--   Uses 22050 as the <a>audioFrequency</a>, <a>FormatS16_Sys</a> as the
--   <a>audioFormat</a> and <a>Stereo</a> as the <a>audioOutput</a>.
defaultAudio :: Audio

-- | The size of each mixed sample.
--   
--   The smaller this is, the more often callbacks will be invoked. If this
--   is made too small on a slow system, the sounds may skip. If made too
--   large, sound effects could lag.
type ChunkSize = Int

-- | Get the audio format in use by the opened audio device.
--   
--   This may or may not match the <a>Audio</a> you asked for when calling
--   <a>withAudio</a>.
queryAudio :: MonadIO m => m Audio

-- | An alternative to <a>withAudio</a>, also initializes the
--   <tt>SDL2_mixer</tt> API.
--   
--   However, <a>openAudio</a> does not take care of automatically calling
--   <a>closeAudio</a> after a computation ends, so you have to take care
--   to do so manually.
openAudio :: MonadIO m => Audio -> ChunkSize -> m ()

-- | Shut down and clean up the <tt>SDL2_mixer</tt> API.
--   
--   After calling this, all audio stops.
--   
--   You don't have to call this if you're using <a>withAudio</a>.
closeAudio :: MonadIO m => m ()

-- | A class of all values that can be loaded from some source. You can
--   load both <a>Chunk</a>s and <a>Music</a> this way.
--   
--   Note that you must call <a>withAudio</a> before using these, since
--   they have to know the audio configuration to properly convert the data
--   for playback.
class Loadable a

-- | Load the value from a <a>ByteString</a>.
decode :: (Loadable a, MonadIO m) => ByteString -> m a

-- | Same as <a>decode</a>, but loads from a file instead.
load :: (Loadable a, MonadIO m) => FilePath -> m a

-- | Frees the value's memory. It should no longer be used.
--   
--   <b>Note that you shouldn't free those values that are currently
--   playing.</b>
free :: (Loadable a, MonadIO m) => a -> m ()

-- | A loaded audio chunk.
newtype Chunk
Chunk :: Ptr Chunk -> Chunk

-- | Returns the names of all chunk decoders currently available.
--   
--   These depend on the availability of shared libraries for each of the
--   formats. The list may contain any of the following, and possibly
--   others: <tt>WAVE</tt>, <tt>AIFF</tt>, <tt>VOC</tt>, <tt>OFF</tt>,
--   <tt>FLAC</tt>, <tt>MP3</tt>.
chunkDecoders :: MonadIO m => m [String]

-- | A loaded music file.
--   
--   <a>Music</a> is played on a separate channel different from the normal
--   mixing <a>Channel</a>s.
--   
--   To manipulate <a>Music</a> outside of post-processing callbacks, use
--   the music variant functions listed below.
newtype Music
Music :: Ptr Music -> Music

-- | Returns the names of all music decoders currently available.
--   
--   These depend on the availability of shared libraries for each of the
--   formats. The list may contain any of the following, and possibly
--   others: <tt>WAVE</tt>, <tt>MODPLUG</tt>, <tt>MIKMOD</tt>,
--   <tt>TIMIDITY</tt>, <tt>FLUIDSYNTH</tt>, <tt>NATIVEMIDI</tt>,
--   <tt>OGG</tt>, <tt>FLAC</tt>, <tt>MP3</tt>.
musicDecoders :: MonadIO m => m [String]

-- | A mixing channel.
--   
--   Use the <a>Integral</a> instance to define these: the first channel is
--   0, the second 1 and so on.
--   
--   The default number of <a>Channel</a>s available at startup is 8, so
--   note that you cannot usemore than these starting 8 if you haven't
--   created more with <a>setChannels</a>.
--   
--   The starting <a>Volume</a> of each <a>Channel</a> is the maximum: 128.
data Channel

-- | Use this value when you wish to perform an operation on <i>all</i>
--   <a>Channel</a>s.
--   
--   For more information, see each of the functions accepting a
--   <a>Channel</a>.
pattern AllChannels :: Channel

-- | Prepares a given number of <a>Channel</a>s for use.
--   
--   There are 8 such <a>Channel</a>s already prepared for use after
--   <a>withAudio</a> is called.
--   
--   You may call this multiple times, even with sounds playing. If setting
--   a lesser number of <a>Channel</a>s than are currently in use, the
--   higher <a>Channel</a>s will be stopped, their finish callbacks
--   invoked, and their memory freed. Passing in 0 or less will therefore
--   stop and free all mixing channels.
--   
--   Any <a>Music</a> playing is not affected by this function.
setChannels :: MonadIO m => Int -> m ()

-- | Gets the number of <a>Channel</a>s currently in use.
getChannels :: MonadIO m => m Int

-- | Play a <a>Chunk</a> once, using the first available <a>Channel</a>.
play :: MonadIO m => Chunk -> m ()

-- | Same as <a>play</a>, but keeps playing the <a>Chunk</a> forever.
playForever :: MonadIO m => Chunk -> m ()

-- | How many times should a certain <a>Chunk</a> be played?
data Times

-- | A shorthand for playing once.
pattern Once :: Times

-- | A shorthand for looping a <a>Chunk</a> forever.
pattern Forever :: Times

-- | Same as <a>play</a>, but plays the <a>Chunk</a> using a given
--   <a>Channel</a> a certain number of <a>Times</a>.
--   
--   If <a>AllChannels</a> is used, then plays the <a>Chunk</a> using the
--   first available <a>Channel</a> instead.
--   
--   Returns the <a>Channel</a> that was used.
playOn :: MonadIO m => Channel -> Times -> Chunk -> m Channel

-- | A time in milliseconds.
type Milliseconds = Int

-- | An upper limit of time, in milliseconds.
type Limit = Milliseconds

-- | A lack of an upper limit.
pattern NoLimit :: Limit

-- | Same as <a>playOn</a>, but imposes an upper limit in
--   <a>Milliseconds</a> to how long the <a>Chunk</a> can play.
--   
--   The playing may still stop before the limit is reached.
--   
--   This is the most generic play function variant.
playLimit :: MonadIO m => Limit -> Channel -> Times -> Chunk -> m Channel

-- | Same as <a>play</a>, but fades in the <a>Chunk</a> by making the
--   <a>Channel</a> <a>Volume</a> start at 0 and rise to a full 128 over
--   the course of a given number of <a>Milliseconds</a>.
--   
--   The <a>Chunk</a> may end playing before the fade-in is complete, if it
--   doesn't last as long as the given fade-in time.
fadeIn :: MonadIO m => Milliseconds -> Chunk -> m ()

-- | Same as <a>fadeIn</a>, but allows you to specify the <a>Channel</a> to
--   play on and how many <a>Times</a> to play it, similar to
--   <a>playOn</a>.
--   
--   If <a>AllChannels</a> is used, will play the <a>Chunk</a> on the first
--   available <a>Channel</a>.
--   
--   Returns the <a>Channel</a> that was used.
fadeInOn :: MonadIO m => Channel -> Times -> Milliseconds -> Chunk -> m Channel

-- | Same as <a>fadeInOn</a>, but imposes an upper <a>Limit</a> to how long
--   the <a>Chunk</a> can play, similar to <a>playLimit</a>.
--   
--   This is the most generic fade-in function variant.
fadeInLimit :: MonadIO m => Limit -> Channel -> Times -> Milliseconds -> Chunk -> m Channel

-- | Reserve a given number of <a>Channel</a>s, starting from
--   <a>Channel</a> 0.
--   
--   A reserved <a>Channel</a> is considered not to be available for
--   playing samples when using any <a>play</a> or <a>fadeIn</a> function
--   variant with <a>AllChannels</a>. In other words, whenever you let
--   <a>Mixer</a> pick the first available <a>Channel</a> itself, these
--   reserved <a>Channel</a>s will not be considered.
reserveChannels :: MonadIO m => Int -> m Int

-- | A group of <a>Channel</a>s.
--   
--   Grouping <a>Channel</a>s together allows you to perform some
--   operations on all of them at once.
--   
--   By default, all <a>Channel</a>s are members of the
--   <a>DefaultGroup</a>.
data Group

-- | The default <a>Group</a> all <a>Channel</a>s are in the moment they
--   are created.
pattern DefaultGroup :: Group

-- | Assigns a given <a>Channel</a> to a certain <a>Group</a>.
--   
--   If <a>DefaultGroup</a> is used, assigns the <a>Channel</a> the the
--   default starting <a>Group</a> (essentially <i>ungrouping</i> them).
--   
--   If <a>AllChannels</a> is used, assigns all <a>Channel</a>s to the
--   given <a>Group</a>.
--   
--   Returns whether the <a>Channel</a> was successfully grouped or not.
--   Failure is poosible if the <a>Channel</a> does not exist, for
--   instance.
group :: MonadIO m => Group -> Channel -> m Bool

-- | Same as <tt>groupChannel</tt>, but groups all <a>Channel</a>s between
--   the first and last given, inclusive.
--   
--   If <a>DefaultGroup</a> is used, assigns the entire <a>Channel</a> span
--   to the default starting <a>Group</a> (essentially <i>ungrouping</i>
--   them).
--   
--   Using <a>AllChannels</a> is invalid.
--   
--   Returns the number of <a>Channel</a>s successfully grouped. This
--   number may be less than the number of <a>Channel</a>s given, for
--   instance if some of them do not exist.
groupSpan :: MonadIO m => Group -> Channel -> Channel -> m Int

-- | Returns the number of <tt>Channels</tt> within a <a>Group</a>.
--   
--   If <a>DefaultGroup</a> is used, will return the number of all
--   <a>Channel</a>s, since all of them are within the default
--   <a>Group</a>.
groupCount :: MonadIO m => Group -> m Int

-- | Gets the first inactive (not playing) <a>Channel</a> within a given
--   <a>Group</a>, if any.
--   
--   Using <a>DefaultGroup</a> will give you the first inactive
--   <a>Channel</a> out of all that exist.
getAvailable :: MonadIO m => Group -> m (Maybe Channel)

-- | Gets the oldest actively playing <a>Channel</a> within a given
--   <a>Group</a>.
--   
--   Returns <a>Nothing</a> when the <a>Group</a> is empty or no
--   <a>Channel</a>s within it are playing.
getOldest :: MonadIO m => Group -> m (Maybe Channel)

-- | Gets the newest actively playing <a>Channel</a> within a given
--   <a>Group</a>.
--   
--   Returns <a>Nothing</a> when the <a>Group</a> is empty or no
--   <a>Channel</a>s within it are playing.
getNewest :: MonadIO m => Group -> m (Maybe Channel)

-- | Pauses the given <a>Channel</a>, if it is actively playing.
--   
--   If <a>AllChannels</a> is used, will pause all actively playing
--   <a>Channel</a>s instead.
--   
--   Note that <a>pause</a>d <a>Channel</a>s may still be <a>halt</a>ed.
pause :: MonadIO m => Channel -> m ()

-- | Resumes playing a <a>Channel</a>, or all <a>Channel</a>s if
--   <a>AllChannels</a> is used.
resume :: MonadIO m => Channel -> m ()

-- | Halts playback on a <a>Channel</a>, or all <a>Channel</a>s if
--   <a>AllChannels</a> is used.
halt :: MonadIO m => Channel -> m ()

-- | Same as <a>halt</a>, but only does so after a certain number of
--   <a>Milliseconds</a>.
--   
--   If <a>AllChannels</a> is used, it will halt all the <a>Channel</a>s
--   after the given time instead.
haltAfter :: MonadIO m => Milliseconds -> Channel -> m ()

-- | Same as <a>halt</a>, but halts an entire <a>Group</a> instead.
--   
--   Note that using <a>DefaultGroup</a> here is the same as calling
--   <a>halt</a> <a>AllChannels</a>.
haltGroup :: MonadIO m => Group -> m ()

-- | A volume, where 0 is silent and 128 loudest.
--   
--   <a>Volume</a>s lesser than 0 or greater than 128 function as if they
--   are 0 and 128, respectively.
type Volume = Int

-- | A class of all values that have a <a>Volume</a>.
class HasVolume a

-- | Gets the value's currently set <a>Volume</a>.
--   
--   If the value is a <a>Channel</a> and <a>AllChannels</a> is used, gets
--   the <i>average</i> <a>Volume</a> of all <a>Channel</a>s.
getVolume :: (HasVolume a, MonadIO m) => a -> m Volume

-- | Sets a value's <a>Volume</a>.
--   
--   If the value is a <a>Chunk</a>, the volume setting only takes effect
--   when the <a>Chunk</a> is used on a <a>Channel</a>, being mixed into
--   the output.
--   
--   In case of being used on a <a>Channel</a>, the volume setting takes
--   effect during the final mix, along with the <a>Chunk</a> volume. For
--   instance, setting the <a>Volume</a> of a certain <a>Channel</a> to 64
--   will halve the volume of all <a>Chunk</a>s played on that
--   <a>Channel</a>. If <a>AllChannels</a> is used, sets all
--   <a>Channel</a>s to the given <a>Volume</a> instead.
setVolume :: (HasVolume a, MonadIO m) => Volume -> a -> m ()

-- | Returns whether the given <a>Channel</a> is playing or not.
--   
--   If <a>AllChannels</a> is used, this returns whether <i>any</i> of the
--   channels is currently playing.
playing :: MonadIO m => Channel -> m Bool

-- | Returns how many <a>Channel</a>s are currently playing.
playingCount :: MonadIO m => m Int

-- | Returns whether the given <a>Channel</a> is paused or not.
--   
--   If <a>AllChannels</a> is used, this returns whether <i>any</i> of the
--   channels is currently paused.
paused :: MonadIO m => Channel -> m Bool

-- | Returns how many <a>Channel</a>s are currently paused.
pausedCount :: MonadIO m => m Int

-- | Gets the most recent <a>Chunk</a> played on a <a>Channel</a>, if any.
--   
--   Using <a>AllChannels</a> is not valid here, and will return
--   <a>Nothing</a>.
--   
--   Note that the returned <a>Chunk</a> might be invalid if it was already
--   <a>free</a>d.
playedLast :: MonadIO m => Channel -> m (Maybe Chunk)

-- | Describes whether a <a>Channel</a> is fading in, out, or not at all.
data Fading

-- | Returns a <a>Channel</a>'s <a>Fading</a> status.
--   
--   Note that using <a>AllChannels</a> here is not valid, and will simply
--   return the <a>Fading</a> status of the first <a>Channel</a> instead.
fading :: MonadIO m => Channel -> m Fading

-- | Gradually fade out a given playing <a>Channel</a> during the next
--   <a>Milliseconds</a>, even if it is <a>pause</a>d.
--   
--   If <a>AllChannels</a> is used, fades out all the playing
--   <a>Channel</a>s instead.
fadeOut :: MonadIO m => Milliseconds -> Channel -> m ()

-- | Same as <a>fadeOut</a>, but fades out an entire <a>Group</a> instead.
--   
--   Using <a>DefaultGroup</a> here is the same as calling <a>fadeOut</a>
--   with <a>AllChannels</a>.
fadeOutGroup :: MonadIO m => Milliseconds -> Group -> m ()

-- | Sets a callback that gets invoked each time a <a>Channel</a> finishes
--   playing.
--   
--   A <a>Channel</a> finishes playing both when playback ends normally and
--   when it is <a>halt</a>ed (also possibly via <a>setChannels</a>).
--   
--   <b>Note: don't call other <a>Mixer</a> functions within this
--   callback.</b>
whenChannelFinished :: MonadIO m => (Channel -> IO ()) -> m ()

-- | Plays a given <a>Music</a> a certain number of <a>Times</a>.
--   
--   The previously playing <a>Music</a> will be halted, unless it is
--   fading out in which case a blocking wait occurs until it fades out
--   completely.
playMusic :: MonadIO m => Times -> Music -> m ()

-- | A position in milliseconds within a piece of <a>Music</a>.
type Position = Milliseconds

-- | Plays a given <a>Music</a> a number of <a>Times</a>, but fading it in
--   during a certain number of <a>Milliseconds</a>.
--   
--   The fading only occurs during the first time the <a>Music</a> is
--   played.
fadeInMusic :: MonadIO m => Milliseconds -> Times -> Music -> m ()

-- | Same as <a>fadeInMusic</a>, but with a custom starting <a>Music</a>'s
--   <a>Position</a>.
--   
--   Note that this only works on <a>Music</a> that <a>setMusicPosition</a>
--   works on.
fadeInMusicAt :: MonadIO m => Position -> Milliseconds -> Times -> Music -> m ()

-- | Same as <a>fadeInMusicAt</a>, but works with <tt>MOD</tt>
--   <a>Music</a>.
--   
--   Instead of milliseconds, specify the position with a pattern number.
fadeInMusicAtMOD :: MonadIO m => Int -> Milliseconds -> Times -> Music -> m ()

-- | Pauses <a>Music</a> playback, if it is actively playing.
--   
--   You may still <a>haltMusic</a> paused <a>Music</a>.
pauseMusic :: MonadIO m => m ()

-- | Halts <a>Music</a> playback.
haltMusic :: MonadIO m => m ()

-- | Resumes <a>Music</a> playback.
--   
--   This works on both paused and halted <a>Music</a>.
--   
--   If <a>Music</a> is currently actively playing, this has no effect.
resumeMusic :: MonadIO m => m ()

-- | Rewinds the <a>Music</a> to the beginning.
--   
--   When playing new <a>Music</a>, it starts at the beginning by default.
--   
--   This function only works with <tt>MOD</tt>, <tt>OGG</tt>, <tt>MP3</tt>
--   and <tt>NATIVEMIDI</tt> streams.
rewindMusic :: MonadIO m => m ()

-- | Set the <a>Position</a> for currently playing <a>Music</a>.
--   
--   Note: this only works for <tt>OGG</tt> and <tt>MP3</tt> <a>Music</a>.
setMusicPosition :: MonadIO m => Position -> m ()

-- | Similar to <a>setMusicPosition</a>, but works only with <tt>MOD</tt>
--   <a>Music</a>.
--   
--   Pass in the pattern number.
setMusicPositionMOD :: MonadIO m => Int -> m ()

-- | Sets the <a>Volume</a> for <a>Music</a>.
--   
--   Note that this won't work if any <a>Music</a> is currently fading.
setMusicVolume :: MonadIO m => Volume -> m ()

-- | Gets the current <a>Volume</a> setting for <a>Music</a>.
getMusicVolume :: MonadIO m => m Volume

-- | Returns whether a <a>Music</a> is currently playing or not.
--   
--   Note that this returns <a>True</a> even if the <a>Music</a> is
--   currently paused.
playingMusic :: MonadIO m => m Bool

-- | Returns whether a <a>Music</a> is currently paused or not.
--   
--   Note that this returns <a>False</a> if the <a>Music</a> is currently
--   halted.
pausedMusic :: MonadIO m => m Bool

-- | Returns the <a>Music</a>'s <a>Fading</a> status.
fadingMusic :: MonadIO m => m Fading

-- | A <a>Music</a>'s type.
data MusicType
CMD :: MusicType
WAV :: MusicType
MOD :: MusicType
MID :: MusicType
OGG :: MusicType
MP3 :: MusicType
FLAC :: MusicType

-- | Gets the <a>MusicType</a> of a given <a>Music</a>.
musicType :: Music -> Maybe MusicType

-- | Gets the <a>MusicType</a> of currently playing <a>Music</a>, if any.
playingMusicType :: MonadIO m => m (Maybe MusicType)

-- | Gradually fade out the <a>Music</a> over a given number of
--   <a>Milliseconds</a>.
--   
--   The <a>Music</a> is set to fade out only when it is playing and not
--   fading already.
--   
--   Returns whether the <a>Music</a> was successfully set to fade out.
fadeOutMusic :: MonadIO m => Milliseconds -> m Bool

-- | Sets a callback that gets invoked each time a <a>Music</a> finishes
--   playing.
--   
--   <b>Note: don't call other <a>Mixer</a> functions within this
--   callback.</b>
whenMusicFinished :: MonadIO m => IO () -> m ()

-- | A post-processing effect as a function operating on a mutable stream.
--   
--   <b>Note that, at the moment, this is a stream of bytes. Depending on
--   the</b> <b><a>Audio</a> <a>Format</a> you're using, you're probably
--   going to want to treat is</b> <b>as a stream of 16-bit values
--   instead.</b>
type Effect = Channel -> IOVector Word8 -> IO ()

-- | A function called when a processor is finished being used.
--   
--   This allows you to clean up any state you might have had.
type EffectFinished = Channel -> IO ()

-- | A way to refer to the special <a>Channel</a> used for post-processing
--   effects.
--   
--   You can only use this value with <a>effect</a> and the other in-built
--   effect functions such as <a>effectPan</a> and <a>effectDistance</a>.
pattern PostProcessing :: Channel

-- | Adds a post-processing <a>Effect</a> to a certain <a>Channel</a>.
--   
--   A <a>Channel</a>'s <a>Effect</a>s are called in the order they were
--   added.
--   
--   Returns an action that, when executed, removes this <a>Effect</a>.
--   <b>Note: do</b> <b>execute this returned action more than once.</b>
effect :: MonadIO m => Channel -> EffectFinished -> Effect -> m (m ())

-- | Applies an in-built effect implementing panning.
--   
--   Sets the left-channel and right-channel <a>Volume</a> to the given
--   values.
--   
--   This only works when <a>Audio</a>'s <a>Output</a> is <a>Stereo</a>,
--   which is the default.
--   
--   Returns an action that, when executed, removes this effect. That
--   action simply calls <a>effectPan</a> with <tt>Volumes</tt> 128 and
--   128.
effectPan :: MonadIO m => Channel -> Volume -> Volume -> m (m ())

-- | Applies a different volume based on the distance (as <a>Word8</a>)
--   specified.
--   
--   The volume is loudest at distance 0, quietest at distance 255.
--   
--   Returns an action that, when executed, removes this effect. That
--   action simply calls <a>effectDistance</a> with a distance of 0.
effectDistance :: MonadIO m => Channel -> Word8 -> m (m ())

-- | Simulates a simple 3D audio effect.
--   
--   Accepts the angle in degrees (as <a>Int16</a>) in relation to the
--   source of the sound (0 is directly in front, 90 directly to the right,
--   and so on) and a distance (as <a>Word8</a>) from the source of the
--   sound (where 255 is very far away, and 0 extremely close).
--   
--   Returns an action that, when executed, removes this effect. That
--   action simply calls <a>effectPosition</a> with both angle and distance
--   set to 0.
effectPosition :: MonadIO m => Channel -> Int16 -> Word8 -> m (m ())

-- | Swaps the left and right channel sound.
--   
--   If given <a>True</a>, will swap the sound channels.
--   
--   Returns an action that, when executed, removes this effect. That
--   action simply calls <a>effectReverseStereo</a> with <a>False</a>.
effectReverseStereo :: MonadIO m => Channel -> Bool -> m (m ())

-- | Initialize the library by loading support for a certain set of
--   sample/music formats.
--   
--   Note that calling this is not strictly necessary: support for a
--   certain format will be loaded automatically when attempting to load
--   data in that format. Using <a>initialize</a> allows you to decide
--   <i>when</i> to load support.
--   
--   You may call this function multiple times.
initialize :: (Foldable f, MonadIO m) => f InitFlag -> m ()

-- | Used with <a>initialize</a> to designate loading support for a
--   particular sample/music format.
data InitFlag
InitFLAC :: InitFlag
InitMOD :: InitFlag
InitMP3 :: InitFlag
InitOGG :: InitFlag

-- | Cleans up any loaded libraries, freeing memory.
quit :: MonadIO m => m ()

-- | Gets the major, minor, patch versions of the linked
--   <tt>SDL2_mixer</tt> library.
version :: (Integral a, MonadIO m) => m (a, a, a)
instance GHC.Show.Show SDL.Mixer.InitFlag
instance GHC.Read.Read SDL.Mixer.InitFlag
instance GHC.Enum.Bounded SDL.Mixer.InitFlag
instance GHC.Classes.Ord SDL.Mixer.InitFlag
instance GHC.Classes.Eq SDL.Mixer.InitFlag
instance GHC.Show.Show SDL.Mixer.Format
instance GHC.Read.Read SDL.Mixer.Format
instance GHC.Enum.Bounded SDL.Mixer.Format
instance GHC.Classes.Ord SDL.Mixer.Format
instance GHC.Classes.Eq SDL.Mixer.Format
instance GHC.Show.Show SDL.Mixer.Output
instance GHC.Read.Read SDL.Mixer.Output
instance GHC.Enum.Bounded SDL.Mixer.Output
instance GHC.Classes.Ord SDL.Mixer.Output
instance GHC.Classes.Eq SDL.Mixer.Output
instance GHC.Show.Show SDL.Mixer.Audio
instance GHC.Read.Read SDL.Mixer.Audio
instance GHC.Classes.Eq SDL.Mixer.Audio
instance GHC.Show.Show SDL.Mixer.Chunk
instance GHC.Classes.Eq SDL.Mixer.Chunk
instance GHC.Num.Num SDL.Mixer.Channel
instance GHC.Real.Real SDL.Mixer.Channel
instance GHC.Real.Integral SDL.Mixer.Channel
instance GHC.Enum.Enum SDL.Mixer.Channel
instance GHC.Classes.Ord SDL.Mixer.Channel
instance GHC.Classes.Eq SDL.Mixer.Channel
instance GHC.Num.Num SDL.Mixer.Times
instance GHC.Real.Real SDL.Mixer.Times
instance GHC.Real.Integral SDL.Mixer.Times
instance GHC.Enum.Enum SDL.Mixer.Times
instance GHC.Classes.Ord SDL.Mixer.Times
instance GHC.Classes.Eq SDL.Mixer.Times
instance GHC.Read.Read SDL.Mixer.Fading
instance GHC.Show.Show SDL.Mixer.Fading
instance GHC.Classes.Ord SDL.Mixer.Fading
instance GHC.Classes.Eq SDL.Mixer.Fading
instance GHC.Num.Num SDL.Mixer.Group
instance GHC.Real.Real SDL.Mixer.Group
instance GHC.Real.Integral SDL.Mixer.Group
instance GHC.Enum.Enum SDL.Mixer.Group
instance GHC.Classes.Ord SDL.Mixer.Group
instance GHC.Classes.Eq SDL.Mixer.Group
instance GHC.Show.Show SDL.Mixer.Music
instance GHC.Classes.Eq SDL.Mixer.Music
instance GHC.Enum.Bounded SDL.Mixer.MusicType
instance GHC.Classes.Ord SDL.Mixer.MusicType
instance GHC.Read.Read SDL.Mixer.MusicType
instance GHC.Show.Show SDL.Mixer.MusicType
instance GHC.Classes.Eq SDL.Mixer.MusicType
instance SDL.Mixer.Loadable SDL.Mixer.Music
instance GHC.Show.Show SDL.Mixer.Channel
instance SDL.Mixer.HasVolume SDL.Mixer.Channel
instance SDL.Mixer.Loadable SDL.Mixer.Chunk
instance SDL.Mixer.HasVolume SDL.Mixer.Chunk
instance Data.Default.Class.Default SDL.Mixer.Audio
