dynamically load openal libs using mellinoe's code

This commit is contained in:
emmaus 2018-06-19 14:14:46 +00:00
parent 6f91916149
commit 92530a7544
3 changed files with 257 additions and 177 deletions

View file

@ -67,30 +67,57 @@ namespace OpenTK.Audio.OpenAL
public static partial class AL public static partial class AL
{ {
internal const string Lib = "openal32.dll"; internal static readonly NativeLibrary ALNativeLib = NativeLibrary.Load(AL.GetOpenALLibName());
private const CallingConvention Style = CallingConvention.Cdecl;
internal static string GetOpenALLibName()
{
#if NETSTANDARD
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return "openal32.dll";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
return "libopenal.so.1";
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
return "/System/Library/Frameworks/OpenAL.framework/OpenAL";
}
else
{
return "openal32.dll";
}
#else
return "openal32.dll";
#endif
}
private unsafe delegate void alEnable_d(ALCapability capability);
private static alEnable_d alEnable_ptr = ALNativeLib.LoadFunctionPointer<alEnable_d>("alEnable");
/// <summary>This function enables a feature of the OpenAL driver. There are no capabilities defined in OpenAL 1.1 to be used with this function, but it may be used by an extension.</summary> /// <summary>This function enables a feature of the OpenAL driver. There are no capabilities defined in OpenAL 1.1 to be used with this function, but it may be used by an extension.</summary>
/// <param name="capability">The name of a capability to enable.</param> /// <param name="capability">The name of a capability to enable.</param>
[DllImport(AL.Lib, EntryPoint = "alEnable", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void Enable(ALCapability capability) => alEnable_ptr(capability);
public static extern void Enable(ALCapability capability);
//AL_API void AL_APIENTRY alEnable( ALenum capability ); //AL_API void AL_APIENTRY alEnable( ALenum capability );
private unsafe delegate void alDisable_d(ALCapability capability);
private static alDisable_d alDisable_ptr = ALNativeLib.LoadFunctionPointer<alDisable_d>("alDisable");
/// <summary>This function disables a feature of the OpenAL driver.</summary> /// <summary>This function disables a feature of the OpenAL driver.</summary>
/// <param name="capability">The name of a capability to disable.</param> /// <param name="capability">The name of a capability to disable.</param>
[DllImport(AL.Lib, EntryPoint = "alDisable", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void Disable(ALCapability capability) => alDisable_ptr(capability);
public static extern void Disable(ALCapability capability);
// AL_API void AL_APIENTRY alDisable( ALenum capability ); // AL_API void AL_APIENTRY alDisable( ALenum capability );
private unsafe delegate bool IsEnabled_d(ALCapability capability);
private static IsEnabled_d alIsEnabled_ptr = ALNativeLib.LoadFunctionPointer<IsEnabled_d>("alIsEnabled");
/// <summary>This function returns a boolean indicating if a specific feature is enabled in the OpenAL driver.</summary> /// <summary>This function returns a boolean indicating if a specific feature is enabled in the OpenAL driver.</summary>
/// <param name="capability">The name of a capability to enable.</param> /// <param name="capability">The name of a capability to enable.</param>
/// <returns>True if enabled, False if disabled.</returns> /// <returns>True if enabled, False if disabled.</returns>
[DllImport(AL.Lib, EntryPoint = "alIsEnabled", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static bool IsEnabled(ALCapability capability) => alIsEnabled_ptr(capability);
public static extern bool IsEnabled(ALCapability capability);
// AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability ); // AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability );
[DllImport(AL.Lib, EntryPoint = "alGetString", ExactSpelling = true, CallingConvention = AL.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] private unsafe delegate IntPtr GetStringPrivate_d(ALGetString param);
private static extern IntPtr GetStringPrivate(ALGetString param); // accepts the enums AlError, AlContextString private static GetStringPrivate_d alGetString_ptr = ALNativeLib.LoadFunctionPointer<GetStringPrivate_d>("alGetString");
private static IntPtr GetStringPrivate(ALGetString param) => alGetString_ptr(param); // accepts the enums AlError, AlContextString
// AL_API const ALchar* AL_APIENTRY alGetString( ALenum param ); // AL_API const ALchar* AL_APIENTRY alGetString( ALenum param );
/// <summary>This function retrieves an OpenAL string property.</summary> /// <summary>This function retrieves an OpenAL string property.</summary>
@ -125,18 +152,20 @@ namespace OpenTK.Audio.OpenAL
// AL_API ALboolean AL_APIENTRY alGetBoolean( ALenum param ); // AL_API ALboolean AL_APIENTRY alGetBoolean( ALenum param );
*/ */
private unsafe delegate int Get_d(ALGetInteger param);
private static Get_d alGetInteger_ptr = ALNativeLib.LoadFunctionPointer<Get_d>("alGetInteger");
/// <summary>This function returns an integer OpenAL state.</summary> /// <summary>This function returns an integer OpenAL state.</summary>
/// <param name="param">the state to be queried: DistanceModel.</param> /// <param name="param">the state to be queried: DistanceModel.</param>
/// <returns>The integer state described by param will be returned.</returns> /// <returns>The integer state described by param will be returned.</returns>
[DllImport(AL.Lib, EntryPoint = "alGetInteger", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static int Get(ALGetInteger param) => alGetInteger_ptr(param);
public static extern int Get(ALGetInteger param);
// AL_API ALint AL_APIENTRY alGetInteger( ALenum param ); // AL_API ALint AL_APIENTRY alGetInteger( ALenum param );
private unsafe delegate float GetFloat_d(ALGetFloat param);
private static GetFloat_d alGetFloat_ptr = ALNativeLib.LoadFunctionPointer<GetFloat_d>("alGetFloat");
/// <summary>This function returns a floating-point OpenAL state.</summary> /// <summary>This function returns a floating-point OpenAL state.</summary>
/// <param name="param">the state to be queried: DopplerFactor, SpeedOfSound.</param> /// <param name="param">the state to be queried: DopplerFactor, SpeedOfSound.</param>
/// <returns>The floating-point state described by param will be returned.</returns> /// <returns>The floating-point state described by param will be returned.</returns>
[DllImport(AL.Lib, EntryPoint = "alGetFloat", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static float Get(ALGetFloat param) => alGetFloat_ptr(param);
public static extern float Get(ALGetFloat param);
// AL_API ALfloat AL_APIENTRY alGetFloat( ALenum param ); // AL_API ALfloat AL_APIENTRY alGetFloat( ALenum param );
/* disabled due to no token using it /* disabled due to no token using it
@ -148,31 +177,35 @@ namespace OpenTK.Audio.OpenAL
// AL_API ALdouble AL_APIENTRY alGetDouble( ALenum param ); // AL_API ALdouble AL_APIENTRY alGetDouble( ALenum param );
*/ */
private unsafe delegate ALError GetError_d();
private static GetError_d alGetError_ptr = ALNativeLib.LoadFunctionPointer<GetError_d>("alGetError");
/// <summary>Error support. Obtain the most recent error generated in the AL state machine. When an error is detected by AL, a flag is set and the error code is recorded. Further errors, if they occur, do not affect this recorded code. When alGetError is called, the code is returned and the flag is cleared, so that a further error will again record its code.</summary> /// <summary>Error support. Obtain the most recent error generated in the AL state machine. When an error is detected by AL, a flag is set and the error code is recorded. Further errors, if they occur, do not affect this recorded code. When alGetError is called, the code is returned and the flag is cleared, so that a further error will again record its code.</summary>
/// <returns>The first error that occured. can be used with AL.GetString. Returns an Alenum representing the error state. When an OpenAL error occurs, the error state is set and will not be changed until the error state is retrieved using alGetError. Whenever alGetError is called, the error state is cleared and the last state (the current state when the call was made) is returned. To isolate error detection to a specific portion of code, alGetError should be called before the isolated section to clear the current error state.</returns> /// <returns>The first error that occured. can be used with AL.GetString. Returns an Alenum representing the error state. When an OpenAL error occurs, the error state is set and will not be changed until the error state is retrieved using alGetError. Whenever alGetError is called, the error state is cleared and the last state (the current state when the call was made) is returned. To isolate error detection to a specific portion of code, alGetError should be called before the isolated section to clear the current error state.</returns>
[DllImport(AL.Lib, EntryPoint = "alGetError", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static ALError GetError() => alGetError_ptr();
public static extern ALError GetError();
// AL_API ALenum AL_APIENTRY alGetError( void ); // AL_API ALenum AL_APIENTRY alGetError( void );
///<summary>This function tests if a specific Extension is available for the OpenAL driver.</summary> ///<summary>This function tests if a specific Extension is available for the OpenAL driver.</summary>
/// <param name="extname">A string naming the desired extension. Example: "EAX-RAM"</param> /// <param name="extname">A string naming the desired extension. Example: "EAX-RAM"</param>
/// <returns>Returns True if the Extension is available or False if not available.</returns> /// <returns>Returns True if the Extension is available or False if not available.</returns>
[DllImport(AL.Lib, EntryPoint = "alIsExtensionPresent", ExactSpelling = true, CallingConvention = AL.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] public static bool IsExtensionPresent([In] string extname) => IsExtensionPresent_dptr(extname);
public static extern bool IsExtensionPresent([In] string extname); private static IsExtensionPresent_d IsExtensionPresent_dptr = ALNativeLib.LoadFunctionPointer<IsExtensionPresent_d>("alIsExtensionPresent");
private unsafe delegate bool IsExtensionPresent_d([In] string extname);
// AL_API ALboolean AL_APIENTRY alIsExtensionPresent( const ALchar* extname ); // AL_API ALboolean AL_APIENTRY alIsExtensionPresent( const ALchar* extname );
/// <summary>This function returns the address of an OpenAL extension function. Handle with care.</summary> /// <summary>This function returns the address of an OpenAL extension function. Handle with care.</summary>
/// <param name="fname">A string containing the function name.</param> /// <param name="fname">A string containing the function name.</param>
/// <returns>The return value is a pointer to the specified function. The return value will be IntPtr.Zero if the function is not found.</returns> /// <returns>The return value is a pointer to the specified function. The return value will be IntPtr.Zero if the function is not found.</returns>
[DllImport(AL.Lib, EntryPoint = "alGetProcAddress", ExactSpelling = true, CallingConvention = AL.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] public static IntPtr GetProcAddress([In] string fname) => GetProcAddress_dptr(fname);
public static extern IntPtr GetProcAddress([In] string fname); private static GetProcAddress_d GetProcAddress_dptr = ALNativeLib.LoadFunctionPointer<GetProcAddress_d>("alGetProcAddress");
private unsafe delegate IntPtr GetProcAddress_d([In] string fname);
// AL_API void* AL_APIENTRY alGetProcAddress( const ALchar* fname ); // AL_API void* AL_APIENTRY alGetProcAddress( const ALchar* fname );
/// <summary>This function returns the enumeration value of an OpenAL token, described by a string.</summary> /// <summary>This function returns the enumeration value of an OpenAL token, described by a string.</summary>
/// <param name="ename">A string describing an OpenAL token. Example "AL_DISTANCE_MODEL"</param> /// <param name="ename">A string describing an OpenAL token. Example "AL_DISTANCE_MODEL"</param>
/// <returns>Returns the actual ALenum described by a string. Returns 0 if the string doesnt describe a valid OpenAL token.</returns> /// <returns>Returns the actual ALenum described by a string. Returns 0 if the string doesnt describe a valid OpenAL token.</returns>
[DllImport(AL.Lib, EntryPoint = "alGetEnumValue", ExactSpelling = true, CallingConvention = AL.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] public static int GetEnumValue([In] string ename) => GetEnumValue_dptr(ename);
public static extern int GetEnumValue([In] string ename); private static GetEnumValue_d GetEnumValue_dptr = ALNativeLib.LoadFunctionPointer<GetEnumValue_d>("alGetEnumValue");
private unsafe delegate int GetEnumValue_d([In] string ename);
// AL_API ALenum AL_APIENTRY alGetEnumValue( const ALchar* ename ); // AL_API ALenum AL_APIENTRY alGetEnumValue( const ALchar* ename );
/* Listener /* Listener
@ -190,8 +223,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function sets a floating-point property for the listener.</summary> /// <summary>This function sets a floating-point property for the listener.</summary>
/// <param name="param">The name of the attribute to be set: ALListenerf.Gain</param> /// <param name="param">The name of the attribute to be set: ALListenerf.Gain</param>
/// <param name="value">The float value to set the attribute to.</param> /// <param name="value">The float value to set the attribute to.</param>
[DllImport(AL.Lib, EntryPoint = "alListenerf", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void Listener(ALListenerf param, float value) => Listener_dptr(param, value);
public static extern void Listener(ALListenerf param, float value); private static Listener_d Listener_dptr = ALNativeLib.LoadFunctionPointer<Listener_d>("alListenerf");
private unsafe delegate void Listener_d(ALListenerf param, float value);
// AL_API void AL_APIENTRY alListenerf( ALenum param, ALfloat value ); // AL_API void AL_APIENTRY alListenerf( ALenum param, ALfloat value );
/// <summary>This function sets a floating-point property for the listener.</summary> /// <summary>This function sets a floating-point property for the listener.</summary>
@ -199,8 +233,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="value1">The value to set the attribute to.</param> /// <param name="value1">The value to set the attribute to.</param>
/// <param name="value2">The value to set the attribute to.</param> /// <param name="value2">The value to set the attribute to.</param>
/// <param name="value3">The value to set the attribute to.</param> /// <param name="value3">The value to set the attribute to.</param>
[DllImport(AL.Lib, EntryPoint = "alListener3f", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void Listener(ALListener3f param, float value1, float value2, float value3) => Listener3_dptr(param, value1, value2, value3);
public static extern void Listener(ALListener3f param, float value1, float value2, float value3); private static Listener3_d Listener3_dptr = ALNativeLib.LoadFunctionPointer<Listener3_d>("alListener3f");
private unsafe delegate void Listener3_d(ALListener3f param, float value1, float value2, float value3);
// AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); // AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
/// <summary>This function sets a Math.Vector3 property for the listener.</summary> /// <summary>This function sets a Math.Vector3 property for the listener.</summary>
@ -211,8 +246,9 @@ namespace OpenTK.Audio.OpenAL
Listener(param, values.X, values.Y, values.Z); Listener(param, values.X, values.Y, values.Z);
} }
[DllImport(AL.Lib, EntryPoint = "alListenerfv", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] private unsafe delegate void ListenerPrivate_d(ALListenerfv param, float* values);
unsafe private static extern void ListenerPrivate(ALListenerfv param, float* values); private static ListenerPrivate_d alListenerfv_ptr = ALNativeLib.LoadFunctionPointer<ListenerPrivate_d>("alListenerfv");
unsafe private static void ListenerPrivate(ALListenerfv param, float* values) => alListenerfv_ptr(param, values);
// AL_API void AL_APIENTRY alListenerfv( ALenum param, const ALfloat* values ); // AL_API void AL_APIENTRY alListenerfv( ALenum param, const ALfloat* values );
/// <summary>This function sets a floating-point vector property of the listener.</summary> /// <summary>This function sets a floating-point vector property of the listener.</summary>
@ -262,8 +298,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function retrieves a floating-point property of the listener.</summary> /// <summary>This function retrieves a floating-point property of the listener.</summary>
/// <param name="param">the name of the attribute to be retrieved: ALListenerf.Gain</param> /// <param name="param">the name of the attribute to be retrieved: ALListenerf.Gain</param>
/// <param name="value">a pointer to the floating-point value being retrieved.</param> /// <param name="value">a pointer to the floating-point value being retrieved.</param>
[DllImport(AL.Lib, EntryPoint = "alGetListenerf", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void GetListener(ALListenerf param, [Out] out float value) => GetListener_dptr(param, out value);
public static extern void GetListener(ALListenerf param, [Out] out float value); private static GetListener_d GetListener_dptr = ALNativeLib.LoadFunctionPointer<GetListener_d>("alGetListenerf");
private unsafe delegate void GetListener_d(ALListenerf param, [Out] out float value);
// AL_API void AL_APIENTRY alGetListenerf( ALenum param, ALfloat* value ); // AL_API void AL_APIENTRY alGetListenerf( ALenum param, ALfloat* value );
/// <summary>This function retrieves a set of three floating-point values from a property of the listener.</summary> /// <summary>This function retrieves a set of three floating-point values from a property of the listener.</summary>
@ -271,8 +308,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="value1">The first floating-point value being retrieved.</param> /// <param name="value1">The first floating-point value being retrieved.</param>
/// <param name="value2">The second floating-point value being retrieved.</param> /// <param name="value2">The second floating-point value being retrieved.</param>
/// <param name="value3">The third floating-point value being retrieved.</param> /// <param name="value3">The third floating-point value being retrieved.</param>
[DllImport(AL.Lib, EntryPoint = "alGetListener3f", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void GetListener(ALListener3f param, [Out] out float value1, [Out] out float value2, [Out] out float value3) => GetListener3_dptr(param, out value1, out value2, out value3);
public static extern void GetListener(ALListener3f param, [Out] out float value1, [Out] out float value2, [Out] out float value3); private static GetListener3_d GetListener3_dptr = ALNativeLib.LoadFunctionPointer<GetListener3_d>("alGetListener3f");
private unsafe delegate void GetListener3_d(ALListener3f param, [Out] out float value1, [Out] out float value2, [Out] out float value3);
// AL_API void AL_APIENTRY alGetListener3f( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 ); // AL_API void AL_APIENTRY alGetListener3f( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
/// <summary>This function retrieves a Math.Vector3 from a property of the listener.</summary> /// <summary>This function retrieves a Math.Vector3 from a property of the listener.</summary>
@ -286,8 +324,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function retrieves a floating-point vector property of the listener. You must pin it manually.</summary> /// <summary>This function retrieves a floating-point vector property of the listener. You must pin it manually.</summary>
/// <param name="param">the name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity, ALListenerfv.Orientation</param> /// <param name="param">the name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity, ALListenerfv.Orientation</param>
/// <param name="values">A pointer to the floating-point vector value being retrieved.</param> /// <param name="values">A pointer to the floating-point vector value being retrieved.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alGetListenerfv", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] unsafe public static void GetListener(ALListenerfv param, float* values) => GetListenerfv_dptr(param, values);
unsafe public static extern void GetListener(ALListenerfv param, float* values); private static GetListenerfv_d GetListenerfv_dptr = ALNativeLib.LoadFunctionPointer<GetListenerfv_d>("alGetListenerfv");
private unsafe delegate void GetListenerfv_d(ALListenerfv param, float* values);
// AL_API void AL_APIENTRY alGetListenerfv( ALenum param, ALfloat* values ); // AL_API void AL_APIENTRY alGetListenerfv( ALenum param, ALfloat* values );
/// <summary>This function retrieves two Math.Vector3 properties of the listener.</summary> /// <summary>This function retrieves two Math.Vector3 properties of the listener.</summary>
@ -356,8 +395,9 @@ namespace OpenTK.Audio.OpenAL
* Buffers Processed (Query only) AL_BUFFERS_PROCESSED ALint * Buffers Processed (Query only) AL_BUFFERS_PROCESSED ALint
*/ */
[DllImport(AL.Lib, EntryPoint = "alGenSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] private unsafe delegate void GenSourcesPrivate_D(int n, [Out] uint* sources);
unsafe private static extern void GenSourcesPrivate(int n, [Out] uint* sources); private static GenSourcesPrivate_D alGenSources_ptr = ALNativeLib.LoadFunctionPointer<GenSourcesPrivate_D>("alGenSources");
unsafe private static void GenSourcesPrivate(int n, [Out] uint* sources) => alGenSources_ptr(n, sources);
// AL_API void AL_APIENTRY alGenSources( ALsizei n, ALuint* Sources ); // AL_API void AL_APIENTRY alGenSources( ALsizei n, ALuint* Sources );
/// <summary>This function generates one or more sources. References to sources are uint values, which are used wherever a source reference is needed (in calls such as AL.DeleteSources and AL.Source with parameter ALSourcei).</summary> /// <summary>This function generates one or more sources. References to sources are uint values, which are used wherever a source reference is needed (in calls such as AL.DeleteSources and AL.Source with parameter ALSourcei).</summary>
@ -437,22 +477,25 @@ namespace OpenTK.Audio.OpenAL
/// <param name="n">The number of sources to be deleted.</param> /// <param name="n">The number of sources to be deleted.</param>
/// <param name="sources">Pointer to an array of source names identifying the sources to be deleted.</param> /// <param name="sources">Pointer to an array of source names identifying the sources to be deleted.</param>
[CLSCompliant(false)] [CLSCompliant(false)]
[DllImport(AL.Lib, EntryPoint = "alDeleteSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] unsafe public static void DeleteSources(int n, [In] uint* sources) => DeleteSources_dptr(n, sources);
unsafe public static extern void DeleteSources(int n, [In] uint* sources); // Delete Source objects private static DeleteSources_d DeleteSources_dptr = ALNativeLib.LoadFunctionPointer<DeleteSources_d>("alDeleteSources");
// AL_API void AL_APIENTRY alDeleteSources( ALsizei n, const ALuint* Sources ); private unsafe delegate void DeleteSources_d(int n, [In] uint* sources); // Delete Source objects
// AL_API void AL_APIENTRY alDeleteSources( ALsizei n, const ALuint* Sources );
/// <summary>This function deletes one or more sources.</summary> /// <summary>This function deletes one or more sources.</summary>
/// <param name="n">The number of sources to be deleted.</param> /// <param name="n">The number of sources to be deleted.</param>
/// <param name="sources">Reference to a single source, or an array of source names identifying the sources to be deleted.</param> /// <param name="sources">Reference to a single source, or an array of source names identifying the sources to be deleted.</param>
[CLSCompliant(false)] [CLSCompliant(false)]
[DllImport(AL.Lib, EntryPoint = "alDeleteSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void DeleteSources(int n, ref uint sources) => DeleteSources1_dptr(n, ref sources);
public static extern void DeleteSources(int n, ref uint sources); private static DeleteSources1_d DeleteSources1_dptr = AL.ALNativeLib.LoadFunctionPointer<DeleteSources1_d>("alDeleteSources");
private delegate void DeleteSources1_d(int n, ref uint sources);
/// <summary>This function deletes one or more sources.</summary> /// <summary>This function deletes one or more sources.</summary>
/// <param name="n">The number of sources to be deleted.</param> /// <param name="n">The number of sources to be deleted.</param>
/// <param name="sources">Reference to a single source, or an array of source names identifying the sources to be deleted.</param> /// <param name="sources">Reference to a single source, or an array of source names identifying the sources to be deleted.</param>
[DllImport(AL.Lib, EntryPoint = "alDeleteSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void DeleteSources(int n, ref int sources) => DeleteSources2_dptr(n, ref sources);
public static extern void DeleteSources(int n, ref int sources); private static DeleteSources2_d DeleteSources2_dptr = AL.ALNativeLib.LoadFunctionPointer<DeleteSources2_d>("alDeleteSources");
private delegate void DeleteSources2_d(int n, ref int sources);
/// <summary>This function deletes one or more sources.</summary> /// <summary>This function deletes one or more sources.</summary>
/// <param name="sources">An array of source names identifying the sources to be deleted.</param> /// <param name="sources">An array of source names identifying the sources to be deleted.</param>
@ -503,8 +546,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function tests if a source name is valid, returning True if valid and False if not.</summary> /// <summary>This function tests if a source name is valid, returning True if valid and False if not.</summary>
/// <param name="sid">A source name to be tested for validity</param> /// <param name="sid">A source name to be tested for validity</param>
/// <returns>Success.</returns> /// <returns>Success.</returns>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alIsSource", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static bool IsSource(uint sid) => IsSource_dptr(sid);
public static extern bool IsSource(uint sid); private static IsSource_d IsSource_dptr = ALNativeLib.LoadFunctionPointer<IsSource_d>("alIsSource");
private unsafe delegate bool IsSource_d(uint sid);
// AL_API ALboolean AL_APIENTRY alIsSource( ALuint sid ); // AL_API ALboolean AL_APIENTRY alIsSource( ALuint sid );
/// <summary>This function tests if a source name is valid, returning True if valid and False if not.</summary> /// <summary>This function tests if a source name is valid, returning True if valid and False if not.</summary>
@ -519,8 +563,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="sid">Source name whose attribute is being set</param> /// <param name="sid">Source name whose attribute is being set</param>
/// <param name="param">The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.</param> /// <param name="param">The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.</param>
/// <param name="value">The value to set the attribute to.</param> /// <param name="value">The value to set the attribute to.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourcef", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void Source(uint sid, ALSourcef param, float value) => Source_dptr(sid, param, value);
public static extern void Source(uint sid, ALSourcef param, float value); private static Source_d Source_dptr = ALNativeLib.LoadFunctionPointer<Source_d>("alSourcef");
private unsafe delegate void Source_d(uint sid, ALSourcef param, float value);
// AL_API void AL_APIENTRY alSourcef( ALuint sid, ALenum param, ALfloat value ); // AL_API void AL_APIENTRY alSourcef( ALuint sid, ALenum param, ALfloat value );
/// <summary>This function sets a floating-point property of a source.</summary> /// <summary>This function sets a floating-point property of a source.</summary>
@ -538,8 +583,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="value1">The three ALfloat values which the attribute will be set to.</param> /// <param name="value1">The three ALfloat values which the attribute will be set to.</param>
/// <param name="value2">The three ALfloat values which the attribute will be set to.</param> /// <param name="value2">The three ALfloat values which the attribute will be set to.</param>
/// <param name="value3">The three ALfloat values which the attribute will be set to.</param> /// <param name="value3">The three ALfloat values which the attribute will be set to.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSource3f", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void Source(uint sid, ALSource3f param, float value1, float value2, float value3) => Source3_dptr(sid, param, value1, value2, value3);
public static extern void Source(uint sid, ALSource3f param, float value1, float value2, float value3); private static Source3_d Source3_dptr = ALNativeLib.LoadFunctionPointer<Source3_d>("alSource3f");
private unsafe delegate void Source3_d(uint sid, ALSource3f param, float value1, float value2, float value3);
// AL_API void AL_APIENTRY alSource3f( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 ); // AL_API void AL_APIENTRY alSource3f( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
/// <summary>This function sets a source property requiring three floating-point values.</summary> /// <summary>This function sets a source property requiring three floating-point values.</summary>
@ -576,8 +622,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="sid">Source name whose attribute is being set.</param> /// <param name="sid">Source name whose attribute is being set.</param>
/// <param name="param">The name of the attribute to set: ALSourcei.SourceRelative, ConeInnerAngle, ConeOuterAngle, Looping, Buffer, SourceState.</param> /// <param name="param">The name of the attribute to set: ALSourcei.SourceRelative, ConeInnerAngle, ConeOuterAngle, Looping, Buffer, SourceState.</param>
/// <param name="value">The value to set the attribute to.</param> /// <param name="value">The value to set the attribute to.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourcei", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void Source(uint sid, ALSourcei param, int value) => Sourcei_dptr(sid, param, value);
public static extern void Source(uint sid, ALSourcei param, int value); private static Sourcei_d Sourcei_dptr = ALNativeLib.LoadFunctionPointer<Sourcei_d>("alSourcei");
private unsafe delegate void Sourcei_d(uint sid, ALSourcei param, int value);
// AL_API void AL_APIENTRY alSourcei( ALuint sid, ALenum param, ALint value ); // AL_API void AL_APIENTRY alSourcei( ALuint sid, ALenum param, ALint value );
/// <summary>This function sets an integer property of a source.</summary> /// <summary>This function sets an integer property of a source.</summary>
@ -631,8 +678,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="value1">The value to set the attribute to. (EFX Extension) The destination Auxiliary Effect Slot ID</param> /// <param name="value1">The value to set the attribute to. (EFX Extension) The destination Auxiliary Effect Slot ID</param>
/// <param name="value2">The value to set the attribute to. (EFX Extension) The Auxiliary Send number.</param> /// <param name="value2">The value to set the attribute to. (EFX Extension) The Auxiliary Send number.</param>
///<param name="value3">The value to set the attribute to. (EFX Extension) optional Filter ID.</param> ///<param name="value3">The value to set the attribute to. (EFX Extension) optional Filter ID.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSource3i", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void Source(uint sid, ALSource3i param, int value1, int value2, int value3) => Source3i_dptr(sid, param, value1, value2, value3);
public static extern void Source(uint sid, ALSource3i param, int value1, int value2, int value3); private static Source3i_d Source3i_dptr = ALNativeLib.LoadFunctionPointer<Source3i_d>("alSource3i");
private unsafe delegate void Source3i_d(uint sid, ALSource3i param, int value1, int value2, int value3);
// AL_API void AL_APIENTRY alSource3i( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 ); // AL_API void AL_APIENTRY alSource3i( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
/// <summary>This function sets 3 integer properties of a source. This property is used to establish connections between Sources and Auxiliary Effect Slots.</summary> /// <summary>This function sets 3 integer properties of a source. This property is used to establish connections between Sources and Auxiliary Effect Slots.</summary>
@ -654,8 +702,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="sid">Source name whose attribute is being retrieved.</param> /// <param name="sid">Source name whose attribute is being retrieved.</param>
/// <param name="param">The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.</param> /// <param name="param">The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.</param>
/// <param name="value">A pointer to the floating-point value being retrieved</param> /// <param name="value">A pointer to the floating-point value being retrieved</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alGetSourcef", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void GetSource(uint sid, ALSourcef param, [Out] out float value) => GetSource_dptr(sid, param, out value);
public static extern void GetSource(uint sid, ALSourcef param, [Out] out float value); private static GetSource_d GetSource_dptr = ALNativeLib.LoadFunctionPointer<GetSource_d>("alGetSourcef");
private unsafe delegate void GetSource_d(uint sid, ALSourcef param, [Out] out float value);
// AL_API void AL_APIENTRY alGetSourcef( ALuint sid, ALenum param, ALfloat* value ); // AL_API void AL_APIENTRY alGetSourcef( ALuint sid, ALenum param, ALfloat* value );
/// <summary>This function retrieves a floating-point property of a source.</summary> /// <summary>This function retrieves a floating-point property of a source.</summary>
@ -673,8 +722,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="value1">Pointer to the value to retrieve.</param> /// <param name="value1">Pointer to the value to retrieve.</param>
/// <param name="value2">Pointer to the value to retrieve.</param> /// <param name="value2">Pointer to the value to retrieve.</param>
/// <param name="value3">Pointer to the value to retrieve.</param> /// <param name="value3">Pointer to the value to retrieve.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alGetSource3f", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void GetSource(uint sid, ALSource3f param, [Out] out float value1, [Out] out float value2, [Out] out float value3) => GetSource3_dptr(sid, param, out value1, out value2, out value3);
public static extern void GetSource(uint sid, ALSource3f param, [Out] out float value1, [Out] out float value2, [Out] out float value3); private static GetSource3_d GetSource3_dptr = ALNativeLib.LoadFunctionPointer<GetSource3_d>("alGetSource3f");
private unsafe delegate void GetSource3_d(uint sid, ALSource3f param, [Out] out float value1, [Out] out float value2, [Out] out float value3);
// AL_API void AL_APIENTRY alGetSource3f( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3); // AL_API void AL_APIENTRY alGetSource3f( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
/// <summary>This function retrieves three floating-point values representing a property of a source.</summary> /// <summary>This function retrieves three floating-point values representing a property of a source.</summary>
@ -711,8 +761,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="sid">Source name whose attribute is being retrieved.</param> /// <param name="sid">Source name whose attribute is being retrieved.</param>
/// <param name="param">The name of the attribute to retrieve: ALSourcei.SourceRelative, Buffer, SourceState, BuffersQueued, BuffersProcessed.</param> /// <param name="param">The name of the attribute to retrieve: ALSourcei.SourceRelative, Buffer, SourceState, BuffersQueued, BuffersProcessed.</param>
/// <param name="value">A pointer to the integer value being retrieved.</param> /// <param name="value">A pointer to the integer value being retrieved.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alGetSourcei", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void GetSource(uint sid, ALGetSourcei param, [Out] out int value) => GetSourcei_dptr(sid, param, out value);
public static extern void GetSource(uint sid, ALGetSourcei param, [Out] out int value); private static GetSourcei_d GetSourcei_dptr = ALNativeLib.LoadFunctionPointer<GetSourcei_d>("alGetSourcei");
private unsafe delegate void GetSourcei_d(uint sid, ALGetSourcei param, [Out] out int value);
// AL_API void AL_APIENTRY alGetSourcei( ALuint sid, ALenum param, ALint* value ); // AL_API void AL_APIENTRY alGetSourcei( ALuint sid, ALenum param, ALint* value );
/// <summary>This function retrieves an integer property of a source.</summary> /// <summary>This function retrieves an integer property of a source.</summary>
@ -755,8 +806,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function plays a set of sources. The playing sources will have their state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.</summary> /// <summary>This function plays a set of sources. The playing sources will have their state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.</summary>
/// <param name="ns">The number of sources to be played.</param> /// <param name="ns">The number of sources to be played.</param>
/// <param name="sids">A pointer to an array of sources to be played.</param> /// <param name="sids">A pointer to an array of sources to be played.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourcePlayv"), SuppressUnmanagedCodeSecurity] unsafe public static void SourcePlay(int ns, [In] uint* sids) => SourcePlayv_dptr(ns, sids);
unsafe public static extern void SourcePlay(int ns, [In] uint* sids); private static SourcePlayv_d SourcePlayv_dptr = ALNativeLib.LoadFunctionPointer<SourcePlayv_d>("alSourcePlayv");
private unsafe delegate void SourcePlayv_d(int ns, [In] uint* sids);
// AL_API void AL_APIENTRY alSourcePlayv( ALsizei ns, const ALuint *sids ); // AL_API void AL_APIENTRY alSourcePlayv( ALsizei ns, const ALuint *sids );
/// <summary>This function plays a set of sources. The playing sources will have their state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.</summary> /// <summary>This function plays a set of sources. The playing sources will have their state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.</summary>
@ -805,8 +857,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.</summary> /// <summary>This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.</summary>
/// <param name="ns">The number of sources to stop.</param> /// <param name="ns">The number of sources to stop.</param>
/// <param name="sids">A pointer to an array of sources to be stopped.</param> /// <param name="sids">A pointer to an array of sources to be stopped.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourceStopv"), SuppressUnmanagedCodeSecurity] unsafe public static void SourceStop(int ns, [In] uint* sids) => SourceStopv_dptr(ns, sids);
unsafe public static extern void SourceStop(int ns, [In] uint* sids); private static SourceStopv_d SourceStopv_dptr = ALNativeLib.LoadFunctionPointer<SourceStopv_d>("alSourceStopv");
private unsafe delegate void SourceStopv_d(int ns, [In] uint* sids);
// AL_API void AL_APIENTRY alSourceStopv( ALsizei ns, const ALuint *sids ); // AL_API void AL_APIENTRY alSourceStopv( ALsizei ns, const ALuint *sids );
/// <summary>This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.</summary> /// <summary>This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.</summary>
@ -855,8 +908,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function stops a set of sources and sets all their states to ALSourceState.Initial.</summary> /// <summary>This function stops a set of sources and sets all their states to ALSourceState.Initial.</summary>
/// <param name="ns">The number of sources to be rewound.</param> /// <param name="ns">The number of sources to be rewound.</param>
/// <param name="sids">A pointer to an array of sources to be rewound.</param> /// <param name="sids">A pointer to an array of sources to be rewound.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourceRewindv"), SuppressUnmanagedCodeSecurity] unsafe public static void SourceRewind(int ns, [In] uint* sids) => SourceRewindv_dptr(ns, sids);
unsafe public static extern void SourceRewind(int ns, [In] uint* sids); private static SourceRewindv_d SourceRewindv_dptr = ALNativeLib.LoadFunctionPointer<SourceRewindv_d>("alSourceRewindv");
private unsafe delegate void SourceRewindv_d(int ns, [In] uint* sids);
// AL_API void AL_APIENTRY alSourceRewindv( ALsizei ns, const ALuint *sids ); // AL_API void AL_APIENTRY alSourceRewindv( ALsizei ns, const ALuint *sids );
/// <summary>This function stops a set of sources and sets all their states to ALSourceState.Initial.</summary> /// <summary>This function stops a set of sources and sets all their states to ALSourceState.Initial.</summary>
@ -905,8 +959,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.</summary> /// <summary>This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.</summary>
/// <param name="ns">The number of sources to be paused.</param> /// <param name="ns">The number of sources to be paused.</param>
/// <param name="sids">A pointer to an array of sources to be paused.</param> /// <param name="sids">A pointer to an array of sources to be paused.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourcePausev"), SuppressUnmanagedCodeSecurity] unsafe public static void SourcePause(int ns, [In] uint* sids) => SourcePausev_dptr(ns, sids);
unsafe public static extern void SourcePause(int ns, [In] uint* sids); private static SourcePausev_d SourcePausev_dptr = ALNativeLib.LoadFunctionPointer<SourcePausev_d>("alSourcePausev");
private unsafe delegate void SourcePausev_d(int ns, [In] uint* sids);
// AL_API void AL_APIENTRY alSourcePausev( ALsizei ns, const ALuint *sids ); // AL_API void AL_APIENTRY alSourcePausev( ALsizei ns, const ALuint *sids );
/// <summary>This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.</summary> /// <summary>This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.</summary>
@ -953,8 +1008,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function plays, replays or resumes a source. The playing source will have it's state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.</summary> /// <summary>This function plays, replays or resumes a source. The playing source will have it's state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.</summary>
/// <param name="sid">The name of the source to be played.</param> /// <param name="sid">The name of the source to be played.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourcePlay", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void SourcePlay(uint sid) => SourcePlay_dptr(sid);
public static extern void SourcePlay(uint sid); private static SourcePlay_d SourcePlay_dptr = ALNativeLib.LoadFunctionPointer<SourcePlay_d>("alSourcePlay");
private unsafe delegate void SourcePlay_d(uint sid);
// AL_API void AL_APIENTRY alSourcePlay( ALuint sid ); // AL_API void AL_APIENTRY alSourcePlay( ALuint sid );
/// <summary>This function plays, replays or resumes a source. The playing source will have it's state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.</summary> /// <summary>This function plays, replays or resumes a source. The playing source will have it's state changed to ALSourceState.Playing. When called on a source which is already playing, the source will restart at the beginning. When the attached buffer(s) are done playing, the source will progress to the ALSourceState.Stopped state.</summary>
@ -966,8 +1022,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function stops a source. The stopped source will have it's state changed to ALSourceState.Stopped.</summary> /// <summary>This function stops a source. The stopped source will have it's state changed to ALSourceState.Stopped.</summary>
/// <param name="sid">The name of the source to be stopped.</param> /// <param name="sid">The name of the source to be stopped.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourceStop", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void SourceStop(uint sid) => SourceStop_dptr(sid);
public static extern void SourceStop(uint sid); private static SourceStop_d SourceStop_dptr = ALNativeLib.LoadFunctionPointer<SourceStop_d>("alSourceStop");
private unsafe delegate void SourceStop_d(uint sid);
// AL_API void AL_APIENTRY alSourceStop( ALuint sid ); // AL_API void AL_APIENTRY alSourceStop( ALuint sid );
/// <summary>This function stops a source. The stopped source will have it's state changed to ALSourceState.Stopped.</summary> /// <summary>This function stops a source. The stopped source will have it's state changed to ALSourceState.Stopped.</summary>
@ -979,8 +1036,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function stops the source and sets its state to ALSourceState.Initial.</summary> /// <summary>This function stops the source and sets its state to ALSourceState.Initial.</summary>
/// <param name="sid">The name of the source to be rewound.</param> /// <param name="sid">The name of the source to be rewound.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourceRewind", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void SourceRewind(uint sid) => SourceRewind_dptr(sid);
public static extern void SourceRewind(uint sid); private static SourceRewind_d SourceRewind_dptr = ALNativeLib.LoadFunctionPointer<SourceRewind_d>("alSourceRewind");
private unsafe delegate void SourceRewind_d(uint sid);
// AL_API void AL_APIENTRY alSourceRewind( ALuint sid ); // AL_API void AL_APIENTRY alSourceRewind( ALuint sid );
/// <summary>This function stops the source and sets its state to ALSourceState.Initial.</summary> /// <summary>This function stops the source and sets its state to ALSourceState.Initial.</summary>
@ -992,8 +1050,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function pauses a source. The paused source will have its state changed to ALSourceState.Paused.</summary> /// <summary>This function pauses a source. The paused source will have its state changed to ALSourceState.Paused.</summary>
/// <param name="sid">The name of the source to be paused.</param> /// <param name="sid">The name of the source to be paused.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourcePause", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void SourcePause(uint sid) => SourcePause_dptr(sid);
public static extern void SourcePause(uint sid); private static SourcePause_d SourcePause_dptr = ALNativeLib.LoadFunctionPointer<SourcePause_d>("alSourcePause");
private unsafe delegate void SourcePause_d(uint sid);
// AL_API void AL_APIENTRY alSourcePause( ALuint sid ); // AL_API void AL_APIENTRY alSourcePause( ALuint sid );
/// <summary>This function pauses a source. The paused source will have its state changed to ALSourceState.Paused.</summary> /// <summary>This function pauses a source. The paused source will have its state changed to ALSourceState.Paused.</summary>
@ -1007,8 +1066,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="sid">The name of the source to queue buffers onto.</param> /// <param name="sid">The name of the source to queue buffers onto.</param>
/// <param name="numEntries">The number of buffers to be queued.</param> /// <param name="numEntries">The number of buffers to be queued.</param>
/// <param name="bids">A pointer to an array of buffer names to be queued.</param> /// <param name="bids">A pointer to an array of buffer names to be queued.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourceQueueBuffers"), SuppressUnmanagedCodeSecurity] unsafe public static void SourceQueueBuffers(uint sid, int numEntries, [In] uint* bids) => SourceQueueBuffers_dptr(sid, numEntries, bids);
unsafe public static extern void SourceQueueBuffers(uint sid, int numEntries, [In] uint* bids); private static SourceQueueBuffers_d SourceQueueBuffers_dptr = ALNativeLib.LoadFunctionPointer<SourceQueueBuffers_d>("alSourceQueueBuffers");
private unsafe delegate void SourceQueueBuffers_d(uint sid, int numEntries, [In] uint* bids);
// AL_API void AL_APIENTRY alSourceQueueBuffers( ALuint sid, ALsizei numEntries, const ALuint *bids ); // AL_API void AL_APIENTRY alSourceQueueBuffers( ALuint sid, ALsizei numEntries, const ALuint *bids );
/// <summary>This function queues a set of buffers on a source. All buffers attached to a source will be played in sequence, and the number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed. When first created, a source will be of type ALSourceType.Undetermined. A successful AL.SourceQueueBuffers call will change the source type to ALSourceType.Streaming.</summary> /// <summary>This function queues a set of buffers on a source. All buffers attached to a source will be played in sequence, and the number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed. When first created, a source will be of type ALSourceType.Undetermined. A successful AL.SourceQueueBuffers call will change the source type to ALSourceType.Streaming.</summary>
@ -1069,8 +1129,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="sid">The name of the source to unqueue buffers from.</param> /// <param name="sid">The name of the source to unqueue buffers from.</param>
/// <param name="numEntries">The number of buffers to be unqueued.</param> /// <param name="numEntries">The number of buffers to be unqueued.</param>
/// <param name="bids">A pointer to an array of buffer names that were removed.</param> /// <param name="bids">A pointer to an array of buffer names that were removed.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourceUnqueueBuffers"), SuppressUnmanagedCodeSecurity] unsafe public static void SourceUnqueueBuffers(uint sid, int numEntries, [In] uint* bids) => SourceUnqueueBuffers1_dptr(sid, numEntries, bids);
unsafe public static extern void SourceUnqueueBuffers(uint sid, int numEntries, [In] uint* bids); private static SourceUnqueueBuffers1_d SourceUnqueueBuffers1_dptr = ALNativeLib.LoadFunctionPointer<SourceUnqueueBuffers1_d>("alSourceUnqueueBuffers");
private unsafe delegate void SourceUnqueueBuffers1_d(uint sid, int numEntries, [In] uint* bids);
// AL_API void AL_APIENTRY alSourceUnqueueBuffers( ALuint sid, ALsizei numEntries, ALuint *bids ); // AL_API void AL_APIENTRY alSourceUnqueueBuffers( ALuint sid, ALsizei numEntries, ALuint *bids );
/// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary> /// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary>
@ -1078,30 +1139,34 @@ namespace OpenTK.Audio.OpenAL
/// <param name="numEntries">The number of buffers to be unqueued.</param> /// <param name="numEntries">The number of buffers to be unqueued.</param>
/// <param name="bids">A pointer to an array of buffer names that were removed.</param> /// <param name="bids">A pointer to an array of buffer names that were removed.</param>
[CLSCompliant(false)] [CLSCompliant(false)]
[DllImport(AL.Lib, EntryPoint = "alSourceUnqueueBuffers"), SuppressUnmanagedCodeSecurity] public static void SourceUnqueueBuffers(uint sid, int numEntries, [Out] uint[] bids) => SourceUnqueueBuffers2_dptr(sid, numEntries, bids);
public static extern void SourceUnqueueBuffers(uint sid, int numEntries, [Out] uint[] bids); private static SourceUnqueueBuffers2_d SourceUnqueueBuffers2_dptr = ALNativeLib.LoadFunctionPointer<SourceUnqueueBuffers2_d>("alSourceUnqueueBuffers");
private delegate void SourceUnqueueBuffers2_d(uint sid, int numEntries, [Out] uint[] bids);
/// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary> /// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary>
/// <param name="sid">The name of the source to unqueue buffers from.</param> /// <param name="sid">The name of the source to unqueue buffers from.</param>
/// <param name="numEntries">The number of buffers to be unqueued.</param> /// <param name="numEntries">The number of buffers to be unqueued.</param>
/// <param name="bids">A pointer to an array of buffer names that were removed.</param> /// <param name="bids">A pointer to an array of buffer names that were removed.</param>
[DllImport(AL.Lib, EntryPoint = "alSourceUnqueueBuffers"), SuppressUnmanagedCodeSecurity] public static void SourceUnqueueBuffers(int sid, int numEntries, [Out] int[] bids) => SourceUnqueueBuffers3_dptr(sid, numEntries, bids);
public static extern void SourceUnqueueBuffers(int sid, int numEntries, [Out] int[] bids); private static SourceUnqueueBuffers3_d SourceUnqueueBuffers3_dptr = ALNativeLib.LoadFunctionPointer<SourceUnqueueBuffers3_d>("alSourceUnqueueBuffers");
private delegate void SourceUnqueueBuffers3_d(int sid, int numEntries, [Out] int[] bids);
/// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary> /// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary>
/// <param name="sid">The name of the source to unqueue buffers from.</param> /// <param name="sid">The name of the source to unqueue buffers from.</param>
/// <param name="numEntries">The number of buffers to be unqueued.</param> /// <param name="numEntries">The number of buffers to be unqueued.</param>
/// <param name="bids">A pointer to an array of buffer names that were removed.</param> /// <param name="bids">A pointer to an array of buffer names that were removed.</param>
[CLSCompliant(false)] [CLSCompliant(false)]
[DllImport(AL.Lib, EntryPoint = "alSourceUnqueueBuffers"), SuppressUnmanagedCodeSecurity] public static void SourceUnqueueBuffers(uint sid, int numEntries, ref uint bids) => SourceUnqueueBuffers4_dptr(sid, numEntries, ref bids);
public static extern void SourceUnqueueBuffers(uint sid, int numEntries, ref uint bids); private static SourceUnqueueBuffers4_d SourceUnqueueBuffers4_dptr = ALNativeLib.LoadFunctionPointer<SourceUnqueueBuffers4_d>("alSourceUnqueueBuffers");
private delegate void SourceUnqueueBuffers4_d(uint sid, int numEntries, ref uint bids);
/// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary> /// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary>
/// <param name="sid">The name of the source to unqueue buffers from.</param> /// <param name="sid">The name of the source to unqueue buffers from.</param>
/// <param name="numEntries">The number of buffers to be unqueued.</param> /// <param name="numEntries">The number of buffers to be unqueued.</param>
/// <param name="bids">A pointer to an array of buffer names that were removed.</param> /// <param name="bids">A pointer to an array of buffer names that were removed.</param>
[DllImport(AL.Lib, EntryPoint = "alSourceUnqueueBuffers"), SuppressUnmanagedCodeSecurity] public static void SourceUnqueueBuffers(int sid, int numEntries, ref int bids) => SourceUnqueueBuffers5_dptr(sid, numEntries, ref bids);
public static extern void SourceUnqueueBuffers(int sid, int numEntries, ref int bids); private static SourceUnqueueBuffers5_d SourceUnqueueBuffers5_dptr = ALNativeLib.LoadFunctionPointer<SourceUnqueueBuffers5_d>("alSourceUnqueueBuffers");
private delegate void SourceUnqueueBuffers5_d(int sid, int numEntries, ref int bids);
/// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary> /// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using AL.GetSource with parameter ALGetSourcei.BuffersProcessed, which is the maximum number of buffers that can be unqueued using this call. The unqueue operation will only take place if all n buffers can be removed from the queue.</summary>
/// <param name="sid">The name of the source to unqueue buffers from.</param> /// <param name="sid">The name of the source to unqueue buffers from.</param>
@ -1144,16 +1209,14 @@ namespace OpenTK.Audio.OpenAL
/// <param name="n">The number of buffers to be generated.</param> /// <param name="n">The number of buffers to be generated.</param>
/// <param name="buffers">Pointer to an array of uint values which will store the names of the new buffers.</param> /// <param name="buffers">Pointer to an array of uint values which will store the names of the new buffers.</param>
[CLSCompliant(false)] [CLSCompliant(false)]
[DllImport(AL.Lib, EntryPoint = "alGenBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity] unsafe public static void GenBuffers(int n, [Out] uint* buffers) => GenBuffers_dptr(n, buffers);
unsafe public static extern void GenBuffers(int n, [Out] uint* buffers); private static GenBuffers_d GenBuffers_dptr = ALNativeLib.LoadFunctionPointer<GenBuffers_d>("alGenBuffers");
// AL_API void AL_APIENTRY alGenBuffers( ALsizei n, ALuint* Buffers ); private unsafe delegate void GenBuffers_d(int n, [Out] uint* buffers);
/// <summary>This function generates one or more buffers, which contain audio buffer (see AL.BufferData). References to buffers are uint values, which are used wherever a buffer reference is needed (in calls such as AL.DeleteBuffers, AL.Source with parameter ALSourcei, AL.SourceQueueBuffers, and AL.SourceUnqueueBuffers).</summary> unsafe public static void GenBuffers(int n, [Out] int* buffers) => GenBuffersS_dptr(n, buffers);
/// <param name="n">The number of buffers to be generated.</param> private static GenBuffersS_d GenBuffersS_dptr = ALNativeLib.LoadFunctionPointer<GenBuffersS_d>("alGenBuffers");
/// <param name="buffers">Pointer to an array of uint values which will store the names of the new buffers.</param> private unsafe delegate void GenBuffersS_d(int n, [Out] int* buffers);
[CLSCompliant(false)] // AL_API void AL_APIENTRY alGenBuffers( ALsizei n, ALuint* Buffers );
[DllImport(AL.Lib, EntryPoint = "alGenBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity]
unsafe public static extern void GenBuffers(int n, [Out] int* buffers);
/// <summary>This function generates one or more buffers, which contain audio buffer (see AL.BufferData). References to buffers are uint values, which are used wherever a buffer reference is needed (in calls such as AL.DeleteBuffers, AL.Source with parameter ALSourcei, AL.SourceQueueBuffers, and AL.SourceUnqueueBuffers).</summary> /// <summary>This function generates one or more buffers, which contain audio buffer (see AL.BufferData). References to buffers are uint values, which are used wherever a buffer reference is needed (in calls such as AL.DeleteBuffers, AL.Source with parameter ALSourcei, AL.SourceQueueBuffers, and AL.SourceUnqueueBuffers).</summary>
/// <param name="n">The number of buffers to be generated.</param> /// <param name="n">The number of buffers to be generated.</param>
@ -1215,16 +1278,18 @@ namespace OpenTK.Audio.OpenAL
/// <param name="n">The number of buffers to be deleted.</param> /// <param name="n">The number of buffers to be deleted.</param>
/// <param name="buffers">Pointer to an array of buffer names identifying the buffers to be deleted.</param> /// <param name="buffers">Pointer to an array of buffer names identifying the buffers to be deleted.</param>
[CLSCompliant(false)] [CLSCompliant(false)]
[DllImport(AL.Lib, EntryPoint = "alDeleteBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] unsafe public static void DeleteBuffers(int n, [In] uint* buffers) => DeleteBuffers_dptr(n, buffers);
unsafe public static extern void DeleteBuffers(int n, [In] uint* buffers); private static DeleteBuffers_d DeleteBuffers_dptr = ALNativeLib.LoadFunctionPointer<DeleteBuffers_d>("alDeleteBuffers");
private unsafe delegate void DeleteBuffers_d(int n, [In] uint* buffers);
// AL_API void AL_APIENTRY alDeleteBuffers( ALsizei n, const ALuint* Buffers ); // AL_API void AL_APIENTRY alDeleteBuffers( ALsizei n, const ALuint* Buffers );
/// <summary>This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary> /// <summary>This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary>
/// <param name="n">The number of buffers to be deleted.</param> /// <param name="n">The number of buffers to be deleted.</param>
/// <param name="buffers">Pointer to an array of buffer names identifying the buffers to be deleted.</param> /// <param name="buffers">Pointer to an array of buffer names identifying the buffers to be deleted.</param>
[CLSCompliant(false)] [CLSCompliant(false)]
[DllImport(AL.Lib, EntryPoint = "alDeleteBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] unsafe public static void DeleteBuffers(int n, [In] int* buffers) => DeleteBuffersS_dptr(n, buffers);
unsafe public static extern void DeleteBuffers(int n, [In] int* buffers); private static DeleteBuffersS_d DeleteBuffersS_dptr = ALNativeLib.LoadFunctionPointer<DeleteBuffersS_d>("alDeleteBuffers");
private unsafe delegate void DeleteBuffersS_d(int n, [In] int* buffers);
/// <summary>This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary> /// <summary>This function deletes one or more buffers, freeing the resources used by the buffer. Buffers which are attached to a source can not be deleted. See AL.Source (ALSourcei) and AL.SourceUnqueueBuffers for information on how to detach a buffer from a source.</summary>
/// <param name="n">The number of buffers to be deleted.</param> /// <param name="n">The number of buffers to be deleted.</param>
@ -1304,8 +1369,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function tests if a buffer name is valid, returning True if valid, False if not.</summary> /// <summary>This function tests if a buffer name is valid, returning True if valid, False if not.</summary>
/// <param name="bid">A buffer Handle previously allocated with <see cref="GenBuffers(int)"/>.</param> /// <param name="bid">A buffer Handle previously allocated with <see cref="GenBuffers(int)"/>.</param>
/// <returns>Success.</returns> /// <returns>Success.</returns>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alIsBuffer", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static bool IsBuffer(uint bid) => IsBuffer_dptr(bid);
public static extern bool IsBuffer(uint bid); private static IsBuffer_d IsBuffer_dptr = ALNativeLib.LoadFunctionPointer<IsBuffer_d>("alIsBuffer");
private unsafe delegate bool IsBuffer_d(uint bid);
// AL_API ALboolean AL_APIENTRY alIsBuffer( ALuint bid ); // AL_API ALboolean AL_APIENTRY alIsBuffer( ALuint bid );
/// <summary>This function tests if a buffer name is valid, returning True if valid, False if not.</summary> /// <summary>This function tests if a buffer name is valid, returning True if valid, False if not.</summary>
@ -1323,8 +1389,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="buffer">Pointer to a pinned audio buffer.</param> /// <param name="buffer">Pointer to a pinned audio buffer.</param>
/// <param name="size">The size of the audio buffer in bytes.</param> /// <param name="size">The size of the audio buffer in bytes.</param>
/// <param name="freq">The frequency of the audio buffer.</param> /// <param name="freq">The frequency of the audio buffer.</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alBufferData", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void BufferData(uint bid, ALFormat format, IntPtr buffer, int size, int freq) => BufferData_dptr(bid, format, buffer, size, freq);
public static extern void BufferData(uint bid, ALFormat format, IntPtr buffer, int size, int freq); private static BufferData_d BufferData_dptr = ALNativeLib.LoadFunctionPointer<BufferData_d>("alBufferData");
private unsafe delegate void BufferData_d(uint bid, ALFormat format, IntPtr buffer, int size, int freq);
// AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* buffer, ALsizei size, ALsizei freq ); // AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* buffer, ALsizei size, ALsizei freq );
/// <summary>This function fills a buffer with audio buffer. All the pre-defined formats are PCM buffer, but this function may be used by extensions to load other buffer types as well.</summary> /// <summary>This function fills a buffer with audio buffer. All the pre-defined formats are PCM buffer, but this function may be used by extensions to load other buffer types as well.</summary>
@ -1383,8 +1450,9 @@ namespace OpenTK.Audio.OpenAL
/// <param name="bid">Buffer name whose attribute is being retrieved</param> /// <param name="bid">Buffer name whose attribute is being retrieved</param>
/// <param name="param">The name of the attribute to be retrieved: ALGetBufferi.Frequency, Bits, Channels, Size, and the currently hidden AL_DATA (dangerous).</param> /// <param name="param">The name of the attribute to be retrieved: ALGetBufferi.Frequency, Bits, Channels, Size, and the currently hidden AL_DATA (dangerous).</param>
/// <param name="value">A pointer to an int to hold the retrieved buffer</param> /// <param name="value">A pointer to an int to hold the retrieved buffer</param>
[CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alGetBufferi", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void GetBuffer(uint bid, ALGetBufferi param, [Out] out int value) => GetBuffer_dptr(bid, param, out value);
public static extern void GetBuffer(uint bid, ALGetBufferi param, [Out] out int value); private static GetBuffer_d GetBuffer_dptr = ALNativeLib.LoadFunctionPointer<GetBuffer_d>("alGetBufferi");
private unsafe delegate void GetBuffer_d(uint bid, ALGetBufferi param, [Out] out int value);
// AL_API void AL_APIENTRY alGetBufferi( ALuint bid, ALenum param, ALint* value ); // AL_API void AL_APIENTRY alGetBufferi( ALuint bid, ALenum param, ALint* value );
/// <summary>This function retrieves an integer property of a buffer.</summary> /// <summary>This function retrieves an integer property of a buffer.</summary>
@ -1404,20 +1472,23 @@ namespace OpenTK.Audio.OpenAL
/// <summary>AL.DopplerFactor is a simple scaling of source and listener velocities to exaggerate or deemphasize the Doppler (pitch) shift resulting from the calculation.</summary> /// <summary>AL.DopplerFactor is a simple scaling of source and listener velocities to exaggerate or deemphasize the Doppler (pitch) shift resulting from the calculation.</summary>
/// <param name="value">A negative value will result in an error, the command is then ignored. The default value is 1f. The current setting can be queried using AL.Get with parameter ALGetFloat.SpeedOfSound.</param> /// <param name="value">A negative value will result in an error, the command is then ignored. The default value is 1f. The current setting can be queried using AL.Get with parameter ALGetFloat.SpeedOfSound.</param>
[DllImport(AL.Lib, EntryPoint = "alDopplerFactor", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void DopplerFactor(float value) => DopplerFactor_dptr(value);
public static extern void DopplerFactor(float value); private static DopplerFactor_d DopplerFactor_dptr = ALNativeLib.LoadFunctionPointer<DopplerFactor_d>("alDopplerFactor");
private unsafe delegate void DopplerFactor_d(float value);
// AL_API void AL_APIENTRY alDopplerFactor( ALfloat value ); // AL_API void AL_APIENTRY alDopplerFactor( ALfloat value );
/// <summary>This function is deprecated and should not be used.</summary> /// <summary>This function is deprecated and should not be used.</summary>
/// <param name="value">The default is 1.0f.</param> /// <param name="value">The default is 1.0f.</param>
[DllImport(AL.Lib, EntryPoint = "alDopplerVelocity", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void DopplerVelocity(float value) => DopplerVelocity_dptr(value);
public static extern void DopplerVelocity(float value); private static DopplerVelocity_d DopplerVelocity_dptr = ALNativeLib.LoadFunctionPointer<DopplerVelocity_d>("alDopplerVelocity");
private unsafe delegate void DopplerVelocity_d(float value);
// AL_API void AL_APIENTRY alDopplerVelocity( ALfloat value ); // AL_API void AL_APIENTRY alDopplerVelocity( ALfloat value );
/// <summary>AL.SpeedOfSound allows the application to change the reference (propagation) speed used in the Doppler calculation. The source and listener velocities should be expressed in the same units as the speed of sound.</summary> /// <summary>AL.SpeedOfSound allows the application to change the reference (propagation) speed used in the Doppler calculation. The source and listener velocities should be expressed in the same units as the speed of sound.</summary>
/// <param name="value">A negative or zero value will result in an error, and the command is ignored. Default: 343.3f (appropriate for velocity units of meters and air as the propagation medium). The current setting can be queried using AL.Get with parameter ALGetFloat.SpeedOfSound.</param> /// <param name="value">A negative or zero value will result in an error, and the command is ignored. Default: 343.3f (appropriate for velocity units of meters and air as the propagation medium). The current setting can be queried using AL.Get with parameter ALGetFloat.SpeedOfSound.</param>
[DllImport(AL.Lib, EntryPoint = "alSpeedOfSound", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void SpeedOfSound(float value) => SpeedOfSound_dptr(value);
public static extern void SpeedOfSound(float value); private static SpeedOfSound_d SpeedOfSound_dptr = ALNativeLib.LoadFunctionPointer<SpeedOfSound_d>("alSpeedOfSound");
private unsafe delegate void SpeedOfSound_d(float value);
// AL_API void AL_APIENTRY alSpeedOfSound( ALfloat value ); // AL_API void AL_APIENTRY alSpeedOfSound( ALfloat value );
/// <summary>This function selects the OpenAL distance model ALDistanceModel.InverseDistance, ALDistanceModel.InverseDistanceClamped, ALDistanceModel.LinearDistance, ALDistanceModel.LinearDistanceClamped, ALDistanceModel.ExponentDistance, ALDistanceModel.ExponentDistanceClamped, or ALDistanceModel.None. The default distance model in OpenAL is ALDistanceModel.InverseDistanceClamped.</summary> /// <summary>This function selects the OpenAL distance model ALDistanceModel.InverseDistance, ALDistanceModel.InverseDistanceClamped, ALDistanceModel.LinearDistance, ALDistanceModel.LinearDistanceClamped, ALDistanceModel.ExponentDistance, ALDistanceModel.ExponentDistanceClamped, or ALDistanceModel.None. The default distance model in OpenAL is ALDistanceModel.InverseDistanceClamped.</summary>
@ -1451,8 +1522,9 @@ namespace OpenTK.Audio.OpenAL
/// gain = 1f; /// gain = 1f;
/// </remarks> /// </remarks>
/// <param name="distancemodel"></param> /// <param name="distancemodel"></param>
[DllImport(AL.Lib, EntryPoint = "alDistanceModel", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()] public static void DistanceModel(ALDistanceModel distancemodel) => DistanceModel_dptr(distancemodel);
public static extern void DistanceModel(ALDistanceModel distancemodel); private static DistanceModel_d DistanceModel_dptr = ALNativeLib.LoadFunctionPointer<DistanceModel_d>("alDistanceModel");
private unsafe delegate void DistanceModel_d(ALDistanceModel distancemodel);
// AL_API void AL_APIENTRY alDistanceModel( ALenum distanceModel ); // AL_API void AL_APIENTRY alDistanceModel( ALenum distanceModel );
/// <summary>(Helper) Returns Source state information.</summary> /// <summary>(Helper) Returns Source state information.</summary>

View file

@ -71,11 +71,9 @@ namespace OpenTK.Audio.OpenAL
/// <summary>Alc = Audio Library Context</summary> /// <summary>Alc = Audio Library Context</summary>
public static class Alc public static class Alc
{ {
private const string Lib = AL.Lib; private unsafe delegate IntPtr d_alcCreateContext(IntPtr device, int* attrList);
private const CallingConvention Style = CallingConvention.Cdecl; private static d_alcCreateContext ptr_alcCreateContext = AL.ALNativeLib.LoadFunctionPointer<d_alcCreateContext>("alcCreateContext");
unsafe static IntPtr sys_CreateContext([In] IntPtr device, [In] int* attrlist) => ptr_alcCreateContext(device, attrlist);
[DllImport(Alc.Lib, EntryPoint = "alcCreateContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity]
private unsafe static extern IntPtr sys_CreateContext([In] IntPtr device, [In] int* attrlist);
/// <summary>This function creates a context using a specified device.</summary> /// <summary>This function creates a context using a specified device.</summary>
/// <param name="device">a pointer to a device</param> /// <param name="device">a pointer to a device</param>
@ -105,20 +103,22 @@ namespace OpenTK.Audio.OpenAL
} }
} }
[DllImport(Alc.Lib, EntryPoint = "alcMakeContextCurrent", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] static bool MakeContextCurrent(IntPtr context) => MakeContextCurrent_dptr(context);
private static extern bool MakeContextCurrent(IntPtr context); private static MakeContextCurrent_d MakeContextCurrent_dptr = AL.ALNativeLib.LoadFunctionPointer<MakeContextCurrent_d>("alcMakeContextCurrent");
private delegate bool MakeContextCurrent_d(IntPtr context);
/// <summary>This function makes a specified context the current context.</summary> /// <summary>This function makes a specified context the current context.</summary>
/// <param name="context">A pointer to the new context.</param> /// <param name="context">A pointer to the new context.</param>
/// <returns>Returns True on success, or False on failure.</returns> /// <returns>Returns True on success, or False on failure.</returns>
public static bool MakeContextCurrent(ContextHandle context) public static bool MakeContextCurrent(ContextHandle context)
{ {
return MakeContextCurrent(context.Handle); return MakeContextCurrent(context.Handle);
} }
// ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context ); // ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
[DllImport(Alc.Lib, EntryPoint = "alcProcessContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] static void ProcessContext(IntPtr context) => ProcessContext_dptr(context);
private static extern void ProcessContext(IntPtr context); private static ProcessContext_d ProcessContext_dptr = AL.ALNativeLib.LoadFunctionPointer<ProcessContext_d>("alcProcessContext");
private delegate void ProcessContext_d(IntPtr context);
/// <summary>This function tells a context to begin processing. When a context is suspended, changes in OpenAL state will be accepted but will not be processed. alcSuspendContext can be used to suspend a context, and then all the OpenAL state changes can be applied at once, followed by a call to alcProcessContext to apply all the state changes immediately. In some cases, this procedure may be more efficient than application of properties in a non-suspended state. In some implementations, process and suspend calls are each a NOP.</summary> /// <summary>This function tells a context to begin processing. When a context is suspended, changes in OpenAL state will be accepted but will not be processed. alcSuspendContext can be used to suspend a context, and then all the OpenAL state changes can be applied at once, followed by a call to alcProcessContext to apply all the state changes immediately. In some cases, this procedure may be more efficient than application of properties in a non-suspended state. In some implementations, process and suspend calls are each a NOP.</summary>
/// <param name="context">a pointer to the new context</param> /// <param name="context">a pointer to the new context</param>
@ -128,8 +128,9 @@ namespace OpenTK.Audio.OpenAL
} }
// ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context ); // ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context );
[DllImport(Alc.Lib, EntryPoint = "alcSuspendContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] static void SuspendContext(IntPtr context) => SuspendContext_dptr(context);
private static extern void SuspendContext(IntPtr context); private static SuspendContext_d SuspendContext_dptr = AL.ALNativeLib.LoadFunctionPointer<SuspendContext_d>("alcSuspendContext");
private delegate void SuspendContext_d(IntPtr context);
/// <summary>This function suspends processing on a specified context. When a context is suspended, changes in OpenAL state will be accepted but will not be processed. A typical use of alcSuspendContext would be to suspend a context, apply all the OpenAL state changes at once, and then call alcProcessContext to apply all the state changes at once. In some cases, this procedure may be more efficient than application of properties in a non-suspended state. In some implementations, process and suspend calls are each a NOP.</summary> /// <summary>This function suspends processing on a specified context. When a context is suspended, changes in OpenAL state will be accepted but will not be processed. A typical use of alcSuspendContext would be to suspend a context, apply all the OpenAL state changes at once, and then call alcProcessContext to apply all the state changes at once. In some cases, this procedure may be more efficient than application of properties in a non-suspended state. In some implementations, process and suspend calls are each a NOP.</summary>
/// <param name="context">a pointer to the context to be suspended.</param> /// <param name="context">a pointer to the context to be suspended.</param>
@ -139,8 +140,9 @@ namespace OpenTK.Audio.OpenAL
} }
// ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context ); // ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context );
[DllImport(Alc.Lib, EntryPoint = "alcDestroyContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] static void DestroyContext(IntPtr context) => DestroyContext_dptr(context);
private static extern void DestroyContext(IntPtr context); private static DestroyContext_d DestroyContext_dptr = AL.ALNativeLib.LoadFunctionPointer<DestroyContext_d>("alcDestroyContext");
private delegate void DestroyContext_d(IntPtr context);
/// <summary>This function destroys a context.</summary> /// <summary>This function destroys a context.</summary>
/// <param name="context">a pointer to the new context.</param> /// <param name="context">a pointer to the new context.</param>
@ -150,8 +152,9 @@ namespace OpenTK.Audio.OpenAL
} }
// ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context ); // ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context );
[DllImport(Alc.Lib, EntryPoint = "alcGetCurrentContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] private static IntPtr sys_GetCurrentContext() => sys_GetCurrentContext_dptr();
private static extern IntPtr sys_GetCurrentContext(); private static sys_GetCurrentContext_d sys_GetCurrentContext_dptr = AL.ALNativeLib.LoadFunctionPointer<sys_GetCurrentContext_d>("alcGetCurrentContext");
private delegate IntPtr sys_GetCurrentContext_d();
/// <summary>This function retrieves the current context.</summary> /// <summary>This function retrieves the current context.</summary>
/// <returns>Returns a pointer to the current context.</returns> /// <returns>Returns a pointer to the current context.</returns>
@ -161,8 +164,9 @@ namespace OpenTK.Audio.OpenAL
} }
// ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void ); // ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void );
[DllImport(Alc.Lib, EntryPoint = "alcGetContextsDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] static IntPtr GetContextsDevice(IntPtr context) => GetContextsDevice_dptr(context);
private static extern IntPtr GetContextsDevice(IntPtr context); private static GetContextsDevice_d GetContextsDevice_dptr = AL.ALNativeLib.LoadFunctionPointer<GetContextsDevice_d>("alcGetContextsDevice");
private delegate IntPtr GetContextsDevice_d(IntPtr context);
/// <summary>This function retrieves a context's device pointer.</summary> /// <summary>This function retrieves a context's device pointer.</summary>
/// <param name="context">a pointer to a context.</param> /// <param name="context">a pointer to a context.</param>
@ -176,50 +180,57 @@ namespace OpenTK.Audio.OpenAL
/// <summary>This function opens a device by name.</summary> /// <summary>This function opens a device by name.</summary>
/// <param name="devicename">a null-terminated string describing a device.</param> /// <param name="devicename">a null-terminated string describing a device.</param>
/// <returns>Returns a pointer to the opened device. The return value will be NULL if there is an error.</returns> /// <returns>Returns a pointer to the opened device. The return value will be NULL if there is an error.</returns>
[DllImport(Alc.Lib, EntryPoint = "alcOpenDevice", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] public static IntPtr OpenDevice([In] string devicename) => OpenDevice_dptr(devicename);
public static extern IntPtr OpenDevice([In] string devicename); private static OpenDevice_d OpenDevice_dptr = AL.ALNativeLib.LoadFunctionPointer<OpenDevice_d>("alcOpenDevice");
private delegate IntPtr OpenDevice_d([In] string devicename);
// ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename ); // ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
/// <summary>This function closes a device by name.</summary> /// <summary>This function closes a device by name.</summary>
/// <param name="device">a pointer to an opened device</param> /// <param name="device">a pointer to an opened device</param>
/// <returns>True will be returned on success or False on failure. Closing a device will fail if the device contains any contexts or buffers.</returns> /// <returns>True will be returned on success or False on failure. Closing a device will fail if the device contains any contexts or buffers.</returns>
[DllImport(Alc.Lib, EntryPoint = "alcCloseDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] public static bool CloseDevice([In] IntPtr device) => CloseDevice_dptr(device);
public static extern bool CloseDevice([In] IntPtr device); private static CloseDevice_d CloseDevice_dptr = AL.ALNativeLib.LoadFunctionPointer<CloseDevice_d>("alcCloseDevice");
private delegate bool CloseDevice_d([In] IntPtr device);
// ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device ); // ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
/// <summary>This function retrieves the current context error state.</summary> /// <summary>This function retrieves the current context error state.</summary>
/// <param name="device">a pointer to the device to retrieve the error state from</param> /// <param name="device">a pointer to the device to retrieve the error state from</param>
/// <returns>Errorcode Int32.</returns> /// <returns>Errorcode Int32.</returns>
[DllImport(Alc.Lib, EntryPoint = "alcGetError", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] public static AlcError GetError([In] IntPtr device) => GetError_dptr(device);
public static extern AlcError GetError([In] IntPtr device); private static GetError_d GetError_dptr = AL.ALNativeLib.LoadFunctionPointer<GetError_d>("alcGetError");
private delegate AlcError GetError_d([In] IntPtr device);
// ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device ); // ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device );
/// <summary>This function queries if a specified context extension is available.</summary> /// <summary>This function queries if a specified context extension is available.</summary>
/// <param name="device">a pointer to the device to be queried for an extension.</param> /// <param name="device">a pointer to the device to be queried for an extension.</param>
/// <param name="extname">a null-terminated string describing the extension.</param> /// <param name="extname">a null-terminated string describing the extension.</param>
/// <returns>Returns True if the extension is available, False if the extension is not available.</returns> /// <returns>Returns True if the extension is available, False if the extension is not available.</returns>
[DllImport(Alc.Lib, EntryPoint = "alcIsExtensionPresent", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] public static bool IsExtensionPresent([In] IntPtr device, [In] string extname) => IsExtensionPresent_dptr(device, extname);
public static extern bool IsExtensionPresent([In] IntPtr device, [In] string extname); private static IsExtensionPresent_d IsExtensionPresent_dptr = AL.ALNativeLib.LoadFunctionPointer<IsExtensionPresent_d>("alcIsExtensionPresent");
private delegate bool IsExtensionPresent_d([In] IntPtr device, [In] string extname);
// ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname ); // ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
/// <summary>This function retrieves the address of a specified context extension function.</summary> /// <summary>This function retrieves the address of a specified context extension function.</summary>
/// <param name="device">a pointer to the device to be queried for the function.</param> /// <param name="device">a pointer to the device to be queried for the function.</param>
/// <param name="funcname">a null-terminated string describing the function.</param> /// <param name="funcname">a null-terminated string describing the function.</param>
/// <returns>Returns the address of the function, or NULL if it is not found.</returns> /// <returns>Returns the address of the function, or NULL if it is not found.</returns>
[DllImport(Alc.Lib, EntryPoint = "alcGetProcAddress", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] public static IntPtr GetProcAddress([In] IntPtr device, [In] string funcname) => GetProcAddress_dptr(device, funcname);
public static extern IntPtr GetProcAddress([In] IntPtr device, [In] string funcname); private static GetProcAddress_d GetProcAddress_dptr = AL.ALNativeLib.LoadFunctionPointer<GetProcAddress_d>("alcGetProcAddress");
private delegate IntPtr GetProcAddress_d([In] IntPtr device, [In] string funcname);
// ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname ); // ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
/// <summary>This function retrieves the enum value for a specified enumeration name.</summary> /// <summary>This function retrieves the enum value for a specified enumeration name.</summary>
/// <param name="device">a pointer to the device to be queried.</param> /// <param name="device">a pointer to the device to be queried.</param>
/// <param name="enumname">a null terminated string describing the enum value.</param> /// <param name="enumname">a null terminated string describing the enum value.</param>
/// <returns>Returns the enum value described by the enumName string. This is most often used for querying an enum value for an ALC extension.</returns> /// <returns>Returns the enum value described by the enumName string. This is most often used for querying an enum value for an ALC extension.</returns>
[DllImport(Alc.Lib, EntryPoint = "alcGetEnumValue", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] public static int GetEnumValue([In] IntPtr device, [In] string enumname) => GetEnumValue_dptr(device, enumname);
public static extern int GetEnumValue([In] IntPtr device, [In] string enumname); private static GetEnumValue_d GetEnumValue_dptr = AL.ALNativeLib.LoadFunctionPointer<GetEnumValue_d>("alcGetEnumValue");
private delegate int GetEnumValue_d([In] IntPtr device, [In] string enumname);
// ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname ); // ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
[DllImport(Alc.Lib, EntryPoint = "alcGetString", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] private delegate IntPtr GetStringPrivate_d([In] IntPtr device, AlcGetString param);
private static extern IntPtr GetStringPrivate([In] IntPtr device, AlcGetString param); private static GetStringPrivate_d alcGetString_ptr = AL.ALNativeLib.LoadFunctionPointer<GetStringPrivate_d>("alcGetString");
private static IntPtr GetStringPrivate([In] IntPtr device, AlcGetString param) => alcGetString_ptr(device, param);
// ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param ); // ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
/// <summary>This function returns pointers to strings related to the context.</summary> /// <summary>This function returns pointers to strings related to the context.</summary>
@ -306,8 +317,9 @@ namespace OpenTK.Audio.OpenAL
return result; return result;
} }
[DllImport(Alc.Lib, EntryPoint = "alcGetIntegerv", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] unsafe static void GetInteger(IntPtr device, AlcGetInteger param, int size, int* data) => GetInteger_dptr(device, param, size, data);
private unsafe static extern void GetInteger(IntPtr device, AlcGetInteger param, int size, int* data); private static GetInteger_d GetInteger_dptr = AL.ALNativeLib.LoadFunctionPointer<GetInteger_d>("alcGetIntegerv");
private unsafe delegate void GetInteger_d(IntPtr device, AlcGetInteger param, int size, int* data);
// ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *buffer ); // ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *buffer );
/// <summary>This function returns integers related to the context.</summary> /// <summary>This function returns integers related to the context.</summary>
@ -348,46 +360,44 @@ namespace OpenTK.Audio.OpenAL
/// <param name="format">the requested capture buffer format.</param> /// <param name="format">the requested capture buffer format.</param>
/// <param name="buffersize">the size of the capture buffer in samples, not bytes.</param> /// <param name="buffersize">the size of the capture buffer in samples, not bytes.</param>
/// <returns>Returns the capture device pointer, or NULL on failure.</returns> /// <returns>Returns the capture device pointer, or NULL on failure.</returns>
[CLSCompliant(false), DllImport(Alc.Lib, EntryPoint = "alcCaptureOpenDevice", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()] public static IntPtr CaptureOpenDevice(string devicename, uint frequency, ALFormat format, int buffersize) => CaptureOpenDevice_dptr(devicename, frequency, format, buffersize);
public static extern IntPtr CaptureOpenDevice(string devicename, uint frequency, ALFormat format, int buffersize); private static CaptureOpenDevice_d CaptureOpenDevice_dptr = AL.ALNativeLib.LoadFunctionPointer<CaptureOpenDevice_d>("alcCaptureOpenDevice");
private delegate IntPtr CaptureOpenDevice_d(string devicename, uint frequency, ALFormat format, int buffersize);
/// <summary>This function opens a capture device by name. </summary> public static IntPtr CaptureOpenDevice(string devicename, int frequency, ALFormat format, int buffersize) => CaptureOpenDeviceS_dptr(devicename, frequency, format, buffersize);
/// <param name="devicename">a pointer to a device name string.</param> private static CaptureOpenDeviceS_d CaptureOpenDeviceS_dptr = AL.ALNativeLib.LoadFunctionPointer<CaptureOpenDeviceS_d>("alcCaptureOpenDevice");
/// <param name="frequency">the frequency that the buffer should be captured at.</param> private delegate IntPtr CaptureOpenDeviceS_d(string devicename, int frequency, ALFormat format, int buffersize);
/// <param name="format">the requested capture buffer format.</param>
/// <param name="buffersize">the size of the capture buffer in samples, not bytes.</param>
/// <returns>Returns the capture device pointer, or NULL on failure.</returns>
[DllImport(Alc.Lib, EntryPoint = "alcCaptureOpenDevice", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
public static extern IntPtr CaptureOpenDevice(string devicename, int frequency, ALFormat format, int buffersize);
// ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
/// <summary>This function closes the specified capture device.</summary> /// <summary>This function closes the specified capture device.</summary>
/// <param name="device">a pointer to a capture device.</param> /// <param name="device">a pointer to a capture device.</param>
/// <returns>Returns True if the close operation was successful, False on failure.</returns> /// <returns>Returns True if the close operation was successful, False on failure.</returns>
[DllImport(Alc.Lib, EntryPoint = "alcCaptureCloseDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] public static bool CaptureCloseDevice([In] IntPtr device) => CaptureCloseDevice_dptr(device);
public static extern bool CaptureCloseDevice([In] IntPtr device); private static CaptureCloseDevice_d CaptureCloseDevice_dptr = AL.ALNativeLib.LoadFunctionPointer<CaptureCloseDevice_d>("alcCaptureCloseDevice");
private delegate bool CaptureCloseDevice_d([In] IntPtr device);
// ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device ); // ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
/// <summary>This function begins a capture operation.</summary> /// <summary>This function begins a capture operation.</summary>
/// <remarks>alcCaptureStart will begin recording to an internal ring buffer of the size specified when opening the capture device. The application can then retrieve the number of samples currently available using the ALC_CAPTURE_SAPMPLES token with alcGetIntegerv. When the application determines that enough samples are available for processing, then it can obtain them with a call to alcCaptureSamples.</remarks> /// <remarks>alcCaptureStart will begin recording to an internal ring buffer of the size specified when opening the capture device. The application can then retrieve the number of samples currently available using the ALC_CAPTURE_SAPMPLES token with alcGetIntegerv. When the application determines that enough samples are available for processing, then it can obtain them with a call to alcCaptureSamples.</remarks>
/// <param name="device">a pointer to a capture device.</param> /// <param name="device">a pointer to a capture device.</param>
[DllImport(Alc.Lib, EntryPoint = "alcCaptureStart", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] public static void CaptureStart([In] IntPtr device) => CaptureStart_dptr(device);
public static extern void CaptureStart([In] IntPtr device); private static CaptureStart_d CaptureStart_dptr = AL.ALNativeLib.LoadFunctionPointer<CaptureStart_d>("alcCaptureStart");
private delegate void CaptureStart_d([In] IntPtr device);
// ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device ); // ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device );
/// <summary>This function stops a capture operation.</summary> /// <summary>This function stops a capture operation.</summary>
/// <param name="device">a pointer to a capture device.</param> /// <param name="device">a pointer to a capture device.</param>
[DllImport(Alc.Lib, EntryPoint = "alcCaptureStop", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] public static void CaptureStop([In] IntPtr device) => CaptureStop_dptr(device);
public static extern void CaptureStop([In] IntPtr device); private static CaptureStop_d CaptureStop_dptr = AL.ALNativeLib.LoadFunctionPointer<CaptureStop_d>("alcCaptureStop");
private delegate void CaptureStop_d([In] IntPtr device);
// ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device ); // ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device );
/// <summary>This function completes a capture operation, and does not block.</summary> /// <summary>This function completes a capture operation, and does not block.</summary>
/// <param name="device">a pointer to a capture device.</param> /// <param name="device">a pointer to a capture device.</param>
/// <param name="buffer">a pointer to a buffer, which must be large enough to accommodate the number of samples.</param> /// <param name="buffer">a pointer to a buffer, which must be large enough to accommodate the number of samples.</param>
/// <param name="samples">the number of samples to be retrieved.</param> /// <param name="samples">the number of samples to be retrieved.</param>
[DllImport(Alc.Lib, EntryPoint = "alcCaptureSamples", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()] public static void CaptureSamples(IntPtr device, IntPtr buffer, int samples) => CaptureSamples_dptr(device, buffer, samples);
public static extern void CaptureSamples(IntPtr device, IntPtr buffer, int samples); private static CaptureSamples_d CaptureSamples_dptr = AL.ALNativeLib.LoadFunctionPointer<CaptureSamples_d>("alcCaptureSamples");
private delegate void CaptureSamples_d(IntPtr device, IntPtr buffer, int samples);
// ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); // ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
/// <summary>This function completes a capture operation, and does not block.</summary> /// <summary>This function completes a capture operation, and does not block.</summary>
@ -440,7 +450,5 @@ namespace OpenTK.Audio.OpenAL
{ {
CaptureSamples(device, ref buffer[0, 0, 0], samples); CaptureSamples(device, ref buffer[0, 0, 0], samples);
} }
} }
} }

View file

@ -402,9 +402,9 @@ namespace OpenTK.Platform.SDL2
public static JoystickGuid JoystickGetGUID(IntPtr joystick) => SDL_JoystickGetGUID_ptr(joystick); public static JoystickGuid JoystickGetGUID(IntPtr joystick) => SDL_JoystickGetGUID_ptr(joystick);
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
private delegate JoystickGuid SDL_JoystickInstanceID_d(IntPtr joystick); private delegate int SDL_JoystickInstanceID_d(IntPtr joystick);
private static SDL_JoystickInstanceID_d SDL_JoystickInstanceID_ptr = NativeLib.LoadFunctionPointer<SDL_JoystickInstanceID_d>("SDL_JoystickInstanceID"); private static SDL_JoystickInstanceID_d SDL_JoystickInstanceID_ptr = NativeLib.LoadFunctionPointer<SDL_JoystickInstanceID_d>("SDL_JoystickInstanceID");
public static JoystickGuid JoystickInstanceID(IntPtr joystick) => SDL_JoystickInstanceID_ptr(joystick); public static int JoystickInstanceID(IntPtr joystick) => SDL_JoystickInstanceID_ptr(joystick);
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
private delegate IntPtr SDL_JoystickName_d(IntPtr joystick); private delegate IntPtr SDL_JoystickName_d(IntPtr joystick);