use sdl3_sys::everything::*;
pub const SDL_SOUND_MAJOR_VERSION: ::core::primitive::i32 = 3;
pub const SDL_SOUND_MINOR_VERSION: ::core::primitive::i32 = 2;
pub const SDL_SOUND_MICRO_VERSION: ::core::primitive::i32 = 0;
pub const SDL_SOUND_VERSION: ::core::primitive::i32 = SDL_VERSIONNUM(
SDL_SOUND_MAJOR_VERSION,
SDL_SOUND_MINOR_VERSION,
SDL_SOUND_MICRO_VERSION,
);
#[inline(always)]
pub const fn SDL_SOUND_VERSION_ATLEAST(
X: ::core::primitive::i32,
Y: ::core::primitive::i32,
Z: ::core::primitive::i32,
) -> ::core::primitive::bool {
(((SDL_SOUND_MAJOR_VERSION >= X)
&& ((SDL_SOUND_MAJOR_VERSION > X) || (SDL_SOUND_MINOR_VERSION >= Y)))
&& (((SDL_SOUND_MAJOR_VERSION > X) || (SDL_SOUND_MINOR_VERSION > Y))
|| (SDL_SOUND_MICRO_VERSION >= Z)))
}
unsafe extern "C" {
pub fn Sound_Version() -> ::core::ffi::c_int;
}
#[repr(transparent)]
#[derive(Clone, Copy, Default, PartialEq, Eq, Hash)]
pub struct Sound_SampleFlags(pub ::core::primitive::u32);
impl ::core::cmp::PartialEq<::core::primitive::u32> for Sound_SampleFlags {
#[inline(always)]
fn eq(&self, other: &::core::primitive::u32) -> bool {
&self.0 == other
}
}
impl ::core::cmp::PartialEq<Sound_SampleFlags> for ::core::primitive::u32 {
#[inline(always)]
fn eq(&self, other: &Sound_SampleFlags) -> bool {
self == &other.0
}
}
impl From<Sound_SampleFlags> for ::core::primitive::u32 {
#[inline(always)]
fn from(value: Sound_SampleFlags) -> Self {
value.0
}
}
#[cfg(feature = "debug-impls")]
impl ::core::fmt::Debug for Sound_SampleFlags {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
let mut first = true;
let all_bits = 0;
write!(f, "Sound_SampleFlags(")?;
let all_bits = all_bits | Self::NONE.0;
if (Self::NONE != 0 || self.0 == 0) && *self & Self::NONE == Self::NONE {
if !first {
write!(f, " | ")?;
}
first = false;
write!(f, "NONE")?;
}
let all_bits = all_bits | Self::CANSEEK.0;
if (Self::CANSEEK != 0 || self.0 == 0) && *self & Self::CANSEEK == Self::CANSEEK {
if !first {
write!(f, " | ")?;
}
first = false;
write!(f, "CANSEEK")?;
}
let all_bits = all_bits | Self::EOF.0;
if (Self::EOF != 0 || self.0 == 0) && *self & Self::EOF == Self::EOF {
if !first {
write!(f, " | ")?;
}
first = false;
write!(f, "EOF")?;
}
let all_bits = all_bits | Self::ERROR.0;
if (Self::ERROR != 0 || self.0 == 0) && *self & Self::ERROR == Self::ERROR {
if !first {
write!(f, " | ")?;
}
first = false;
write!(f, "ERROR")?;
}
let all_bits = all_bits | Self::EAGAIN.0;
if (Self::EAGAIN != 0 || self.0 == 0) && *self & Self::EAGAIN == Self::EAGAIN {
if !first {
write!(f, " | ")?;
}
first = false;
write!(f, "EAGAIN")?;
}
if self.0 & !all_bits != 0 {
if !first {
write!(f, " | ")?;
}
write!(f, "{:#x}", self.0)?;
} else if first {
write!(f, "0")?;
}
write!(f, ")")
}
}
impl ::core::ops::BitAnd for Sound_SampleFlags {
type Output = Self;
#[inline(always)]
fn bitand(self, rhs: Self) -> Self::Output {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitAndAssign for Sound_SampleFlags {
#[inline(always)]
fn bitand_assign(&mut self, rhs: Self) {
self.0 &= rhs.0;
}
}
impl ::core::ops::BitOr for Sound_SampleFlags {
type Output = Self;
#[inline(always)]
fn bitor(self, rhs: Self) -> Self::Output {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitOrAssign for Sound_SampleFlags {
#[inline(always)]
fn bitor_assign(&mut self, rhs: Self) {
self.0 |= rhs.0;
}
}
impl ::core::ops::BitXor for Sound_SampleFlags {
type Output = Self;
#[inline(always)]
fn bitxor(self, rhs: Self) -> Self::Output {
Self(self.0 ^ rhs.0)
}
}
impl ::core::ops::BitXorAssign for Sound_SampleFlags {
#[inline(always)]
fn bitxor_assign(&mut self, rhs: Self) {
self.0 ^= rhs.0;
}
}
impl ::core::ops::Not for Sound_SampleFlags {
type Output = Self;
#[inline(always)]
fn not(self) -> Self::Output {
Self(!self.0)
}
}
impl Sound_SampleFlags {
pub const NONE: Self = Self((0 as ::core::primitive::u32));
pub const CANSEEK: Self = Self((1 as ::core::primitive::u32));
pub const EOF: Self = Self((536870912_i32 as ::core::primitive::u32));
pub const ERROR: Self = Self((1073741824_i32 as ::core::primitive::u32));
pub const EAGAIN: Self = Self((-2147483648_i32 as ::core::primitive::u32));
}
pub const SOUND_SAMPLEFLAG_NONE: Sound_SampleFlags = Sound_SampleFlags::NONE;
pub const SOUND_SAMPLEFLAG_CANSEEK: Sound_SampleFlags = Sound_SampleFlags::CANSEEK;
pub const SOUND_SAMPLEFLAG_EOF: Sound_SampleFlags = Sound_SampleFlags::EOF;
pub const SOUND_SAMPLEFLAG_ERROR: Sound_SampleFlags = Sound_SampleFlags::ERROR;
pub const SOUND_SAMPLEFLAG_EAGAIN: Sound_SampleFlags = Sound_SampleFlags::EAGAIN;
impl Sound_SampleFlags {
#[inline(always)]
pub const fn new(value: ::core::primitive::u32) -> Self {
Self(value)
}
}
impl Sound_SampleFlags {
#[inline(always)]
pub const fn value(&self) -> ::core::primitive::u32 {
self.0
}
}
#[cfg(feature = "metadata")]
impl sdl3_sys::metadata::GroupMetadata for Sound_SampleFlags {
const GROUP_METADATA: &'static sdl3_sys::metadata::Group =
&crate::metadata::sound::METADATA_Sound_SampleFlags;
}
#[repr(C)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
pub struct Sound_DecoderInfo {
pub extensions: *mut *const ::core::ffi::c_char,
pub description: *const ::core::ffi::c_char,
pub author: *const ::core::ffi::c_char,
pub url: *const ::core::ffi::c_char,
}
impl ::core::default::Default for Sound_DecoderInfo {
#[inline(always)]
fn default() -> Self {
unsafe { ::core::mem::MaybeUninit::<Self>::zeroed().assume_init() }
}
}
#[repr(C)]
#[cfg_attr(feature = "debug-impls", derive(Debug))]
pub struct Sound_Sample {
pub opaque: *mut ::core::ffi::c_void,
pub decoder: *const Sound_DecoderInfo,
pub desired: SDL_AudioSpec,
pub actual: SDL_AudioSpec,
pub buffer: *mut ::core::ffi::c_void,
pub buffer_size: Uint32,
pub flags: Sound_SampleFlags,
}
impl ::core::default::Default for Sound_Sample {
#[inline(always)]
fn default() -> Self {
unsafe { ::core::mem::MaybeUninit::<Self>::zeroed().assume_init() }
}
}
unsafe extern "C" {
pub fn Sound_Init() -> ::core::ffi::c_int;
}
unsafe extern "C" {
pub fn Sound_Quit() -> ::core::ffi::c_int;
}
unsafe extern "C" {
pub fn Sound_AvailableDecoders() -> *mut *const Sound_DecoderInfo;
}
unsafe extern "C" {
pub fn Sound_GetError() -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
pub fn Sound_ClearError();
}
unsafe extern "C" {
pub fn Sound_NewSample(
io: *mut SDL_IOStream,
ext: *const ::core::ffi::c_char,
desired: *const SDL_AudioSpec,
bufferSize: Uint32,
) -> *mut Sound_Sample;
}
unsafe extern "C" {
pub fn Sound_NewSampleFromMem(
data: *const Uint8,
size: Uint32,
ext: *const ::core::ffi::c_char,
desired: *const SDL_AudioSpec,
bufferSize: Uint32,
) -> *mut Sound_Sample;
}
unsafe extern "C" {
pub fn Sound_NewSampleFromFile(
filename: *const ::core::ffi::c_char,
desired: *const SDL_AudioSpec,
bufferSize: Uint32,
) -> *mut Sound_Sample;
}
unsafe extern "C" {
pub fn Sound_FreeSample(sample: *mut Sound_Sample);
}
unsafe extern "C" {
pub fn Sound_GetDuration(sample: *mut Sound_Sample) -> Sint32;
}
unsafe extern "C" {
pub fn Sound_SetBufferSize(sample: *mut Sound_Sample, new_size: Uint32) -> ::core::ffi::c_int;
}
unsafe extern "C" {
pub fn Sound_SetDesiredFormat(
sample: *mut Sound_Sample,
desired: *const SDL_AudioSpec,
) -> ::core::ffi::c_int;
}
unsafe extern "C" {
pub fn Sound_Decode(sample: *mut Sound_Sample) -> Uint32;
}
unsafe extern "C" {
pub fn Sound_DecodeAll(sample: *mut Sound_Sample) -> Uint32;
}
unsafe extern "C" {
pub fn Sound_Rewind(sample: *mut Sound_Sample) -> ::core::ffi::c_int;
}
unsafe extern "C" {
pub fn Sound_Seek(sample: *mut Sound_Sample, ms: Uint32) -> ::core::ffi::c_int;
}
#[cfg(doc)]
use crate::everything::*;