mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-20 22:35:41 +00:00
Audio types have the same naming convention as other SDL endian types, e.g. [S|U][BITS][LE|BE]
Native endian types have no LE/BE suffix
This commit is contained in:
@@ -80,15 +80,17 @@ typedef Uint16 SDL_AudioFormat;
|
||||
/* @{ */
|
||||
|
||||
#define SDL_AUDIO_MASK_BITSIZE (0xFF)
|
||||
#define SDL_AUDIO_MASK_DATATYPE (1<<8)
|
||||
#define SDL_AUDIO_MASK_ENDIAN (1<<12)
|
||||
#define SDL_AUDIO_MASK_FLOAT (1<<8)
|
||||
#define SDL_AUDIO_MASK_LIL_ENDIAN (1<<12)
|
||||
#define SDL_AUDIO_MASK_BIG_ENDIAN (1<<13)
|
||||
#define SDL_AUDIO_MASK_ENDIAN (SDL_AUDIO_MASK_BIG_ENDIAN|SDL_AUDIO_MASK_LIL_ENDIAN)
|
||||
#define SDL_AUDIO_MASK_SIGNED (1<<15)
|
||||
#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE)
|
||||
#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE)
|
||||
#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN)
|
||||
#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED)
|
||||
#define SDL_AUDIO_BITSIZE(x) ((x) & SDL_AUDIO_MASK_BITSIZE)
|
||||
#define SDL_AUDIO_ISFLOAT(x) ((x) & SDL_AUDIO_MASK_FLOAT)
|
||||
#define SDL_AUDIO_ISBIGENDIAN(x) (((x) & SDL_AUDIO_MASK_ENDIAN) == SDL_AUDIO_MASK_BIG_ENDIAN)
|
||||
#define SDL_AUDIO_ISLITTLEENDIAN(x) (((x) & SDL_AUDIO_MASK_ENDIAN) == SDL_AUDIO_MASK_LIL_ENDIAN)
|
||||
#define SDL_AUDIO_ISSIGNED(x) ((x) & SDL_AUDIO_MASK_SIGNED)
|
||||
#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x))
|
||||
#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x))
|
||||
#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x))
|
||||
|
||||
/**
|
||||
@@ -99,27 +101,24 @@ typedef Uint16 SDL_AudioFormat;
|
||||
/* @{ */
|
||||
#define SDL_AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */
|
||||
#define SDL_AUDIO_S8 0x8008 /**< Signed 8-bit samples */
|
||||
#define SDL_AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */
|
||||
#define SDL_AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */
|
||||
#define SDL_AUDIO_S16 SDL_AUDIO_S16LSB
|
||||
#define SDL_AUDIO_S16LE 0x9010 /**< Signed 16-bit samples */
|
||||
#define SDL_AUDIO_S16BE 0xA010 /**< As above, but big-endian byte order */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* \name int32 support
|
||||
*/
|
||||
/* @{ */
|
||||
#define SDL_AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */
|
||||
#define SDL_AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */
|
||||
#define SDL_AUDIO_S32 SDL_AUDIO_S32LSB
|
||||
#define SDL_AUDIO_S32LE 0x9020 /**< 32-bit integer samples */
|
||||
#define SDL_AUDIO_S32BE 0xA020 /**< As above, but big-endian byte order */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* \name float32 support
|
||||
*/
|
||||
/* @{ */
|
||||
#define SDL_AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */
|
||||
#define SDL_AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */
|
||||
#define SDL_AUDIO_F32 SDL_AUDIO_F32LSB
|
||||
#define SDL_AUDIO_F32LE 0x9120 /**< 32-bit floating point samples */
|
||||
#define SDL_AUDIO_F32BE 0xA120 /**< As above, but big-endian byte order */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
@@ -127,13 +126,13 @@ typedef Uint16 SDL_AudioFormat;
|
||||
*/
|
||||
/* @{ */
|
||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||
#define SDL_AUDIO_S16SYS SDL_AUDIO_S16LSB
|
||||
#define SDL_AUDIO_S32SYS SDL_AUDIO_S32LSB
|
||||
#define SDL_AUDIO_F32SYS SDL_AUDIO_F32LSB
|
||||
#define SDL_AUDIO_S16 SDL_AUDIO_S16LE
|
||||
#define SDL_AUDIO_S32 SDL_AUDIO_S32LE
|
||||
#define SDL_AUDIO_F32 SDL_AUDIO_F32LE
|
||||
#else
|
||||
#define SDL_AUDIO_S16SYS SDL_AUDIO_S16MSB
|
||||
#define SDL_AUDIO_S32SYS SDL_AUDIO_S32MSB
|
||||
#define SDL_AUDIO_F32SYS SDL_AUDIO_F32MSB
|
||||
#define SDL_AUDIO_S16 SDL_AUDIO_S16BE
|
||||
#define SDL_AUDIO_S32 SDL_AUDIO_S32BE
|
||||
#define SDL_AUDIO_F32 SDL_AUDIO_F32BE
|
||||
#endif
|
||||
/* @} */
|
||||
|
||||
|
||||
@@ -43,18 +43,18 @@
|
||||
#define SDL_atomic_t SDL_AtomicInt
|
||||
|
||||
/* ##SDL_audio.h */
|
||||
#define AUDIO_F32 SDL_AUDIO_F32
|
||||
#define AUDIO_F32LSB SDL_AUDIO_F32LSB
|
||||
#define AUDIO_F32MSB SDL_AUDIO_F32MSB
|
||||
#define AUDIO_F32SYS SDL_AUDIO_F32SYS
|
||||
#define AUDIO_S16 SDL_AUDIO_S16
|
||||
#define AUDIO_S16LSB SDL_AUDIO_S16LSB
|
||||
#define AUDIO_S16MSB SDL_AUDIO_S16MSB
|
||||
#define AUDIO_S16SYS SDL_AUDIO_S16SYS
|
||||
#define AUDIO_S32 SDL_AUDIO_S32
|
||||
#define AUDIO_S32LSB SDL_AUDIO_S32LSB
|
||||
#define AUDIO_S32MSB SDL_AUDIO_S32MSB
|
||||
#define AUDIO_S32SYS SDL_AUDIO_S32SYS
|
||||
#define AUDIO_F32 SDL_AUDIO_F32LE
|
||||
#define AUDIO_F32LSB SDL_AUDIO_F32LE
|
||||
#define AUDIO_F32MSB SDL_AUDIO_F32BE
|
||||
#define AUDIO_F32SYS SDL_AUDIO_F32
|
||||
#define AUDIO_S16 SDL_AUDIO_S16LE
|
||||
#define AUDIO_S16LSB SDL_AUDIO_S16LE
|
||||
#define AUDIO_S16MSB SDL_AUDIO_S16BE
|
||||
#define AUDIO_S16SYS SDL_AUDIO_S16
|
||||
#define AUDIO_S32 SDL_AUDIO_S32LE
|
||||
#define AUDIO_S32LSB SDL_AUDIO_S32LE
|
||||
#define AUDIO_S32MSB SDL_AUDIO_S32BE
|
||||
#define AUDIO_S32SYS SDL_AUDIO_S32
|
||||
#define AUDIO_S8 SDL_AUDIO_S8
|
||||
#define AUDIO_U8 SDL_AUDIO_U8
|
||||
#define SDL_AudioStreamAvailable SDL_GetAudioStreamAvailable
|
||||
@@ -494,18 +494,18 @@
|
||||
#elif !defined(SDL_DISABLE_OLD_NAMES)
|
||||
|
||||
/* ##SDL_audio.h */
|
||||
#define AUDIO_F32 AUDIO_F32_renamed_SDL_AUDIO_F32
|
||||
#define AUDIO_F32LSB AUDIO_F32LSB_renamed_SDL_AUDIO_F32LSB
|
||||
#define AUDIO_F32MSB AUDIO_F32MSB_renamed_SDL_AUDIO_F32MSB
|
||||
#define AUDIO_F32SYS AUDIO_F32SYS_renamed_SDL_AUDIO_F32SYS
|
||||
#define AUDIO_S16 AUDIO_S16_renamed_SDL_AUDIO_S16
|
||||
#define AUDIO_S16LSB AUDIO_S16LSB_renamed_SDL_AUDIO_S16LSB
|
||||
#define AUDIO_S16MSB AUDIO_S16MSB_renamed_SDL_AUDIO_S16MSB
|
||||
#define AUDIO_S16SYS AUDIO_S16SYS_renamed_SDL_AUDIO_S16SYS
|
||||
#define AUDIO_S32 AUDIO_S32_renamed_SDL_AUDIO_S32
|
||||
#define AUDIO_S32LSB AUDIO_S32LSB_renamed_SDL_AUDIO_S32LSB
|
||||
#define AUDIO_S32MSB AUDIO_S32MSB_renamed_SDL_AUDIO_S32MSB
|
||||
#define AUDIO_S32SYS AUDIO_S32SYS_renamed_SDL_AUDIO_S32SYS
|
||||
#define AUDIO_F32 AUDIO_F32_renamed_SDL_AUDIO_F32LE
|
||||
#define AUDIO_F32LSB AUDIO_F32LSB_renamed_SDL_AUDIO_F32LE
|
||||
#define AUDIO_F32MSB AUDIO_F32MSB_renamed_SDL_AUDIO_F32BE
|
||||
#define AUDIO_F32SYS AUDIO_F32SYS_renamed_SDL_AUDIO_F32
|
||||
#define AUDIO_S16 AUDIO_S16_renamed_SDL_AUDIO_S16LE
|
||||
#define AUDIO_S16LSB AUDIO_S16LSB_renamed_SDL_AUDIO_S16LE
|
||||
#define AUDIO_S16MSB AUDIO_S16MSB_renamed_SDL_AUDIO_S16BE
|
||||
#define AUDIO_S16SYS AUDIO_S16SYS_renamed_SDL_AUDIO_S16
|
||||
#define AUDIO_S32 AUDIO_S32_renamed_SDL_AUDIO_S32LE
|
||||
#define AUDIO_S32LSB AUDIO_S32LSB_renamed_SDL_AUDIO_S32LE
|
||||
#define AUDIO_S32MSB AUDIO_S32MSB_renamed_SDL_AUDIO_S32BE
|
||||
#define AUDIO_S32SYS AUDIO_S32SYS_renamed_SDL_AUDIO_S32
|
||||
#define AUDIO_S8 AUDIO_S8_renamed_SDL_AUDIO_S8
|
||||
#define AUDIO_U8 AUDIO_U8_renamed_SDL_AUDIO_U8
|
||||
#define SDL_AudioStreamAvailable SDL_AudioStreamAvailable_renamed_SDL_GetAudioStreamAvailable
|
||||
|
||||
Reference in New Issue
Block a user