sdl2-mixer-1.2.0.0: Haskell bindings to SDL2_mixer

License | BSD3
Stability | experimental
Safe Haskell | None
Language | Haskell2010

SDL.Raw.Mixer

Contents

- General
- Samples
- Channels
- Groups
- Music
- Effects
- MikMod
- MIDI backends

Description

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.

Synopsis

- 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 {
  - chunkAllocated :: CInt
  - chunkAbuf :: Ptr Word8
  - chunkAlen :: Word32
  - chunkVolume :: 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

# General

getVersion :: MonadIO m => m (Ptr Version) Source #

pattern SDL_MIXER_MAJOR_VERSION :: (Eq a, Num a) => a Source #

pattern SDL_MIXER_MINOR_VERSION :: (Eq a, Num a) => a Source #

pattern SDL_MIXER_PATCHLEVEL :: (Eq a, Num a) => a Source #

type InitFlag = CInt Source #

init :: MonadIO m => InitFlag -> m CInt Source #

pattern INIT_FLAC :: (Eq a, Num a) => a Source #

pattern INIT_MOD :: (Eq a, Num a) => a Source #

pattern INIT_MP3 :: (Eq a, Num a) => a Source #

pattern INIT_OGG :: (Eq a, Num a) => a Source #

quit :: MonadIO m => m () Source #

type Format = Word16 Source #

pattern DEFAULT_FORMAT :: (Eq a, Num a) => a Source #

pattern DEFAULT_FREQUENCY :: (Eq a, Num a) => a Source #

pattern DEFAULT_CHANNELS :: (Eq a, Num a) => a Source #

openAudio :: MonadIO m => CInt -> Format -> CInt -> CInt -> m CInt Source #

pattern AUDIO_U8 :: (Eq a, Num a) => a Source #

pattern AUDIO_S8 :: (Eq a, Num a) => a Source #

pattern AUDIO_U16LSB :: (Eq a, Num a) => a Source #

pattern AUDIO_S16LSB :: (Eq a, Num a) => a Source #

pattern AUDIO_U16MSB :: (Eq a, Num a) => a Source #

pattern AUDIO_S16MSB :: (Eq a, Num a) => a Source #

pattern AUDIO_U16 :: (Eq a, Num a) => a Source #

pattern AUDIO_S16 :: (Eq a, Num a) => a Source #

pattern AUDIO_U16SYS :: (Eq a, Num a) => a Source #

pattern AUDIO_S16SYS :: (Eq a, Num a) => a Source #

closeAudio :: MonadIO m => m () Source #

querySpec :: MonadIO m => Ptr CInt -> Ptr Format -> Ptr CInt -> m CInt Source #

# Samples

getNumChunkDecoders :: MonadIO m => m CInt Source #

getChunkDecoder :: MonadIO m => CInt -> m CString Source #

data Chunk Source #

Constructors

Chunk |

Fields

- chunkAllocated :: CInt
- chunkAbuf :: Ptr Word8
- chunkAlen :: Word32
- chunkVolume :: Word8

#### Instances

Instances details

Storable Chunk Source # |

Instance details

Defined in SDL.Raw.Mixer

Methods

sizeOf :: Chunk -> Int Source #

alignment :: Chunk -> Int Source #

peekElemOff :: Ptr Chunk -> Int -> IO Chunk Source #

pokeElemOff :: Ptr Chunk -> Int -> Chunk -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO Chunk Source #

pokeByteOff :: Ptr b -> Int -> Chunk -> IO () Source #

peek :: Ptr Chunk -> IO Chunk Source #

poke :: Ptr Chunk -> Chunk -> IO () Source #

Show Chunk Source # |
Instance details Defined in SDL.Raw.Mixer Methods showsPrec :: Int -> Chunk -> ShowS Source # show :: Chunk -> String Source # showList :: [Chunk] -> ShowS Source #
Eq Chunk Source # |
Instance details Defined in SDL.Raw.Mixer Methods (==) :: Chunk -> Chunk -> Bool Source # (/=) :: Chunk -> Chunk -> Bool Source #

loadWAV :: MonadIO m => CString -> m (Ptr Chunk) Source #

loadWAV_RW :: MonadIO m => Ptr RWops -> CInt -> m (Ptr Chunk) Source #

quickLoadWAV :: MonadIO m => Ptr Word8 -> m (Ptr Chunk) Source #

quickLoadRaw :: MonadIO m => Ptr Word8 -> m (Ptr Chunk) Source #

pattern MAX_VOLUME :: (Eq a, Num a) => a Source #

volumeChunk :: MonadIO m => Ptr Chunk -> CInt -> m CInt Source #

freeChunk :: MonadIO m => Ptr Chunk -> m () Source #

# Channels

allocateChannels :: MonadIO m => CInt -> m CInt Source #

pattern CHANNELS :: (Eq a, Num a) => a Source #

type Channel = CInt Source #

volume :: MonadIO m => Channel -> CInt -> m CInt Source #

playChannel :: MonadIO m => Channel -> Ptr Chunk -> CInt -> m CInt Source #

playChannelTimed :: MonadIO m => Channel -> Ptr Chunk -> CInt -> CInt -> m CInt Source #

fadeInChannel :: MonadIO m => Channel -> Ptr Chunk -> CInt -> CInt -> m CInt Source #

fadeInChannelTimed :: MonadIO m => Channel -> Ptr Chunk -> CInt -> CInt -> CInt -> m CInt Source #

pause :: MonadIO m => Channel -> m () Source #

resume :: MonadIO m => Channel -> m () Source #

haltChannel :: MonadIO m => Channel -> m CInt Source #

expireChannel :: MonadIO m => Channel -> CInt -> m CInt Source #

fadeOutChannel :: MonadIO m => Channel -> CInt -> m CInt Source #

channelFinished :: MonadIO m => FunPtr (Channel -> IO ()) -> m () Source #

wrapChannelCallback :: (Channel -> IO ()) -> IO (FunPtr (Channel -> IO ())) Source #

playing :: MonadIO m => Channel -> m CInt Source #

paused :: MonadIO m => Channel -> m CInt Source #

type Fading = Word32 Source #

fadingChannel :: MonadIO m => Channel -> m Fading Source #

pattern NO_FADING :: (Eq a, Num a) => a Source #

pattern FADING_OUT :: (Eq a, Num a) => a Source #

pattern FADING_IN :: (Eq a, Num a) => a Source #

getChunk :: MonadIO m => Channel -> m (Ptr Chunk) Source #

# Groups

reserveChannels :: MonadIO m => CInt -> m CInt Source #

type Tag = CInt Source #

groupChannel :: MonadIO m => Channel -> Tag -> m CInt Source #

groupChannels :: MonadIO m => Channel -> Channel -> Tag -> m CInt Source #

groupCount :: MonadIO m => Tag -> m CInt Source #

groupAvailable :: MonadIO m => Tag -> m CInt Source #

groupOldest :: MonadIO m => Tag -> m CInt Source #

groupNewer :: MonadIO m => Tag -> m CInt Source #

fadeOutGroup :: MonadIO m => Tag -> CInt -> m CInt Source #

haltGroup :: MonadIO m => Tag -> m CInt Source #

# Music

getNumMusicDecoders :: MonadIO m => m CInt Source #

getMusicDecoder :: MonadIO m => CInt -> m CString Source #

data Music Source #

loadMUS :: MonadIO m => CString -> m (Ptr Music) Source #

loadMUS_RW :: MonadIO m => Ptr RWops -> CInt -> m (Ptr Music) Source #

loadMUSType_RW :: MonadIO m => Ptr RWops -> MusicType -> CInt -> m (Ptr Music) Source #

freeMusic :: MonadIO m => Ptr Music -> m () Source #

playMusic :: MonadIO m => Ptr Music -> CInt -> m CInt Source #

fadeInMusic :: MonadIO m => Ptr Music -> CInt -> CInt -> m CInt Source #

fadeInMusicPos :: MonadIO m => Ptr Music -> CInt -> CInt -> CDouble -> m CInt Source #

hookMusic :: MonadIO m => FunPtr (Ptr () -> Ptr Word8 -> CInt -> IO ()) -> Ptr () -> m () Source #

volumeMusic :: MonadIO m => CInt -> m CInt Source #

pauseMusic :: MonadIO m => m () Source #

resumeMusic :: MonadIO m => m () Source #

rewindMusic :: MonadIO m => m () Source #

setMusicPosition :: MonadIO m => CDouble -> m CInt Source #

setMusicCMD :: MonadIO m => CString -> m CInt Source #

haltMusic :: MonadIO m => m CInt Source #

fadeOutMusic :: MonadIO m => CInt -> m CInt Source #

wrapMusicCallback :: IO () -> IO (FunPtr (IO ())) Source #

hookMusicFinished :: MonadIO m => FunPtr (IO ()) -> m () Source #

type MusicType = Word32 Source #

getMusicType :: MonadIO m => Ptr Music -> m MusicType Source #

pattern MUS_NONE :: (Eq a, Num a) => a Source #

pattern MUS_CMD :: (Eq a, Num a) => a Source #

pattern MUS_WAV :: (Eq a, Num a) => a Source #

pattern MUS_MOD :: (Eq a, Num a) => a Source #

pattern MUS_MID :: (Eq a, Num a) => a Source #

pattern MUS_OGG :: (Eq a, Num a) => a Source #

pattern MUS_MP3 :: (Eq a, Num a) => a Source #

pattern MUS_FLAC :: (Eq a, Num a) => a Source #

playingMusic :: MonadIO m => m CInt Source #

pausedMusic :: MonadIO m => m CInt Source #

fadingMusic :: MonadIO m => m Fading Source #

getMusicHookData :: MonadIO m => m (Ptr ()) Source #

# Effects

type Effect = Channel -> Ptr () -> CInt -> Ptr () -> IO () Source #

wrapEffect :: Effect -> IO (FunPtr Effect) Source #

type EffectFinished = Channel -> Ptr () -> IO () Source #

wrapEffectFinished :: EffectFinished -> IO (FunPtr EffectFinished) Source #

registerEffect :: MonadIO m => Channel -> FunPtr Effect -> FunPtr EffectFinished -> Ptr () -> m CInt Source #

pattern CHANNEL_POST :: (Eq a, Num a) => a Source #

unregisterEffect :: MonadIO m => Channel -> FunPtr Effect -> m CInt Source #

unregisterAllEffects :: MonadIO m => Channel -> m CInt Source #

setPostMix :: MonadIO m => FunPtr (Ptr () -> Ptr Word8 -> CInt -> IO ()) -> Ptr () -> m () Source #

setPanning :: MonadIO m => Channel -> Word8 -> Word8 -> m CInt Source #

setDistance :: MonadIO m => Channel -> Word8 -> m CInt Source #

setPosition :: MonadIO m => Channel -> Int16 -> Word8 -> m CInt Source #

setReverseStereo :: MonadIO m => Channel -> CInt -> m CInt Source #

# MikMod

setSynchroValue :: MonadIO m => CInt -> m CInt Source #

getSynchroValue :: MonadIO m => m CInt Source #

# MIDI backends

setSoundFonts :: MonadIO m => Ptr CString -> m CInt Source #

getSoundFonts :: MonadIO m => m (Ptr CString) Source #

eachSoundFont :: MonadIO m => FunPtr (CString -> Ptr () -> IO CInt) -> Ptr () -> m CInt Source #