mirror of https://github.com/ppy/SDL3-CS.git
234 lines
13 KiB
C#
234 lines
13 KiB
C#
/*
|
|
<auto-generated/>
|
|
C# bindings for Simple DirectMedia Layer.
|
|
Original copyright notice of input files:
|
|
|
|
Simple DirectMedia Layer
|
|
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
|
|
|
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 partial struct SDL_AudioSpec
|
|
{
|
|
[NativeTypeName("SDL_AudioFormat")]
|
|
public ushort format;
|
|
|
|
public int channels;
|
|
|
|
public int freq;
|
|
}
|
|
|
|
public partial struct SDL_AudioStream
|
|
{
|
|
}
|
|
|
|
public static unsafe partial class SDL3
|
|
{
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_GetNumAudioDrivers();
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("const char *")]
|
|
public static extern byte* SDL_GetAudioDriver(int index);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("const char *")]
|
|
public static extern byte* SDL_GetCurrentAudioDriver();
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("SDL_AudioDeviceID *")]
|
|
public static extern uint* SDL_GetAudioOutputDevices(int* count);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("SDL_AudioDeviceID *")]
|
|
public static extern uint* SDL_GetAudioCaptureDevices(int* count);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("char *")]
|
|
public static extern byte* SDL_GetAudioDeviceName([NativeTypeName("SDL_AudioDeviceID")] uint devid);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_GetAudioDeviceFormat([NativeTypeName("SDL_AudioDeviceID")] uint devid, SDL_AudioSpec* spec, int* sample_frames);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("SDL_AudioDeviceID")]
|
|
public static extern uint SDL_OpenAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_PauseAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_ResumeAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint dev);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("SDL_bool")]
|
|
public static extern int SDL_AudioDevicePaused([NativeTypeName("SDL_AudioDeviceID")] uint dev);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern void SDL_CloseAudioDevice([NativeTypeName("SDL_AudioDeviceID")] uint devid);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_BindAudioStreams([NativeTypeName("SDL_AudioDeviceID")] uint devid, SDL_AudioStream** streams, int num_streams);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_BindAudioStream([NativeTypeName("SDL_AudioDeviceID")] uint devid, SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern void SDL_UnbindAudioStreams(SDL_AudioStream** streams, int num_streams);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern void SDL_UnbindAudioStream(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("SDL_AudioDeviceID")]
|
|
public static extern uint SDL_GetAudioStreamDevice(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_AudioStream* SDL_CreateAudioStream([NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
[return: NativeTypeName("SDL_PropertiesID")]
|
|
public static extern uint SDL_GetAudioStreamProperties(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_GetAudioStreamFormat(SDL_AudioStream* stream, SDL_AudioSpec* src_spec, SDL_AudioSpec* dst_spec);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_SetAudioStreamFormat(SDL_AudioStream* stream, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern float SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream* stream, float ratio);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_PutAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("const void *")] IntPtr buf, int len);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_GetAudioStreamData(SDL_AudioStream* stream, [NativeTypeName("void*")] IntPtr buf, int len);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_GetAudioStreamAvailable(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_GetAudioStreamQueued(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_FlushAudioStream(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_ClearAudioStream(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_LockAudioStream(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_UnlockAudioStream(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_SetAudioStreamGetCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_SetAudioStreamPutCallback(SDL_AudioStream* stream, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern void SDL_DestroyAudioStream(SDL_AudioStream* stream);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern SDL_AudioStream* SDL_OpenAudioDeviceStream([NativeTypeName("SDL_AudioDeviceID")] uint devid, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* spec, [NativeTypeName("SDL_AudioStreamCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioStream*, int, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_SetAudioPostmixCallback([NativeTypeName("SDL_AudioDeviceID")] uint devid, [NativeTypeName("SDL_AudioPostmixCallback")] delegate* unmanaged[Cdecl]<IntPtr, SDL_AudioSpec*, float*, int, void> callback, [NativeTypeName("void*")] IntPtr userdata);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_LoadWAV_IO(SDL_IOStream* src, [NativeTypeName("SDL_bool")] int closeio, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_LoadWAV([NativeTypeName("const char *")] byte* path, SDL_AudioSpec* spec, [NativeTypeName("Uint8 **")] byte** audio_buf, [NativeTypeName("Uint32 *")] uint* audio_len);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_MixAudioFormat([NativeTypeName("Uint8 *")] byte* dst, [NativeTypeName("const Uint8 *")] byte* src, [NativeTypeName("SDL_AudioFormat")] ushort format, [NativeTypeName("Uint32")] uint len, int volume);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_ConvertAudioSamples([NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* src_spec, [NativeTypeName("const Uint8 *")] byte* src_data, int src_len, [NativeTypeName("const SDL_AudioSpec *")] SDL_AudioSpec* dst_spec, [NativeTypeName("Uint8 **")] byte** dst_data, int* dst_len);
|
|
|
|
[DllImport("SDL3", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
|
public static extern int SDL_GetSilenceValueForFormat([NativeTypeName("SDL_AudioFormat")] ushort format);
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_MASK_BITSIZE (0xFF)")]
|
|
public const int SDL_AUDIO_MASK_BITSIZE = (0xFF);
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_MASK_FLOAT (1<<8)")]
|
|
public const int SDL_AUDIO_MASK_FLOAT = (1 << 8);
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_MASK_BIG_ENDIAN (1<<12)")]
|
|
public const int SDL_AUDIO_MASK_BIG_ENDIAN = (1 << 12);
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_MASK_SIGNED (1<<15)")]
|
|
public const int SDL_AUDIO_MASK_SIGNED = (1 << 15);
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_U8 0x0008")]
|
|
public const int SDL_AUDIO_U8 = 0x0008;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_S8 0x8008")]
|
|
public const int SDL_AUDIO_S8 = 0x8008;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_S16LE 0x8010")]
|
|
public const int SDL_AUDIO_S16LE = 0x8010;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_S16BE 0x9010")]
|
|
public const int SDL_AUDIO_S16BE = 0x9010;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_S32LE 0x8020")]
|
|
public const int SDL_AUDIO_S32LE = 0x8020;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_S32BE 0x9020")]
|
|
public const int SDL_AUDIO_S32BE = 0x9020;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_F32LE 0x8120")]
|
|
public const int SDL_AUDIO_F32LE = 0x8120;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_F32BE 0x9120")]
|
|
public const int SDL_AUDIO_F32BE = 0x9120;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_S16 SDL_AUDIO_S16LE")]
|
|
public const int SDL_AUDIO_S16 = 0x8010;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_S32 SDL_AUDIO_S32LE")]
|
|
public const int SDL_AUDIO_S32 = 0x8020;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_F32 SDL_AUDIO_F32LE")]
|
|
public const int SDL_AUDIO_F32 = 0x8120;
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_OUTPUT ((SDL_AudioDeviceID) 0xFFFFFFFF)")]
|
|
public const uint SDL_AUDIO_DEVICE_DEFAULT_OUTPUT = ((uint)(0xFFFFFFFF));
|
|
|
|
[NativeTypeName("#define SDL_AUDIO_DEVICE_DEFAULT_CAPTURE ((SDL_AudioDeviceID) 0xFFFFFFFE)")]
|
|
public const uint SDL_AUDIO_DEVICE_DEFAULT_CAPTURE = ((uint)(0xFFFFFFFE));
|
|
|
|
[NativeTypeName("#define SDL_MIX_MAXVOLUME 128")]
|
|
public const int SDL_MIX_MAXVOLUME = 128;
|
|
}
|
|
}
|