{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE NoImplicitPrelude #-}

-- | Audio functionality for the SDL library.
--
--     All audio in SDL3 revolves around 'SDL_AudioStream'. Whether you want to play or record audio, convert it, stream it, buffer it, or mix it, you\'re going to be passing it through an audio stream.
--
--     Audio streams are quite flexible; they can accept any amount of data at a time, in any supported format, and output it as needed in any other format, even if the data format changes on either side halfway through.
--
--     An app opens an audio device and binds any number of audio streams to it, feeding more data to the streams as available. When the device needs more data, it will pull it from all bound streams and mix them together for playback.
--
--     Audio streams can also use an app-provided callback to supply data on-demand, which maps pretty closely to the SDL2 audio model.
--
--     SDL also provides a simple .WAV loader in SDL_LoadWAV (and SDL_LoadWAV_IO if you aren\'t reading from a file) as a basic means to load sound data into your program.
--
--     Logical audio devices
--
--     In SDL3, opening a physical device (like a SoundBlaster 16 Pro) gives you a logical device ID that you can bind audio streams to. In almost all cases, logical devices can be used anywhere in the API that a physical device is normally used. However, since each device opening generates a new logical device, different parts of the program (say, a VoIP library, or text-to-speech framework, or maybe some other sort of mixer on top of SDL) can have their own device opens that do not interfere with each other; each logical device will mix its separate audio down to a single buffer, fed to the physical device, behind the scenes. As many logical devices as you like can come and go; SDL will only have to open the physical device at the OS level once, and will manage all the logical devices on top of it internally.
--
--     One other benefit of logical devices: if you don\'t open a specific physical device, instead opting for the default, SDL can automatically migrate those logical devices to different hardware as circumstances change: a user plugged in headphones? The system default changed? SDL can transparently migrate the logical devices to the correct physical device seamlessly and keep playing; the app doesn\'t even have to know it happened if it doesn\'t want to.
--
--     Simplified audio
--
--     As a simplified model for when a single source of audio is all that\'s needed, an app can use SDL_OpenAudioDeviceStream, which is a single function to open an audio device, create an audio stream, bind that stream to the newly-opened device, and (optionally) provide a callback for obtaining audio data. When using this function, the primary interface is the 'SDL_AudioStream' and the device handle is mostly hidden away; destroying a stream created through this function will also close the device, stream bindings cannot be changed, etc. One other quirk of this is that the device is started in a /paused/ state and must be explicitly resumed; this is partially to offer a clean migration for SDL2 apps and partially because the app might have to do more setup before playback begins; in the non-simplified form, nothing will play until a stream is bound to a device, so they start /unpaused/.
--
--     Channel layouts
--
--     Audio data passing through SDL is uncompressed PCM data, interleaved. One can provide their own decompression through an MP3, etc, decoder, but SDL does not provide this directly. Each interleaved channel of data is meant to be in a specific order.
--
--     Abbreviations:
--
--     * FRONT = single mono speaker
--
--     * FL = front left speaker
--
--     * FR = front right speaker
--
--     * FC = front center speaker
--
--     * BL = back left speaker
--
--     * BR = back right speaker
--
--     * SR = surround right speaker
--
--     * SL = surround left speaker
--
--     * BC = back center speaker
--
--     * LFE = low-frequency speaker
--
--     These are listed in the order they are laid out in memory, so \"FL, FR\" means \"the front left speaker is laid out in memory first, then the front right, then it repeats for the next audio frame\".
--
--     * 1 channel (mono) layout: FRONT
--
--     * 2 channels (stereo) layout: FL, FR
--
--     * 3 channels (2.1) layout: FL, FR, LFE
--
--     * 4 channels (quad) layout: FL, FR, BL, BR
--
--     * 5 channels (4.1) layout: FL, FR, LFE, BL, BR
--
--     * 6 channels (5.1) layout: FL, FR, FC, LFE, BL, BR (last two can also be SL, SR)
--
--     * 7 channels (6.1) layout: FL, FR, FC, LFE, BC, SL, SR
--
--     * 8 channels (7.1) layout: FL, FR, FC, LFE, BL, BR, SL, SR
--
--     This is the same order as DirectSound expects, but applied to all platforms; SDL will swizzle the channels as necessary if a platform expects something different.
--
--     'SDL_AudioStream' can also be provided channel maps to change this ordering to whatever is necessary, in other audio processing scenarios. Mask of bits in an 'SDL_AudioFormat' that contains the format bit size.
--
--     Generally one should use SDL_AUDIO_BITSIZE instead of this macro directly.
--
--     @since 3.2.0
module SDL3.Sys.Bindgen.Audio (
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_MASK_BITSIZE,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_MASK_FLOAT,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_MASK_BIG_ENDIAN,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_MASK_SIGNED,
  SDL3.Sys.Bindgen.Audio.SDL_AudioFormat (..),
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_UNKNOWN,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_U8,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_S8,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_S16LE,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_S16BE,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_S32LE,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_S32BE,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_F32LE,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_F32BE,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_S16,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_S32,
  pattern SDL3.Sys.Bindgen.Audio.SDL_AUDIO_F32,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_BITSIZE,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_BYTESIZE,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_ISFLOAT,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_ISBIGENDIAN,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_ISLITTLEENDIAN,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_ISSIGNED,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_ISINT,
  SDL3.Sys.Bindgen.Audio.sDL_AUDIO_ISUNSIGNED,
  SDL3.Sys.Bindgen.Audio.SDL_AudioDeviceID (..),
  SDL3.Sys.Bindgen.Audio.SDL_AudioSpec (..),
  SDL3.Sys.Bindgen.Audio.SDL_AudioStream,
  SDL3.Sys.Bindgen.Audio.sDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN,
  SDL3.Sys.Bindgen.Audio.SDL_AudioStreamDataCompleteCallback_Aux (..),
  SDL3.Sys.Bindgen.Audio.SDL_AudioStreamDataCompleteCallback (..),
  SDL3.Sys.Bindgen.Audio.SDL_AudioStreamCallback_Aux (..),
  SDL3.Sys.Bindgen.Audio.SDL_AudioStreamCallback (..),
  SDL3.Sys.Bindgen.Audio.SDL_AudioPostmixCallback_Aux (..),
  SDL3.Sys.Bindgen.Audio.SDL_AudioPostmixCallback (..),
)
where

import Prelude (
  Bounded,
  Enum,
  Eq,
  IO,
  Int,
  Integral,
  Num,
  Ord,
  Read,
  Real,
  Show,
  fmap,
  pure,
  (<*>),
  (>>),
  type (~),
 )

import C.Expr.HostPlatform qualified
import HsBindgen.Runtime.CEnum qualified as CEnum
import HsBindgen.Runtime.HasCField qualified as HasCField
import HsBindgen.Runtime.Marshal qualified as Marshal
import HsBindgen.Runtime.PtrConst qualified as PtrConst
import HsBindgen.Runtime.Struct qualified as Struct
import HsBindgen.Runtime.Support qualified as BG
import HsBindgen.Runtime.Support.CompatHasField qualified as BG.CompatHasField
import SDL3.Sys.Bindgen.Stdinc qualified

-- | [C declaration]: @macro SDL_AUDIO_MASK_BITSIZE@, defined at @SDL3\/SDL_audio.h 151:9@
sDL_AUDIO_MASK_BITSIZE :: BG.CUInt
sDL_AUDIO_MASK_BITSIZE :: CUInt
sDL_AUDIO_MASK_BITSIZE = (CUInt
255 :: BG.CUInt)

-- | Mask of bits in an 'SDL_AudioFormat' that contain the floating point flag.
--
--     Generally one should use SDL_AUDIO_ISFLOAT instead of this macro directly.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_MASK_FLOAT@, defined at @SDL3\/SDL_audio.h 160:9@
sDL_AUDIO_MASK_FLOAT :: BG.CUInt
sDL_AUDIO_MASK_FLOAT :: CUInt
sDL_AUDIO_MASK_FLOAT =
  CUInt -> CInt -> ShiftRes CUInt
forall a i. Shift a i => a -> i -> ShiftRes a
(C.Expr.HostPlatform.<<) (CUInt
1 :: BG.CUInt) (CInt
8 :: BG.CInt)

-- | Mask of bits in an 'SDL_AudioFormat' that contain the bigendian flag.
--
--     Generally one should use SDL_AUDIO_ISBIGENDIAN or SDL_AUDIO_ISLITTLEENDIAN instead of this macro directly.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_MASK_BIG_ENDIAN@, defined at @SDL3\/SDL_audio.h 170:9@
sDL_AUDIO_MASK_BIG_ENDIAN :: BG.CUInt
sDL_AUDIO_MASK_BIG_ENDIAN :: CUInt
sDL_AUDIO_MASK_BIG_ENDIAN =
  CUInt -> CInt -> ShiftRes CUInt
forall a i. Shift a i => a -> i -> ShiftRes a
(C.Expr.HostPlatform.<<) (CUInt
1 :: BG.CUInt) (CInt
12 :: BG.CInt)

-- | Mask of bits in an 'SDL_AudioFormat' that contain the signed data flag.
--
--     Generally one should use SDL_AUDIO_ISSIGNED instead of this macro directly.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_MASK_SIGNED@, defined at @SDL3\/SDL_audio.h 179:9@
sDL_AUDIO_MASK_SIGNED :: BG.CUInt
sDL_AUDIO_MASK_SIGNED :: CUInt
sDL_AUDIO_MASK_SIGNED =
  CUInt -> CInt -> ShiftRes CUInt
forall a i. Shift a i => a -> i -> ShiftRes a
(C.Expr.HostPlatform.<<) (CUInt
1 :: BG.CUInt) (CInt
15 :: BG.CInt)

-- | Audio format.
--
--     @since 3.2.0
--
--     [See also]: 'sDL_AUDIO_BITSIZE', 'sDL_AUDIO_BYTESIZE', 'sDL_AUDIO_ISINT', 'sDL_AUDIO_ISFLOAT', 'sDL_AUDIO_ISBIGENDIAN', 'sDL_AUDIO_ISLITTLEENDIAN', 'sDL_AUDIO_ISSIGNED', 'sDL_AUDIO_ISUNSIGNED'
--
--     [C declaration]: @enum SDL_AudioFormat@, defined at @SDL3\/SDL_audio.h 221:14@
newtype SDL_AudioFormat = SDL_AudioFormat
  { SDL_AudioFormat -> CUInt
unwrap :: BG.CUInt
  }
  deriving stock ((forall x. SDL_AudioFormat -> Rep SDL_AudioFormat x)
-> (forall x. Rep SDL_AudioFormat x -> SDL_AudioFormat)
-> Generic SDL_AudioFormat
forall x. Rep SDL_AudioFormat x -> SDL_AudioFormat
forall x. SDL_AudioFormat -> Rep SDL_AudioFormat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_AudioFormat -> Rep SDL_AudioFormat x
from :: forall x. SDL_AudioFormat -> Rep SDL_AudioFormat x
$cto :: forall x. Rep SDL_AudioFormat x -> SDL_AudioFormat
to :: forall x. Rep SDL_AudioFormat x -> SDL_AudioFormat
BG.Generic, SDL_AudioFormat -> SDL_AudioFormat -> Bool
(SDL_AudioFormat -> SDL_AudioFormat -> Bool)
-> (SDL_AudioFormat -> SDL_AudioFormat -> Bool)
-> Eq SDL_AudioFormat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
== :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
$c/= :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
/= :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
Eq, Eq SDL_AudioFormat
Eq SDL_AudioFormat =>
(SDL_AudioFormat -> SDL_AudioFormat -> Ordering)
-> (SDL_AudioFormat -> SDL_AudioFormat -> Bool)
-> (SDL_AudioFormat -> SDL_AudioFormat -> Bool)
-> (SDL_AudioFormat -> SDL_AudioFormat -> Bool)
-> (SDL_AudioFormat -> SDL_AudioFormat -> Bool)
-> (SDL_AudioFormat -> SDL_AudioFormat -> SDL_AudioFormat)
-> (SDL_AudioFormat -> SDL_AudioFormat -> SDL_AudioFormat)
-> Ord SDL_AudioFormat
SDL_AudioFormat -> SDL_AudioFormat -> Bool
SDL_AudioFormat -> SDL_AudioFormat -> Ordering
SDL_AudioFormat -> SDL_AudioFormat -> SDL_AudioFormat
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_AudioFormat -> SDL_AudioFormat -> Ordering
compare :: SDL_AudioFormat -> SDL_AudioFormat -> Ordering
$c< :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
< :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
$c<= :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
<= :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
$c> :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
> :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
$c>= :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
>= :: SDL_AudioFormat -> SDL_AudioFormat -> Bool
$cmax :: SDL_AudioFormat -> SDL_AudioFormat -> SDL_AudioFormat
max :: SDL_AudioFormat -> SDL_AudioFormat -> SDL_AudioFormat
$cmin :: SDL_AudioFormat -> SDL_AudioFormat -> SDL_AudioFormat
min :: SDL_AudioFormat -> SDL_AudioFormat -> SDL_AudioFormat
Ord)
  deriving newtype (FFIType SDL_AudioFormat -> SDL_AudioFormat
SDL_AudioFormat -> FFIType SDL_AudioFormat
(SDL_AudioFormat -> FFIType SDL_AudioFormat)
-> (FFIType SDL_AudioFormat -> SDL_AudioFormat)
-> HasFFIType SDL_AudioFormat
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_AudioFormat -> FFIType SDL_AudioFormat
toFFIType :: SDL_AudioFormat -> FFIType SDL_AudioFormat
$cfromFFIType :: FFIType SDL_AudioFormat -> SDL_AudioFormat
fromFFIType :: FFIType SDL_AudioFormat -> SDL_AudioFormat
BG.HasFFIType)

instance Marshal.StaticSize SDL_AudioFormat where
  staticSizeOf :: Proxy SDL_AudioFormat -> Int
staticSizeOf = \Proxy SDL_AudioFormat
_ -> (Int
4 :: Int)

  staticAlignment :: Proxy SDL_AudioFormat -> Int
staticAlignment = \Proxy SDL_AudioFormat
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_AudioFormat where
  readRaw :: Ptr SDL_AudioFormat -> IO SDL_AudioFormat
readRaw =
    \Ptr SDL_AudioFormat
ptr0 ->
      (CUInt -> SDL_AudioFormat) -> IO (CUInt -> SDL_AudioFormat)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CUInt -> SDL_AudioFormat
SDL_AudioFormat
        IO (CUInt -> SDL_AudioFormat) -> IO CUInt -> IO SDL_AudioFormat
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Ptr SDL_AudioFormat -> Int -> IO CUInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_AudioFormat
ptr0 (Int
0 :: Int)

instance Marshal.WriteRaw SDL_AudioFormat where
  writeRaw :: Ptr SDL_AudioFormat -> SDL_AudioFormat -> IO ()
writeRaw =
    \Ptr SDL_AudioFormat
ptr0 ->
      \SDL_AudioFormat
s1 ->
        case SDL_AudioFormat
s1 of
          SDL_AudioFormat CUInt
unwrap2 ->
            Ptr SDL_AudioFormat -> Int -> CUInt -> IO ()
forall a b. WriteRaw a => Ptr b -> Int -> a -> IO ()
Marshal.writeRawByteOff Ptr SDL_AudioFormat
ptr0 (Int
0 :: Int) CUInt
unwrap2

deriving via Marshal.EquivStorable SDL_AudioFormat instance BG.Storable SDL_AudioFormat

deriving via BG.CUInt instance BG.Prim SDL_AudioFormat

instance CEnum.CEnum SDL_AudioFormat where
  type CEnumZ SDL_AudioFormat = BG.CUInt

  toCEnum :: CEnumZ SDL_AudioFormat -> SDL_AudioFormat
toCEnum = CUInt -> SDL_AudioFormat
CEnumZ SDL_AudioFormat -> SDL_AudioFormat
SDL_AudioFormat

  fromCEnum :: SDL_AudioFormat -> CEnumZ SDL_AudioFormat
fromCEnum = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap"

  declaredValues :: forall (proxy :: * -> *).
proxy SDL_AudioFormat -> DeclaredValues SDL_AudioFormat
declaredValues =
    \proxy SDL_AudioFormat
_ ->
      [(CEnumZ SDL_AudioFormat, NonEmpty String)]
-> DeclaredValues SDL_AudioFormat
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (CUInt
CEnumZ SDL_AudioFormat
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_AUDIO_UNKNOWN")
        , (CUInt
CEnumZ SDL_AudioFormat
8, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_AUDIO_U8")
        , (CUInt
CEnumZ SDL_AudioFormat
32776, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_AUDIO_S8")
        , (CUInt
CEnumZ SDL_AudioFormat
32784, (String
"SDL_AUDIO_S16LE" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
BG.:| [String
"SDL_AUDIO_S16"]))
        , (CUInt
CEnumZ SDL_AudioFormat
32800, (String
"SDL_AUDIO_S32LE" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
BG.:| [String
"SDL_AUDIO_S32"]))
        , (CUInt
CEnumZ SDL_AudioFormat
33056, (String
"SDL_AUDIO_F32LE" String -> [String] -> NonEmpty String
forall a. a -> [a] -> NonEmpty a
BG.:| [String
"SDL_AUDIO_F32"]))
        , (CUInt
CEnumZ SDL_AudioFormat
36880, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_AUDIO_S16BE")
        , (CUInt
CEnumZ SDL_AudioFormat
36896, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_AUDIO_S32BE")
        , (CUInt
CEnumZ SDL_AudioFormat
37152, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_AUDIO_F32BE")
        ]

  showsUndeclared :: forall (proxy :: * -> *).
proxy SDL_AudioFormat -> Int -> CEnumZ SDL_AudioFormat -> ShowS
showsUndeclared =
    String
-> proxy SDL_AudioFormat -> Int -> CEnumZ SDL_AudioFormat -> ShowS
forall a (proxy :: * -> *).
Show (CEnumZ a) =>
String -> proxy a -> Int -> CEnumZ a -> ShowS
CEnum.showsWrappedUndeclared String
"SDL_AudioFormat"

  readPrecUndeclared :: ReadPrec SDL_AudioFormat
readPrecUndeclared =
    String -> ReadPrec SDL_AudioFormat
forall a. (CEnum a, Read (CEnumZ a)) => String -> ReadPrec a
CEnum.readPrecWrappedUndeclared String
"SDL_AudioFormat"

instance Show SDL_AudioFormat where
  showsPrec :: Int -> SDL_AudioFormat -> ShowS
showsPrec = Int -> SDL_AudioFormat -> ShowS
forall a. CEnum a => Int -> a -> ShowS
CEnum.shows

instance Read SDL_AudioFormat where
  readPrec :: ReadPrec SDL_AudioFormat
readPrec = ReadPrec SDL_AudioFormat
forall a. CEnum a => ReadPrec a
CEnum.readPrec

  readList :: ReadS [SDL_AudioFormat]
readList = ReadS [SDL_AudioFormat]
forall a. Read a => ReadS [a]
BG.readListDefault

  readListPrec :: ReadPrec [SDL_AudioFormat]
readListPrec = ReadPrec [SDL_AudioFormat]
forall a. Read a => ReadPrec [a]
BG.readListPrecDefault

instance
  (ty ~ BG.CUInt)
  => BG.CompatHasField.HasField "unwrap" SDL_AudioFormat ty
  where
  hasField :: SDL_AudioFormat -> (ty -> SDL_AudioFormat, ty)
hasField =
    \SDL_AudioFormat
x0 ->
      ( \ty
y1 ->
          SDL_AudioFormat{unwrap :: CUInt
unwrap = ty
CUInt
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_AudioFormat
x0
      )

instance
  (ty ~ BG.CUInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_AudioFormat) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioFormat -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_AudioFormat -> Ptr (CFieldType SDL_AudioFormat "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_AudioFormat "unwrap" where
  type CFieldType SDL_AudioFormat "unwrap" = BG.CUInt

  offset# :: Proxy# SDL_AudioFormat -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_AudioFormat
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | Unspecified audio format
--
--     [C declaration]: @SDL_AUDIO_UNKNOWN@, defined at @SDL3\/SDL_audio.h 223:5@
pattern SDL_AUDIO_UNKNOWN :: SDL_AudioFormat
pattern $mSDL_AUDIO_UNKNOWN :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_UNKNOWN :: SDL_AudioFormat
SDL_AUDIO_UNKNOWN = SDL_AudioFormat 0

-- | Unsigned 8-bit samples
--
--     [C declaration]: @SDL_AUDIO_U8@, defined at @SDL3\/SDL_audio.h 224:5@
pattern SDL_AUDIO_U8 :: SDL_AudioFormat
pattern $mSDL_AUDIO_U8 :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_U8 :: SDL_AudioFormat
SDL_AUDIO_U8 = SDL_AudioFormat 8

-- | Signed 8-bit samples
--
--     [C declaration]: @SDL_AUDIO_S8@, defined at @SDL3\/SDL_audio.h 226:5@
pattern SDL_AUDIO_S8 :: SDL_AudioFormat
pattern $mSDL_AUDIO_S8 :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_S8 :: SDL_AudioFormat
SDL_AUDIO_S8 = SDL_AudioFormat 32776

-- | Signed 16-bit samples
--
--     [C declaration]: @SDL_AUDIO_S16LE@, defined at @SDL3\/SDL_audio.h 228:5@
pattern SDL_AUDIO_S16LE :: SDL_AudioFormat
pattern $mSDL_AUDIO_S16LE :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_S16LE :: SDL_AudioFormat
SDL_AUDIO_S16LE = SDL_AudioFormat 32784

-- | As above, but big-endian byte order
--
--     [C declaration]: @SDL_AUDIO_S16BE@, defined at @SDL3\/SDL_audio.h 230:5@
pattern SDL_AUDIO_S16BE :: SDL_AudioFormat
pattern $mSDL_AUDIO_S16BE :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_S16BE :: SDL_AudioFormat
SDL_AUDIO_S16BE = SDL_AudioFormat 36880

-- | 32-bit integer samples
--
--     [C declaration]: @SDL_AUDIO_S32LE@, defined at @SDL3\/SDL_audio.h 232:5@
pattern SDL_AUDIO_S32LE :: SDL_AudioFormat
pattern $mSDL_AUDIO_S32LE :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_S32LE :: SDL_AudioFormat
SDL_AUDIO_S32LE = SDL_AudioFormat 32800

-- | As above, but big-endian byte order
--
--     [C declaration]: @SDL_AUDIO_S32BE@, defined at @SDL3\/SDL_audio.h 234:5@
pattern SDL_AUDIO_S32BE :: SDL_AudioFormat
pattern $mSDL_AUDIO_S32BE :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_S32BE :: SDL_AudioFormat
SDL_AUDIO_S32BE = SDL_AudioFormat 36896

-- | 32-bit floating point samples
--
--     [C declaration]: @SDL_AUDIO_F32LE@, defined at @SDL3\/SDL_audio.h 236:5@
pattern SDL_AUDIO_F32LE :: SDL_AudioFormat
pattern $mSDL_AUDIO_F32LE :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_F32LE :: SDL_AudioFormat
SDL_AUDIO_F32LE = SDL_AudioFormat 33056

-- | As above, but big-endian byte order
--
--     [C declaration]: @SDL_AUDIO_F32BE@, defined at @SDL3\/SDL_audio.h 238:5@
pattern SDL_AUDIO_F32BE :: SDL_AudioFormat
pattern $mSDL_AUDIO_F32BE :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_F32BE :: SDL_AudioFormat
SDL_AUDIO_F32BE = SDL_AudioFormat 37152

-- | [C declaration]: @SDL_AUDIO_S16@, defined at @SDL3\/SDL_audio.h 243:5@
pattern SDL_AUDIO_S16 :: SDL_AudioFormat
pattern $mSDL_AUDIO_S16 :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_S16 :: SDL_AudioFormat
SDL_AUDIO_S16 = SDL_AudioFormat 32784

-- | [C declaration]: @SDL_AUDIO_S32@, defined at @SDL3\/SDL_audio.h 244:5@
pattern SDL_AUDIO_S32 :: SDL_AudioFormat
pattern $mSDL_AUDIO_S32 :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_S32 :: SDL_AudioFormat
SDL_AUDIO_S32 = SDL_AudioFormat 32800

-- | [C declaration]: @SDL_AUDIO_F32@, defined at @SDL3\/SDL_audio.h 245:5@
pattern SDL_AUDIO_F32 :: SDL_AudioFormat
pattern $mSDL_AUDIO_F32 :: forall {r}. SDL_AudioFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_AUDIO_F32 :: SDL_AudioFormat
SDL_AUDIO_F32 = SDL_AudioFormat 33056

-- | Retrieve the size, in bits, from an 'SDL_AudioFormat'.
--
--     For example, @SDL_AUDIO_BITSIZE(SDL_AUDIO_S16)@ returns 16.
--
--     [@x@]: an 'SDL_AudioFormat' value.
--
--     [Returns]: data size in bits.
--
--     [Thread safety]: It is safe to call this macro from any thread.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_BITSIZE@, defined at @SDL3\/SDL_audio.h 266:9@
sDL_AUDIO_BITSIZE
  :: forall a0. (C.Expr.HostPlatform.Bitwise a0 BG.CUInt) => a0 -> C.Expr.HostPlatform.BitsRes a0 BG.CUInt
sDL_AUDIO_BITSIZE :: forall a0. Bitwise a0 CUInt => a0 -> BitsRes a0 CUInt
sDL_AUDIO_BITSIZE =
  \a0
x0 ->
    a0 -> CUInt -> BitsRes a0 CUInt
forall a b. Bitwise a b => a -> b -> BitsRes a b
(C.Expr.HostPlatform..&.) a0
x0 CUInt
sDL_AUDIO_MASK_BITSIZE

-- | Retrieve the size, in bytes, from an 'SDL_AudioFormat'.
--
--     For example, @SDL_AUDIO_BYTESIZE(SDL_AUDIO_S16)@ returns 2.
--
--     [@x@]: an 'SDL_AudioFormat' value.
--
--     [Returns]: data size in bytes.
--
--     [Thread safety]: It is safe to call this macro from any thread.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_BYTESIZE@, defined at @SDL3\/SDL_audio.h 280:9@
sDL_AUDIO_BYTESIZE
  :: forall a0
   . (C.Expr.HostPlatform.Div (C.Expr.HostPlatform.BitsRes a0 BG.CUInt) BG.CInt)
  => (C.Expr.HostPlatform.Bitwise a0 BG.CUInt)
  => a0 -> C.Expr.HostPlatform.DivRes (C.Expr.HostPlatform.BitsRes a0 BG.CUInt) BG.CInt
sDL_AUDIO_BYTESIZE :: forall a0.
(Div (BitsRes a0 CUInt) CInt, Bitwise a0 CUInt) =>
a0 -> DivRes (BitsRes a0 CUInt) CInt
sDL_AUDIO_BYTESIZE =
  \a0
x0 ->
    BitsRes a0 CUInt -> CInt -> DivRes (BitsRes a0 CUInt) CInt
forall a b. Div a b => a -> b -> DivRes a b
(C.Expr.HostPlatform./) (a0 -> BitsRes a0 CUInt
forall a0. Bitwise a0 CUInt => a0 -> BitsRes a0 CUInt
sDL_AUDIO_BITSIZE a0
x0) (CInt
8 :: BG.CInt)

-- | Determine if an 'SDL_AudioFormat' represents floating point data.
--
--     For example, @SDL_AUDIO_ISFLOAT(SDL_AUDIO_S16)@ returns 0.
--
--     [@x@]: an 'SDL_AudioFormat' value.
--
--     [Returns]: non-zero if format is floating point, zero otherwise.
--
--     [Thread safety]: It is safe to call this macro from any thread.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_ISFLOAT@, defined at @SDL3\/SDL_audio.h 294:9@
sDL_AUDIO_ISFLOAT
  :: forall a0. (C.Expr.HostPlatform.Bitwise a0 BG.CUInt) => a0 -> C.Expr.HostPlatform.BitsRes a0 BG.CUInt
sDL_AUDIO_ISFLOAT :: forall a0. Bitwise a0 CUInt => a0 -> BitsRes a0 CUInt
sDL_AUDIO_ISFLOAT =
  \a0
x0 ->
    a0 -> CUInt -> BitsRes a0 CUInt
forall a b. Bitwise a b => a -> b -> BitsRes a b
(C.Expr.HostPlatform..&.) a0
x0 CUInt
sDL_AUDIO_MASK_FLOAT

-- | Determine if an 'SDL_AudioFormat' represents bigendian data.
--
--     For example, @SDL_AUDIO_ISBIGENDIAN(SDL_AUDIO_S16LE)@ returns 0.
--
--     [@x@]: an 'SDL_AudioFormat' value.
--
--     [Returns]: non-zero if format is bigendian, zero otherwise.
--
--     [Thread safety]: It is safe to call this macro from any thread.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_ISBIGENDIAN@, defined at @SDL3\/SDL_audio.h 308:9@
sDL_AUDIO_ISBIGENDIAN
  :: forall a0. (C.Expr.HostPlatform.Bitwise a0 BG.CUInt) => a0 -> C.Expr.HostPlatform.BitsRes a0 BG.CUInt
sDL_AUDIO_ISBIGENDIAN :: forall a0. Bitwise a0 CUInt => a0 -> BitsRes a0 CUInt
sDL_AUDIO_ISBIGENDIAN =
  \a0
x0 ->
    a0 -> CUInt -> BitsRes a0 CUInt
forall a b. Bitwise a b => a -> b -> BitsRes a b
(C.Expr.HostPlatform..&.) a0
x0 CUInt
sDL_AUDIO_MASK_BIG_ENDIAN

-- | Determine if an 'SDL_AudioFormat' represents littleendian data.
--
--     For example, @SDL_AUDIO_ISLITTLEENDIAN(SDL_AUDIO_S16BE)@ returns 0.
--
--     [@x@]: an 'SDL_AudioFormat' value.
--
--     [Returns]: non-zero if format is littleendian, zero otherwise.
--
--     [Thread safety]: It is safe to call this macro from any thread.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_ISLITTLEENDIAN@, defined at @SDL3\/SDL_audio.h 322:9@
sDL_AUDIO_ISLITTLEENDIAN
  :: forall a0
   . (C.Expr.HostPlatform.Not (C.Expr.HostPlatform.BitsRes a0 BG.CUInt))
  => (C.Expr.HostPlatform.Bitwise a0 BG.CUInt)
  => a0 -> BG.CInt
sDL_AUDIO_ISLITTLEENDIAN :: forall a0. (Not (BitsRes a0 CUInt), Bitwise a0 CUInt) => a0 -> CInt
sDL_AUDIO_ISLITTLEENDIAN =
  \a0
x0 ->
    BitsRes a0 CUInt -> CInt
forall a. Not a => a -> CInt
C.Expr.HostPlatform.not (a0 -> BitsRes a0 CUInt
forall a0. Bitwise a0 CUInt => a0 -> BitsRes a0 CUInt
sDL_AUDIO_ISBIGENDIAN a0
x0)

-- | Determine if an 'SDL_AudioFormat' represents signed data.
--
--     For example, @SDL_AUDIO_ISSIGNED(SDL_AUDIO_U8)@ returns 0.
--
--     [@x@]: an 'SDL_AudioFormat' value.
--
--     [Returns]: non-zero if format is signed, zero otherwise.
--
--     [Thread safety]: It is safe to call this macro from any thread.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_ISSIGNED@, defined at @SDL3\/SDL_audio.h 336:9@
sDL_AUDIO_ISSIGNED
  :: forall a0. (C.Expr.HostPlatform.Bitwise a0 BG.CUInt) => a0 -> C.Expr.HostPlatform.BitsRes a0 BG.CUInt
sDL_AUDIO_ISSIGNED :: forall a0. Bitwise a0 CUInt => a0 -> BitsRes a0 CUInt
sDL_AUDIO_ISSIGNED =
  \a0
x0 ->
    a0 -> CUInt -> BitsRes a0 CUInt
forall a b. Bitwise a b => a -> b -> BitsRes a b
(C.Expr.HostPlatform..&.) a0
x0 CUInt
sDL_AUDIO_MASK_SIGNED

-- | Determine if an 'SDL_AudioFormat' represents integer data.
--
--     For example, @SDL_AUDIO_ISINT(SDL_AUDIO_F32)@ returns 0.
--
--     [@x@]: an 'SDL_AudioFormat' value.
--
--     [Returns]: non-zero if format is integer, zero otherwise.
--
--     [Thread safety]: It is safe to call this macro from any thread.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_ISINT@, defined at @SDL3\/SDL_audio.h 350:9@
sDL_AUDIO_ISINT
  :: forall a0
   . (C.Expr.HostPlatform.Not (C.Expr.HostPlatform.BitsRes a0 BG.CUInt))
  => (C.Expr.HostPlatform.Bitwise a0 BG.CUInt)
  => a0 -> BG.CInt
sDL_AUDIO_ISINT :: forall a0. (Not (BitsRes a0 CUInt), Bitwise a0 CUInt) => a0 -> CInt
sDL_AUDIO_ISINT =
  \a0
x0 -> BitsRes a0 CUInt -> CInt
forall a. Not a => a -> CInt
C.Expr.HostPlatform.not (a0 -> BitsRes a0 CUInt
forall a0. Bitwise a0 CUInt => a0 -> BitsRes a0 CUInt
sDL_AUDIO_ISFLOAT a0
x0)

-- | Determine if an 'SDL_AudioFormat' represents unsigned data.
--
--     For example, @SDL_AUDIO_ISUNSIGNED(SDL_AUDIO_S16)@ returns 0.
--
--     [@x@]: an 'SDL_AudioFormat' value.
--
--     [Returns]: non-zero if format is unsigned, zero otherwise.
--
--     [Thread safety]: It is safe to call this macro from any thread.
--
--     @since 3.2.0
--
--     [C declaration]: @macro SDL_AUDIO_ISUNSIGNED@, defined at @SDL3\/SDL_audio.h 364:9@
sDL_AUDIO_ISUNSIGNED
  :: forall a0
   . (C.Expr.HostPlatform.Not (C.Expr.HostPlatform.BitsRes a0 BG.CUInt))
  => (C.Expr.HostPlatform.Bitwise a0 BG.CUInt)
  => a0 -> BG.CInt
sDL_AUDIO_ISUNSIGNED :: forall a0. (Not (BitsRes a0 CUInt), Bitwise a0 CUInt) => a0 -> CInt
sDL_AUDIO_ISUNSIGNED =
  \a0
x0 ->
    BitsRes a0 CUInt -> CInt
forall a. Not a => a -> CInt
C.Expr.HostPlatform.not (a0 -> BitsRes a0 CUInt
forall a0. Bitwise a0 CUInt => a0 -> BitsRes a0 CUInt
sDL_AUDIO_ISSIGNED a0
x0)

-- | SDL Audio Device instance IDs.
--
--     Zero is used to signify an invalid\/null device.
--
--     @since 3.2.0
--
--     [C declaration]: @SDL_AudioDeviceID@, defined at @SDL3\/SDL_audio.h 374:16@
newtype SDL_AudioDeviceID = SDL_AudioDeviceID
  { SDL_AudioDeviceID -> Uint32
unwrap :: SDL3.Sys.Bindgen.Stdinc.Uint32
  }
  deriving stock ((forall x. SDL_AudioDeviceID -> Rep SDL_AudioDeviceID x)
-> (forall x. Rep SDL_AudioDeviceID x -> SDL_AudioDeviceID)
-> Generic SDL_AudioDeviceID
forall x. Rep SDL_AudioDeviceID x -> SDL_AudioDeviceID
forall x. SDL_AudioDeviceID -> Rep SDL_AudioDeviceID x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_AudioDeviceID -> Rep SDL_AudioDeviceID x
from :: forall x. SDL_AudioDeviceID -> Rep SDL_AudioDeviceID x
$cto :: forall x. Rep SDL_AudioDeviceID x -> SDL_AudioDeviceID
to :: forall x. Rep SDL_AudioDeviceID x -> SDL_AudioDeviceID
BG.Generic, SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
(SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool)
-> Eq SDL_AudioDeviceID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
== :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
$c/= :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
/= :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
Eq, Eq SDL_AudioDeviceID
Eq SDL_AudioDeviceID =>
(SDL_AudioDeviceID -> SDL_AudioDeviceID -> Ordering)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> Ord SDL_AudioDeviceID
SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
SDL_AudioDeviceID -> SDL_AudioDeviceID -> Ordering
SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Ordering
compare :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Ordering
$c< :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
< :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
$c<= :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
<= :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
$c> :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
> :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
$c>= :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
>= :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bool
$cmax :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
max :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$cmin :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
min :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
Ord, ReadPrec [SDL_AudioDeviceID]
ReadPrec SDL_AudioDeviceID
Int -> ReadS SDL_AudioDeviceID
ReadS [SDL_AudioDeviceID]
(Int -> ReadS SDL_AudioDeviceID)
-> ReadS [SDL_AudioDeviceID]
-> ReadPrec SDL_AudioDeviceID
-> ReadPrec [SDL_AudioDeviceID]
-> Read SDL_AudioDeviceID
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS SDL_AudioDeviceID
readsPrec :: Int -> ReadS SDL_AudioDeviceID
$creadList :: ReadS [SDL_AudioDeviceID]
readList :: ReadS [SDL_AudioDeviceID]
$creadPrec :: ReadPrec SDL_AudioDeviceID
readPrec :: ReadPrec SDL_AudioDeviceID
$creadListPrec :: ReadPrec [SDL_AudioDeviceID]
readListPrec :: ReadPrec [SDL_AudioDeviceID]
Read, Int -> SDL_AudioDeviceID -> ShowS
[SDL_AudioDeviceID] -> ShowS
SDL_AudioDeviceID -> String
(Int -> SDL_AudioDeviceID -> ShowS)
-> (SDL_AudioDeviceID -> String)
-> ([SDL_AudioDeviceID] -> ShowS)
-> Show SDL_AudioDeviceID
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_AudioDeviceID -> ShowS
showsPrec :: Int -> SDL_AudioDeviceID -> ShowS
$cshow :: SDL_AudioDeviceID -> String
show :: SDL_AudioDeviceID -> String
$cshowList :: [SDL_AudioDeviceID] -> ShowS
showList :: [SDL_AudioDeviceID] -> ShowS
Show)
  deriving newtype
    ( Word64 -> Int -> SDL_AudioDeviceID
SDL_AudioDeviceID -> Int -> Word64
(SDL_AudioDeviceID -> Int -> Word64)
-> (Word64 -> Int -> SDL_AudioDeviceID)
-> Bitfield SDL_AudioDeviceID
forall a.
(a -> Int -> Word64) -> (Word64 -> Int -> a) -> Bitfield a
$cnarrow :: SDL_AudioDeviceID -> Int -> Word64
narrow :: SDL_AudioDeviceID -> Int -> Word64
$cextend :: Word64 -> Int -> SDL_AudioDeviceID
extend :: Word64 -> Int -> SDL_AudioDeviceID
BG.Bitfield
    , Eq SDL_AudioDeviceID
SDL_AudioDeviceID
Eq SDL_AudioDeviceID =>
(SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> SDL_AudioDeviceID
-> (Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> Bool)
-> (SDL_AudioDeviceID -> Maybe Int)
-> (SDL_AudioDeviceID -> Int)
-> (SDL_AudioDeviceID -> Bool)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int)
-> Bits SDL_AudioDeviceID
Int -> SDL_AudioDeviceID
SDL_AudioDeviceID -> Bool
SDL_AudioDeviceID -> Int
SDL_AudioDeviceID -> Maybe Int
SDL_AudioDeviceID -> SDL_AudioDeviceID
SDL_AudioDeviceID -> Int -> Bool
SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
$c.&. :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
.&. :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$c.|. :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
.|. :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$cxor :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
xor :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$ccomplement :: SDL_AudioDeviceID -> SDL_AudioDeviceID
complement :: SDL_AudioDeviceID -> SDL_AudioDeviceID
$cshift :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
shift :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$crotate :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
rotate :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$czeroBits :: SDL_AudioDeviceID
zeroBits :: SDL_AudioDeviceID
$cbit :: Int -> SDL_AudioDeviceID
bit :: Int -> SDL_AudioDeviceID
$csetBit :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
setBit :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$cclearBit :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
clearBit :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$ccomplementBit :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
complementBit :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$ctestBit :: SDL_AudioDeviceID -> Int -> Bool
testBit :: SDL_AudioDeviceID -> Int -> Bool
$cbitSizeMaybe :: SDL_AudioDeviceID -> Maybe Int
bitSizeMaybe :: SDL_AudioDeviceID -> Maybe Int
$cbitSize :: SDL_AudioDeviceID -> Int
bitSize :: SDL_AudioDeviceID -> Int
$cisSigned :: SDL_AudioDeviceID -> Bool
isSigned :: SDL_AudioDeviceID -> Bool
$cshiftL :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
shiftL :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$cunsafeShiftL :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
unsafeShiftL :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$cshiftR :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
shiftR :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$cunsafeShiftR :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
unsafeShiftR :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$crotateL :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
rotateL :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$crotateR :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
rotateR :: SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID
$cpopCount :: SDL_AudioDeviceID -> Int
popCount :: SDL_AudioDeviceID -> Int
BG.Bits
    , Bits SDL_AudioDeviceID
Bits SDL_AudioDeviceID =>
(SDL_AudioDeviceID -> Int)
-> (SDL_AudioDeviceID -> Int)
-> (SDL_AudioDeviceID -> Int)
-> FiniteBits SDL_AudioDeviceID
SDL_AudioDeviceID -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: SDL_AudioDeviceID -> Int
finiteBitSize :: SDL_AudioDeviceID -> Int
$ccountLeadingZeros :: SDL_AudioDeviceID -> Int
countLeadingZeros :: SDL_AudioDeviceID -> Int
$ccountTrailingZeros :: SDL_AudioDeviceID -> Int
countTrailingZeros :: SDL_AudioDeviceID -> Int
BG.FiniteBits
    , FFIType SDL_AudioDeviceID -> SDL_AudioDeviceID
SDL_AudioDeviceID -> FFIType SDL_AudioDeviceID
(SDL_AudioDeviceID -> FFIType SDL_AudioDeviceID)
-> (FFIType SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> HasFFIType SDL_AudioDeviceID
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_AudioDeviceID -> FFIType SDL_AudioDeviceID
toFFIType :: SDL_AudioDeviceID -> FFIType SDL_AudioDeviceID
$cfromFFIType :: FFIType SDL_AudioDeviceID -> SDL_AudioDeviceID
fromFFIType :: FFIType SDL_AudioDeviceID -> SDL_AudioDeviceID
BG.HasFFIType
    , Ord SDL_AudioDeviceID
Ord SDL_AudioDeviceID =>
((SDL_AudioDeviceID, SDL_AudioDeviceID) -> [SDL_AudioDeviceID])
-> ((SDL_AudioDeviceID, SDL_AudioDeviceID)
    -> SDL_AudioDeviceID -> Int)
-> ((SDL_AudioDeviceID, SDL_AudioDeviceID)
    -> SDL_AudioDeviceID -> Int)
-> ((SDL_AudioDeviceID, SDL_AudioDeviceID)
    -> SDL_AudioDeviceID -> Bool)
-> ((SDL_AudioDeviceID, SDL_AudioDeviceID) -> Int)
-> ((SDL_AudioDeviceID, SDL_AudioDeviceID) -> Int)
-> Ix SDL_AudioDeviceID
(SDL_AudioDeviceID, SDL_AudioDeviceID) -> Int
(SDL_AudioDeviceID, SDL_AudioDeviceID) -> [SDL_AudioDeviceID]
(SDL_AudioDeviceID, SDL_AudioDeviceID) -> SDL_AudioDeviceID -> Bool
(SDL_AudioDeviceID, SDL_AudioDeviceID) -> SDL_AudioDeviceID -> Int
forall a.
Ord a =>
((a, a) -> [a])
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Bool)
-> ((a, a) -> Int)
-> ((a, a) -> Int)
-> Ix a
$crange :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> [SDL_AudioDeviceID]
range :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> [SDL_AudioDeviceID]
$cindex :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> SDL_AudioDeviceID -> Int
index :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> SDL_AudioDeviceID -> Int
$cunsafeIndex :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> SDL_AudioDeviceID -> Int
unsafeIndex :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> SDL_AudioDeviceID -> Int
$cinRange :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> SDL_AudioDeviceID -> Bool
inRange :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> SDL_AudioDeviceID -> Bool
$crangeSize :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> Int
rangeSize :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> Int
$cunsafeRangeSize :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> Int
unsafeRangeSize :: (SDL_AudioDeviceID, SDL_AudioDeviceID) -> Int
BG.Ix
    , Addr# -> Int# -> SDL_AudioDeviceID
ByteArray# -> Int# -> SDL_AudioDeviceID
Proxy SDL_AudioDeviceID -> Int#
SDL_AudioDeviceID -> Int#
(Proxy SDL_AudioDeviceID -> Int#)
-> (SDL_AudioDeviceID -> Int#)
-> (Proxy SDL_AudioDeviceID -> Int#)
-> (SDL_AudioDeviceID -> Int#)
-> (ByteArray# -> Int# -> SDL_AudioDeviceID)
-> (forall s.
    MutableByteArray# s
    -> Int# -> State# s -> (# State# s, SDL_AudioDeviceID #))
-> (forall s.
    MutableByteArray# s
    -> Int# -> SDL_AudioDeviceID -> State# s -> State# s)
-> (forall s.
    MutableByteArray# s
    -> Int# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s)
-> (Addr# -> Int# -> SDL_AudioDeviceID)
-> (forall s.
    Addr# -> Int# -> State# s -> (# State# s, SDL_AudioDeviceID #))
-> (forall s.
    Addr# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s)
-> (forall s.
    Addr# -> Int# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s)
-> Prim SDL_AudioDeviceID
forall s.
Addr# -> Int# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s
forall s.
Addr# -> Int# -> State# s -> (# State# s, SDL_AudioDeviceID #)
forall s.
Addr# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s
forall s.
MutableByteArray# s
-> Int# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s
forall s.
MutableByteArray# s
-> Int# -> State# s -> (# State# s, SDL_AudioDeviceID #)
forall s.
MutableByteArray# s
-> Int# -> SDL_AudioDeviceID -> State# s -> State# s
forall a.
(Proxy a -> Int#)
-> (a -> Int#)
-> (Proxy a -> Int#)
-> (a -> Int#)
-> (ByteArray# -> Int# -> a)
-> (forall s.
    MutableByteArray# s -> Int# -> State# s -> (# State# s, a #))
-> (forall s.
    MutableByteArray# s -> Int# -> a -> State# s -> State# s)
-> (forall s.
    MutableByteArray# s -> Int# -> Int# -> a -> State# s -> State# s)
-> (Addr# -> Int# -> a)
-> (forall s. Addr# -> Int# -> State# s -> (# State# s, a #))
-> (forall s. Addr# -> Int# -> a -> State# s -> State# s)
-> (forall s. Addr# -> Int# -> Int# -> a -> State# s -> State# s)
-> Prim a
$csizeOfType# :: Proxy SDL_AudioDeviceID -> Int#
sizeOfType# :: Proxy SDL_AudioDeviceID -> Int#
$csizeOf# :: SDL_AudioDeviceID -> Int#
sizeOf# :: SDL_AudioDeviceID -> Int#
$calignmentOfType# :: Proxy SDL_AudioDeviceID -> Int#
alignmentOfType# :: Proxy SDL_AudioDeviceID -> Int#
$calignment# :: SDL_AudioDeviceID -> Int#
alignment# :: SDL_AudioDeviceID -> Int#
$cindexByteArray# :: ByteArray# -> Int# -> SDL_AudioDeviceID
indexByteArray# :: ByteArray# -> Int# -> SDL_AudioDeviceID
$creadByteArray# :: forall s.
MutableByteArray# s
-> Int# -> State# s -> (# State# s, SDL_AudioDeviceID #)
readByteArray# :: forall s.
MutableByteArray# s
-> Int# -> State# s -> (# State# s, SDL_AudioDeviceID #)
$cwriteByteArray# :: forall s.
MutableByteArray# s
-> Int# -> SDL_AudioDeviceID -> State# s -> State# s
writeByteArray# :: forall s.
MutableByteArray# s
-> Int# -> SDL_AudioDeviceID -> State# s -> State# s
$csetByteArray# :: forall s.
MutableByteArray# s
-> Int# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s
setByteArray# :: forall s.
MutableByteArray# s
-> Int# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s
$cindexOffAddr# :: Addr# -> Int# -> SDL_AudioDeviceID
indexOffAddr# :: Addr# -> Int# -> SDL_AudioDeviceID
$creadOffAddr# :: forall s.
Addr# -> Int# -> State# s -> (# State# s, SDL_AudioDeviceID #)
readOffAddr# :: forall s.
Addr# -> Int# -> State# s -> (# State# s, SDL_AudioDeviceID #)
$cwriteOffAddr# :: forall s.
Addr# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s
writeOffAddr# :: forall s.
Addr# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s
$csetOffAddr# :: forall s.
Addr# -> Int# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s
setOffAddr# :: forall s.
Addr# -> Int# -> Int# -> SDL_AudioDeviceID -> State# s -> State# s
BG.Prim
    , Ptr SDL_AudioDeviceID -> IO SDL_AudioDeviceID
Ptr SDL_AudioDeviceID -> Int -> IO SDL_AudioDeviceID
Ptr SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID -> IO ()
Ptr SDL_AudioDeviceID -> SDL_AudioDeviceID -> IO ()
SDL_AudioDeviceID -> Int
(SDL_AudioDeviceID -> Int)
-> (SDL_AudioDeviceID -> Int)
-> (Ptr SDL_AudioDeviceID -> Int -> IO SDL_AudioDeviceID)
-> (Ptr SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID -> IO ())
-> (forall b. Ptr b -> Int -> IO SDL_AudioDeviceID)
-> (forall b. Ptr b -> Int -> SDL_AudioDeviceID -> IO ())
-> (Ptr SDL_AudioDeviceID -> IO SDL_AudioDeviceID)
-> (Ptr SDL_AudioDeviceID -> SDL_AudioDeviceID -> IO ())
-> Storable SDL_AudioDeviceID
forall b. Ptr b -> Int -> IO SDL_AudioDeviceID
forall b. Ptr b -> Int -> SDL_AudioDeviceID -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: SDL_AudioDeviceID -> Int
sizeOf :: SDL_AudioDeviceID -> Int
$calignment :: SDL_AudioDeviceID -> Int
alignment :: SDL_AudioDeviceID -> Int
$cpeekElemOff :: Ptr SDL_AudioDeviceID -> Int -> IO SDL_AudioDeviceID
peekElemOff :: Ptr SDL_AudioDeviceID -> Int -> IO SDL_AudioDeviceID
$cpokeElemOff :: Ptr SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID -> IO ()
pokeElemOff :: Ptr SDL_AudioDeviceID -> Int -> SDL_AudioDeviceID -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SDL_AudioDeviceID
peekByteOff :: forall b. Ptr b -> Int -> IO SDL_AudioDeviceID
$cpokeByteOff :: forall b. Ptr b -> Int -> SDL_AudioDeviceID -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> SDL_AudioDeviceID -> IO ()
$cpeek :: Ptr SDL_AudioDeviceID -> IO SDL_AudioDeviceID
peek :: Ptr SDL_AudioDeviceID -> IO SDL_AudioDeviceID
$cpoke :: Ptr SDL_AudioDeviceID -> SDL_AudioDeviceID -> IO ()
poke :: Ptr SDL_AudioDeviceID -> SDL_AudioDeviceID -> IO ()
BG.Storable
    , SDL_AudioDeviceID
SDL_AudioDeviceID -> SDL_AudioDeviceID -> Bounded SDL_AudioDeviceID
forall a. a -> a -> Bounded a
$cminBound :: SDL_AudioDeviceID
minBound :: SDL_AudioDeviceID
$cmaxBound :: SDL_AudioDeviceID
maxBound :: SDL_AudioDeviceID
Bounded
    , Int -> SDL_AudioDeviceID
SDL_AudioDeviceID -> Int
SDL_AudioDeviceID -> [SDL_AudioDeviceID]
SDL_AudioDeviceID -> SDL_AudioDeviceID
SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID]
SDL_AudioDeviceID
-> SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID]
(SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (Int -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> Int)
-> (SDL_AudioDeviceID -> [SDL_AudioDeviceID])
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID])
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID])
-> (SDL_AudioDeviceID
    -> SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID])
-> Enum SDL_AudioDeviceID
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: SDL_AudioDeviceID -> SDL_AudioDeviceID
succ :: SDL_AudioDeviceID -> SDL_AudioDeviceID
$cpred :: SDL_AudioDeviceID -> SDL_AudioDeviceID
pred :: SDL_AudioDeviceID -> SDL_AudioDeviceID
$ctoEnum :: Int -> SDL_AudioDeviceID
toEnum :: Int -> SDL_AudioDeviceID
$cfromEnum :: SDL_AudioDeviceID -> Int
fromEnum :: SDL_AudioDeviceID -> Int
$cenumFrom :: SDL_AudioDeviceID -> [SDL_AudioDeviceID]
enumFrom :: SDL_AudioDeviceID -> [SDL_AudioDeviceID]
$cenumFromThen :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID]
enumFromThen :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID]
$cenumFromTo :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID]
enumFromTo :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID]
$cenumFromThenTo :: SDL_AudioDeviceID
-> SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID]
enumFromThenTo :: SDL_AudioDeviceID
-> SDL_AudioDeviceID -> SDL_AudioDeviceID -> [SDL_AudioDeviceID]
Enum
    , Enum SDL_AudioDeviceID
Real SDL_AudioDeviceID
(Real SDL_AudioDeviceID, Enum SDL_AudioDeviceID) =>
(SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID
    -> SDL_AudioDeviceID -> (SDL_AudioDeviceID, SDL_AudioDeviceID))
-> (SDL_AudioDeviceID
    -> SDL_AudioDeviceID -> (SDL_AudioDeviceID, SDL_AudioDeviceID))
-> (SDL_AudioDeviceID -> Integer)
-> Integral SDL_AudioDeviceID
SDL_AudioDeviceID -> Integer
SDL_AudioDeviceID
-> SDL_AudioDeviceID -> (SDL_AudioDeviceID, SDL_AudioDeviceID)
SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
forall a.
(Real a, Enum a) =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
$cquot :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
quot :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$crem :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
rem :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$cdiv :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
div :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$cmod :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
mod :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$cquotRem :: SDL_AudioDeviceID
-> SDL_AudioDeviceID -> (SDL_AudioDeviceID, SDL_AudioDeviceID)
quotRem :: SDL_AudioDeviceID
-> SDL_AudioDeviceID -> (SDL_AudioDeviceID, SDL_AudioDeviceID)
$cdivMod :: SDL_AudioDeviceID
-> SDL_AudioDeviceID -> (SDL_AudioDeviceID, SDL_AudioDeviceID)
divMod :: SDL_AudioDeviceID
-> SDL_AudioDeviceID -> (SDL_AudioDeviceID, SDL_AudioDeviceID)
$ctoInteger :: SDL_AudioDeviceID -> Integer
toInteger :: SDL_AudioDeviceID -> Integer
Integral
    , Ptr SDL_AudioDeviceID -> IO SDL_AudioDeviceID
(Ptr SDL_AudioDeviceID -> IO SDL_AudioDeviceID)
-> ReadRaw SDL_AudioDeviceID
forall a. (Ptr a -> IO a) -> ReadRaw a
$creadRaw :: Ptr SDL_AudioDeviceID -> IO SDL_AudioDeviceID
readRaw :: Ptr SDL_AudioDeviceID -> IO SDL_AudioDeviceID
Marshal.ReadRaw
    , Proxy SDL_AudioDeviceID -> Int
(Proxy SDL_AudioDeviceID -> Int)
-> (Proxy SDL_AudioDeviceID -> Int) -> StaticSize SDL_AudioDeviceID
forall a. (Proxy a -> Int) -> (Proxy a -> Int) -> StaticSize a
$cstaticSizeOf :: Proxy SDL_AudioDeviceID -> Int
staticSizeOf :: Proxy SDL_AudioDeviceID -> Int
$cstaticAlignment :: Proxy SDL_AudioDeviceID -> Int
staticAlignment :: Proxy SDL_AudioDeviceID -> Int
Marshal.StaticSize
    , Ptr SDL_AudioDeviceID -> SDL_AudioDeviceID -> IO ()
(Ptr SDL_AudioDeviceID -> SDL_AudioDeviceID -> IO ())
-> WriteRaw SDL_AudioDeviceID
forall a. (Ptr a -> a -> IO ()) -> WriteRaw a
$cwriteRaw :: Ptr SDL_AudioDeviceID -> SDL_AudioDeviceID -> IO ()
writeRaw :: Ptr SDL_AudioDeviceID -> SDL_AudioDeviceID -> IO ()
Marshal.WriteRaw
    , Integer -> SDL_AudioDeviceID
SDL_AudioDeviceID -> SDL_AudioDeviceID
SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
(SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (SDL_AudioDeviceID -> SDL_AudioDeviceID)
-> (Integer -> SDL_AudioDeviceID)
-> Num SDL_AudioDeviceID
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
$c+ :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
+ :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$c- :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
- :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$c* :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
* :: SDL_AudioDeviceID -> SDL_AudioDeviceID -> SDL_AudioDeviceID
$cnegate :: SDL_AudioDeviceID -> SDL_AudioDeviceID
negate :: SDL_AudioDeviceID -> SDL_AudioDeviceID
$cabs :: SDL_AudioDeviceID -> SDL_AudioDeviceID
abs :: SDL_AudioDeviceID -> SDL_AudioDeviceID
$csignum :: SDL_AudioDeviceID -> SDL_AudioDeviceID
signum :: SDL_AudioDeviceID -> SDL_AudioDeviceID
$cfromInteger :: Integer -> SDL_AudioDeviceID
fromInteger :: Integer -> SDL_AudioDeviceID
Num
    , Num SDL_AudioDeviceID
Ord SDL_AudioDeviceID
(Num SDL_AudioDeviceID, Ord SDL_AudioDeviceID) =>
(SDL_AudioDeviceID -> Rational) -> Real SDL_AudioDeviceID
SDL_AudioDeviceID -> Rational
forall a. (Num a, Ord a) => (a -> Rational) -> Real a
$ctoRational :: SDL_AudioDeviceID -> Rational
toRational :: SDL_AudioDeviceID -> Rational
Real
    )

instance
  (ty ~ SDL3.Sys.Bindgen.Stdinc.Uint32)
  => BG.CompatHasField.HasField "unwrap" SDL_AudioDeviceID ty
  where
  hasField :: SDL_AudioDeviceID -> (ty -> SDL_AudioDeviceID, ty)
hasField =
    \SDL_AudioDeviceID
x0 ->
      ( \ty
y1 ->
          SDL_AudioDeviceID{unwrap :: Uint32
unwrap = ty
Uint32
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_AudioDeviceID
x0
      )

instance
  (ty ~ SDL3.Sys.Bindgen.Stdinc.Uint32)
  => BG.HasField "unwrap" (BG.Ptr SDL_AudioDeviceID) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioDeviceID -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_AudioDeviceID
-> Ptr (CFieldType SDL_AudioDeviceID "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_AudioDeviceID "unwrap" where
  type
    CFieldType SDL_AudioDeviceID "unwrap" =
      SDL3.Sys.Bindgen.Stdinc.Uint32

  offset# :: Proxy# SDL_AudioDeviceID -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_AudioDeviceID
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | Format specifier for audio data.
--
--     @since 3.2.0
--
--     [See also]: 'SDL_AudioFormat'
--
--     [C declaration]: @struct SDL_AudioSpec@, defined at @SDL3\/SDL_audio.h 405:16@
data SDL_AudioSpec = SDL_AudioSpec
  { SDL_AudioSpec -> SDL_AudioFormat
format :: SDL_AudioFormat
  -- ^ Audio data format
  --
  --          [C declaration]: @format@, defined at @SDL3\/SDL_audio.h 407:21@
  , SDL_AudioSpec -> CInt
channels :: BG.CInt
  -- ^ Number of channels: 1 mono, 2 stereo, etc
  --
  --          [C declaration]: @channels@, defined at @SDL3\/SDL_audio.h 408:9@
  , SDL_AudioSpec -> CInt
freq :: BG.CInt
  -- ^ sample rate: sample frames per second
  --
  --          [C declaration]: @freq@, defined at @SDL3\/SDL_audio.h 409:9@
  }
  deriving stock ((forall x. SDL_AudioSpec -> Rep SDL_AudioSpec x)
-> (forall x. Rep SDL_AudioSpec x -> SDL_AudioSpec)
-> Generic SDL_AudioSpec
forall x. Rep SDL_AudioSpec x -> SDL_AudioSpec
forall x. SDL_AudioSpec -> Rep SDL_AudioSpec x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_AudioSpec -> Rep SDL_AudioSpec x
from :: forall x. SDL_AudioSpec -> Rep SDL_AudioSpec x
$cto :: forall x. Rep SDL_AudioSpec x -> SDL_AudioSpec
to :: forall x. Rep SDL_AudioSpec x -> SDL_AudioSpec
BG.Generic, SDL_AudioSpec -> SDL_AudioSpec -> Bool
(SDL_AudioSpec -> SDL_AudioSpec -> Bool)
-> (SDL_AudioSpec -> SDL_AudioSpec -> Bool) -> Eq SDL_AudioSpec
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_AudioSpec -> SDL_AudioSpec -> Bool
== :: SDL_AudioSpec -> SDL_AudioSpec -> Bool
$c/= :: SDL_AudioSpec -> SDL_AudioSpec -> Bool
/= :: SDL_AudioSpec -> SDL_AudioSpec -> Bool
Eq, Int -> SDL_AudioSpec -> ShowS
[SDL_AudioSpec] -> ShowS
SDL_AudioSpec -> String
(Int -> SDL_AudioSpec -> ShowS)
-> (SDL_AudioSpec -> String)
-> ([SDL_AudioSpec] -> ShowS)
-> Show SDL_AudioSpec
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_AudioSpec -> ShowS
showsPrec :: Int -> SDL_AudioSpec -> ShowS
$cshow :: SDL_AudioSpec -> String
show :: SDL_AudioSpec -> String
$cshowList :: [SDL_AudioSpec] -> ShowS
showList :: [SDL_AudioSpec] -> ShowS
Show)

instance Marshal.StaticSize SDL_AudioSpec where
  staticSizeOf :: Proxy SDL_AudioSpec -> Int
staticSizeOf = \Proxy SDL_AudioSpec
_ -> (Int
12 :: Int)

  staticAlignment :: Proxy SDL_AudioSpec -> Int
staticAlignment = \Proxy SDL_AudioSpec
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_AudioSpec where
  readRaw :: Ptr SDL_AudioSpec -> IO SDL_AudioSpec
readRaw =
    \Ptr SDL_AudioSpec
ptr0 ->
      (SDL_AudioFormat -> CInt -> CInt -> SDL_AudioSpec)
-> IO (SDL_AudioFormat -> CInt -> CInt -> SDL_AudioSpec)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SDL_AudioFormat -> CInt -> CInt -> SDL_AudioSpec
SDL_AudioSpec
        IO (SDL_AudioFormat -> CInt -> CInt -> SDL_AudioSpec)
-> IO SDL_AudioFormat -> IO (CInt -> CInt -> SDL_AudioSpec)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "format"
-> Ptr SDL_AudioSpec -> IO (CFieldType SDL_AudioSpec "format")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"format") Ptr SDL_AudioSpec
ptr0
        IO (CInt -> CInt -> SDL_AudioSpec)
-> IO CInt -> IO (CInt -> SDL_AudioSpec)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "channels"
-> Ptr SDL_AudioSpec -> IO (CFieldType SDL_AudioSpec "channels")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"channels") Ptr SDL_AudioSpec
ptr0
        IO (CInt -> SDL_AudioSpec) -> IO CInt -> IO SDL_AudioSpec
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "freq"
-> Ptr SDL_AudioSpec -> IO (CFieldType SDL_AudioSpec "freq")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"freq") Ptr SDL_AudioSpec
ptr0

instance Marshal.WriteRaw SDL_AudioSpec where
  writeRaw :: Ptr SDL_AudioSpec -> SDL_AudioSpec -> IO ()
writeRaw =
    \Ptr SDL_AudioSpec
ptr0 ->
      \SDL_AudioSpec
s1 ->
        case SDL_AudioSpec
s1 of
          SDL_AudioSpec SDL_AudioFormat
format2 CInt
channels3 CInt
freq4 ->
            Proxy "format"
-> Ptr SDL_AudioSpec -> CFieldType SDL_AudioSpec "format" -> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"format") Ptr SDL_AudioSpec
ptr0 CFieldType SDL_AudioSpec "format"
SDL_AudioFormat
format2
              IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Proxy "channels"
-> Ptr SDL_AudioSpec
-> CFieldType SDL_AudioSpec "channels"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"channels") Ptr SDL_AudioSpec
ptr0 CInt
CFieldType SDL_AudioSpec "channels"
channels3
              IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Proxy "freq"
-> Ptr SDL_AudioSpec -> CFieldType SDL_AudioSpec "freq" -> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"freq") Ptr SDL_AudioSpec
ptr0 CInt
CFieldType SDL_AudioSpec "freq"
freq4

deriving via Marshal.EquivStorable SDL_AudioSpec instance BG.Storable SDL_AudioSpec

deriving via Struct.IsStructViaReadRaw SDL_AudioSpec instance Struct.IsStruct SDL_AudioSpec

-- | Audio data format
--
--     [C declaration]: @format@, defined at @SDL3\/SDL_audio.h 407:21@
instance
  (ty ~ SDL_AudioFormat)
  => BG.CompatHasField.HasField "format" SDL_AudioSpec ty
  where
  hasField :: SDL_AudioSpec -> (ty -> SDL_AudioSpec, ty)
hasField =
    \SDL_AudioSpec
x0 ->
      ( \ty
y1 ->
          SDL_AudioSpec
            { format :: SDL_AudioFormat
format = ty
SDL_AudioFormat
y1
            , channels :: CInt
channels = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"channels" SDL_AudioSpec
x0
            , freq :: CInt
freq = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"freq" SDL_AudioSpec
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"format" SDL_AudioSpec
x0
      )

instance
  (ty ~ SDL_AudioFormat)
  => BG.HasField "format" (BG.Ptr SDL_AudioSpec) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioSpec -> Ptr ty
getField = Proxy "format"
-> Ptr SDL_AudioSpec -> Ptr (CFieldType SDL_AudioSpec "format")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"format")

instance HasCField.HasCField SDL_AudioSpec "format" where
  type
    CFieldType SDL_AudioSpec "format" =
      SDL_AudioFormat

  offset# :: Proxy# SDL_AudioSpec -> Proxy# "format" -> Int
offset# = \Proxy# SDL_AudioSpec
_ -> \Proxy# "format"
_ -> Int
0

-- | Number of channels: 1 mono, 2 stereo, etc
--
--     [C declaration]: @channels@, defined at @SDL3\/SDL_audio.h 408:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "channels" SDL_AudioSpec ty
  where
  hasField :: SDL_AudioSpec -> (ty -> SDL_AudioSpec, ty)
hasField =
    \SDL_AudioSpec
x0 ->
      ( \ty
y1 ->
          SDL_AudioSpec
            { channels :: CInt
channels = ty
CInt
y1
            , format :: SDL_AudioFormat
format = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"format" SDL_AudioSpec
x0
            , freq :: CInt
freq = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"freq" SDL_AudioSpec
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"channels" SDL_AudioSpec
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "channels" (BG.Ptr SDL_AudioSpec) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioSpec -> Ptr ty
getField = Proxy "channels"
-> Ptr SDL_AudioSpec -> Ptr (CFieldType SDL_AudioSpec "channels")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"channels")

instance HasCField.HasCField SDL_AudioSpec "channels" where
  type CFieldType SDL_AudioSpec "channels" = BG.CInt

  offset# :: Proxy# SDL_AudioSpec -> Proxy# "channels" -> Int
offset# = \Proxy# SDL_AudioSpec
_ -> \Proxy# "channels"
_ -> Int
4

-- | sample rate: sample frames per second
--
--     [C declaration]: @freq@, defined at @SDL3\/SDL_audio.h 409:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "freq" SDL_AudioSpec ty
  where
  hasField :: SDL_AudioSpec -> (ty -> SDL_AudioSpec, ty)
hasField =
    \SDL_AudioSpec
x0 ->
      ( \ty
y1 ->
          SDL_AudioSpec
            { freq :: CInt
freq = ty
CInt
y1
            , format :: SDL_AudioFormat
format = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"format" SDL_AudioSpec
x0
            , channels :: CInt
channels = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"channels" SDL_AudioSpec
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"freq" SDL_AudioSpec
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "freq" (BG.Ptr SDL_AudioSpec) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioSpec -> Ptr ty
getField = Proxy "freq"
-> Ptr SDL_AudioSpec -> Ptr (CFieldType SDL_AudioSpec "freq")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"freq")

instance HasCField.HasCField SDL_AudioSpec "freq" where
  type CFieldType SDL_AudioSpec "freq" = BG.CInt

  offset# :: Proxy# SDL_AudioSpec -> Proxy# "freq" -> Int
offset# = \Proxy# SDL_AudioSpec
_ -> \Proxy# "freq"
_ -> Int
8

-- | The opaque handle that represents an audio stream.
--
--     'SDL_AudioStream' is an audio conversion interface.
--
--     * It can handle resampling data in chunks without generating artifacts, when it doesn\'t have the complete buffer available.
--
--     * It can handle incoming data in any variable size.
--
--     * It can handle input\/output format changes on the fly.
--
--     * It can remap audio channels between inputs and outputs.
--
--     * You push data as you have it, and pull it when you need it; the stream will buffer data as needed.
--
--     * It can also function as a basic audio data queue even if you just have sound that needs to pass from one place to another.
--
--     * You can hook callbacks up to them when more data is added or requested, to manage data on-the-fly.
--
--     Audio streams are the core of the SDL3 audio interface. You create one or more of them, bind them to an opened audio device, and feed data to them (or for recording, consume data from them).
--
--     @since 3.2.0
--
--     [See also]: 'sDL_CreateAudioStream'
--
--     [C declaration]: @struct SDL_AudioStream@, defined at @SDL3\/SDL_audio.h 452:16@
data SDL_AudioStream

-- | [C declaration]: @macro SDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN@, literal @\"SDL.audiostream.auto_cleanup\"@, defined at @SDL3\/SDL_audio.h 1108:9@
sDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN :: BG.ByteString
sDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN :: ByteString
sDL_PROP_AUDIOSTREAM_AUTO_CLEANUP_BOOLEAN =
  [Word8] -> ByteString
BG.pack
    [ Word8
0x53
    , Word8
0x44
    , Word8
0x4C
    , Word8
0x2E
    , Word8
0x61
    , Word8
0x75
    , Word8
0x64
    , Word8
0x69
    , Word8
0x6F
    , Word8
0x73
    , Word8
0x74
    , Word8
0x72
    , Word8
0x65
    , Word8
0x61
    , Word8
0x6D
    , Word8
0x2E
    , Word8
0x61
    , Word8
0x75
    , Word8
0x74
    , Word8
0x6F
    , Word8
0x5F
    , Word8
0x63
    , Word8
0x6C
    , Word8
0x65
    , Word8
0x61
    , Word8
0x6E
    , Word8
0x75
    , Word8
0x70
    ]

-- | Auxiliary type used by 'SDL_AudioStreamDataCompleteCallback'
--
--     [C declaration]: @SDL_AudioStreamDataCompleteCallback@, defined at @SDL3\/SDL_audio.h 1483:24@
newtype SDL_AudioStreamDataCompleteCallback_Aux = SDL_AudioStreamDataCompleteCallback_Aux
  { SDL_AudioStreamDataCompleteCallback_Aux
-> Ptr Void -> PtrConst Void -> CInt -> IO ()
unwrap :: BG.Ptr BG.Void -> PtrConst.PtrConst BG.Void -> BG.CInt -> IO ()
  }
  deriving stock ((forall x.
 SDL_AudioStreamDataCompleteCallback_Aux
 -> Rep SDL_AudioStreamDataCompleteCallback_Aux x)
-> (forall x.
    Rep SDL_AudioStreamDataCompleteCallback_Aux x
    -> SDL_AudioStreamDataCompleteCallback_Aux)
-> Generic SDL_AudioStreamDataCompleteCallback_Aux
forall x.
Rep SDL_AudioStreamDataCompleteCallback_Aux x
-> SDL_AudioStreamDataCompleteCallback_Aux
forall x.
SDL_AudioStreamDataCompleteCallback_Aux
-> Rep SDL_AudioStreamDataCompleteCallback_Aux x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_AudioStreamDataCompleteCallback_Aux
-> Rep SDL_AudioStreamDataCompleteCallback_Aux x
from :: forall x.
SDL_AudioStreamDataCompleteCallback_Aux
-> Rep SDL_AudioStreamDataCompleteCallback_Aux x
$cto :: forall x.
Rep SDL_AudioStreamDataCompleteCallback_Aux x
-> SDL_AudioStreamDataCompleteCallback_Aux
to :: forall x.
Rep SDL_AudioStreamDataCompleteCallback_Aux x
-> SDL_AudioStreamDataCompleteCallback_Aux
BG.Generic)

-- __unique:__ @toSDL_AudioStreamDataCompleteCallback_Aux@
foreign import ccall safe "wrapper"
  hs_bindgen_d632898096a732d7_base
    :: (BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.CInt -> IO ())
    -> IO (BG.FunPtr (BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.CInt -> IO ()))

-- __unique:__ @toSDL_AudioStreamDataCompleteCallback_Aux@
hs_bindgen_d632898096a732d7
  :: SDL_AudioStreamDataCompleteCallback_Aux
  -> IO (BG.FunPtr SDL_AudioStreamDataCompleteCallback_Aux)
hs_bindgen_d632898096a732d7 :: SDL_AudioStreamDataCompleteCallback_Aux
-> IO (FunPtr SDL_AudioStreamDataCompleteCallback_Aux)
hs_bindgen_d632898096a732d7 =
  \SDL_AudioStreamDataCompleteCallback_Aux
fun0 ->
    (FunPtr (Ptr Void -> Ptr Void -> CInt -> IO ())
 -> FunPtr SDL_AudioStreamDataCompleteCallback_Aux)
-> IO (FunPtr (Ptr Void -> Ptr Void -> CInt -> IO ()))
-> IO (FunPtr SDL_AudioStreamDataCompleteCallback_Aux)
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
      FunPtr (Ptr Void -> Ptr Void -> CInt -> IO ())
-> FunPtr SDL_AudioStreamDataCompleteCallback_Aux
forall a b. FunPtr a -> FunPtr b
BG.castFunPtr
      ( (Ptr Void -> Ptr Void -> CInt -> IO ())
-> IO (FunPtr (Ptr Void -> Ptr Void -> CInt -> IO ()))
hs_bindgen_d632898096a732d7_base
          ( \Ptr Void
x1 ->
              \Ptr Void
x2 ->
                \CInt
x3 ->
                  forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_AudioStreamDataCompleteCallback_Aux
fun0 (FFIType (Ptr Void) -> Ptr Void
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType Ptr Void
FFIType (Ptr Void)
x1) (FFIType (PtrConst Void) -> PtrConst Void
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType Ptr Void
FFIType (PtrConst Void)
x2) (FFIType CInt -> CInt
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType CInt
FFIType CInt
x3)
          )
      )

-- __unique:__ @fromSDL_AudioStreamDataCompleteCallback_Aux@
foreign import ccall safe "dynamic"
  hs_bindgen_13d85e7076fc6ef1_base
    :: BG.FunPtr (BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.CInt -> IO ())
    -> BG.Ptr BG.Void
    -> BG.Ptr BG.Void
    -> BG.CInt
    -> IO ()

-- __unique:__ @fromSDL_AudioStreamDataCompleteCallback_Aux@
hs_bindgen_13d85e7076fc6ef1
  :: BG.FunPtr SDL_AudioStreamDataCompleteCallback_Aux
  -> SDL_AudioStreamDataCompleteCallback_Aux
hs_bindgen_13d85e7076fc6ef1 :: FunPtr SDL_AudioStreamDataCompleteCallback_Aux
-> SDL_AudioStreamDataCompleteCallback_Aux
hs_bindgen_13d85e7076fc6ef1 =
  \FunPtr SDL_AudioStreamDataCompleteCallback_Aux
funPtr0 ->
    (Ptr Void -> PtrConst Void -> CInt -> IO ())
-> SDL_AudioStreamDataCompleteCallback_Aux
SDL_AudioStreamDataCompleteCallback_Aux
      ( \Ptr Void
x1 ->
          \PtrConst Void
x2 ->
            \CInt
x3 ->
              FunPtr (Ptr Void -> Ptr Void -> CInt -> IO ())
-> Ptr Void -> Ptr Void -> CInt -> IO ()
hs_bindgen_13d85e7076fc6ef1_base
                (FunPtr SDL_AudioStreamDataCompleteCallback_Aux
-> FunPtr (Ptr Void -> Ptr Void -> CInt -> IO ())
forall a b. FunPtr a -> FunPtr b
BG.castFunPtr FunPtr SDL_AudioStreamDataCompleteCallback_Aux
funPtr0)
                (Ptr Void -> FFIType (Ptr Void)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Ptr Void
x1)
                (PtrConst Void -> FFIType (PtrConst Void)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType PtrConst Void
x2)
                (CInt -> FFIType CInt
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType CInt
x3)
      )

instance BG.ToFunPtr SDL_AudioStreamDataCompleteCallback_Aux where
  toFunPtr :: SDL_AudioStreamDataCompleteCallback_Aux
-> IO (FunPtr SDL_AudioStreamDataCompleteCallback_Aux)
toFunPtr = SDL_AudioStreamDataCompleteCallback_Aux
-> IO (FunPtr SDL_AudioStreamDataCompleteCallback_Aux)
hs_bindgen_d632898096a732d7

instance BG.FromFunPtr SDL_AudioStreamDataCompleteCallback_Aux where
  fromFunPtr :: FunPtr SDL_AudioStreamDataCompleteCallback_Aux
-> SDL_AudioStreamDataCompleteCallback_Aux
fromFunPtr = FunPtr SDL_AudioStreamDataCompleteCallback_Aux
-> SDL_AudioStreamDataCompleteCallback_Aux
hs_bindgen_13d85e7076fc6ef1

instance
  (ty ~ (BG.Ptr BG.Void -> PtrConst.PtrConst BG.Void -> BG.CInt -> IO ()))
  => BG.CompatHasField.HasField "unwrap" SDL_AudioStreamDataCompleteCallback_Aux ty
  where
  hasField :: SDL_AudioStreamDataCompleteCallback_Aux
-> (ty -> SDL_AudioStreamDataCompleteCallback_Aux, ty)
hasField =
    \SDL_AudioStreamDataCompleteCallback_Aux
x0 ->
      ( \ty
y1 ->
          SDL_AudioStreamDataCompleteCallback_Aux{unwrap :: Ptr Void -> PtrConst Void -> CInt -> IO ()
unwrap = ty
Ptr Void -> PtrConst Void -> CInt -> IO ()
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_AudioStreamDataCompleteCallback_Aux
x0
      )

instance
  (ty ~ (BG.Ptr BG.Void -> PtrConst.PtrConst BG.Void -> BG.CInt -> IO ()))
  => BG.HasField "unwrap" (BG.Ptr SDL_AudioStreamDataCompleteCallback_Aux) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioStreamDataCompleteCallback_Aux -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_AudioStreamDataCompleteCallback_Aux
-> Ptr
     (CFieldType SDL_AudioStreamDataCompleteCallback_Aux "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_AudioStreamDataCompleteCallback_Aux "unwrap" where
  type
    CFieldType SDL_AudioStreamDataCompleteCallback_Aux "unwrap" =
      BG.Ptr BG.Void -> PtrConst.PtrConst BG.Void -> BG.CInt -> IO ()

  offset# :: Proxy# SDL_AudioStreamDataCompleteCallback_Aux
-> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_AudioStreamDataCompleteCallback_Aux
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | A callback that fires for completed @SDL_PutAudioStreamDataNoCopy()@ data.
--
--     When using @SDL_PutAudioStreamDataNoCopy()@ to provide data to an 'SDL_AudioStream', it\'s not safe to dispose of the data until the stream has completely consumed it. Often times it\'s difficult to know exactly when this has happened.
--
--     This callback fires once when the stream no longer needs the buffer, allowing the app to easily free or reuse it.
--
--     [@userdata@]: an opaque pointer provided by the app for their personal use.
--
--     [@buf@]: the pointer provided to @SDL_PutAudioStreamDataNoCopy()@.
--
--     [@buflen@]: the size of buffer, in bytes, provided to @SDL_PutAudioStreamDataNoCopy()@.
--
--     [Thread safety]: This callbacks may run from any thread, so if you need to protect shared data, you should use SDL_LockAudioStream to serialize access; this lock will be held before your callback is called, so your callback does not need to manage the lock explicitly.
--
--     @since 3.4.0
--
--     [See also]: 'sDL_SetAudioStreamGetCallback', 'sDL_SetAudioStreamPutCallback'
--
--     [C declaration]: @SDL_AudioStreamDataCompleteCallback@, defined at @SDL3\/SDL_audio.h 1483:24@
newtype SDL_AudioStreamDataCompleteCallback = SDL_AudioStreamDataCompleteCallback
  { SDL_AudioStreamDataCompleteCallback
-> FunPtr SDL_AudioStreamDataCompleteCallback_Aux
unwrap :: BG.FunPtr SDL_AudioStreamDataCompleteCallback_Aux
  }
  deriving stock ((forall x.
 SDL_AudioStreamDataCompleteCallback
 -> Rep SDL_AudioStreamDataCompleteCallback x)
-> (forall x.
    Rep SDL_AudioStreamDataCompleteCallback x
    -> SDL_AudioStreamDataCompleteCallback)
-> Generic SDL_AudioStreamDataCompleteCallback
forall x.
Rep SDL_AudioStreamDataCompleteCallback x
-> SDL_AudioStreamDataCompleteCallback
forall x.
SDL_AudioStreamDataCompleteCallback
-> Rep SDL_AudioStreamDataCompleteCallback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_AudioStreamDataCompleteCallback
-> Rep SDL_AudioStreamDataCompleteCallback x
from :: forall x.
SDL_AudioStreamDataCompleteCallback
-> Rep SDL_AudioStreamDataCompleteCallback x
$cto :: forall x.
Rep SDL_AudioStreamDataCompleteCallback x
-> SDL_AudioStreamDataCompleteCallback
to :: forall x.
Rep SDL_AudioStreamDataCompleteCallback x
-> SDL_AudioStreamDataCompleteCallback
BG.Generic, SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
(SDL_AudioStreamDataCompleteCallback
 -> SDL_AudioStreamDataCompleteCallback -> Bool)
-> (SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback -> Bool)
-> Eq SDL_AudioStreamDataCompleteCallback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
== :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
$c/= :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
/= :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
Eq, Eq SDL_AudioStreamDataCompleteCallback
Eq SDL_AudioStreamDataCompleteCallback =>
(SDL_AudioStreamDataCompleteCallback
 -> SDL_AudioStreamDataCompleteCallback -> Ordering)
-> (SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback -> Bool)
-> (SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback -> Bool)
-> (SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback -> Bool)
-> (SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback -> Bool)
-> (SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback)
-> (SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback)
-> Ord SDL_AudioStreamDataCompleteCallback
SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Ordering
SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Ordering
compare :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Ordering
$c< :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
< :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
$c<= :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
<= :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
$c> :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
> :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
$c>= :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
>= :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> Bool
$cmax :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
max :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
$cmin :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
min :: SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
Ord, Int -> SDL_AudioStreamDataCompleteCallback -> ShowS
[SDL_AudioStreamDataCompleteCallback] -> ShowS
SDL_AudioStreamDataCompleteCallback -> String
(Int -> SDL_AudioStreamDataCompleteCallback -> ShowS)
-> (SDL_AudioStreamDataCompleteCallback -> String)
-> ([SDL_AudioStreamDataCompleteCallback] -> ShowS)
-> Show SDL_AudioStreamDataCompleteCallback
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_AudioStreamDataCompleteCallback -> ShowS
showsPrec :: Int -> SDL_AudioStreamDataCompleteCallback -> ShowS
$cshow :: SDL_AudioStreamDataCompleteCallback -> String
show :: SDL_AudioStreamDataCompleteCallback -> String
$cshowList :: [SDL_AudioStreamDataCompleteCallback] -> ShowS
showList :: [SDL_AudioStreamDataCompleteCallback] -> ShowS
Show)
  deriving newtype
    ( FFIType SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
SDL_AudioStreamDataCompleteCallback
-> FFIType SDL_AudioStreamDataCompleteCallback
(SDL_AudioStreamDataCompleteCallback
 -> FFIType SDL_AudioStreamDataCompleteCallback)
-> (FFIType SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback)
-> HasFFIType SDL_AudioStreamDataCompleteCallback
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_AudioStreamDataCompleteCallback
-> FFIType SDL_AudioStreamDataCompleteCallback
toFFIType :: SDL_AudioStreamDataCompleteCallback
-> FFIType SDL_AudioStreamDataCompleteCallback
$cfromFFIType :: FFIType SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
fromFFIType :: FFIType SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback
BG.HasFFIType
    , Ptr SDL_AudioStreamDataCompleteCallback
-> IO SDL_AudioStreamDataCompleteCallback
Ptr SDL_AudioStreamDataCompleteCallback
-> Int -> IO SDL_AudioStreamDataCompleteCallback
Ptr SDL_AudioStreamDataCompleteCallback
-> Int -> SDL_AudioStreamDataCompleteCallback -> IO ()
Ptr SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> IO ()
SDL_AudioStreamDataCompleteCallback -> Int
(SDL_AudioStreamDataCompleteCallback -> Int)
-> (SDL_AudioStreamDataCompleteCallback -> Int)
-> (Ptr SDL_AudioStreamDataCompleteCallback
    -> Int -> IO SDL_AudioStreamDataCompleteCallback)
-> (Ptr SDL_AudioStreamDataCompleteCallback
    -> Int -> SDL_AudioStreamDataCompleteCallback -> IO ())
-> (forall b.
    Ptr b -> Int -> IO SDL_AudioStreamDataCompleteCallback)
-> (forall b.
    Ptr b -> Int -> SDL_AudioStreamDataCompleteCallback -> IO ())
-> (Ptr SDL_AudioStreamDataCompleteCallback
    -> IO SDL_AudioStreamDataCompleteCallback)
-> (Ptr SDL_AudioStreamDataCompleteCallback
    -> SDL_AudioStreamDataCompleteCallback -> IO ())
-> Storable SDL_AudioStreamDataCompleteCallback
forall b. Ptr b -> Int -> IO SDL_AudioStreamDataCompleteCallback
forall b.
Ptr b -> Int -> SDL_AudioStreamDataCompleteCallback -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: SDL_AudioStreamDataCompleteCallback -> Int
sizeOf :: SDL_AudioStreamDataCompleteCallback -> Int
$calignment :: SDL_AudioStreamDataCompleteCallback -> Int
alignment :: SDL_AudioStreamDataCompleteCallback -> Int
$cpeekElemOff :: Ptr SDL_AudioStreamDataCompleteCallback
-> Int -> IO SDL_AudioStreamDataCompleteCallback
peekElemOff :: Ptr SDL_AudioStreamDataCompleteCallback
-> Int -> IO SDL_AudioStreamDataCompleteCallback
$cpokeElemOff :: Ptr SDL_AudioStreamDataCompleteCallback
-> Int -> SDL_AudioStreamDataCompleteCallback -> IO ()
pokeElemOff :: Ptr SDL_AudioStreamDataCompleteCallback
-> Int -> SDL_AudioStreamDataCompleteCallback -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SDL_AudioStreamDataCompleteCallback
peekByteOff :: forall b. Ptr b -> Int -> IO SDL_AudioStreamDataCompleteCallback
$cpokeByteOff :: forall b.
Ptr b -> Int -> SDL_AudioStreamDataCompleteCallback -> IO ()
pokeByteOff :: forall b.
Ptr b -> Int -> SDL_AudioStreamDataCompleteCallback -> IO ()
$cpeek :: Ptr SDL_AudioStreamDataCompleteCallback
-> IO SDL_AudioStreamDataCompleteCallback
peek :: Ptr SDL_AudioStreamDataCompleteCallback
-> IO SDL_AudioStreamDataCompleteCallback
$cpoke :: Ptr SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> IO ()
poke :: Ptr SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> IO ()
BG.Storable
    , Ptr SDL_AudioStreamDataCompleteCallback
-> IO SDL_AudioStreamDataCompleteCallback
(Ptr SDL_AudioStreamDataCompleteCallback
 -> IO SDL_AudioStreamDataCompleteCallback)
-> ReadRaw SDL_AudioStreamDataCompleteCallback
forall a. (Ptr a -> IO a) -> ReadRaw a
$creadRaw :: Ptr SDL_AudioStreamDataCompleteCallback
-> IO SDL_AudioStreamDataCompleteCallback
readRaw :: Ptr SDL_AudioStreamDataCompleteCallback
-> IO SDL_AudioStreamDataCompleteCallback
Marshal.ReadRaw
    , Proxy SDL_AudioStreamDataCompleteCallback -> Int
(Proxy SDL_AudioStreamDataCompleteCallback -> Int)
-> (Proxy SDL_AudioStreamDataCompleteCallback -> Int)
-> StaticSize SDL_AudioStreamDataCompleteCallback
forall a. (Proxy a -> Int) -> (Proxy a -> Int) -> StaticSize a
$cstaticSizeOf :: Proxy SDL_AudioStreamDataCompleteCallback -> Int
staticSizeOf :: Proxy SDL_AudioStreamDataCompleteCallback -> Int
$cstaticAlignment :: Proxy SDL_AudioStreamDataCompleteCallback -> Int
staticAlignment :: Proxy SDL_AudioStreamDataCompleteCallback -> Int
Marshal.StaticSize
    , Ptr SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> IO ()
(Ptr SDL_AudioStreamDataCompleteCallback
 -> SDL_AudioStreamDataCompleteCallback -> IO ())
-> WriteRaw SDL_AudioStreamDataCompleteCallback
forall a. (Ptr a -> a -> IO ()) -> WriteRaw a
$cwriteRaw :: Ptr SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> IO ()
writeRaw :: Ptr SDL_AudioStreamDataCompleteCallback
-> SDL_AudioStreamDataCompleteCallback -> IO ()
Marshal.WriteRaw
    )

instance
  (ty ~ BG.FunPtr SDL_AudioStreamDataCompleteCallback_Aux)
  => BG.CompatHasField.HasField "unwrap" SDL_AudioStreamDataCompleteCallback ty
  where
  hasField :: SDL_AudioStreamDataCompleteCallback
-> (ty -> SDL_AudioStreamDataCompleteCallback, ty)
hasField =
    \SDL_AudioStreamDataCompleteCallback
x0 ->
      ( \ty
y1 ->
          SDL_AudioStreamDataCompleteCallback{unwrap :: FunPtr SDL_AudioStreamDataCompleteCallback_Aux
unwrap = ty
FunPtr SDL_AudioStreamDataCompleteCallback_Aux
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_AudioStreamDataCompleteCallback
x0
      )

instance
  (ty ~ BG.FunPtr SDL_AudioStreamDataCompleteCallback_Aux)
  => BG.HasField "unwrap" (BG.Ptr SDL_AudioStreamDataCompleteCallback) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioStreamDataCompleteCallback -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_AudioStreamDataCompleteCallback
-> Ptr (CFieldType SDL_AudioStreamDataCompleteCallback "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_AudioStreamDataCompleteCallback "unwrap" where
  type
    CFieldType SDL_AudioStreamDataCompleteCallback "unwrap" =
      BG.FunPtr SDL_AudioStreamDataCompleteCallback_Aux

  offset# :: Proxy# SDL_AudioStreamDataCompleteCallback
-> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_AudioStreamDataCompleteCallback
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | Auxiliary type used by 'SDL_AudioStreamCallback'
--
--     [C declaration]: @SDL_AudioStreamCallback@, defined at @SDL3\/SDL_audio.h 1878:24@
newtype SDL_AudioStreamCallback_Aux = SDL_AudioStreamCallback_Aux
  { SDL_AudioStreamCallback_Aux
-> Ptr Void -> Ptr SDL_AudioStream -> CInt -> CInt -> IO ()
unwrap :: BG.Ptr BG.Void -> BG.Ptr SDL_AudioStream -> BG.CInt -> BG.CInt -> IO ()
  }
  deriving stock ((forall x.
 SDL_AudioStreamCallback_Aux -> Rep SDL_AudioStreamCallback_Aux x)
-> (forall x.
    Rep SDL_AudioStreamCallback_Aux x -> SDL_AudioStreamCallback_Aux)
-> Generic SDL_AudioStreamCallback_Aux
forall x.
Rep SDL_AudioStreamCallback_Aux x -> SDL_AudioStreamCallback_Aux
forall x.
SDL_AudioStreamCallback_Aux -> Rep SDL_AudioStreamCallback_Aux x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_AudioStreamCallback_Aux -> Rep SDL_AudioStreamCallback_Aux x
from :: forall x.
SDL_AudioStreamCallback_Aux -> Rep SDL_AudioStreamCallback_Aux x
$cto :: forall x.
Rep SDL_AudioStreamCallback_Aux x -> SDL_AudioStreamCallback_Aux
to :: forall x.
Rep SDL_AudioStreamCallback_Aux x -> SDL_AudioStreamCallback_Aux
BG.Generic)

-- __unique:__ @toSDL_AudioStreamCallback_Aux@
foreign import ccall safe "wrapper"
  hs_bindgen_2ba16e119c56cb1b_base
    :: (BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.CInt -> BG.CInt -> IO ())
    -> IO (BG.FunPtr (BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.CInt -> BG.CInt -> IO ()))

-- __unique:__ @toSDL_AudioStreamCallback_Aux@
hs_bindgen_2ba16e119c56cb1b
  :: SDL_AudioStreamCallback_Aux
  -> IO (BG.FunPtr SDL_AudioStreamCallback_Aux)
hs_bindgen_2ba16e119c56cb1b :: SDL_AudioStreamCallback_Aux
-> IO (FunPtr SDL_AudioStreamCallback_Aux)
hs_bindgen_2ba16e119c56cb1b =
  \SDL_AudioStreamCallback_Aux
fun0 ->
    (FunPtr (Ptr Void -> Ptr Void -> CInt -> CInt -> IO ())
 -> FunPtr SDL_AudioStreamCallback_Aux)
-> IO (FunPtr (Ptr Void -> Ptr Void -> CInt -> CInt -> IO ()))
-> IO (FunPtr SDL_AudioStreamCallback_Aux)
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
      FunPtr (Ptr Void -> Ptr Void -> CInt -> CInt -> IO ())
-> FunPtr SDL_AudioStreamCallback_Aux
forall a b. FunPtr a -> FunPtr b
BG.castFunPtr
      ( (Ptr Void -> Ptr Void -> CInt -> CInt -> IO ())
-> IO (FunPtr (Ptr Void -> Ptr Void -> CInt -> CInt -> IO ()))
hs_bindgen_2ba16e119c56cb1b_base
          ( \Ptr Void
x1 ->
              \Ptr Void
x2 ->
                \CInt
x3 ->
                  \CInt
x4 ->
                    forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap"
                      SDL_AudioStreamCallback_Aux
fun0
                      (FFIType (Ptr Void) -> Ptr Void
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType Ptr Void
FFIType (Ptr Void)
x1)
                      (FFIType (Ptr SDL_AudioStream) -> Ptr SDL_AudioStream
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType Ptr Void
FFIType (Ptr SDL_AudioStream)
x2)
                      (FFIType CInt -> CInt
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType CInt
FFIType CInt
x3)
                      (FFIType CInt -> CInt
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType CInt
FFIType CInt
x4)
          )
      )

-- __unique:__ @fromSDL_AudioStreamCallback_Aux@
foreign import ccall safe "dynamic"
  hs_bindgen_a0fafe03b8b6d008_base
    :: BG.FunPtr (BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.CInt -> BG.CInt -> IO ())
    -> BG.Ptr BG.Void
    -> BG.Ptr BG.Void
    -> BG.CInt
    -> BG.CInt
    -> IO ()

-- __unique:__ @fromSDL_AudioStreamCallback_Aux@
hs_bindgen_a0fafe03b8b6d008
  :: BG.FunPtr SDL_AudioStreamCallback_Aux
  -> SDL_AudioStreamCallback_Aux
hs_bindgen_a0fafe03b8b6d008 :: FunPtr SDL_AudioStreamCallback_Aux -> SDL_AudioStreamCallback_Aux
hs_bindgen_a0fafe03b8b6d008 =
  \FunPtr SDL_AudioStreamCallback_Aux
funPtr0 ->
    (Ptr Void -> Ptr SDL_AudioStream -> CInt -> CInt -> IO ())
-> SDL_AudioStreamCallback_Aux
SDL_AudioStreamCallback_Aux
      ( \Ptr Void
x1 ->
          \Ptr SDL_AudioStream
x2 ->
            \CInt
x3 ->
              \CInt
x4 ->
                FunPtr (Ptr Void -> Ptr Void -> CInt -> CInt -> IO ())
-> Ptr Void -> Ptr Void -> CInt -> CInt -> IO ()
hs_bindgen_a0fafe03b8b6d008_base
                  (FunPtr SDL_AudioStreamCallback_Aux
-> FunPtr (Ptr Void -> Ptr Void -> CInt -> CInt -> IO ())
forall a b. FunPtr a -> FunPtr b
BG.castFunPtr FunPtr SDL_AudioStreamCallback_Aux
funPtr0)
                  (Ptr Void -> FFIType (Ptr Void)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Ptr Void
x1)
                  (Ptr SDL_AudioStream -> FFIType (Ptr SDL_AudioStream)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Ptr SDL_AudioStream
x2)
                  (CInt -> FFIType CInt
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType CInt
x3)
                  (CInt -> FFIType CInt
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType CInt
x4)
      )

instance BG.ToFunPtr SDL_AudioStreamCallback_Aux where
  toFunPtr :: SDL_AudioStreamCallback_Aux
-> IO (FunPtr SDL_AudioStreamCallback_Aux)
toFunPtr = SDL_AudioStreamCallback_Aux
-> IO (FunPtr SDL_AudioStreamCallback_Aux)
hs_bindgen_2ba16e119c56cb1b

instance BG.FromFunPtr SDL_AudioStreamCallback_Aux where
  fromFunPtr :: FunPtr SDL_AudioStreamCallback_Aux -> SDL_AudioStreamCallback_Aux
fromFunPtr = FunPtr SDL_AudioStreamCallback_Aux -> SDL_AudioStreamCallback_Aux
hs_bindgen_a0fafe03b8b6d008

instance
  (ty ~ (BG.Ptr BG.Void -> BG.Ptr SDL_AudioStream -> BG.CInt -> BG.CInt -> IO ()))
  => BG.CompatHasField.HasField "unwrap" SDL_AudioStreamCallback_Aux ty
  where
  hasField :: SDL_AudioStreamCallback_Aux
-> (ty -> SDL_AudioStreamCallback_Aux, ty)
hasField =
    \SDL_AudioStreamCallback_Aux
x0 ->
      ( \ty
y1 ->
          SDL_AudioStreamCallback_Aux{unwrap :: Ptr Void -> Ptr SDL_AudioStream -> CInt -> CInt -> IO ()
unwrap = ty
Ptr Void -> Ptr SDL_AudioStream -> CInt -> CInt -> IO ()
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_AudioStreamCallback_Aux
x0
      )

instance
  (ty ~ (BG.Ptr BG.Void -> BG.Ptr SDL_AudioStream -> BG.CInt -> BG.CInt -> IO ()))
  => BG.HasField "unwrap" (BG.Ptr SDL_AudioStreamCallback_Aux) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioStreamCallback_Aux -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_AudioStreamCallback_Aux
-> Ptr (CFieldType SDL_AudioStreamCallback_Aux "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_AudioStreamCallback_Aux "unwrap" where
  type
    CFieldType SDL_AudioStreamCallback_Aux "unwrap" =
      BG.Ptr BG.Void -> BG.Ptr SDL_AudioStream -> BG.CInt -> BG.CInt -> IO ()

  offset# :: Proxy# SDL_AudioStreamCallback_Aux -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_AudioStreamCallback_Aux
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | A callback that fires when data passes through an 'SDL_AudioStream'.
--
--     Apps can (optionally) register a callback with an audio stream that is called when data is added with SDL_PutAudioStreamData, or requested with SDL_GetAudioStreamData.
--
--     Two values are offered here: one is the amount of additional data needed to satisfy the immediate request (which might be zero if the stream already has enough data queued) and the other is the total amount being requested. In a Get call triggering a Put callback, these values can be different. In a Put call triggering a Get callback, these values are always the same.
--
--     Byte counts might be slightly overestimated due to buffering or resampling, and may change from call to call.
--
--     This callback is not required to do anything. Generally this is useful for adding\/reading data on demand, and the app will often put\/get data as appropriate, but the system goes on with the data currently available to it if this callback does nothing.
--
--     Do not call @SDL_DestroyAudioStream()@ on @stream@ during this callback.
--
--     [@stream@]: the SDL audio stream associated with this callback.
--
--     [@additional_amount@]: the amount of data, in bytes, that is needed right now.
--
--     [@total_amount@]: the total amount of data requested, in bytes, that is requested or available.
--
--     [@userdata@]: an opaque pointer provided by the app for their personal use.
--
--     [Thread safety]: This callbacks may run from any thread, so if you need to protect shared data, you should use SDL_LockAudioStream to serialize access; this lock will be held before your callback is called, so your callback does not need to manage the lock explicitly.
--
--     @since 3.2.0
--
--     [See also]: 'sDL_SetAudioStreamGetCallback', 'sDL_SetAudioStreamPutCallback'
--
--     [C declaration]: @SDL_AudioStreamCallback@, defined at @SDL3\/SDL_audio.h 1878:24@
newtype SDL_AudioStreamCallback = SDL_AudioStreamCallback
  { SDL_AudioStreamCallback -> FunPtr SDL_AudioStreamCallback_Aux
unwrap :: BG.FunPtr SDL_AudioStreamCallback_Aux
  }
  deriving stock ((forall x.
 SDL_AudioStreamCallback -> Rep SDL_AudioStreamCallback x)
-> (forall x.
    Rep SDL_AudioStreamCallback x -> SDL_AudioStreamCallback)
-> Generic SDL_AudioStreamCallback
forall x. Rep SDL_AudioStreamCallback x -> SDL_AudioStreamCallback
forall x. SDL_AudioStreamCallback -> Rep SDL_AudioStreamCallback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_AudioStreamCallback -> Rep SDL_AudioStreamCallback x
from :: forall x. SDL_AudioStreamCallback -> Rep SDL_AudioStreamCallback x
$cto :: forall x. Rep SDL_AudioStreamCallback x -> SDL_AudioStreamCallback
to :: forall x. Rep SDL_AudioStreamCallback x -> SDL_AudioStreamCallback
BG.Generic, SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
(SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool)
-> (SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool)
-> Eq SDL_AudioStreamCallback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
== :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
$c/= :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
/= :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
Eq, Eq SDL_AudioStreamCallback
Eq SDL_AudioStreamCallback =>
(SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Ordering)
-> (SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool)
-> (SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool)
-> (SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool)
-> (SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool)
-> (SDL_AudioStreamCallback
    -> SDL_AudioStreamCallback -> SDL_AudioStreamCallback)
-> (SDL_AudioStreamCallback
    -> SDL_AudioStreamCallback -> SDL_AudioStreamCallback)
-> Ord SDL_AudioStreamCallback
SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Ordering
SDL_AudioStreamCallback
-> SDL_AudioStreamCallback -> SDL_AudioStreamCallback
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Ordering
compare :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Ordering
$c< :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
< :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
$c<= :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
<= :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
$c> :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
> :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
$c>= :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
>= :: SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> Bool
$cmax :: SDL_AudioStreamCallback
-> SDL_AudioStreamCallback -> SDL_AudioStreamCallback
max :: SDL_AudioStreamCallback
-> SDL_AudioStreamCallback -> SDL_AudioStreamCallback
$cmin :: SDL_AudioStreamCallback
-> SDL_AudioStreamCallback -> SDL_AudioStreamCallback
min :: SDL_AudioStreamCallback
-> SDL_AudioStreamCallback -> SDL_AudioStreamCallback
Ord, Int -> SDL_AudioStreamCallback -> ShowS
[SDL_AudioStreamCallback] -> ShowS
SDL_AudioStreamCallback -> String
(Int -> SDL_AudioStreamCallback -> ShowS)
-> (SDL_AudioStreamCallback -> String)
-> ([SDL_AudioStreamCallback] -> ShowS)
-> Show SDL_AudioStreamCallback
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_AudioStreamCallback -> ShowS
showsPrec :: Int -> SDL_AudioStreamCallback -> ShowS
$cshow :: SDL_AudioStreamCallback -> String
show :: SDL_AudioStreamCallback -> String
$cshowList :: [SDL_AudioStreamCallback] -> ShowS
showList :: [SDL_AudioStreamCallback] -> ShowS
Show)
  deriving newtype
    ( FFIType SDL_AudioStreamCallback -> SDL_AudioStreamCallback
SDL_AudioStreamCallback -> FFIType SDL_AudioStreamCallback
(SDL_AudioStreamCallback -> FFIType SDL_AudioStreamCallback)
-> (FFIType SDL_AudioStreamCallback -> SDL_AudioStreamCallback)
-> HasFFIType SDL_AudioStreamCallback
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_AudioStreamCallback -> FFIType SDL_AudioStreamCallback
toFFIType :: SDL_AudioStreamCallback -> FFIType SDL_AudioStreamCallback
$cfromFFIType :: FFIType SDL_AudioStreamCallback -> SDL_AudioStreamCallback
fromFFIType :: FFIType SDL_AudioStreamCallback -> SDL_AudioStreamCallback
BG.HasFFIType
    , Ptr SDL_AudioStreamCallback -> IO SDL_AudioStreamCallback
Ptr SDL_AudioStreamCallback -> Int -> IO SDL_AudioStreamCallback
Ptr SDL_AudioStreamCallback
-> Int -> SDL_AudioStreamCallback -> IO ()
Ptr SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> IO ()
SDL_AudioStreamCallback -> Int
(SDL_AudioStreamCallback -> Int)
-> (SDL_AudioStreamCallback -> Int)
-> (Ptr SDL_AudioStreamCallback
    -> Int -> IO SDL_AudioStreamCallback)
-> (Ptr SDL_AudioStreamCallback
    -> Int -> SDL_AudioStreamCallback -> IO ())
-> (forall b. Ptr b -> Int -> IO SDL_AudioStreamCallback)
-> (forall b. Ptr b -> Int -> SDL_AudioStreamCallback -> IO ())
-> (Ptr SDL_AudioStreamCallback -> IO SDL_AudioStreamCallback)
-> (Ptr SDL_AudioStreamCallback
    -> SDL_AudioStreamCallback -> IO ())
-> Storable SDL_AudioStreamCallback
forall b. Ptr b -> Int -> IO SDL_AudioStreamCallback
forall b. Ptr b -> Int -> SDL_AudioStreamCallback -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: SDL_AudioStreamCallback -> Int
sizeOf :: SDL_AudioStreamCallback -> Int
$calignment :: SDL_AudioStreamCallback -> Int
alignment :: SDL_AudioStreamCallback -> Int
$cpeekElemOff :: Ptr SDL_AudioStreamCallback -> Int -> IO SDL_AudioStreamCallback
peekElemOff :: Ptr SDL_AudioStreamCallback -> Int -> IO SDL_AudioStreamCallback
$cpokeElemOff :: Ptr SDL_AudioStreamCallback
-> Int -> SDL_AudioStreamCallback -> IO ()
pokeElemOff :: Ptr SDL_AudioStreamCallback
-> Int -> SDL_AudioStreamCallback -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SDL_AudioStreamCallback
peekByteOff :: forall b. Ptr b -> Int -> IO SDL_AudioStreamCallback
$cpokeByteOff :: forall b. Ptr b -> Int -> SDL_AudioStreamCallback -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> SDL_AudioStreamCallback -> IO ()
$cpeek :: Ptr SDL_AudioStreamCallback -> IO SDL_AudioStreamCallback
peek :: Ptr SDL_AudioStreamCallback -> IO SDL_AudioStreamCallback
$cpoke :: Ptr SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> IO ()
poke :: Ptr SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> IO ()
BG.Storable
    , Ptr SDL_AudioStreamCallback -> IO SDL_AudioStreamCallback
(Ptr SDL_AudioStreamCallback -> IO SDL_AudioStreamCallback)
-> ReadRaw SDL_AudioStreamCallback
forall a. (Ptr a -> IO a) -> ReadRaw a
$creadRaw :: Ptr SDL_AudioStreamCallback -> IO SDL_AudioStreamCallback
readRaw :: Ptr SDL_AudioStreamCallback -> IO SDL_AudioStreamCallback
Marshal.ReadRaw
    , Proxy SDL_AudioStreamCallback -> Int
(Proxy SDL_AudioStreamCallback -> Int)
-> (Proxy SDL_AudioStreamCallback -> Int)
-> StaticSize SDL_AudioStreamCallback
forall a. (Proxy a -> Int) -> (Proxy a -> Int) -> StaticSize a
$cstaticSizeOf :: Proxy SDL_AudioStreamCallback -> Int
staticSizeOf :: Proxy SDL_AudioStreamCallback -> Int
$cstaticAlignment :: Proxy SDL_AudioStreamCallback -> Int
staticAlignment :: Proxy SDL_AudioStreamCallback -> Int
Marshal.StaticSize
    , Ptr SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> IO ()
(Ptr SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> IO ())
-> WriteRaw SDL_AudioStreamCallback
forall a. (Ptr a -> a -> IO ()) -> WriteRaw a
$cwriteRaw :: Ptr SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> IO ()
writeRaw :: Ptr SDL_AudioStreamCallback -> SDL_AudioStreamCallback -> IO ()
Marshal.WriteRaw
    )

instance
  (ty ~ BG.FunPtr SDL_AudioStreamCallback_Aux)
  => BG.CompatHasField.HasField "unwrap" SDL_AudioStreamCallback ty
  where
  hasField :: SDL_AudioStreamCallback -> (ty -> SDL_AudioStreamCallback, ty)
hasField =
    \SDL_AudioStreamCallback
x0 ->
      ( \ty
y1 ->
          SDL_AudioStreamCallback{unwrap :: FunPtr SDL_AudioStreamCallback_Aux
unwrap = ty
FunPtr SDL_AudioStreamCallback_Aux
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_AudioStreamCallback
x0
      )

instance
  (ty ~ BG.FunPtr SDL_AudioStreamCallback_Aux)
  => BG.HasField "unwrap" (BG.Ptr SDL_AudioStreamCallback) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioStreamCallback -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_AudioStreamCallback
-> Ptr (CFieldType SDL_AudioStreamCallback "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_AudioStreamCallback "unwrap" where
  type
    CFieldType SDL_AudioStreamCallback "unwrap" =
      BG.FunPtr SDL_AudioStreamCallback_Aux

  offset# :: Proxy# SDL_AudioStreamCallback -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_AudioStreamCallback
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | Auxiliary type used by 'SDL_AudioPostmixCallback'
--
--     [C declaration]: @SDL_AudioPostmixCallback@, defined at @SDL3\/SDL_audio.h 2095:24@
newtype SDL_AudioPostmixCallback_Aux = SDL_AudioPostmixCallback_Aux
  { SDL_AudioPostmixCallback_Aux
-> Ptr Void
-> PtrConst SDL_AudioSpec
-> Ptr CFloat
-> CInt
-> IO ()
unwrap :: BG.Ptr BG.Void -> PtrConst.PtrConst SDL_AudioSpec -> BG.Ptr BG.CFloat -> BG.CInt -> IO ()
  }
  deriving stock ((forall x.
 SDL_AudioPostmixCallback_Aux -> Rep SDL_AudioPostmixCallback_Aux x)
-> (forall x.
    Rep SDL_AudioPostmixCallback_Aux x -> SDL_AudioPostmixCallback_Aux)
-> Generic SDL_AudioPostmixCallback_Aux
forall x.
Rep SDL_AudioPostmixCallback_Aux x -> SDL_AudioPostmixCallback_Aux
forall x.
SDL_AudioPostmixCallback_Aux -> Rep SDL_AudioPostmixCallback_Aux x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_AudioPostmixCallback_Aux -> Rep SDL_AudioPostmixCallback_Aux x
from :: forall x.
SDL_AudioPostmixCallback_Aux -> Rep SDL_AudioPostmixCallback_Aux x
$cto :: forall x.
Rep SDL_AudioPostmixCallback_Aux x -> SDL_AudioPostmixCallback_Aux
to :: forall x.
Rep SDL_AudioPostmixCallback_Aux x -> SDL_AudioPostmixCallback_Aux
BG.Generic)

-- __unique:__ @toSDL_AudioPostmixCallback_Aux@
foreign import ccall safe "wrapper"
  hs_bindgen_303b6f766f2a421d_base
    :: (BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.CInt -> IO ())
    -> IO (BG.FunPtr (BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.CInt -> IO ()))

-- __unique:__ @toSDL_AudioPostmixCallback_Aux@
hs_bindgen_303b6f766f2a421d
  :: SDL_AudioPostmixCallback_Aux
  -> IO (BG.FunPtr SDL_AudioPostmixCallback_Aux)
hs_bindgen_303b6f766f2a421d :: SDL_AudioPostmixCallback_Aux
-> IO (FunPtr SDL_AudioPostmixCallback_Aux)
hs_bindgen_303b6f766f2a421d =
  \SDL_AudioPostmixCallback_Aux
fun0 ->
    (FunPtr (Ptr Void -> Ptr Void -> Ptr Void -> CInt -> IO ())
 -> FunPtr SDL_AudioPostmixCallback_Aux)
-> IO (FunPtr (Ptr Void -> Ptr Void -> Ptr Void -> CInt -> IO ()))
-> IO (FunPtr SDL_AudioPostmixCallback_Aux)
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap
      FunPtr (Ptr Void -> Ptr Void -> Ptr Void -> CInt -> IO ())
-> FunPtr SDL_AudioPostmixCallback_Aux
forall a b. FunPtr a -> FunPtr b
BG.castFunPtr
      ( (Ptr Void -> Ptr Void -> Ptr Void -> CInt -> IO ())
-> IO (FunPtr (Ptr Void -> Ptr Void -> Ptr Void -> CInt -> IO ()))
hs_bindgen_303b6f766f2a421d_base
          ( \Ptr Void
x1 ->
              \Ptr Void
x2 ->
                \Ptr Void
x3 ->
                  \CInt
x4 ->
                    forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap"
                      SDL_AudioPostmixCallback_Aux
fun0
                      (FFIType (Ptr Void) -> Ptr Void
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType Ptr Void
FFIType (Ptr Void)
x1)
                      (FFIType (PtrConst SDL_AudioSpec) -> PtrConst SDL_AudioSpec
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType Ptr Void
FFIType (PtrConst SDL_AudioSpec)
x2)
                      (FFIType (Ptr CFloat) -> Ptr CFloat
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType Ptr Void
FFIType (Ptr CFloat)
x3)
                      (FFIType CInt -> CInt
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType CInt
FFIType CInt
x4)
          )
      )

-- __unique:__ @fromSDL_AudioPostmixCallback_Aux@
foreign import ccall safe "dynamic"
  hs_bindgen_148fa618325eaf19_base
    :: BG.FunPtr (BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.Ptr BG.Void -> BG.CInt -> IO ())
    -> BG.Ptr BG.Void
    -> BG.Ptr BG.Void
    -> BG.Ptr BG.Void
    -> BG.CInt
    -> IO ()

-- __unique:__ @fromSDL_AudioPostmixCallback_Aux@
hs_bindgen_148fa618325eaf19
  :: BG.FunPtr SDL_AudioPostmixCallback_Aux
  -> SDL_AudioPostmixCallback_Aux
hs_bindgen_148fa618325eaf19 :: FunPtr SDL_AudioPostmixCallback_Aux -> SDL_AudioPostmixCallback_Aux
hs_bindgen_148fa618325eaf19 =
  \FunPtr SDL_AudioPostmixCallback_Aux
funPtr0 ->
    (Ptr Void -> PtrConst SDL_AudioSpec -> Ptr CFloat -> CInt -> IO ())
-> SDL_AudioPostmixCallback_Aux
SDL_AudioPostmixCallback_Aux
      ( \Ptr Void
x1 ->
          \PtrConst SDL_AudioSpec
x2 ->
            \Ptr CFloat
x3 ->
              \CInt
x4 ->
                FunPtr (Ptr Void -> Ptr Void -> Ptr Void -> CInt -> IO ())
-> Ptr Void -> Ptr Void -> Ptr Void -> CInt -> IO ()
hs_bindgen_148fa618325eaf19_base
                  (FunPtr SDL_AudioPostmixCallback_Aux
-> FunPtr (Ptr Void -> Ptr Void -> Ptr Void -> CInt -> IO ())
forall a b. FunPtr a -> FunPtr b
BG.castFunPtr FunPtr SDL_AudioPostmixCallback_Aux
funPtr0)
                  (Ptr Void -> FFIType (Ptr Void)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Ptr Void
x1)
                  (PtrConst SDL_AudioSpec -> FFIType (PtrConst SDL_AudioSpec)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType PtrConst SDL_AudioSpec
x2)
                  (Ptr CFloat -> FFIType (Ptr CFloat)
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType Ptr CFloat
x3)
                  (CInt -> FFIType CInt
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType CInt
x4)
      )

instance BG.ToFunPtr SDL_AudioPostmixCallback_Aux where
  toFunPtr :: SDL_AudioPostmixCallback_Aux
-> IO (FunPtr SDL_AudioPostmixCallback_Aux)
toFunPtr = SDL_AudioPostmixCallback_Aux
-> IO (FunPtr SDL_AudioPostmixCallback_Aux)
hs_bindgen_303b6f766f2a421d

instance BG.FromFunPtr SDL_AudioPostmixCallback_Aux where
  fromFunPtr :: FunPtr SDL_AudioPostmixCallback_Aux -> SDL_AudioPostmixCallback_Aux
fromFunPtr = FunPtr SDL_AudioPostmixCallback_Aux -> SDL_AudioPostmixCallback_Aux
hs_bindgen_148fa618325eaf19

instance
  (ty ~ (BG.Ptr BG.Void -> PtrConst.PtrConst SDL_AudioSpec -> BG.Ptr BG.CFloat -> BG.CInt -> IO ()))
  => BG.CompatHasField.HasField "unwrap" SDL_AudioPostmixCallback_Aux ty
  where
  hasField :: SDL_AudioPostmixCallback_Aux
-> (ty -> SDL_AudioPostmixCallback_Aux, ty)
hasField =
    \SDL_AudioPostmixCallback_Aux
x0 ->
      ( \ty
y1 ->
          SDL_AudioPostmixCallback_Aux{unwrap :: Ptr Void -> PtrConst SDL_AudioSpec -> Ptr CFloat -> CInt -> IO ()
unwrap = ty
Ptr Void -> PtrConst SDL_AudioSpec -> Ptr CFloat -> CInt -> IO ()
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_AudioPostmixCallback_Aux
x0
      )

instance
  (ty ~ (BG.Ptr BG.Void -> PtrConst.PtrConst SDL_AudioSpec -> BG.Ptr BG.CFloat -> BG.CInt -> IO ()))
  => BG.HasField "unwrap" (BG.Ptr SDL_AudioPostmixCallback_Aux) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioPostmixCallback_Aux -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_AudioPostmixCallback_Aux
-> Ptr (CFieldType SDL_AudioPostmixCallback_Aux "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_AudioPostmixCallback_Aux "unwrap" where
  type
    CFieldType SDL_AudioPostmixCallback_Aux "unwrap" =
      BG.Ptr BG.Void -> PtrConst.PtrConst SDL_AudioSpec -> BG.Ptr BG.CFloat -> BG.CInt -> IO ()

  offset# :: Proxy# SDL_AudioPostmixCallback_Aux -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_AudioPostmixCallback_Aux
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | A callback that fires when data is about to be fed to an audio device.
--
--     This is useful for accessing the final mix, perhaps for writing a visualizer or applying a final effect to the audio data before playback.
--
--     This callback should run as quickly as possible and not block for any significant time, as this callback delays submission of data to the audio device, which can cause audio playback problems.
--
--     The postmix callback /must/ be able to handle any audio data format specified in @spec@, which can change between callbacks if the audio device changed. However, this only covers frequency and channel count; data is always provided here in SDL_AUDIO_F32 format.
--
--     The postmix callback runs /after/ logical device gain and audiostream gain have been applied, which is to say you can make the output data louder at this point than the gain settings would suggest.
--
--     [@userdata@]: a pointer provided by the app through SDL_SetAudioPostmixCallback, for its own use.
--
--     [@spec@]: the current format of audio that is to be submitted to the audio device.
--
--     [@buffer@]: the buffer of audio samples to be submitted. The callback can inspect and\/or modify this data.
--
--     [@buflen@]: the size of @buffer@ in bytes.
--
--     [Thread safety]: This will run from a background thread owned by SDL. The application is responsible for locking resources the callback touches that need to be protected.
--
--     @since 3.2.0
--
--     [See also]: 'sDL_SetAudioPostmixCallback'
--
--     [C declaration]: @SDL_AudioPostmixCallback@, defined at @SDL3\/SDL_audio.h 2095:24@
newtype SDL_AudioPostmixCallback = SDL_AudioPostmixCallback
  { SDL_AudioPostmixCallback -> FunPtr SDL_AudioPostmixCallback_Aux
unwrap :: BG.FunPtr SDL_AudioPostmixCallback_Aux
  }
  deriving stock ((forall x.
 SDL_AudioPostmixCallback -> Rep SDL_AudioPostmixCallback x)
-> (forall x.
    Rep SDL_AudioPostmixCallback x -> SDL_AudioPostmixCallback)
-> Generic SDL_AudioPostmixCallback
forall x.
Rep SDL_AudioPostmixCallback x -> SDL_AudioPostmixCallback
forall x.
SDL_AudioPostmixCallback -> Rep SDL_AudioPostmixCallback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_AudioPostmixCallback -> Rep SDL_AudioPostmixCallback x
from :: forall x.
SDL_AudioPostmixCallback -> Rep SDL_AudioPostmixCallback x
$cto :: forall x.
Rep SDL_AudioPostmixCallback x -> SDL_AudioPostmixCallback
to :: forall x.
Rep SDL_AudioPostmixCallback x -> SDL_AudioPostmixCallback
BG.Generic, SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
(SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool)
-> (SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool)
-> Eq SDL_AudioPostmixCallback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
== :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
$c/= :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
/= :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
Eq, Eq SDL_AudioPostmixCallback
Eq SDL_AudioPostmixCallback =>
(SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Ordering)
-> (SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool)
-> (SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool)
-> (SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool)
-> (SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool)
-> (SDL_AudioPostmixCallback
    -> SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback)
-> (SDL_AudioPostmixCallback
    -> SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback)
-> Ord SDL_AudioPostmixCallback
SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Ordering
SDL_AudioPostmixCallback
-> SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Ordering
compare :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Ordering
$c< :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
< :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
$c<= :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
<= :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
$c> :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
> :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
$c>= :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
>= :: SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> Bool
$cmax :: SDL_AudioPostmixCallback
-> SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback
max :: SDL_AudioPostmixCallback
-> SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback
$cmin :: SDL_AudioPostmixCallback
-> SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback
min :: SDL_AudioPostmixCallback
-> SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback
Ord, Int -> SDL_AudioPostmixCallback -> ShowS
[SDL_AudioPostmixCallback] -> ShowS
SDL_AudioPostmixCallback -> String
(Int -> SDL_AudioPostmixCallback -> ShowS)
-> (SDL_AudioPostmixCallback -> String)
-> ([SDL_AudioPostmixCallback] -> ShowS)
-> Show SDL_AudioPostmixCallback
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_AudioPostmixCallback -> ShowS
showsPrec :: Int -> SDL_AudioPostmixCallback -> ShowS
$cshow :: SDL_AudioPostmixCallback -> String
show :: SDL_AudioPostmixCallback -> String
$cshowList :: [SDL_AudioPostmixCallback] -> ShowS
showList :: [SDL_AudioPostmixCallback] -> ShowS
Show)
  deriving newtype
    ( FFIType SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback
SDL_AudioPostmixCallback -> FFIType SDL_AudioPostmixCallback
(SDL_AudioPostmixCallback -> FFIType SDL_AudioPostmixCallback)
-> (FFIType SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback)
-> HasFFIType SDL_AudioPostmixCallback
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_AudioPostmixCallback -> FFIType SDL_AudioPostmixCallback
toFFIType :: SDL_AudioPostmixCallback -> FFIType SDL_AudioPostmixCallback
$cfromFFIType :: FFIType SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback
fromFFIType :: FFIType SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback
BG.HasFFIType
    , Ptr SDL_AudioPostmixCallback -> IO SDL_AudioPostmixCallback
Ptr SDL_AudioPostmixCallback -> Int -> IO SDL_AudioPostmixCallback
Ptr SDL_AudioPostmixCallback
-> Int -> SDL_AudioPostmixCallback -> IO ()
Ptr SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> IO ()
SDL_AudioPostmixCallback -> Int
(SDL_AudioPostmixCallback -> Int)
-> (SDL_AudioPostmixCallback -> Int)
-> (Ptr SDL_AudioPostmixCallback
    -> Int -> IO SDL_AudioPostmixCallback)
-> (Ptr SDL_AudioPostmixCallback
    -> Int -> SDL_AudioPostmixCallback -> IO ())
-> (forall b. Ptr b -> Int -> IO SDL_AudioPostmixCallback)
-> (forall b. Ptr b -> Int -> SDL_AudioPostmixCallback -> IO ())
-> (Ptr SDL_AudioPostmixCallback -> IO SDL_AudioPostmixCallback)
-> (Ptr SDL_AudioPostmixCallback
    -> SDL_AudioPostmixCallback -> IO ())
-> Storable SDL_AudioPostmixCallback
forall b. Ptr b -> Int -> IO SDL_AudioPostmixCallback
forall b. Ptr b -> Int -> SDL_AudioPostmixCallback -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: SDL_AudioPostmixCallback -> Int
sizeOf :: SDL_AudioPostmixCallback -> Int
$calignment :: SDL_AudioPostmixCallback -> Int
alignment :: SDL_AudioPostmixCallback -> Int
$cpeekElemOff :: Ptr SDL_AudioPostmixCallback -> Int -> IO SDL_AudioPostmixCallback
peekElemOff :: Ptr SDL_AudioPostmixCallback -> Int -> IO SDL_AudioPostmixCallback
$cpokeElemOff :: Ptr SDL_AudioPostmixCallback
-> Int -> SDL_AudioPostmixCallback -> IO ()
pokeElemOff :: Ptr SDL_AudioPostmixCallback
-> Int -> SDL_AudioPostmixCallback -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO SDL_AudioPostmixCallback
peekByteOff :: forall b. Ptr b -> Int -> IO SDL_AudioPostmixCallback
$cpokeByteOff :: forall b. Ptr b -> Int -> SDL_AudioPostmixCallback -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> SDL_AudioPostmixCallback -> IO ()
$cpeek :: Ptr SDL_AudioPostmixCallback -> IO SDL_AudioPostmixCallback
peek :: Ptr SDL_AudioPostmixCallback -> IO SDL_AudioPostmixCallback
$cpoke :: Ptr SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> IO ()
poke :: Ptr SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> IO ()
BG.Storable
    , Ptr SDL_AudioPostmixCallback -> IO SDL_AudioPostmixCallback
(Ptr SDL_AudioPostmixCallback -> IO SDL_AudioPostmixCallback)
-> ReadRaw SDL_AudioPostmixCallback
forall a. (Ptr a -> IO a) -> ReadRaw a
$creadRaw :: Ptr SDL_AudioPostmixCallback -> IO SDL_AudioPostmixCallback
readRaw :: Ptr SDL_AudioPostmixCallback -> IO SDL_AudioPostmixCallback
Marshal.ReadRaw
    , Proxy SDL_AudioPostmixCallback -> Int
(Proxy SDL_AudioPostmixCallback -> Int)
-> (Proxy SDL_AudioPostmixCallback -> Int)
-> StaticSize SDL_AudioPostmixCallback
forall a. (Proxy a -> Int) -> (Proxy a -> Int) -> StaticSize a
$cstaticSizeOf :: Proxy SDL_AudioPostmixCallback -> Int
staticSizeOf :: Proxy SDL_AudioPostmixCallback -> Int
$cstaticAlignment :: Proxy SDL_AudioPostmixCallback -> Int
staticAlignment :: Proxy SDL_AudioPostmixCallback -> Int
Marshal.StaticSize
    , Ptr SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> IO ()
(Ptr SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> IO ())
-> WriteRaw SDL_AudioPostmixCallback
forall a. (Ptr a -> a -> IO ()) -> WriteRaw a
$cwriteRaw :: Ptr SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> IO ()
writeRaw :: Ptr SDL_AudioPostmixCallback -> SDL_AudioPostmixCallback -> IO ()
Marshal.WriteRaw
    )

instance
  (ty ~ BG.FunPtr SDL_AudioPostmixCallback_Aux)
  => BG.CompatHasField.HasField "unwrap" SDL_AudioPostmixCallback ty
  where
  hasField :: SDL_AudioPostmixCallback -> (ty -> SDL_AudioPostmixCallback, ty)
hasField =
    \SDL_AudioPostmixCallback
x0 ->
      ( \ty
y1 ->
          SDL_AudioPostmixCallback{unwrap :: FunPtr SDL_AudioPostmixCallback_Aux
unwrap = ty
FunPtr SDL_AudioPostmixCallback_Aux
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_AudioPostmixCallback
x0
      )

instance
  (ty ~ BG.FunPtr SDL_AudioPostmixCallback_Aux)
  => BG.HasField "unwrap" (BG.Ptr SDL_AudioPostmixCallback) (BG.Ptr ty)
  where
  getField :: Ptr SDL_AudioPostmixCallback -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_AudioPostmixCallback
-> Ptr (CFieldType SDL_AudioPostmixCallback "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_AudioPostmixCallback "unwrap" where
  type
    CFieldType SDL_AudioPostmixCallback "unwrap" =
      BG.FunPtr SDL_AudioPostmixCallback_Aux

  offset# :: Proxy# SDL_AudioPostmixCallback -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_AudioPostmixCallback
_ -> \Proxy# "unwrap"
_ -> Int
0