From 6d367145ed7c04751825c487f2290487fa5ffedf Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 3 Aug 2025 00:03:07 +0900 Subject: [PATCH 1/3] Update bindings --- External/SDL | 2 +- External/SDL_image | 2 +- External/SDL_mixer | 2 +- External/SDL_ttf | 2 +- SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs | 4 - SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs | 6 + SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs | 3 + SDL3-CS/SDL3/ClangSharp/SDL_tray.g.cs | 4 + .../SDL3_image/ClangSharp/SDL_image.g.cs | 59 ++ .../SDL3_mixer/ClangSharp/SDL_mixer.g.cs | 574 +++++++++--------- 10 files changed, 374 insertions(+), 284 deletions(-) diff --git a/External/SDL b/External/SDL index 9ed83e7..ae5ce25 160000 --- a/External/SDL +++ b/External/SDL @@ -1 +1 @@ -Subproject commit 9ed83e71f6cc445316e1b599aad98fa79019544d +Subproject commit ae5ce258cf4fdcfdd8533b22adc16f139e8f72a8 diff --git a/External/SDL_image b/External/SDL_image index 925c19d..dce0d25 160000 --- a/External/SDL_image +++ b/External/SDL_image @@ -1 +1 @@ -Subproject commit 925c19db4d0bc9809fd3ac25c7e0ef771b668390 +Subproject commit dce0d252ed2cb6d74a53a2fb9642891c30e58653 diff --git a/External/SDL_mixer b/External/SDL_mixer index 30c1301..60e2959 160000 --- a/External/SDL_mixer +++ b/External/SDL_mixer @@ -1 +1 @@ -Subproject commit 30c1301055a35ee87b8679279b6fc88e10d28fa3 +Subproject commit 60e2959e7310f8821757a03dee155d8d7716994b diff --git a/External/SDL_ttf b/External/SDL_ttf index ffa54ca..a9b5a19 160000 --- a/External/SDL_ttf +++ b/External/SDL_ttf @@ -1 +1 @@ -Subproject commit ffa54ca2ec6b89b4f6dc92ab113484cfa2ccc3a7 +Subproject commit a9b5a19b83f89376be52c99a9f654c314d99761b diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs index 047d876..3585c4f 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_audio.g.cs @@ -239,10 +239,6 @@ namespace SDL [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_AudioStream* SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("bool")] - public static extern SDLBool SDL_SetAudioIterationCallbacks(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioIterationCallback")] delegate* unmanaged[Cdecl] start, [NativeTypeName("SDL_AudioIterationCallback")] delegate* unmanaged[Cdecl] end, [NativeTypeName("void*")] IntPtr userdata); - [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl] callback, [NativeTypeName("void*")] IntPtr userdata); diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs index 8029c6e..972bc03 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_hints.g.cs @@ -352,6 +352,9 @@ namespace SDL [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_8BITDO \"SDL_JOYSTICK_HIDAPI_8BITDO\"")] public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_8BITDO => "SDL_JOYSTICK_HIDAPI_8BITDO"u8; + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_SINPUT \"SDL_JOYSTICK_HIDAPI_SINPUT\"")] + public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_SINPUT => "SDL_JOYSTICK_HIDAPI_SINPUT"u8; + [NativeTypeName("#define SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI \"SDL_JOYSTICK_HIDAPI_FLYDIGI\"")] public static ReadOnlySpan SDL_HINT_JOYSTICK_HIDAPI_FLYDIGI => "SDL_JOYSTICK_HIDAPI_FLYDIGI"u8; @@ -798,5 +801,8 @@ namespace SDL [NativeTypeName("#define SDL_HINT_PEN_TOUCH_EVENTS \"SDL_PEN_TOUCH_EVENTS\"")] public static ReadOnlySpan SDL_HINT_PEN_TOUCH_EVENTS => "SDL_PEN_TOUCH_EVENTS"u8; + + [NativeTypeName("#define SDL_HINT_DEBUG_LOGGING \"SDL_DEBUG_LOGGING\"")] + public static ReadOnlySpan SDL_HINT_DEBUG_LOGGING => "SDL_DEBUG_LOGGING"u8; } } diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs index 7db435a..cdcf842 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_iostream.g.cs @@ -278,6 +278,9 @@ namespace SDL [NativeTypeName("#define SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER \"SDL.iostream.memory.size\"")] public static ReadOnlySpan SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER => "SDL.iostream.memory.size"u8; + [NativeTypeName("#define SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC_POINTER \"SDL.iostream.memory.free\"")] + public static ReadOnlySpan SDL_PROP_IOSTREAM_MEMORY_FREE_FUNC_POINTER => "SDL.iostream.memory.free"u8; + [NativeTypeName("#define SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER \"SDL.iostream.dynamic.memory\"")] public static ReadOnlySpan SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER => "SDL.iostream.dynamic.memory"u8; diff --git a/SDL3-CS/SDL3/ClangSharp/SDL_tray.g.cs b/SDL3-CS/SDL3/ClangSharp/SDL_tray.g.cs index d6017d5..e15e729 100644 --- a/SDL3-CS/SDL3/ClangSharp/SDL_tray.g.cs +++ b/SDL3-CS/SDL3/ClangSharp/SDL_tray.g.cs @@ -42,6 +42,10 @@ namespace SDL public static unsafe partial class SDL3 { + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool SDL_IsTraySupported(); + [DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern SDL_Tray* SDL_CreateTray(SDL_Surface* icon, [NativeTypeName("const char *")] byte* tooltip); diff --git a/SDL3_image-CS/SDL3_image/ClangSharp/SDL_image.g.cs b/SDL3_image-CS/SDL3_image/ClangSharp/SDL_image.g.cs index eb39383..8f33457 100644 --- a/SDL3_image-CS/SDL3_image/ClangSharp/SDL_image.g.cs +++ b/SDL3_image-CS/SDL3_image/ClangSharp/SDL_image.g.cs @@ -23,6 +23,7 @@ 3. This notice may not be removed or altered from any source distribution. */ +using System; using System.Runtime.InteropServices; namespace SDL @@ -40,6 +41,10 @@ namespace SDL public int* delays; } + public partial struct IMG_AnimationStream + { + } + public static unsafe partial class SDL3_image { [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] @@ -225,6 +230,22 @@ namespace SDL [return: NativeTypeName("bool")] public static extern SDLBool IMG_SaveJPG_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, int quality); + [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool IMG_SaveWEBP_IO(SDL_Surface* surface, SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, float quality); + + [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool IMG_SaveWEBP(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file, float quality); + + [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool IMG_SaveTGA_IO(SDL_Surface* surface, SDL_IOStream* dst); + + [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool IMG_SaveTGA(SDL_Surface* surface, [NativeTypeName("const char *")] byte* file); + [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern IMG_Animation* IMG_LoadAnimation([NativeTypeName("const char *")] byte* file); @@ -243,6 +264,23 @@ namespace SDL [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern IMG_Animation* IMG_LoadWEBPAnimation_IO(SDL_IOStream* src); + [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern IMG_AnimationStream* IMG_CreateAnimationStream([NativeTypeName("const char *")] byte* file); + + [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern IMG_AnimationStream* IMG_CreateAnimationStream_IO(SDL_IOStream* dst, [NativeTypeName("bool")] SDLBool closeio, [NativeTypeName("const char *")] byte* type); + + [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern IMG_AnimationStream* IMG_CreateAnimationStreamWithProperties(SDL_PropertiesID props); + + [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool IMG_AddAnimationFrame(IMG_AnimationStream* stream, SDL_Surface* surface, [NativeTypeName("Uint64")] ulong pts); + + [DllImport("SDL3_image", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool IMG_CloseAnimationStream(IMG_AnimationStream* stream); + [NativeTypeName("#define SDL_IMAGE_MAJOR_VERSION 3")] public const int SDL_IMAGE_MAJOR_VERSION = 3; @@ -254,5 +292,26 @@ namespace SDL [NativeTypeName("#define SDL_IMAGE_VERSION SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_MICRO_VERSION)")] public const int SDL_IMAGE_VERSION = ((3) * 1000000 + (3) * 1000 + (0)); + + [NativeTypeName("#define IMG_PROP_ANIMATION_STREAM_CREATE_FILENAME_STRING \"SDL_image.animation_stream.create.filename\"")] + public static ReadOnlySpan IMG_PROP_ANIMATION_STREAM_CREATE_FILENAME_STRING => "SDL_image.animation_stream.create.filename"u8; + + [NativeTypeName("#define IMG_PROP_ANIMATION_STREAM_CREATE_IOSTREAM_POINTER \"SDL_image.animation_stream.create.iostream\"")] + public static ReadOnlySpan IMG_PROP_ANIMATION_STREAM_CREATE_IOSTREAM_POINTER => "SDL_image.animation_stream.create.iostream"u8; + + [NativeTypeName("#define IMG_PROP_ANIMATION_STREAM_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN \"SDL_image.animation_stream.create.iostream.autoclose\"")] + public static ReadOnlySpan IMG_PROP_ANIMATION_STREAM_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN => "SDL_image.animation_stream.create.iostream.autoclose"u8; + + [NativeTypeName("#define IMG_PROP_ANIMATION_STREAM_CREATE_TYPE_STRING \"SDL_image.animation_stream.create.type\"")] + public static ReadOnlySpan IMG_PROP_ANIMATION_STREAM_CREATE_TYPE_STRING => "SDL_image.animation_stream.create.type"u8; + + [NativeTypeName("#define IMG_PROP_ANIMATION_STREAM_CREATE_QUALITY_NUMBER \"SDL_image.animation_stream.create.quality\"")] + public static ReadOnlySpan IMG_PROP_ANIMATION_STREAM_CREATE_QUALITY_NUMBER => "SDL_image.animation_stream.create.quality"u8; + + [NativeTypeName("#define IMG_PROP_ANIMATION_STREAM_CREATE_TIMEBASE_NUMERATOR_NUMBER \"SDL_image.animation_stream.create.timebase.numerator\"")] + public static ReadOnlySpan IMG_PROP_ANIMATION_STREAM_CREATE_TIMEBASE_NUMERATOR_NUMBER => "SDL_image.animation_stream.create.timebase.numerator"u8; + + [NativeTypeName("#define IMG_PROP_ANIMATION_STREAM_CREATE_TIMEBASE_DENOMINATOR_NUMBER \"SDL_image.animation_stream.create.timebase.denominator\"")] + public static ReadOnlySpan IMG_PROP_ANIMATION_STREAM_CREATE_TIMEBASE_DENOMINATOR_NUMBER => "SDL_image.animation_stream.create.timebase.denominator"u8; } } diff --git a/SDL3_mixer-CS/SDL3_mixer/ClangSharp/SDL_mixer.g.cs b/SDL3_mixer-CS/SDL3_mixer/ClangSharp/SDL_mixer.g.cs index ae7b778..d701d93 100644 --- a/SDL3_mixer-CS/SDL3_mixer/ClangSharp/SDL_mixer.g.cs +++ b/SDL3_mixer-CS/SDL3_mixer/ClangSharp/SDL_mixer.g.cs @@ -28,417 +28,439 @@ using System.Runtime.InteropServices; namespace SDL { - public unsafe partial struct Mix_Chunk + public partial struct MIX_Mixer { - public int allocated; - - [NativeTypeName("Uint8 *")] - public byte* abuf; - - [NativeTypeName("Uint32")] - public uint alen; - - [NativeTypeName("Uint8")] - public byte volume; } - public enum Mix_Fading + public partial struct MIX_Audio { - MIX_NO_FADING, - MIX_FADING_OUT, - MIX_FADING_IN, } - public enum Mix_MusicType + public partial struct MIX_Track { - MUS_NONE, - MUS_WAV, - MUS_MOD, - MUS_MID, - MUS_OGG, - MUS_MP3, - MUS_FLAC, - MUS_OPUS, - MUS_WAVPACK, - MUS_GME, } - public partial struct Mix_Music + public partial struct MIX_Group + { + } + + public partial struct MIX_StereoGains + { + public float left; + + public float right; + } + + public partial struct MIX_Point3D + { + public float x; + + public float y; + + public float z; + } + + public partial struct MIX_AudioDecoder { } public static unsafe partial class SDL3_mixer { [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_Version(); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("MIX_InitFlags")] - public static extern uint Mix_Init([NativeTypeName("MIX_InitFlags")] uint flags); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_Quit(); + public static extern int MIX_Version(); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_OpenAudio(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec); + public static extern SDLBool MIX_Init(); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_PauseAudio(int pause_on); + public static extern void MIX_Quit(); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("bool")] - public static extern SDLBool Mix_QuerySpec(int* frequency, SDL_AudioFormat* format, int* channels); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_AllocateChannels(int numchans); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_Chunk* Mix_LoadWAV_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_Chunk* Mix_LoadWAV([NativeTypeName("const char *")] byte* file); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_Music* Mix_LoadMUS([NativeTypeName("const char *")] byte* file); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_Music* Mix_LoadMUS_IO(SDL_IOStream* src, [NativeTypeName("bool")] SDLBool closeio); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_Music* Mix_LoadMUSType_IO(SDL_IOStream* src, Mix_MusicType type, [NativeTypeName("bool")] SDLBool closeio); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_Chunk* Mix_QuickLoad_WAV([NativeTypeName("Uint8 *")] byte* mem); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_Chunk* Mix_QuickLoad_RAW([NativeTypeName("Uint8 *")] byte* mem, [NativeTypeName("Uint32")] uint len); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_FreeChunk(Mix_Chunk* chunk); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_FreeMusic(Mix_Music* music); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_GetNumChunkDecoders(); + public static extern int MIX_GetNumAudioDecoders(); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("const char *")] - public static extern byte* Mix_GetChunkDecoder(int index); + public static extern byte* MIX_GetAudioDecoder(int index); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_Mixer* MIX_CreateMixerDevice(SDL_AudioDeviceID devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_Mixer* MIX_CreateMixer([NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void MIX_DestroyMixer(MIX_Mixer* mixer); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_PropertiesID MIX_GetMixerProperties(MIX_Mixer* mixer); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_HasChunkDecoder([NativeTypeName("const char *")] byte* name); + public static extern SDLBool MIX_GetMixerFormat(MIX_Mixer* mixer, SDL_AudioSpec* spec); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_GetNumMusicDecoders(); + public static extern MIX_Audio* MIX_LoadAudio_IO(MIX_Mixer* mixer, SDL_IOStream* io, [NativeTypeName("bool")] SDLBool predecode, [NativeTypeName("bool")] SDLBool closeio); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern byte* Mix_GetMusicDecoder(int index); + public static extern MIX_Audio* MIX_LoadAudio(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* path, [NativeTypeName("bool")] SDLBool predecode); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_Audio* MIX_LoadAudioWithProperties(SDL_PropertiesID props); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_Audio* MIX_LoadRawAudio_IO(MIX_Mixer* mixer, SDL_IOStream* io, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("bool")] SDLBool closeio); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_Audio* MIX_LoadRawAudio(MIX_Mixer* mixer, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("size_t")] nuint datalen, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_Audio* MIX_LoadRawAudioNoCopy(MIX_Mixer* mixer, [NativeTypeName("const void *")] IntPtr data, [NativeTypeName("size_t")] nuint datalen, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("bool")] SDLBool free_when_done); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_Audio* MIX_CreateSineWaveAudio(MIX_Mixer* mixer, int hz, float amplitude); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_PropertiesID MIX_GetAudioProperties(MIX_Audio* audio); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long MIX_GetAudioDuration(MIX_Audio* audio); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_HasMusicDecoder([NativeTypeName("const char *")] byte* name); + public static extern SDLBool MIX_GetAudioFormat(MIX_Audio* audio, SDL_AudioSpec* spec); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_MusicType Mix_GetMusicType([NativeTypeName("const Mix_Music *")] Mix_Music* music); + public static extern void MIX_DestroyAudio(MIX_Audio* audio); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern byte* Mix_GetMusicTitle([NativeTypeName("const Mix_Music *")] Mix_Music* music); + public static extern MIX_Track* MIX_CreateTrack(MIX_Mixer* mixer); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern byte* Mix_GetMusicTitleTag([NativeTypeName("const Mix_Music *")] Mix_Music* music); + public static extern void MIX_DestroyTrack(MIX_Track* track); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern byte* Mix_GetMusicArtistTag([NativeTypeName("const Mix_Music *")] Mix_Music* music); + public static extern SDL_PropertiesID MIX_GetTrackProperties(MIX_Track* track); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern byte* Mix_GetMusicAlbumTag([NativeTypeName("const Mix_Music *")] Mix_Music* music); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern byte* Mix_GetMusicCopyrightTag([NativeTypeName("const Mix_Music *")] Mix_Music* music); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_SetPostMix([NativeTypeName("Mix_MixCallback")] delegate* unmanaged[Cdecl] mix_func, [NativeTypeName("void*")] IntPtr arg); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_HookMusic([NativeTypeName("Mix_MixCallback")] delegate* unmanaged[Cdecl] mix_func, [NativeTypeName("void*")] IntPtr arg); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_HookMusicFinished([NativeTypeName("Mix_MusicFinishedCallback")] delegate* unmanaged[Cdecl] music_finished); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("void*")] - public static extern IntPtr Mix_GetMusicHookData(); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_ChannelFinished([NativeTypeName("Mix_ChannelFinishedCallback")] delegate* unmanaged[Cdecl] channel_finished); + public static extern MIX_Mixer* MIX_GetTrackMixer(MIX_Track* track); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_RegisterEffect(int chan, [NativeTypeName("Mix_EffectFunc_t")] delegate* unmanaged[Cdecl] f, [NativeTypeName("Mix_EffectDone_t")] delegate* unmanaged[Cdecl] d, [NativeTypeName("void*")] IntPtr arg); + public static extern SDLBool MIX_SetTrackAudio(MIX_Track* track, MIX_Audio* audio); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_UnregisterEffect(int channel, [NativeTypeName("Mix_EffectFunc_t")] delegate* unmanaged[Cdecl] f); + public static extern SDLBool MIX_SetTrackAudioStream(MIX_Track* track, SDL_AudioStream* stream); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_UnregisterAllEffects(int channel); + public static extern SDLBool MIX_SetTrackIOStream(MIX_Track* track, SDL_IOStream* io, [NativeTypeName("bool")] SDLBool closeio); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_SetPanning(int channel, [NativeTypeName("Uint8")] byte left, [NativeTypeName("Uint8")] byte right); + public static extern SDLBool MIX_TagTrack(MIX_Track* track, [NativeTypeName("const char *")] byte* tag); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void MIX_UntagTrack(MIX_Track* track, [NativeTypeName("const char *")] byte* tag); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_SetPosition(int channel, [NativeTypeName("Sint16")] short angle, [NativeTypeName("Uint8")] byte distance); + public static extern SDLBool MIX_SetTrackPlaybackPosition(MIX_Track* track, [NativeTypeName("Sint64")] long frames); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long MIX_GetTrackPlaybackPosition(MIX_Track* track); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_SetDistance(int channel, [NativeTypeName("Uint8")] byte distance); + public static extern SDLBool MIX_TrackLooping(MIX_Track* track); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_Audio* MIX_GetTrackAudio(MIX_Track* track); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_AudioStream* MIX_GetTrackAudioStream(MIX_Track* track); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long MIX_GetTrackRemaining(MIX_Track* track); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long MIX_TrackMSToFrames(MIX_Track* track, [NativeTypeName("Sint64")] long ms); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long MIX_TrackFramesToMS(MIX_Track* track, [NativeTypeName("Sint64")] long frames); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long MIX_AudioMSToFrames(MIX_Audio* audio, [NativeTypeName("Sint64")] long ms); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long MIX_AudioFramesToMS(MIX_Audio* audio, [NativeTypeName("Sint64")] long frames); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long MIX_MSToFrames(int sample_rate, [NativeTypeName("Sint64")] long ms); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("Sint64")] + public static extern long MIX_FramesToMS(int sample_rate, [NativeTypeName("Sint64")] long frames); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_SetReverseStereo(int channel, int flip); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_ReserveChannels(int num); + public static extern SDLBool MIX_PlayTrack(MIX_Track* track, SDL_PropertiesID options); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_GroupChannel(int which, int tag); + public static extern SDLBool MIX_PlayTag(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* tag, SDL_PropertiesID options); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_GroupChannels(int from, int to, int tag); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_GroupAvailable(int tag); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_GroupCount(int tag); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_GroupOldest(int tag); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_GroupNewer(int tag); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_PlayChannel(int channel, Mix_Chunk* chunk, int loops); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_PlayChannelTimed(int channel, Mix_Chunk* chunk, int loops, int ticks); + public static extern SDLBool MIX_PlayAudio(MIX_Mixer* mixer, MIX_Audio* audio); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_PlayMusic(Mix_Music* music, int loops); + public static extern SDLBool MIX_StopTrack(MIX_Track* track, [NativeTypeName("Sint64")] long fade_out_frames); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_FadeInMusic(Mix_Music* music, int loops, int ms); + public static extern SDLBool MIX_StopAllTracks(MIX_Mixer* mixer, [NativeTypeName("Sint64")] long fade_out_ms); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_FadeInMusicPos(Mix_Music* music, int loops, int ms, double position); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_FadeInChannel(int channel, Mix_Chunk* chunk, int loops, int ms); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_FadeInChannelTimed(int channel, Mix_Chunk* chunk, int loops, int ms, int ticks); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_Volume(int channel, int volume); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_VolumeChunk(Mix_Chunk* chunk, int volume); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_VolumeMusic(int volume); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_GetMusicVolume(Mix_Music* music); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_MasterVolume(int volume); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_HaltChannel(int channel); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_HaltGroup(int tag); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_HaltMusic(); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_ExpireChannel(int channel, int ticks); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_FadeOutChannel(int which, int ms); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_FadeOutGroup(int tag, int ms); + public static extern SDLBool MIX_StopTag(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* tag, [NativeTypeName("Sint64")] long fade_out_ms); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_FadeOutMusic(int ms); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_Fading Mix_FadingMusic(); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_Fading Mix_FadingChannel(int which); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_Pause(int channel); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_PauseGroup(int tag); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_Resume(int channel); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_ResumeGroup(int tag); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_Paused(int channel); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_PauseMusic(); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_ResumeMusic(); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_RewindMusic(); + public static extern SDLBool MIX_PauseTrack(MIX_Track* track); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_PausedMusic(); + public static extern SDLBool MIX_PauseAllTracks(MIX_Mixer* mixer); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_ModMusicJumpToOrder(int order); + public static extern SDLBool MIX_PauseTag(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* tag); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_StartTrack(Mix_Music* music, int track); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_GetNumTracks(Mix_Music* music); + public static extern SDLBool MIX_ResumeTrack(MIX_Track* track); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_SetMusicPosition(double position); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern double Mix_GetMusicPosition(Mix_Music* music); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern double Mix_MusicDuration(Mix_Music* music); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern double Mix_GetMusicLoopStartTime(Mix_Music* music); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern double Mix_GetMusicLoopEndTime(Mix_Music* music); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern double Mix_GetMusicLoopLengthTime(Mix_Music* music); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern int Mix_Playing(int channel); + public static extern SDLBool MIX_ResumeAllTracks(MIX_Mixer* mixer); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_PlayingMusic(); + public static extern SDLBool MIX_ResumeTag(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* tag); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_SetSoundFonts([NativeTypeName("const char *")] byte* paths); - - [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern byte* Mix_GetSoundFonts(); + public static extern SDLBool MIX_TrackPlaying(MIX_Track* track); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_EachSoundFont([NativeTypeName("Mix_EachSoundFontCallback")] delegate* unmanaged[Cdecl] function, [NativeTypeName("void*")] IntPtr data); + public static extern SDLBool MIX_TrackPaused(MIX_Track* track); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] - public static extern SDLBool Mix_SetTimidityCfg([NativeTypeName("const char *")] byte* path); + public static extern SDLBool MIX_SetMasterGain(MIX_Mixer* mixer, float gain); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - [return: NativeTypeName("const char *")] - public static extern byte* Mix_GetTimidityCfg(); + public static extern float MIX_GetMasterGain(MIX_Mixer* mixer); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern Mix_Chunk* Mix_GetChunk(int channel); + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetTrackGain(MIX_Track* track, float gain); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] - public static extern void Mix_CloseAudio(); + public static extern float MIX_GetTrackGain(MIX_Track* track); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetTagGain(MIX_Mixer* mixer, [NativeTypeName("const char *")] byte* tag, float gain); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetTrackFrequencyRatio(MIX_Track* track, float ratio); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern float MIX_GetTrackFrequencyRatio(MIX_Track* track); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetTrackOutputChannelMap(MIX_Track* track, [NativeTypeName("const int *")] int* chmap, int count); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetTrackStereo(MIX_Track* track, [NativeTypeName("const MIX_StereoGains *")] MIX_StereoGains* gains); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetTrack3DPosition(MIX_Track* track, [NativeTypeName("const MIX_Point3D *")] MIX_Point3D* position); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_GetTrack3DPosition(MIX_Track* track, MIX_Point3D* position); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_Group* MIX_CreateGroup(MIX_Mixer* mixer); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void MIX_DestroyGroup(MIX_Group* group); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_PropertiesID MIX_GetGroupProperties(MIX_Group* group); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_Mixer* MIX_GetGroupMixer(MIX_Group* group); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetTrackGroup(MIX_Track* track, MIX_Group* group); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetTrackStoppedCallback(MIX_Track* track, [NativeTypeName("MIX_TrackStoppedCallback")] delegate* unmanaged[Cdecl] cb, [NativeTypeName("void*")] IntPtr userdata); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetTrackRawCallback(MIX_Track* track, [NativeTypeName("MIX_TrackMixCallback")] delegate* unmanaged[Cdecl] cb, [NativeTypeName("void*")] IntPtr userdata); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetTrackCookedCallback(MIX_Track* track, [NativeTypeName("MIX_TrackMixCallback")] delegate* unmanaged[Cdecl] cb, [NativeTypeName("void*")] IntPtr userdata); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetGroupPostMixCallback(MIX_Group* group, [NativeTypeName("MIX_GroupMixCallback")] delegate* unmanaged[Cdecl] cb, [NativeTypeName("void*")] IntPtr userdata); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_SetPostMixCallback(MIX_Mixer* mixer, [NativeTypeName("MIX_PostMixCallback")] delegate* unmanaged[Cdecl] cb, [NativeTypeName("void*")] IntPtr userdata); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_Generate(MIX_Mixer* mixer, [NativeTypeName("void*")] IntPtr buffer, int buflen); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_AudioDecoder* MIX_CreateAudioDecoder([NativeTypeName("const char *")] byte* path, SDL_PropertiesID props); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern MIX_AudioDecoder* MIX_CreateAudioDecoder_IO(SDL_IOStream* io, [NativeTypeName("bool")] SDLBool closeio, SDL_PropertiesID props); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern void MIX_DestroyAudioDecoder(MIX_AudioDecoder* audiodecoder); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern SDL_PropertiesID MIX_GetAudioDecoderProperties(MIX_AudioDecoder* audiodecoder); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + [return: NativeTypeName("bool")] + public static extern SDLBool MIX_GetAudioDecoderFormat(MIX_AudioDecoder* audiodecoder, SDL_AudioSpec* spec); + + [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] + public static extern int MIX_DecodeAudio(MIX_AudioDecoder* audiodecoder, [NativeTypeName("void*")] IntPtr buffer, int buflen, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec); [NativeTypeName("#define SDL_MIXER_MAJOR_VERSION 3")] public const int SDL_MIXER_MAJOR_VERSION = 3; - [NativeTypeName("#define SDL_MIXER_MINOR_VERSION 0")] - public const int SDL_MIXER_MINOR_VERSION = 0; + [NativeTypeName("#define SDL_MIXER_MINOR_VERSION 1")] + public const int SDL_MIXER_MINOR_VERSION = 1; [NativeTypeName("#define SDL_MIXER_MICRO_VERSION 0")] public const int SDL_MIXER_MICRO_VERSION = 0; [NativeTypeName("#define SDL_MIXER_VERSION SDL_VERSIONNUM(SDL_MIXER_MAJOR_VERSION, SDL_MIXER_MINOR_VERSION, SDL_MIXER_MICRO_VERSION)")] - public const int SDL_MIXER_VERSION = ((3) * 1000000 + (0) * 1000 + (0)); + public const int SDL_MIXER_VERSION = ((3) * 1000000 + (1) * 1000 + (0)); - [NativeTypeName("#define MIX_INIT_FLAC 0x00000001")] - public const int MIX_INIT_FLAC = 0x00000001; + [NativeTypeName("#define MIX_PROP_AUDIO_LOAD_IOSTREAM_POINTER \"SDL_mixer.audio.load.iostream\"")] + public static ReadOnlySpan MIX_PROP_AUDIO_LOAD_IOSTREAM_POINTER => "SDL_mixer.audio.load.iostream"u8; - [NativeTypeName("#define MIX_INIT_MOD 0x00000002")] - public const int MIX_INIT_MOD = 0x00000002; + [NativeTypeName("#define MIX_PROP_AUDIO_LOAD_CLOSEIO_BOOLEAN \"SDL_mixer.audio.load.closeio\"")] + public static ReadOnlySpan MIX_PROP_AUDIO_LOAD_CLOSEIO_BOOLEAN => "SDL_mixer.audio.load.closeio"u8; - [NativeTypeName("#define MIX_INIT_MP3 0x00000008")] - public const int MIX_INIT_MP3 = 0x00000008; + [NativeTypeName("#define MIX_PROP_AUDIO_LOAD_PREDECODE_BOOLEAN \"SDL_mixer.audio.load.predecode\"")] + public static ReadOnlySpan MIX_PROP_AUDIO_LOAD_PREDECODE_BOOLEAN => "SDL_mixer.audio.load.predecode"u8; - [NativeTypeName("#define MIX_INIT_OGG 0x00000010")] - public const int MIX_INIT_OGG = 0x00000010; + [NativeTypeName("#define MIX_PROP_AUDIO_LOAD_PREFERRED_MIXER_POINTER \"SDL_mixer.audio.load.preferred_mixer\"")] + public static ReadOnlySpan MIX_PROP_AUDIO_LOAD_PREFERRED_MIXER_POINTER => "SDL_mixer.audio.load.preferred_mixer"u8; - [NativeTypeName("#define MIX_INIT_MID 0x00000020")] - public const int MIX_INIT_MID = 0x00000020; + [NativeTypeName("#define MIX_PROP_AUDIO_LOAD_SKIP_METADATA_TAGS_BOOLEAN \"SDL_mixer.audio.load.skip_metadata_tags\"")] + public static ReadOnlySpan MIX_PROP_AUDIO_LOAD_SKIP_METADATA_TAGS_BOOLEAN => "SDL_mixer.audio.load.skip_metadata_tags"u8; - [NativeTypeName("#define MIX_INIT_OPUS 0x00000040")] - public const int MIX_INIT_OPUS = 0x00000040; + [NativeTypeName("#define MIX_PROP_AUDIO_DECODER_STRING \"SDL_mixer.audio.decoder\"")] + public static ReadOnlySpan MIX_PROP_AUDIO_DECODER_STRING => "SDL_mixer.audio.decoder"u8; - [NativeTypeName("#define MIX_INIT_WAVPACK 0x00000080")] - public const int MIX_INIT_WAVPACK = 0x00000080; + [NativeTypeName("#define MIX_PROP_METADATA_TITLE_STRING \"SDL_mixer.metadata.title\"")] + public static ReadOnlySpan MIX_PROP_METADATA_TITLE_STRING => "SDL_mixer.metadata.title"u8; - [NativeTypeName("#define MIX_CHANNELS 8")] - public const int MIX_CHANNELS = 8; + [NativeTypeName("#define MIX_PROP_METADATA_ARTIST_STRING \"SDL_mixer.metadata.artist\"")] + public static ReadOnlySpan MIX_PROP_METADATA_ARTIST_STRING => "SDL_mixer.metadata.artist"u8; - [NativeTypeName("#define MIX_DEFAULT_FREQUENCY 44100")] - public const int MIX_DEFAULT_FREQUENCY = 44100; + [NativeTypeName("#define MIX_PROP_METADATA_ALBUM_STRING \"SDL_mixer.metadata.album\"")] + public static ReadOnlySpan MIX_PROP_METADATA_ALBUM_STRING => "SDL_mixer.metadata.album"u8; - [NativeTypeName("#define MIX_DEFAULT_CHANNELS 2")] - public const int MIX_DEFAULT_CHANNELS = 2; + [NativeTypeName("#define MIX_PROP_METADATA_COPYRIGHT_STRING \"SDL_mixer.metadata.copyright\"")] + public static ReadOnlySpan MIX_PROP_METADATA_COPYRIGHT_STRING => "SDL_mixer.metadata.copyright"u8; - [NativeTypeName("#define MIX_MAX_VOLUME 128")] - public const int MIX_MAX_VOLUME = 128; + [NativeTypeName("#define MIX_PROP_METADATA_TRACK_NUMBER \"SDL_mixer.metadata.track\"")] + public static ReadOnlySpan MIX_PROP_METADATA_TRACK_NUMBER => "SDL_mixer.metadata.track"u8; - [NativeTypeName("#define MIX_CHANNEL_POST (-2)")] - public const int MIX_CHANNEL_POST = (-2); + [NativeTypeName("#define MIX_PROP_METADATA_TOTAL_TRACKS_NUMBER \"SDL_mixer.metadata.total_tracks\"")] + public static ReadOnlySpan MIX_PROP_METADATA_TOTAL_TRACKS_NUMBER => "SDL_mixer.metadata.total_tracks"u8; - [NativeTypeName("#define MIX_EFFECTSMAXSPEED \"MIX_EFFECTSMAXSPEED\"")] - public static ReadOnlySpan MIX_EFFECTSMAXSPEED => "MIX_EFFECTSMAXSPEED"u8; + [NativeTypeName("#define MIX_PROP_METADATA_YEAR_NUMBER \"SDL_mixer.metadata.year\"")] + public static ReadOnlySpan MIX_PROP_METADATA_YEAR_NUMBER => "SDL_mixer.metadata.year"u8; + + [NativeTypeName("#define MIX_PROP_METADATA_DURATION_FRAMES_NUMBER \"SDL_mixer.metadata.duration_frames\"")] + public static ReadOnlySpan MIX_PROP_METADATA_DURATION_FRAMES_NUMBER => "SDL_mixer.metadata.duration_frames"u8; + + [NativeTypeName("#define MIX_PROP_METADATA_DURATION_INFINITE_BOOLEAN \"SDL_mixer.metadata.duration_infinite\"")] + public static ReadOnlySpan MIX_PROP_METADATA_DURATION_INFINITE_BOOLEAN => "SDL_mixer.metadata.duration_infinite"u8; + + [NativeTypeName("#define MIX_DURATION_UNKNOWN -1")] + public const int MIX_DURATION_UNKNOWN = -1; + + [NativeTypeName("#define MIX_DURATION_INFINITE -2")] + public const int MIX_DURATION_INFINITE = -2; + + [NativeTypeName("#define MIX_PROP_PLAY_LOOPS_NUMBER \"SDL_mixer.play.loops\"")] + public static ReadOnlySpan MIX_PROP_PLAY_LOOPS_NUMBER => "SDL_mixer.play.loops"u8; + + [NativeTypeName("#define MIX_PROP_PLAY_MAX_FRAME_NUMBER \"SDL_mixer.play.max_frame\"")] + public static ReadOnlySpan MIX_PROP_PLAY_MAX_FRAME_NUMBER => "SDL_mixer.play.max_frame"u8; + + [NativeTypeName("#define MIX_PROP_PLAY_MAX_MILLISECONDS_NUMBER \"SDL_mixer.play.max_milliseconds\"")] + public static ReadOnlySpan MIX_PROP_PLAY_MAX_MILLISECONDS_NUMBER => "SDL_mixer.play.max_milliseconds"u8; + + [NativeTypeName("#define MIX_PROP_PLAY_START_FRAME_NUMBER \"SDL_mixer.play.start_frame\"")] + public static ReadOnlySpan MIX_PROP_PLAY_START_FRAME_NUMBER => "SDL_mixer.play.start_frame"u8; + + [NativeTypeName("#define MIX_PROP_PLAY_START_MILLISECOND_NUMBER \"SDL_mixer.play.start_millisecond\"")] + public static ReadOnlySpan MIX_PROP_PLAY_START_MILLISECOND_NUMBER => "SDL_mixer.play.start_millisecond"u8; + + [NativeTypeName("#define MIX_PROP_PLAY_LOOP_START_FRAME_NUMBER \"SDL_mixer.play.loop_start_frame\"")] + public static ReadOnlySpan MIX_PROP_PLAY_LOOP_START_FRAME_NUMBER => "SDL_mixer.play.loop_start_frame"u8; + + [NativeTypeName("#define MIX_PROP_PLAY_LOOP_START_MILLISECOND_NUMBER \"SDL_mixer.play.loop_start_millisecond\"")] + public static ReadOnlySpan MIX_PROP_PLAY_LOOP_START_MILLISECOND_NUMBER => "SDL_mixer.play.loop_start_millisecond"u8; + + [NativeTypeName("#define MIX_PROP_PLAY_FADE_IN_FRAMES_NUMBER \"SDL_mixer.play.fade_in_frames\"")] + public static ReadOnlySpan MIX_PROP_PLAY_FADE_IN_FRAMES_NUMBER => "SDL_mixer.play.fade_in_frames"u8; + + [NativeTypeName("#define MIX_PROP_PLAY_FADE_IN_MILLISECONDS_NUMBER \"SDL_mixer.play.fade_in_milliseconds\"")] + public static ReadOnlySpan MIX_PROP_PLAY_FADE_IN_MILLISECONDS_NUMBER => "SDL_mixer.play.fade_in_milliseconds"u8; + + [NativeTypeName("#define MIX_PROP_PLAY_APPEND_SILENCE_FRAMES_NUMBER \"SDL_mixer.play.append_silence_frames\"")] + public static ReadOnlySpan MIX_PROP_PLAY_APPEND_SILENCE_FRAMES_NUMBER => "SDL_mixer.play.append_silence_frames"u8; + + [NativeTypeName("#define MIX_PROP_PLAY_APPEND_SILENCE_MILLISECONDS_NUMBER \"SDL_mixer.play.append_silence_milliseconds\"")] + public static ReadOnlySpan MIX_PROP_PLAY_APPEND_SILENCE_MILLISECONDS_NUMBER => "SDL_mixer.play.append_silence_milliseconds"u8; } } From f51f432541d92fc79e291eb7adcd3cd75017d952 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sun, 3 Aug 2025 00:06:30 +0900 Subject: [PATCH 2/3] Fix prefix --- SDL3-CS.Tests/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDL3-CS.Tests/Program.cs b/SDL3-CS.Tests/Program.cs index 84aa5b1..ae004b6 100644 --- a/SDL3-CS.Tests/Program.cs +++ b/SDL3-CS.Tests/Program.cs @@ -29,7 +29,7 @@ namespace SDL.Tests using (var window = new MyWindow()) { // Check if satellite libraries exist. - Console.WriteLine($"SDL revision: {SDL_GetRevision()}, IMG {IMG_Version()}, TTF {TTF_Version()}, Mixer {Mix_Version()}"); + Console.WriteLine($"SDL revision: {SDL_GetRevision()}, IMG {IMG_Version()}, TTF {TTF_Version()}, Mixer {MIX_Version()}"); printDisplays(); From 523649fd7738efdb12b04a535801720b60252b82 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Sun, 3 Aug 2025 12:06:48 +0200 Subject: [PATCH 3/3] Write SDL_MIXER_VERSION_ATLEAST macro --- SDL3_mixer-CS/SDL3_mixer/SDL_mixer.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SDL3_mixer-CS/SDL3_mixer/SDL_mixer.cs b/SDL3_mixer-CS/SDL3_mixer/SDL_mixer.cs index 0dff368..18bee7f 100644 --- a/SDL3_mixer-CS/SDL3_mixer/SDL_mixer.cs +++ b/SDL3_mixer-CS/SDL3_mixer/SDL_mixer.cs @@ -9,5 +9,11 @@ namespace SDL { [Constant] public static readonly SDL_AudioFormat MIX_DEFAULT_FORMAT = SDL_AUDIO_S16; + + [Macro] + public static bool SDL_MIXER_VERSION_ATLEAST(int X, int Y, int Z) => + ((SDL_MIXER_MAJOR_VERSION >= X) && + (SDL_MIXER_MAJOR_VERSION > X || SDL_MIXER_MINOR_VERSION >= Y) && + (SDL_MIXER_MAJOR_VERSION > X || SDL_MIXER_MINOR_VERSION > Y || SDL_MIXER_MICRO_VERSION >= Z)); } }