mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-12 20:55:37 +00:00
at least 1 CLSCompliant overload per function.
This commit is contained in:
parent
3ee626a08f
commit
15a97e4628
|
@ -67,7 +67,8 @@ namespace OpenTK.OpenAL
|
|||
{
|
||||
|
||||
// AL = Audio Library
|
||||
public static class AL
|
||||
[CLSCompliant( true )]
|
||||
public static partial class AL
|
||||
{
|
||||
#region Constants
|
||||
|
||||
|
@ -384,6 +385,8 @@ namespace OpenTK.OpenAL
|
|||
|
||||
#region Create Source objects
|
||||
|
||||
#region GenSources()
|
||||
|
||||
[DllImport( AL.Lib, EntryPoint = "alGenSources", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
|
||||
unsafe private static extern void GenSourcesPrivate( int n, [Out] uint* sources );
|
||||
// AL_API void AL_APIENTRY alGenSources( ALsizei n, ALuint* Sources );
|
||||
|
@ -404,6 +407,21 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>This function generates one or more sources. References to sources are int values, which are used wherever a source reference is needed (in calls such as AL.DeleteSources and AL.Source with parameter ALSourcei).</summary>
|
||||
/// <param name="n">The number of sources to be generated.</param>
|
||||
/// <param name="sources">Pointer to an array of int values which will store the names of the new sources.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void GenSources( int n, out int[] sources )
|
||||
{
|
||||
uint[] temp = new uint[n];
|
||||
GenSources( n, out temp[0] );
|
||||
sources = new int[n];
|
||||
for ( int i = 0; i < n; i++ )
|
||||
{
|
||||
sources[i] = (int) temp[i];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>This function generates one source only. 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>
|
||||
/// <param name="source">Pointer to an uint value which will store the name of the new source.</param>
|
||||
[CLSCompliant( false )]
|
||||
|
@ -412,6 +430,20 @@ namespace OpenTK.OpenAL
|
|||
GenSources( 1, out source );
|
||||
}
|
||||
|
||||
/// <summary>This function generates one source only. References to sources are int values, which are used wherever a source reference is needed (in calls such as AL.DeleteSources and AL.Source with parameter ALSourcei).</summary>
|
||||
/// <param name="source">Pointer to an int value which will store the name of the new source.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void GenSources( out int source )
|
||||
{
|
||||
uint temp;
|
||||
GenSources( 1, out temp );
|
||||
source = (int) temp;
|
||||
}
|
||||
|
||||
#endregion GenSources()
|
||||
|
||||
#region DeleteSources()
|
||||
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alDeleteSources", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
|
||||
unsafe public static extern void DeleteSources( int n, [In] uint* sources ); // Delete Source objects
|
||||
// AL_API void AL_APIENTRY alDeleteSources( ALsizei n, const ALuint* Sources );
|
||||
|
@ -431,16 +463,44 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>This function deletes one or more sources.</summary>
|
||||
/// <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>
|
||||
[CLSCompliant( true )]
|
||||
public static void DeleteSources( int n, ref int[] sources )
|
||||
{
|
||||
uint[] temp = new uint[n];
|
||||
for ( int i = 0; i < n; i++ )
|
||||
{
|
||||
temp[i] = (uint) sources[i];
|
||||
}
|
||||
DeleteSources( n, ref temp );
|
||||
}
|
||||
|
||||
/// <summary>This function deletes one source only.</summary>
|
||||
/// <param name="source">Pointer to a source name identifying the source to be deleted.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void DeleteSources( ref uint source )
|
||||
{
|
||||
uint[] t = new uint[1];
|
||||
t[0] = source;
|
||||
DeleteSources(1,ref t);
|
||||
uint[] temp = new uint[1];
|
||||
temp[0] = source;
|
||||
DeleteSources( 1, ref temp );
|
||||
}
|
||||
|
||||
/// <summary>This function deletes one source only.</summary>
|
||||
/// <param name="source">Pointer to a source name identifying the source to be deleted.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void DeleteSources( ref int source )
|
||||
{
|
||||
uint[] temp = new uint[1];
|
||||
temp[0] = (uint) source;
|
||||
DeleteSources( 1, ref temp );
|
||||
}
|
||||
|
||||
#endregion DeleteSources()
|
||||
|
||||
#region IsSource()
|
||||
|
||||
/// <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>
|
||||
/// <returns>Success.</returns>
|
||||
|
@ -448,10 +508,23 @@ namespace OpenTK.OpenAL
|
|||
public static extern bool IsSource( uint 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>
|
||||
/// <param name="sid">A source name to be tested for validity</param>
|
||||
/// <returns>Success.</returns>
|
||||
[CLSCompliant( true )]
|
||||
public static bool IsSource( int sid )
|
||||
{
|
||||
return IsSource( (uint) sid );
|
||||
}
|
||||
|
||||
#endregion IsSource()
|
||||
|
||||
#endregion Create Source objects
|
||||
|
||||
#region Set Source parameters
|
||||
|
||||
#region Sourcef
|
||||
|
||||
/// <summary>This function sets a floating point property of a source.</summary>
|
||||
/// <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>
|
||||
|
@ -460,6 +533,20 @@ namespace OpenTK.OpenAL
|
|||
public static extern void Source( uint sid, Enums.ALSourcef param, float 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>
|
||||
/// <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="value">The value to set the attribute to.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void Source( int sid, Enums.ALSourcef param, float value )
|
||||
{
|
||||
Source( (uint) sid, param, value );
|
||||
}
|
||||
|
||||
#endregion Sourcef
|
||||
|
||||
#region Source3f
|
||||
|
||||
/// <summary>This function sets a source property requiring three floating point values.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being set.</param>
|
||||
/// <param name="param">The name of the attribute to set: ALSource3f.Position, Velocity, Direction.</param>
|
||||
|
@ -470,6 +557,18 @@ namespace OpenTK.OpenAL
|
|||
public static extern void Source( uint sid, Enums.ALSource3f param, float value1, float value2, float 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>
|
||||
/// <param name="sid">Source name whose attribute is being set.</param>
|
||||
/// <param name="param">The name of the attribute to set: ALSource3f.Position, Velocity, Direction.</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="value3">The three ALfloat values which the attribute will be set to.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void Source( int sid, Enums.ALSource3f param, float value1, float value2, float value3 )
|
||||
{
|
||||
Source( (uint) sid, param, value1, value2, value3 );
|
||||
}
|
||||
|
||||
/// <summary>This function sets a source property requiring three floating point values.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being set.</param>
|
||||
/// <param name="param">The name of the attribute to set: ALSource3f.Position, Velocity, Direction.</param>
|
||||
|
@ -480,6 +579,20 @@ namespace OpenTK.OpenAL
|
|||
Source( sid, param, values.X, values.Y, values.Z );
|
||||
}
|
||||
|
||||
/// <summary>This function sets a source property requiring three floating point values.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being set.</param>
|
||||
/// <param name="param">The name of the attribute to set: ALSource3f.Position, Velocity, Direction.</param>
|
||||
/// <param name="values">A Math.Vector3 which the attribute will be set to.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void Source( int sid, Enums.ALSource3f param, ref Vector3 values )
|
||||
{
|
||||
Source( (uint) sid, param, values.X, values.Y, values.Z );
|
||||
}
|
||||
|
||||
#endregion Source3f
|
||||
|
||||
#region Sourcei
|
||||
|
||||
/// <summary>This function sets an integer property of a source.</summary>
|
||||
/// <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>
|
||||
|
@ -488,6 +601,16 @@ namespace OpenTK.OpenAL
|
|||
public static extern void Source( uint sid, Enums.ALSourcei param, int value );
|
||||
// AL_API void AL_APIENTRY alSourcei( ALuint sid, ALenum param, ALint value );
|
||||
|
||||
/// <summary>This function sets an integer property of a source.</summary>
|
||||
/// <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="value">The value to set the attribute to.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void Source( int sid, Enums.ALSourcei param, int value )
|
||||
{
|
||||
Source( (uint) sid, param, value );
|
||||
}
|
||||
|
||||
/// <summary>This function sets an bool property of a source.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being set.</param>
|
||||
/// <param name="param">The name of the attribute to set: ALSourceb.SourceRelative, Looping.</param>
|
||||
|
@ -498,6 +621,16 @@ namespace OpenTK.OpenAL
|
|||
Source( sid, (Enums.ALSourcei) param, ( value ) ? 1 : 0 );
|
||||
}
|
||||
|
||||
/// <summary>This function sets an bool property of a source.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being set.</param>
|
||||
/// <param name="param">The name of the attribute to set: ALSourceb.SourceRelative, Looping.</param>
|
||||
/// <param name="value">The value to set the attribute to.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void Source( int sid, Enums.ALSourceb param, bool value )
|
||||
{
|
||||
Source( (uint) sid, (Enums.ALSourcei) param, ( value ) ? 1 : 0 );
|
||||
}
|
||||
|
||||
/// <summary>(Helper) Binds a Buffer to a Source handle.</summary>
|
||||
/// <param name="source">Source name to attach the Buffer to.</param>
|
||||
/// <param name="buffer">Buffer name which is attached to the Source.</param>
|
||||
|
@ -507,6 +640,19 @@ namespace OpenTK.OpenAL
|
|||
Source( source, Enums.ALSourcei.Buffer, (int) buffer );
|
||||
}
|
||||
|
||||
/// <summary>(Helper) Binds a Buffer to a Source handle.</summary>
|
||||
/// <param name="source">Source name to attach the Buffer to.</param>
|
||||
/// <param name="buffer">Buffer name which is attached to the Source.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void BindBufferToSource( int source, int buffer )
|
||||
{
|
||||
Source( (uint) source, Enums.ALSourcei.Buffer, buffer );
|
||||
}
|
||||
|
||||
#endregion Sourcei
|
||||
|
||||
#region Source3i
|
||||
|
||||
/// <summary>This function sets 3 integer properties of a source. This property is used to establish connections between Sources and Auxiliary Effect Slots.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being set.</param>
|
||||
/// <param name="param">The name of the attribute to set: EfxAuxiliarySendFilter</param>
|
||||
|
@ -517,6 +663,20 @@ namespace OpenTK.OpenAL
|
|||
public static extern void Source( uint sid, Enums.ALSource3i param, int value1, int value2, int 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>
|
||||
/// <param name="sid">Source name whose attribute is being set.</param>
|
||||
/// <param name="param">The name of the attribute to set: EfxAuxiliarySendFilter</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="value3">The value to set the attribute to. (EFX Extension) optional Filter ID.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void Source( int sid, Enums.ALSource3i param, int value1, int value2, int value3 )
|
||||
{
|
||||
Source( (uint) sid, param, value1, value2, value3 );
|
||||
}
|
||||
|
||||
#endregion Source3i
|
||||
|
||||
// Not used by any Enum:
|
||||
// AL_API void AL_APIENTRY alSourcefv( ALuint sid, ALenum param, const ALfloat* values );
|
||||
// AL_API void AL_APIENTRY alSourceiv( ALuint sid, ALenum param, const ALint* values );
|
||||
|
@ -525,6 +685,8 @@ namespace OpenTK.OpenAL
|
|||
|
||||
#region Get Source parameters
|
||||
|
||||
#region GetSourcef
|
||||
|
||||
/// <summary>This function retrieves a floating point property of a source.</summary>
|
||||
/// <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>
|
||||
|
@ -533,6 +695,20 @@ namespace OpenTK.OpenAL
|
|||
public static extern void GetSource( uint sid, Enums.ALSourcef param, [Out] out float 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>
|
||||
/// <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="value">A pointer to the floating point value being retrieved</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void GetSource( int sid, Enums.ALSourcef param, out float value )
|
||||
{
|
||||
GetSource( (uint) sid, param, out value );
|
||||
}
|
||||
|
||||
#endregion GetSourcef
|
||||
|
||||
#region GetSource3f
|
||||
|
||||
/// <summary>This function retrieves three floating point values representing a property of a source.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being retrieved.</param>
|
||||
/// <param name="param">the name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.</param>
|
||||
|
@ -543,6 +719,18 @@ namespace OpenTK.OpenAL
|
|||
public static extern void GetSource( uint sid, Enums.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);
|
||||
|
||||
/// <summary>This function retrieves three floating point values representing a property of a source.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being retrieved.</param>
|
||||
/// <param name="param">the name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.</param>
|
||||
/// <param name="value1">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>
|
||||
[CLSCompliant( true )]
|
||||
public static void GetSource( int sid, Enums.ALSource3f param, out float value1, out float value2, out float value3 )
|
||||
{
|
||||
GetSource( (uint) sid, param, out value1, out value2, out value3 );
|
||||
}
|
||||
|
||||
/// <summary>This function retrieves three floating point values representing a property of a source.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being retrieved.</param>
|
||||
/// <param name="param">the name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.</param>
|
||||
|
@ -553,6 +741,20 @@ namespace OpenTK.OpenAL
|
|||
GetSource( sid, param, out values.X, out values.Y, out values.Z );
|
||||
}
|
||||
|
||||
/// <summary>This function retrieves three floating point values representing a property of a source.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being retrieved.</param>
|
||||
/// <param name="param">the name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.</param>
|
||||
/// <param name="values">A Math.Vector3 to retrieve the values to.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void GetSource( int sid, Enums.ALSource3f param, out Vector3 values )
|
||||
{
|
||||
GetSource( (uint) sid, param, out values.X, out values.Y, out values.Z );
|
||||
}
|
||||
|
||||
#endregion GetSource3f
|
||||
|
||||
#region GetSourcei
|
||||
|
||||
/// <summary>This function retrieves an integer property of a source.</summary>
|
||||
/// <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>
|
||||
|
@ -561,12 +763,22 @@ namespace OpenTK.OpenAL
|
|||
public static extern void GetSource( uint sid, Enums.ALGetSourcei param, [Out] out int value );
|
||||
// AL_API void AL_APIENTRY alGetSourcei( ALuint sid, ALenum param, ALint* value );
|
||||
|
||||
/// <summary>This function retrieves an integer property of a source.</summary>
|
||||
/// <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="value">A pointer to the integer value being retrieved.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void GetSource( int sid, Enums.ALGetSourcei param, out int value )
|
||||
{
|
||||
GetSource( (uint) sid, param, out value );
|
||||
}
|
||||
|
||||
/// <summary>This function retrieves a bool property of a source.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being retrieved.</param>
|
||||
/// <param name="param">The name of the attribute to get: ALSourceb.SourceRelative, Looping.</param>
|
||||
/// <param name="value">A pointer to the bool value being retrieved.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void GetSource( uint sid,Enums.ALSourceb param,[Out] out bool value )
|
||||
public static void GetSource( uint sid, Enums.ALSourceb param, out bool value )
|
||||
{
|
||||
int result;
|
||||
GetSource( sid, (Enums.ALGetSourcei) param, out result );
|
||||
|
@ -576,6 +788,23 @@ namespace OpenTK.OpenAL
|
|||
value = false;
|
||||
}
|
||||
|
||||
/// <summary>This function retrieves a bool property of a source.</summary>
|
||||
/// <param name="sid">Source name whose attribute is being retrieved.</param>
|
||||
/// <param name="param">The name of the attribute to get: ALSourceb.SourceRelative, Looping.</param>
|
||||
/// <param name="value">A pointer to the bool value being retrieved.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void GetSource( int sid, Enums.ALSourceb param, out bool value )
|
||||
{
|
||||
int result;
|
||||
GetSource( (uint) sid, (Enums.ALGetSourcei) param, out result );
|
||||
if ( result == 1 )
|
||||
value = true;
|
||||
else
|
||||
value = false;
|
||||
}
|
||||
|
||||
#endregion GetSourcei
|
||||
|
||||
// Not used by any Enum:
|
||||
// AL_API void AL_APIENTRY alGetSource3i( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
|
||||
// AL_API void AL_APIENTRY alGetSourcefv( ALuint sid, ALenum param, ALfloat* values );
|
||||
|
@ -585,6 +814,11 @@ namespace OpenTK.OpenAL
|
|||
|
||||
#region Source vector based playback calls
|
||||
|
||||
#region SourcePlay
|
||||
|
||||
/// <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="sids">A pointer to an array of sources to be played.</param>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alSourcePlayv" ), SuppressUnmanagedCodeSecurity]
|
||||
unsafe public static extern void SourcePlay( int ns, [In] uint* sids );
|
||||
// AL_API void AL_APIENTRY alSourcePlayv( ALsizei ns, const ALuint *sids );
|
||||
|
@ -593,7 +827,7 @@ namespace OpenTK.OpenAL
|
|||
/// <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>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourcePlay( int ns,[In] uint[] sids )
|
||||
public static void SourcePlay( int ns, uint[] sids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -604,11 +838,25 @@ namespace OpenTK.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>
|
||||
/// <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>
|
||||
[CLSCompliant( true )]
|
||||
public static void SourcePlay( int ns, int[] sids )
|
||||
{
|
||||
uint[] temp = new uint[ns];
|
||||
for ( int i = 0; i < ns; i++ )
|
||||
{
|
||||
temp[i] = (uint) sids[i];
|
||||
}
|
||||
SourcePlay( ns, temp );
|
||||
}
|
||||
|
||||
/// <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="sids">A pointer to an array of sources to be played.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourcePlay( int ns,[In] ref uint sids )
|
||||
public static void SourcePlay( int ns, ref uint sids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -619,6 +867,13 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
#endregion SourcePlay
|
||||
|
||||
#region SourceStop
|
||||
|
||||
/// <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="sids">A pointer to an array of sources to be stopped.</param>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alSourceStopv" ), SuppressUnmanagedCodeSecurity]
|
||||
unsafe public static extern void SourceStop( int ns, [In] uint* sids );
|
||||
// AL_API void AL_APIENTRY alSourceStopv( ALsizei ns, const ALuint *sids );
|
||||
|
@ -627,7 +882,7 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="ns">The number of sources to stop.</param>
|
||||
/// <param name="sids">A pointer to an array of sources to be stopped.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourceStop( int ns,[In] uint[] sids )
|
||||
public static void SourceStop( int ns, uint[] sids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -638,11 +893,25 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
/// <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="sids">A pointer to an array of sources to be stopped.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void SourceStop( int ns, int[] sids )
|
||||
{
|
||||
uint[] temp = new uint[ns];
|
||||
for ( int i = 0; i < ns; i++ )
|
||||
{
|
||||
temp[i] = (uint) sids[i];
|
||||
}
|
||||
SourceStop( ns, temp );
|
||||
}
|
||||
|
||||
/// <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="sids">A pointer to an array of sources to be stopped.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourceStop( int ns,[In] ref uint sids )
|
||||
public static void SourceStop( int ns, ref uint sids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -653,6 +922,13 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
#endregion SourceStop
|
||||
|
||||
#region SourceRewind
|
||||
|
||||
/// <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="sids">A pointer to an array of sources to be rewound.</param>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alSourceRewindv" ), SuppressUnmanagedCodeSecurity]
|
||||
unsafe public static extern void SourceRewind( int ns, [In] uint* sids );
|
||||
// AL_API void AL_APIENTRY alSourceRewindv( ALsizei ns, const ALuint *sids );
|
||||
|
@ -661,7 +937,7 @@ namespace OpenTK.OpenAL
|
|||
/// <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>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourceRewind( int ns,[In] uint[] sids )
|
||||
public static void SourceRewind( int ns, uint[] sids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -672,11 +948,25 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
/// <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="sids">A pointer to an array of sources to be rewound.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void SourceRewind( int ns, int[] sids )
|
||||
{
|
||||
uint[] temp = new uint[ns];
|
||||
for ( int i = 0; i < ns; i++ )
|
||||
{
|
||||
temp[i] = (uint) sids[i];
|
||||
}
|
||||
SourceRewind( ns, temp );
|
||||
}
|
||||
|
||||
/// <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="sids">A pointer to an array of sources to be rewound.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourceRewind( int ns,[In] ref uint sids )
|
||||
public static void SourceRewind( int ns, ref uint sids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -687,6 +977,13 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
#endregion SourceRewind
|
||||
|
||||
#region SourcePause
|
||||
|
||||
/// <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="sids">A pointer to an array of sources to be paused.</param>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alSourcePausev" ), SuppressUnmanagedCodeSecurity]
|
||||
unsafe public static extern void SourcePause( int ns, [In] uint* sids );
|
||||
// AL_API void AL_APIENTRY alSourcePausev( ALsizei ns, const ALuint *sids );
|
||||
|
@ -695,7 +992,7 @@ namespace OpenTK.OpenAL
|
|||
/// <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>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourcePause( int ns,[In] uint[] sids )
|
||||
public static void SourcePause( int ns, uint[] sids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -705,12 +1002,25 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
}
|
||||
/// <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="sids">A pointer to an array of sources to be paused.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void SourcePause( int ns, int[] sids )
|
||||
{
|
||||
uint[] temp = new uint[ns];
|
||||
for ( int i = 0; i < ns; i++ )
|
||||
{
|
||||
temp[i] = (uint) sids[i];
|
||||
}
|
||||
SourcePause( ns, temp );
|
||||
}
|
||||
|
||||
/// <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="sids">A pointer to an array of sources to be paused.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourcePause( int ns,[In] ref uint sids )
|
||||
public static void SourcePause( int ns, ref uint sids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -721,48 +1031,104 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
#endregion SourcePause
|
||||
|
||||
#endregion Source vector based playback calls
|
||||
|
||||
#region Source based playback calls
|
||||
|
||||
#region SourcePlay
|
||||
|
||||
/// <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>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alSourcePlay", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
|
||||
public static extern void SourcePlay( uint 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>
|
||||
/// <param name="sid">The name of the source to be played.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void SourcePlay( int sid )
|
||||
{
|
||||
SourcePlay( (uint) sid );
|
||||
}
|
||||
|
||||
#endregion SourcePlay
|
||||
|
||||
#region SourceStop
|
||||
|
||||
/// <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>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alSourceStop", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
|
||||
public static extern void SourceStop( uint 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>
|
||||
/// <param name="sid">The name of the source to be stopped.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void SourceStop( int sid )
|
||||
{
|
||||
SourceStop( (uint) sid );
|
||||
}
|
||||
|
||||
#endregion SourceStop
|
||||
|
||||
#region SourceRewind
|
||||
|
||||
/// <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>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alSourceRewind", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
|
||||
public static extern void SourceRewind( uint sid );
|
||||
// AL_API void AL_APIENTRY alSourceRewind( ALuint sid );
|
||||
|
||||
/// <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>
|
||||
[CLSCompliant( true )]
|
||||
public static void SourceRewind( int sid )
|
||||
{
|
||||
SourceRewind( (uint) sid );
|
||||
}
|
||||
|
||||
#endregion SourceRewind
|
||||
|
||||
#region SourcePause
|
||||
|
||||
/// <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>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alSourcePause", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
|
||||
public static extern void SourcePause( uint 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>
|
||||
/// <param name="sid">The name of the source to be paused.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void SourcePause( int sid )
|
||||
{
|
||||
SourcePause( (uint) sid );
|
||||
}
|
||||
|
||||
#endregion SourcePause
|
||||
|
||||
#endregion Source based playback calls
|
||||
|
||||
#region Source Queuing
|
||||
|
||||
#region SourceQueueBuffers
|
||||
|
||||
/// <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>
|
||||
/// <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="bids">A pointer to an array of buffer names to be queued.</param>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alSourceQueueBuffers" ), SuppressUnmanagedCodeSecurity]
|
||||
unsafe public static extern void SourceQueueBuffers( uint sid, int numEntries, [In] uint* 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 an alSourcei call to retrieve AL_BUFFERS_PROCESSED. When first created, a source will be of type AL_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>
|
||||
/// <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="bids">A pointer to an array of buffer names to be queued.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourceQueueBuffers( uint sid,int numEntries,[In] uint[] bids )
|
||||
public static void SourceQueueBuffers( uint sid, int numEntries, uint[] bids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -773,12 +1139,27 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
/// <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 an alSourcei call to retrieve AL_BUFFERS_PROCESSED. When first created, a source will be of type AL_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>
|
||||
/// <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="bids">A pointer to an array of buffer names to be queued.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void SourceQueueBuffers( int sid, int numEntries, int[] bids )
|
||||
{
|
||||
uint[] temp = new uint[numEntries];
|
||||
for ( int i = 0; i < numEntries; i++ )
|
||||
{
|
||||
temp[i] = (uint) bids[i];
|
||||
}
|
||||
SourceQueueBuffers( (uint) sid, numEntries, temp );
|
||||
}
|
||||
|
||||
/// <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>
|
||||
/// <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="bids">A pointer to an array of buffer names to be queued.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourceQueueBuffers( uint sid,int numEntries,[In] ref uint bids )
|
||||
public static void SourceQueueBuffers( uint sid, int numEntries, ref uint bids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -789,16 +1170,24 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
#endregion SourceQueueBuffers
|
||||
|
||||
#region SourceUnqueueBuffers
|
||||
|
||||
/// <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="numEntries">The number of buffers to be unqueued.</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 extern void SourceUnqueueBuffers( uint sid, int numEntries, [In] uint* 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 an alSourcei call to retrieve AL_BUFFERS_PROCESSED, 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="numEntries">The number of buffers to be unqueued.</param>
|
||||
/// <param name="bids">A pointer to an array of buffer names that were removed.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourceUnqueueBuffers( uint sid,int numEntries,[In] uint[] bids )
|
||||
public static void SourceUnqueueBuffers( uint sid, int numEntries, uint[] bids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -809,12 +1198,27 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>This function unqueues a set of buffers attached to a source. The number of processed buffers can be detected using an alSourcei call to retrieve AL_BUFFERS_PROCESSED, 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="numEntries">The number of buffers to be unqueued.</param>
|
||||
/// <param name="bids">A pointer to an array of buffer names that were removed.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void SourceUnqueueBuffers( int sid, int numEntries, int[] bids )
|
||||
{
|
||||
uint[] temp = new uint[numEntries];
|
||||
for ( int i = 0; i < numEntries; i++ )
|
||||
{
|
||||
temp[i] = (uint) bids[i];
|
||||
}
|
||||
SourceUnqueueBuffers( (uint) sid, numEntries, temp );
|
||||
}
|
||||
|
||||
/// <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="numEntries">The number of buffers to be unqueued.</param>
|
||||
/// <param name="bids">A pointer to an array of buffer names that were removed.</param>
|
||||
[CLSCompliant( false )]
|
||||
public static void SourceUnqueueBuffers( uint sid,int numEntries,[In] ref uint bids )
|
||||
public static void SourceUnqueueBuffers( uint sid, int numEntries, ref uint bids )
|
||||
{
|
||||
unsafe
|
||||
{
|
||||
|
@ -825,6 +1229,8 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
#endregion SourceUnqueueBuffers
|
||||
|
||||
#endregion Source Queuing
|
||||
|
||||
/*
|
||||
|
@ -843,6 +1249,11 @@ namespace OpenTK.OpenAL
|
|||
|
||||
#region Buffer objects
|
||||
|
||||
#region GenBuffers
|
||||
|
||||
/// <summary>This function generates one or more buffers, which contain audio data (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="buffers">Pointer to an array of uint values which will store the names of the new buffers.</param>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alGenBuffers", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
|
||||
unsafe public static extern void GenBuffers( int n, [Out] uint* buffers );
|
||||
// AL_API void AL_APIENTRY alGenBuffers( ALsizei n, ALuint* Buffers );
|
||||
|
@ -863,6 +1274,21 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>This function generates one or more buffers, which contain audio data (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="buffers">Pointer to an array of uint values which will store the names of the new buffers.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void GenBuffers( int n, out int[] buffers )
|
||||
{
|
||||
uint[] temp = new uint[n];
|
||||
GenBuffers( n, out temp[0] );
|
||||
buffers = new int[n];
|
||||
for ( int i = 0; i < n; i++ )
|
||||
{
|
||||
buffers[i] = (int) temp[i];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>This function generates one buffer only, which contain audio data (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="buffer">Pointer to an uint value which will store the name of the new buffer.</param>
|
||||
[CLSCompliant( false )]
|
||||
|
@ -871,6 +1297,23 @@ namespace OpenTK.OpenAL
|
|||
GenBuffers( 1, out buffer );
|
||||
}
|
||||
|
||||
/// <summary>This function generates one buffer only, which contain audio data (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="buffer">Pointer to an uint value which will store the name of the new buffer.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void GenBuffers( out int buffer )
|
||||
{
|
||||
uint temp;
|
||||
GenBuffers( 1, out temp );
|
||||
buffer = (int) temp;
|
||||
}
|
||||
|
||||
#endregion GenBuffers
|
||||
|
||||
#region DeleteBuffers
|
||||
|
||||
/// <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="buffers">Pointer to an array of buffer names identifying the buffers to be deleted.</param>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alDeleteBuffers", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
|
||||
unsafe public static extern void DeleteBuffers( int n, [In] uint* buffers );
|
||||
// AL_API void AL_APIENTRY alDeleteBuffers( ALsizei n, const ALuint* Buffers );
|
||||
|
@ -890,6 +1333,20 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
/// <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="buffers">Pointer to an array of buffer names identifying the buffers to be deleted.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void DeleteBuffers( int n, ref int[] buffers )
|
||||
{
|
||||
uint[] temp = new uint[n];
|
||||
for ( int i = 0; i < n; i++ )
|
||||
{
|
||||
temp[i] = (uint) buffers[i];
|
||||
}
|
||||
DeleteBuffers( n, ref temp );
|
||||
}
|
||||
|
||||
/// <summary>This function deletes one buffer only, 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="buffer">Pointer to a buffer name identifying the buffer to be deleted.</param>
|
||||
[CLSCompliant( false )]
|
||||
|
@ -904,6 +1361,19 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>This function deletes one buffer only, 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="buffer">Pointer to a buffer name identifying the buffer to be deleted.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void DeleteBuffers( ref int buffer )
|
||||
{
|
||||
uint temp = (uint) buffer;
|
||||
DeleteBuffers( ref temp );
|
||||
}
|
||||
|
||||
#endregion DeleteBuffers
|
||||
|
||||
#region IsBuffer
|
||||
|
||||
/// <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="AL.GenBuffers"/>.</param>
|
||||
/// <returns>Success.</returns>
|
||||
|
@ -911,6 +1381,20 @@ namespace OpenTK.OpenAL
|
|||
public static extern bool IsBuffer( uint 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>
|
||||
/// <param name="bid">A buffer Handle previously allocated with <see cref="AL.GenBuffers"/>.</param>
|
||||
/// <returns>Success.</returns>
|
||||
[CLSCompliant( true )]
|
||||
public static bool IsBuffer( int bid )
|
||||
{
|
||||
uint temp = (uint) bid;
|
||||
return IsBuffer( temp );
|
||||
}
|
||||
|
||||
#endregion IsBuffer
|
||||
|
||||
#region BufferData
|
||||
|
||||
/// <summary>This function fills a buffer with audio data. All the pre-defined formats are PCM data, but this function may be used by extensions to load other data types as well.</summary>
|
||||
/// <param name="bid">buffer Handle/Name to be filled with data.</param>
|
||||
/// <param name="format">Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.</param>
|
||||
|
@ -918,9 +1402,23 @@ namespace OpenTK.OpenAL
|
|||
/// <param name="size">The size of the audio data in bytes.</param>
|
||||
/// <param name="freq">The frequency of the audio data.</param>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alBufferData", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
|
||||
public static extern void BufferData( uint bid,Enums.ALFormat format,IntPtr data,int size,int freq ); // Specify the data to be copied into a Buffer
|
||||
public static extern void BufferData( uint bid, Enums.ALFormat format, IntPtr data, int size, int freq );
|
||||
// AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );
|
||||
|
||||
/// <summary>This function fills a buffer with audio data. All the pre-defined formats are PCM data, but this function may be used by extensions to load other data types as well.</summary>
|
||||
/// <param name="bid">buffer Handle/Name to be filled with data.</param>
|
||||
/// <param name="format">Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.</param>
|
||||
/// <param name="data">Pointer to the audio data. YOU MUST PIN THIS MANUALLY.</param>
|
||||
/// <param name="size">The size of the audio data in bytes.</param>
|
||||
/// <param name="freq">The frequency of the audio data.</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void BufferData( int bid, Enums.ALFormat format, IntPtr data, int size, int freq )
|
||||
{
|
||||
BufferData( (uint) bid, format, data, size, freq );
|
||||
}
|
||||
|
||||
#endregion BufferData
|
||||
|
||||
#endregion Buffer objects
|
||||
|
||||
#region Set Buffer parameters (currently parameters can only be read)
|
||||
|
@ -951,14 +1449,28 @@ namespace OpenTK.OpenAL
|
|||
|
||||
#region Get Buffer parameters
|
||||
|
||||
#region GetBufferi
|
||||
|
||||
/// <summary>This function retrieves an integer property of a buffer.</summary>
|
||||
/// <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="value">A pointer to an ALint to hold the retrieved data</param>
|
||||
/// <param name="value">A pointer to an int to hold the retrieved data</param>
|
||||
[CLSCompliant( false ), DllImport( AL.Lib, EntryPoint = "alGetBufferi", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
|
||||
public static extern void GetBuffer( uint bid, Enums.ALGetBufferi param, [Out] out int value );
|
||||
// AL_API void AL_APIENTRY alGetBufferi( ALuint bid, ALenum param, ALint* value );
|
||||
|
||||
/// <summary>This function retrieves an integer property of a buffer.</summary>
|
||||
/// <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="value">A pointer to an int to hold the retrieved data</param>
|
||||
[CLSCompliant( true )]
|
||||
public static void GetBuffer( int bid, Enums.ALGetBufferi param, out int value )
|
||||
{
|
||||
GetBuffer( (uint) bid, param, out value );
|
||||
}
|
||||
|
||||
#endregion GetBufferi
|
||||
|
||||
// AL_API void AL_APIENTRY alGetBufferf( ALuint bid, ALenum param, ALfloat* value );
|
||||
// AL_API void AL_APIENTRY alGetBuffer3f( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
|
||||
// AL_API void AL_APIENTRY alGetBufferfv( ALuint bid, ALenum param, ALfloat* values );
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace OpenTK.OpenAL
|
|||
{
|
||||
|
||||
/// <summary>The X-Ram Extension is provided on the top-end Sound Blaster X-Fi solutions (Sound Blaster X-Fi Fatal1ty, Sound Blaster X-Fi Elite Pro, or later). These products feature 64MB of X-Ram that can only be used for audio purposes, which can be controlled by this Extension.</summary>
|
||||
[CLSCompliant( true )]
|
||||
public class XRamExtension
|
||||
{
|
||||
#region Instance state
|
||||
|
@ -35,7 +36,7 @@ namespace OpenTK.OpenAL
|
|||
private delegate bool Delegate_SetBufferMode( int n, ref uint buffers, int value );
|
||||
//typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value);
|
||||
|
||||
[CLSCompliant( false )]
|
||||
// [CLSCompliant( false )]
|
||||
private delegate int Delegate_GetBufferMode( uint buffer, IntPtr value );
|
||||
//typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value);
|
||||
|
||||
|
@ -140,6 +141,18 @@ namespace OpenTK.OpenAL
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>This function is used to set the storage Mode of an array of OpenAL Buffers.</summary>
|
||||
/// <param name="n">The number of OpenAL Buffers pointed to by buffer.</param>
|
||||
/// <param name="buffer">An array of OpenAL Buffer handles.</param>
|
||||
/// <param name="mode">The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible</param>
|
||||
/// <returns>True if all the Buffers were successfully set to the requested storage mode, False otherwise.</returns>
|
||||
[CLSCompliant( true )]
|
||||
public bool SetBufferMode( int n, ref int buffer, XRamStorage mode )
|
||||
{
|
||||
uint temp = (uint) buffer;
|
||||
return SetBufferMode( n, ref temp, mode );
|
||||
}
|
||||
|
||||
/// <summary>This function is used to retrieve the storage Mode of a single OpenAL Buffer.</summary>
|
||||
/// <param name="buffer">The handle of an OpenAL Buffer.</param>
|
||||
/// <returns>The current Mode of the Buffer.</returns>
|
||||
|
@ -156,6 +169,16 @@ namespace OpenTK.OpenAL
|
|||
return XRamStorage.Automatic;
|
||||
}
|
||||
|
||||
/// <summary>This function is used to retrieve the storage Mode of a single OpenAL Buffer.</summary>
|
||||
/// <param name="buffer">The handle of an OpenAL Buffer.</param>
|
||||
/// <returns>The current Mode of the Buffer.</returns>
|
||||
[CLSCompliant( true )]
|
||||
public XRamStorage GetBufferMode( ref int buffer )
|
||||
{
|
||||
uint temp = (uint) buffer;
|
||||
return GetBufferMode( ref temp );
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue