/* C# bindings for Simple DirectMedia Layer. Original copyright notice of input files: Simple DirectMedia Layer Copyright (C) 1997-2024 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ using System; using System.Runtime.InteropServices; namespace SDL { public unsafe partial struct Mix_Chunk { public int allocated; [NativeTypeName("Uint8 *")] public byte* abuf; [NativeTypeName("Uint32")] public uint alen; [NativeTypeName("Uint8")] public byte volume; } public enum Mix_Fading { MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN, } public enum Mix_MusicType { 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 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(); [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); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void Mix_PauseAudio(int pause_on); [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(); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("const char *")] public static extern byte* Mix_GetChunkDecoder(int index); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_HasChunkDecoder([NativeTypeName("const char *")] byte* name); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern int Mix_GetNumMusicDecoders(); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("const char *")] public static extern byte* Mix_GetMusicDecoder(int index); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_HasMusicDecoder([NativeTypeName("const char *")] byte* name); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mix_MusicType Mix_GetMusicType([NativeTypeName("const Mix_Music *")] Mix_Music* music); [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); [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); [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); [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); [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); [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); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_UnregisterAllEffects(int channel); [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); [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); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_SetDistance(int channel, [NativeTypeName("Uint8")] byte distance); [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); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_GroupChannel(int which, int tag); [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); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_PlayMusic(Mix_Music* music, int loops); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_FadeInMusic(Mix_Music* music, int loops, int 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); [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(); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_PausedMusic(); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_ModMusicJumpToOrder(int order); [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); [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); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_PlayingMusic(); [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(); [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); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("bool")] public static extern SDLBool Mix_SetTimidityCfg([NativeTypeName("const char *")] byte* path); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] [return: NativeTypeName("const char *")] public static extern byte* Mix_GetTimidityCfg(); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern Mix_Chunk* Mix_GetChunk(int channel); [DllImport("SDL3_mixer", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] public static extern void Mix_CloseAudio(); [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_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)); [NativeTypeName("#define MIX_INIT_FLAC 0x00000001")] public const int MIX_INIT_FLAC = 0x00000001; [NativeTypeName("#define MIX_INIT_MOD 0x00000002")] public const int MIX_INIT_MOD = 0x00000002; [NativeTypeName("#define MIX_INIT_MP3 0x00000008")] public const int MIX_INIT_MP3 = 0x00000008; [NativeTypeName("#define MIX_INIT_OGG 0x00000010")] public const int MIX_INIT_OGG = 0x00000010; [NativeTypeName("#define MIX_INIT_MID 0x00000020")] public const int MIX_INIT_MID = 0x00000020; [NativeTypeName("#define MIX_INIT_OPUS 0x00000040")] public const int MIX_INIT_OPUS = 0x00000040; [NativeTypeName("#define MIX_INIT_WAVPACK 0x00000080")] public const int MIX_INIT_WAVPACK = 0x00000080; [NativeTypeName("#define MIX_CHANNELS 8")] public const int MIX_CHANNELS = 8; [NativeTypeName("#define MIX_DEFAULT_FREQUENCY 44100")] public const int MIX_DEFAULT_FREQUENCY = 44100; [NativeTypeName("#define MIX_DEFAULT_CHANNELS 2")] public const int MIX_DEFAULT_CHANNELS = 2; [NativeTypeName("#define MIX_MAX_VOLUME 128")] public const int MIX_MAX_VOLUME = 128; [NativeTypeName("#define MIX_CHANNEL_POST (-2)")] public const int MIX_CHANNEL_POST = (-2); [NativeTypeName("#define MIX_EFFECTSMAXSPEED \"MIX_EFFECTSMAXSPEED\"")] public static ReadOnlySpan MIX_EFFECTSMAXSPEED => "MIX_EFFECTSMAXSPEED"u8; } }