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

-- | Raw bindings to the SDL2_mixer library. No error-handling is
--   done here. For more information about specific function behaviour, see
--   the SDL2_mixer documentation.
module SDL.Raw.Mixer
getVersion :: MonadIO m => m (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 :: MonadIO m => m ()
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 :: MonadIO m => m ()
querySpec :: MonadIO m => Ptr CInt -> Ptr Format -> Ptr CInt -> m CInt
getNumChunkDecoders :: MonadIO m => m 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 :: MonadIO m => m 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 :: MonadIO m => m ()
resumeMusic :: MonadIO m => m ()
rewindMusic :: MonadIO m => m ()
setMusicPosition :: MonadIO m => CDouble -> m CInt
setMusicCMD :: MonadIO m => CString -> m CInt
haltMusic :: MonadIO m => m 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 :: MonadIO m => m CInt
pausedMusic :: MonadIO m => m CInt
fadingMusic :: MonadIO m => m Fading
getMusicHookData :: MonadIO m => m (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 :: MonadIO m => m CInt
setSoundFonts :: MonadIO m => Ptr CString -> m CInt
getSoundFonts :: MonadIO m => m (Ptr CString)
eachSoundFont :: MonadIO m => FunPtr (CString -> Ptr () -> IO CInt) -> Ptr () -> m CInt
instance GHC.Classes.Eq SDL.Raw.Mixer.Chunk
instance GHC.Internal.Show.Show SDL.Raw.Mixer.Chunk
instance GHC.Internal.Foreign.Storable.Storable SDL.Raw.Mixer.Chunk

-- | Bindings to the SDL2_mixer library.
module SDL.Mixer

-- | Initializes the SDL2_mixer API.
--   
--   This should be the first function you call after initializing
--   SDL itself with InitAudio.
--   
--   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 withAudio.
data Audio
Audio :: Int -> Format -> Output -> Audio

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

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

-- | Mono or Stereo 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 Audio configuration.
--   
--   Same as def.
--   
--   Uses 22050 as the audioFrequency, FormatS16_Sys as the
--   audioFormat and Stereo as the audioOutput.
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 Audio you asked for when calling
--   withAudio.
queryAudio :: MonadIO m => m Audio

-- | An alternative to withAudio, also initializes the
--   SDL2_mixer API.
--   
--   However, openAudio does not take care of automatically calling
--   closeAudio 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 SDL2_mixer API.
--   
--   After calling this, all audio stops.
--   
--   You don't have to call this if you're using withAudio.
closeAudio :: MonadIO m => m ()

-- | A class of all values that can be loaded from some source. You can
--   load both Chunks and Music this way.
--   
--   Note that you must call withAudio 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 ByteString.
decode :: (Loadable a, MonadIO m) => ByteString -> m a

-- | Same as decode, 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.
--   
--   Note that you shouldn't free those values that are currently
--   playing.
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: WAVE, AIFF, VOC, OFF,
--   FLAC, MP3.
chunkDecoders :: MonadIO m => m [String]

-- | A loaded music file.
--   
--   Music is played on a separate channel different from the normal
--   mixing Channels.
--   
--   To manipulate Music 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: WAVE, MODPLUG, MIKMOD,
--   TIMIDITY, FLUIDSYNTH, NATIVEMIDI,
--   OGG, FLAC, MP3.
musicDecoders :: MonadIO m => m [String]

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

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

-- | Prepares a given number of Channels for use.
--   
--   There are 8 such Channels already prepared for use after
--   withAudio is called.
--   
--   You may call this multiple times, even with sounds playing. If setting
--   a lesser number of Channels than are currently in use, the
--   higher Channels 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 Music playing is not affected by this function.
setChannels :: MonadIO m => Int -> m ()

-- | Gets the number of Channels currently in use.
getChannels :: MonadIO m => m Int

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

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

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

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

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

-- | Same as play, but plays the Chunk using a given
--   Channel a certain number of Times.
--   
--   If AllChannels is used, then plays the Chunk using the
--   first available Channel instead.
--   
--   Returns the Channel 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 playOn, but imposes an upper limit in
--   Milliseconds to how long the Chunk 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 play, but fades in the Chunk by making the
--   Channel Volume start at 0 and rise to a full 128 over
--   the course of a given number of Milliseconds.
--   
--   The Chunk 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 fadeIn, but allows you to specify the Channel to
--   play on and how many Times to play it, similar to
--   playOn.
--   
--   If AllChannels is used, will play the Chunk on the first
--   available Channel.
--   
--   Returns the Channel that was used.
fadeInOn :: MonadIO m => Channel -> Times -> Milliseconds -> Chunk -> m Channel

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

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

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

-- | The default Group all Channels are in the moment they
--   are created.
pattern DefaultGroup :: Group

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

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

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

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

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

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

-- | Pauses the given Channel, if it is actively playing.
--   
--   If AllChannels is used, will pause all actively playing
--   Channels instead.
--   
--   Note that paused Channels may still be halted.
pause :: MonadIO m => Channel -> m ()

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

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

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

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

-- | A volume, where 0 is silent and 128 loudest.
--   
--   Volumes 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 Volume.
class HasVolume a

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

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

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

-- | Returns how many Channels are currently playing.
playingCount :: MonadIO m => m Int

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

-- | Returns how many Channels are currently paused.
pausedCount :: MonadIO m => m Int

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

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

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

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

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

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

-- | Plays a given Music a certain number of Times.
--   
--   The previously playing Music 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 Music.
type Position = Milliseconds

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

-- | A post-processing effect as a function operating on a mutable stream.
--   
--   Note that, at the moment, this is a stream of bytes. Depending on
--   the Audio Format you're using, you're probably
--   going to want to treat is as a stream of 16-bit values
--   instead.
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 Channel used for post-processing
--   effects.
--   
--   You can only use this value with effect and the other in-built
--   effect functions such as effectPan and effectDistance.
pattern PostProcessing :: Channel

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

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

-- | Applies a different volume based on the distance (as Word8)
--   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 effectDistance with a distance of 0.
effectDistance :: MonadIO m => Channel -> Word8 -> m (m ())

-- | Simulates a simple 3D audio effect.
--   
--   Accepts the angle in degrees (as Int16) 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 Word8) 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 effectPosition 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 True, will swap the sound channels.
--   
--   Returns an action that, when executed, removes this effect. That
--   action simply calls effectReverseStereo with False.
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 initialize allows you to decide
--   when to load support.
--   
--   You may call this function multiple times.
initialize :: (Foldable f, MonadIO m) => f InitFlag -> m ()

-- | Used with initialize 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
--   SDL2_mixer library.
version :: (Integral a, MonadIO m) => m (a, a, a)
instance GHC.Internal.Enum.Bounded SDL.Mixer.Format
instance GHC.Internal.Enum.Bounded SDL.Mixer.InitFlag
instance GHC.Internal.Enum.Bounded SDL.Mixer.MusicType
instance GHC.Internal.Enum.Bounded SDL.Mixer.Output
instance Data.Default.Internal.Default SDL.Mixer.Audio
instance GHC.Internal.Enum.Enum SDL.Mixer.Channel
instance GHC.Internal.Enum.Enum SDL.Mixer.Group
instance GHC.Internal.Enum.Enum SDL.Mixer.Times
instance GHC.Classes.Eq SDL.Mixer.Audio
instance GHC.Classes.Eq SDL.Mixer.Channel
instance GHC.Classes.Eq SDL.Mixer.Chunk
instance GHC.Classes.Eq SDL.Mixer.Fading
instance GHC.Classes.Eq SDL.Mixer.Format
instance GHC.Classes.Eq SDL.Mixer.Group
instance GHC.Classes.Eq SDL.Mixer.InitFlag
instance GHC.Classes.Eq SDL.Mixer.Music
instance GHC.Classes.Eq SDL.Mixer.MusicType
instance GHC.Classes.Eq SDL.Mixer.Output
instance GHC.Classes.Eq SDL.Mixer.Times
instance SDL.Mixer.HasVolume SDL.Mixer.Channel
instance SDL.Mixer.HasVolume SDL.Mixer.Chunk
instance GHC.Internal.Real.Integral SDL.Mixer.Channel
instance GHC.Internal.Real.Integral SDL.Mixer.Group
instance GHC.Internal.Real.Integral SDL.Mixer.Times
instance SDL.Mixer.Loadable SDL.Mixer.Chunk
instance SDL.Mixer.Loadable SDL.Mixer.Music
instance GHC.Internal.Num.Num SDL.Mixer.Channel
instance GHC.Internal.Num.Num SDL.Mixer.Group
instance GHC.Internal.Num.Num SDL.Mixer.Times
instance GHC.Classes.Ord SDL.Mixer.Channel
instance GHC.Classes.Ord SDL.Mixer.Fading
instance GHC.Classes.Ord SDL.Mixer.Format
instance GHC.Classes.Ord SDL.Mixer.Group
instance GHC.Classes.Ord SDL.Mixer.InitFlag
instance GHC.Classes.Ord SDL.Mixer.MusicType
instance GHC.Classes.Ord SDL.Mixer.Output
instance GHC.Classes.Ord SDL.Mixer.Times
instance GHC.Internal.Read.Read SDL.Mixer.Audio
instance GHC.Internal.Read.Read SDL.Mixer.Fading
instance GHC.Internal.Read.Read SDL.Mixer.Format
instance GHC.Internal.Read.Read SDL.Mixer.InitFlag
instance GHC.Internal.Read.Read SDL.Mixer.MusicType
instance GHC.Internal.Read.Read SDL.Mixer.Output
instance GHC.Internal.Real.Real SDL.Mixer.Channel
instance GHC.Internal.Real.Real SDL.Mixer.Group
instance GHC.Internal.Real.Real SDL.Mixer.Times
instance GHC.Internal.Show.Show SDL.Mixer.Audio
instance GHC.Internal.Show.Show SDL.Mixer.Channel
instance GHC.Internal.Show.Show SDL.Mixer.Chunk
instance GHC.Internal.Show.Show SDL.Mixer.Fading
instance GHC.Internal.Show.Show SDL.Mixer.Format
instance GHC.Internal.Show.Show SDL.Mixer.InitFlag
instance GHC.Internal.Show.Show SDL.Mixer.Music
instance GHC.Internal.Show.Show SDL.Mixer.MusicType
instance GHC.Internal.Show.Show SDL.Mixer.Output
