diff --git a/Source/OpenTK/Audio/AudioContext.cs b/Source/OpenTK/Audio/AudioContext.cs index cbb97761..c10b8e59 100644 --- a/Source/OpenTK/Audio/AudioContext.cs +++ b/Source/OpenTK/Audio/AudioContext.cs @@ -267,7 +267,7 @@ namespace OpenTK.Audio CheckForAlcErrors(); - device_name = device; + device_name = Alc.GetString(device_handle, AlcGetString.DeviceSpecifier); // Build the attribute list List attributes = new List(); diff --git a/Source/OpenTK/Audio/OpenAL/AL/AL.cs b/Source/OpenTK/Audio/OpenAL/AL/AL.cs index 4c7fa583..c4265075 100644 --- a/Source/OpenTK/Audio/OpenAL/AL/AL.cs +++ b/Source/OpenTK/Audio/OpenAL/AL/AL.cs @@ -444,10 +444,10 @@ namespace OpenTK.Audio /// 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). /// Pointer to an uint value which will store the name of the new source. - [CLSCompliant( false )] - public static void GenSource( out uint source ) + [CLSCompliant(false)] + public static void GenSource(out uint source) { - GenSources( 1, out source ); + GenSources(1, out source); } #endregion GenSources() @@ -499,7 +499,7 @@ namespace OpenTK.Audio /// This function deletes one source only. /// Pointer to a source name identifying the source to be deleted. [CLSCompliant(false)] - public static void DeleteSource( ref uint source) + public static void DeleteSource(ref uint source) { DeleteSources(1, ref source); } @@ -1316,10 +1316,10 @@ namespace OpenTK.Audio /// 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). /// Pointer to an uint value which will store the names of the new buffer. - [CLSCompliant( false )] - public static void GenBuffer( out uint buffer ) + [CLSCompliant(false)] + public static void GenBuffer(out uint buffer) { - GenBuffers( 1, out buffer ); + GenBuffers(1, out buffer); } #endregion GenBuffers @@ -1372,7 +1372,7 @@ namespace OpenTK.Audio /// 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. /// Pointer to a buffer name identifying the buffer to be deleted. [CLSCompliant(false)] - public static void DeleteBuffer( ref uint buffer) + public static void DeleteBuffer(ref uint buffer) { DeleteBuffers(1, ref buffer); } @@ -1380,7 +1380,7 @@ namespace OpenTK.Audio /// 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. /// Pointer to a buffer name identifying the buffer to be deleted. [CLSCompliant(true)] - public static void DeleteBuffer( int buffer) + public static void DeleteBuffer(int buffer) { DeleteBuffers(1, ref buffer); } @@ -1583,51 +1583,51 @@ namespace OpenTK.Audio /// (Helper) Returns Source state information. /// The source to be queried. /// state information from OpenAL. - [CLSCompliant( false )] - public static ALSourceState GetSourceState( uint sid ) + [CLSCompliant(false)] + public static ALSourceState GetSourceState(uint sid) { int temp; - AL.GetSource( sid, ALGetSourcei.SourceState, out temp ); - return (ALSourceState) temp; + AL.GetSource(sid, ALGetSourcei.SourceState, out temp); + return (ALSourceState)temp; } /// (Helper) Returns Source state information. /// The source to be queried. /// state information from OpenAL. - [CLSCompliant( true )] - public static ALSourceState GetSourceState( int sid ) + [CLSCompliant(true)] + public static ALSourceState GetSourceState(int sid) { int temp; - AL.GetSource( sid, ALGetSourcei.SourceState, out temp ); - return (ALSourceState) temp; + AL.GetSource(sid, ALGetSourcei.SourceState, out temp); + return (ALSourceState)temp; } /// (Helper) Returns Source type information. /// The source to be queried. /// type information from OpenAL. - [CLSCompliant( false )] - public static ALSourceType GetSourceType( uint sid ) + [CLSCompliant(false)] + public static ALSourceType GetSourceType(uint sid) { int temp; - AL.GetSource( sid, ALGetSourcei.SourceType, out temp ); - return (ALSourceType) temp; + AL.GetSource(sid, ALGetSourcei.SourceType, out temp); + return (ALSourceType)temp; } /// (Helper) Returns Source type information. /// The source to be queried. /// type information from OpenAL. - [CLSCompliant( true )] - public static ALSourceType GetSourceType( int sid ) + [CLSCompliant(true)] + public static ALSourceType GetSourceType(int sid) { int temp; - AL.GetSource( sid, ALGetSourcei.SourceType, out temp ); - return (ALSourceType) temp; + AL.GetSource(sid, ALGetSourcei.SourceType, out temp); + return (ALSourceType)temp; } - [CLSCompliant( true )] - public static ALDistanceModel GetDistanceModel( ) + [CLSCompliant(true)] + public static ALDistanceModel GetDistanceModel() { - return (ALDistanceModel) AL.Get( ALGetInteger.DistanceModel ); + return (ALDistanceModel)AL.Get(ALGetInteger.DistanceModel); } #endregion Helpers diff --git a/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs b/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs index 9a9f00fb..69926139 100644 --- a/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs +++ b/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs @@ -34,7 +34,7 @@ namespace OpenTK.Audio /// (Helper) Selects the Effect type used by this Effect handle. /// Effect id returned from a successful call to GenEffects. /// Effect type. - + public void BindEffect(int eid, EfxEffectType type) { Imported_alEffecti((uint)eid, EfxEffecti.EffectType, (int)type); @@ -56,7 +56,7 @@ namespace OpenTK.Audio /// (Helper) reroutes the output of a Source through a Filter. /// A valid Source handle. /// A valid Filter handle. - + public void BindFilterToSource(int source, int filter) { AL.Source((uint)source, ALSourcei.EfxDirectFilter, (int)filter); @@ -78,7 +78,7 @@ namespace OpenTK.Audio /// (Helper) Attaches an Effect to an Auxiliary Effect Slot. /// The slot handle to attach the Effect to. /// The Effect handle that is being attached. - + public void BindEffectToAuxiliarySlot(int auxiliaryeffectslot, int effect) { AuxiliaryEffectSlot((uint)auxiliaryeffectslot, EfxAuxiliaryi.EffectslotEffect, (int)effect); @@ -104,7 +104,7 @@ namespace OpenTK.Audio /// The Auxiliary Effect Slot handle that receives input from the Source. /// Every Source has only a limited number of slots it can feed buffer to. The number must stay below AlcContextAttributes.EfxMaxAuxiliarySends /// Filter handle to be attached between Source ouput and Auxiliary Slot input. Use 0 or EfxFilterType.FilterNull for no filter. - + public void BindSourceToAuxiliarySlot(int source, int slot, int slotnumber, int filter) { AL.Source((uint)source, ALSource3i.EfxAuxiliarySendFilter, (int)slot, (int)slotnumber, (int)filter); @@ -171,7 +171,7 @@ namespace OpenTK.Audio GenEffects(n, out effects[0]); return effects; } - + /// Generates a single effect object. /// A handle to the generated effect object. /// @@ -188,13 +188,13 @@ namespace OpenTK.Audio /// Generates a single effect object. /// A handle to the generated effect object. [CLSCompliant(false)] - public void GenEffect( out uint effect ) + public void GenEffect(out uint effect) { unsafe { - fixed ( uint* ptr = &effect ) + fixed (uint* ptr = &effect) { - Imported_alGenEffects( 1, ptr ); + Imported_alGenEffects(1, ptr); effect = *ptr; } } @@ -262,19 +262,19 @@ namespace OpenTK.Audio /// Pointer to an effect name/handle identifying the Effect Object to be deleted. public void DeleteEffect(int effect) { - DeleteEffects( 1, ref effect ); + DeleteEffects(1, ref effect); } /// This function deletes one Effect only. /// Pointer to an effect name/handle identifying the Effect Object to be deleted. [CLSCompliant(false)] - public void DeleteEffect( ref uint effect ) + public void DeleteEffect(ref uint effect) { unsafe { - fixed ( uint* ptr = &effect ) + fixed (uint* ptr = &effect) { - Imported_alDeleteEffects( 1, ptr ); + Imported_alDeleteEffects(1, ptr); } } } @@ -302,7 +302,7 @@ namespace OpenTK.Audio /// The IsEffect function is used to determine if an object identifier is a valid Effect object. /// Effect identifier to validate. /// True if the identifier is a valid Effect, False otherwise. - + public bool IsEffect(int eid) { return Imported_alIsEffect((uint)eid); @@ -333,7 +333,7 @@ namespace OpenTK.Audio /// Effect object identifier. /// Effect property to set. /// Integer value. - + public void Effect(int eid, EfxEffecti param, int value) { Imported_alEffecti((uint)eid, param, value); @@ -364,7 +364,7 @@ namespace OpenTK.Audio /// Effect object identifier. /// Effect property to set. /// Floating point value. - + public void Effect(int eid, EfxEffectf param, float value) { Imported_alEffectf((uint)eid, param, value); @@ -401,7 +401,7 @@ namespace OpenTK.Audio /// Effect object identifier. /// Effect property to set. /// Pointer to Math.Vector3. - + public void Effect(int eid, EfxEffect3f param, ref Vector3 values) { Effect((uint)eid, param, ref values); @@ -438,7 +438,7 @@ namespace OpenTK.Audio /// Effect object identifier. /// Effect property to retrieve. /// Address where integer value will be stored. - + public void GetEffect(int eid, EfxEffecti pname, out int value) { GetEffect((uint)eid, pname, out value); @@ -475,7 +475,7 @@ namespace OpenTK.Audio /// Effect object identifier. /// Effect property to retrieve. /// Address where floating point value will be stored. - + public void GetEffect(int eid, EfxEffectf pname, out float value) { GetEffect((uint)eid, pname, out value); @@ -515,7 +515,7 @@ namespace OpenTK.Audio /// Effect object identifier. /// Effect property to retrieve. /// A Math.Vector3 to hold the values. - + public void GetEffect(int eid, EfxEffect3f param, out Vector3 values) { GetEffect((uint)eid, param, out values); @@ -599,13 +599,13 @@ namespace OpenTK.Audio /// This function generates only one Filter. /// Storage UInt32 for the new filter name/handle. [CLSCompliant(false)] - unsafe public void GenFilter( out uint filter ) + unsafe public void GenFilter(out uint filter) { unsafe { - fixed ( uint* ptr = &filter ) + fixed (uint* ptr = &filter) { - Imported_alGenFilters( 1, ptr ); + Imported_alGenFilters(1, ptr); filter = *ptr; } } @@ -678,13 +678,13 @@ namespace OpenTK.Audio /// This function deletes one Filter only. /// Pointer to an filter name/handle identifying the Filter Object to be deleted. [CLSCompliant(false)] - public void DeleteFilter( ref uint filter ) + public void DeleteFilter(ref uint filter) { unsafe { - fixed ( uint* ptr = &filter ) + fixed (uint* ptr = &filter) { - Imported_alDeleteFilters( 1, ptr ); + Imported_alDeleteFilters(1, ptr); } } } @@ -712,7 +712,7 @@ namespace OpenTK.Audio /// The IsFilter function is used to determine if an object identifier is a valid Filter object. /// Effect identifier to validate. /// True if the identifier is a valid Filter, False otherwise. - + public bool IsFilter(int fid) { return Imported_alIsFilter((uint)fid); @@ -743,7 +743,7 @@ namespace OpenTK.Audio /// Filter object identifier. /// Effect property to set. /// Integer value. - + public void Filter(int fid, EfxFilteri param, int value) { Imported_alFilteri((uint)fid, param, value); @@ -774,7 +774,7 @@ namespace OpenTK.Audio /// Filter object identifier. /// Effect property to set. /// Floating point value. - + public void Filter(int fid, EfxFilterf param, float value) { Imported_alFilterf((uint)fid, param, value); @@ -811,7 +811,7 @@ namespace OpenTK.Audio /// Filter object identifier. /// Effect property to retrieve. /// Address where integer value will be stored. - + public void GetFilter(int fid, EfxFilteri pname, out int value) { GetFilter((uint)fid, pname, out value); @@ -848,7 +848,7 @@ namespace OpenTK.Audio /// Filter object identifier. /// Effect property to retrieve. /// Address where floating point value will be stored. - + public void GetFilter(int fid, EfxFilterf pname, out float value) { GetFilter((uint)fid, pname, out value); @@ -932,13 +932,13 @@ namespace OpenTK.Audio /// This function generates only one Auxiliary Effect Slot. /// Storage UInt32 for the new auxiliary effect slot name/handle. [CLSCompliant(false)] - public void GenAuxiliaryEffectSlot( out uint slot ) + public void GenAuxiliaryEffectSlot(out uint slot) { unsafe { - fixed ( uint* ptr = &slot ) + fixed (uint* ptr = &slot) { - Imported_alGenAuxiliaryEffectSlots( 1, ptr ); + Imported_alGenAuxiliaryEffectSlots(1, ptr); slot = *ptr; } } @@ -959,7 +959,7 @@ namespace OpenTK.Audio [CLSCompliant(false)] public void DeleteAuxiliaryEffectSlots(int n, ref uint slots) { - unsafe + unsafe { fixed (uint* ptr = &slots) { @@ -1010,13 +1010,13 @@ namespace OpenTK.Audio /// This function deletes one AuxiliaryEffectSlot only. /// Pointer to an auxiliary effect slot name/handle identifying the Auxiliary Effect Slot Object to be deleted. [CLSCompliant(false)] - public void DeleteAuxiliaryEffectSlot( ref uint slot) + public void DeleteAuxiliaryEffectSlot(ref uint slot) { unsafe { - fixed ( uint* ptr = &slot ) + fixed (uint* ptr = &slot) { - Imported_alDeleteAuxiliaryEffectSlots( 1, ptr ); + Imported_alDeleteAuxiliaryEffectSlots(1, ptr); } } } @@ -1044,7 +1044,7 @@ namespace OpenTK.Audio /// The IsAuxiliaryEffectSlot function is used to determine if an object identifier is a valid Auxiliary Effect Slot object. /// Effect Slot object identifier to validate. /// True if the identifier is a valid Auxiliary Effect Slot, False otherwise. - + public bool IsAuxiliaryEffectSlot(int slot) { return Imported_alIsAuxiliaryEffectSlot((uint)slot); @@ -1075,7 +1075,7 @@ namespace OpenTK.Audio /// Auxiliary Effect Slot object identifier. /// Auxiliary Effect Slot property to set. /// Integer value. - + public void AuxiliaryEffectSlot(int asid, EfxAuxiliaryi param, int value) { Imported_alAuxiliaryEffectSloti((uint)asid, param, value); @@ -1106,7 +1106,7 @@ namespace OpenTK.Audio /// Auxiliary Effect Slot object identifier. /// Auxiliary Effect Slot property to set. /// Floating point value. - + public void AuxiliaryEffectSlot(int asid, EfxAuxiliaryf param, float value) { Imported_alAuxiliaryEffectSlotf((uint)asid, param, value); @@ -1143,7 +1143,7 @@ namespace OpenTK.Audio /// Auxiliary Effect Slot object identifier. /// Auxiliary Effect Slot property to retrieve. /// Address where integer value will be stored. - + public void GetAuxiliaryEffectSlot(int asid, EfxAuxiliaryi pname, out int value) { GetAuxiliaryEffectSlot((uint)asid, pname, out value); @@ -1180,7 +1180,7 @@ namespace OpenTK.Audio /// Auxiliary Effect Slot object identifier. /// Auxiliary Effect Slot property to retrieve. /// Address where floating point value will be stored. - + public void GetAuxiliaryEffectSlot(int asid, EfxAuxiliaryf pname, out float value) { GetAuxiliaryEffectSlot((uint)asid, pname, out value); @@ -1282,4 +1282,4 @@ namespace OpenTK.Audio #endregion Constructor / Extension Loading } -} +} \ No newline at end of file diff --git a/Source/OpenTK/Audio/OpenAL/AL/XRamExtension.cs b/Source/OpenTK/Audio/OpenAL/AL/XRamExtension.cs index 4e029524..fc0e0b30 100644 --- a/Source/OpenTK/Audio/OpenAL/AL/XRamExtension.cs +++ b/Source/OpenTK/Audio/OpenAL/AL/XRamExtension.cs @@ -15,7 +15,7 @@ namespace OpenTK.Audio { ///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. - [CLSCompliant( true )] + [CLSCompliant(true)] public sealed class XRamExtension { #region Instance state @@ -33,11 +33,11 @@ namespace OpenTK.Audio #region X-RAM Function pointer definitions // [CLSCompliant(false)] - private delegate bool Delegate_SetBufferMode( int n, ref uint buffers, int value ); + private delegate bool Delegate_SetBufferMode(int n, ref uint buffers, int value); //typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value); // [CLSCompliant( false )] - private delegate int Delegate_GetBufferMode( uint buffer, IntPtr value ); + private delegate int Delegate_GetBufferMode(uint buffer, IntPtr value); //typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value); //[CLSCompliant(false)] @@ -56,27 +56,27 @@ namespace OpenTK.Audio #region Constructor / Extension Loading - public XRamExtension( ) + public XRamExtension() { // Query if Extension supported and retrieve Tokens/Pointers if it is. _valid = false; - if ( AL.IsExtensionPresent( "EAX-RAM" ) == false ) + if (AL.IsExtensionPresent("EAX-RAM") == false) return; - AL_EAX_RAM_SIZE = AL.GetEnumValue( "AL_EAX_RAM_SIZE" ); - AL_EAX_RAM_FREE = AL.GetEnumValue( "AL_EAX_RAM_FREE" ); - AL_STORAGE_AUTOMATIC = AL.GetEnumValue( "AL_STORAGE_AUTOMATIC" ); - AL_STORAGE_HARDWARE = AL.GetEnumValue( "AL_STORAGE_HARDWARE" ); - AL_STORAGE_ACCESSIBLE = AL.GetEnumValue( "AL_STORAGE_ACCESSIBLE" ); + AL_EAX_RAM_SIZE = AL.GetEnumValue("AL_EAX_RAM_SIZE"); + AL_EAX_RAM_FREE = AL.GetEnumValue("AL_EAX_RAM_FREE"); + AL_STORAGE_AUTOMATIC = AL.GetEnumValue("AL_STORAGE_AUTOMATIC"); + AL_STORAGE_HARDWARE = AL.GetEnumValue("AL_STORAGE_HARDWARE"); + AL_STORAGE_ACCESSIBLE = AL.GetEnumValue("AL_STORAGE_ACCESSIBLE"); // Console.WriteLine("RamSize: {0} RamFree: {1} StorageAuto: {2} StorageHW: {3} StorageAccess: {4}",AL_EAX_RAM_SIZE,AL_EAX_RAM_FREE,AL_STORAGE_AUTOMATIC,AL_STORAGE_HARDWARE,AL_STORAGE_ACCESSIBLE); - if ( AL_EAX_RAM_SIZE == 0 || + if (AL_EAX_RAM_SIZE == 0 || AL_EAX_RAM_FREE == 0 || AL_STORAGE_AUTOMATIC == 0 || AL_STORAGE_HARDWARE == 0 || - AL_STORAGE_ACCESSIBLE == 0 ) + AL_STORAGE_ACCESSIBLE == 0) { - Debug.WriteLine( "X-Ram: Token values could not be retrieved." ); + Debug.WriteLine("X-Ram: Token values could not be retrieved."); return; } @@ -84,11 +84,12 @@ namespace OpenTK.Audio try { - Imported_GetBufferMode = (Delegate_GetBufferMode) Marshal.GetDelegateForFunctionPointer( AL.GetProcAddress( "EAXGetBufferMode" ), typeof( Delegate_GetBufferMode ) ); - Imported_SetBufferMode = (Delegate_SetBufferMode) Marshal.GetDelegateForFunctionPointer( AL.GetProcAddress( "EAXSetBufferMode" ), typeof( Delegate_SetBufferMode ) ); - } catch ( Exception e ) + Imported_GetBufferMode = (Delegate_GetBufferMode)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("EAXGetBufferMode"), typeof(Delegate_GetBufferMode)); + Imported_SetBufferMode = (Delegate_SetBufferMode)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("EAXSetBufferMode"), typeof(Delegate_SetBufferMode)); + } + catch (Exception e) { - Debug.WriteLine( "X-Ram: Attempt to marshal function pointers with AL.GetProcAddress failed. " + e.ToString( ) ); + Debug.WriteLine("X-Ram: Attempt to marshal function pointers with AL.GetProcAddress failed. " + e.ToString()); return; } @@ -100,15 +101,15 @@ namespace OpenTK.Audio #region Public Methods /// Query total amount of X-RAM in bytes. - public int GetRamSize( ) + public int GetRamSize() { - return AL.Get( (ALGetInteger) AL_EAX_RAM_SIZE ); + return AL.Get((ALGetInteger)AL_EAX_RAM_SIZE); } /// Query free X-RAM available in bytes. - public int GetRamFree( ) + public int GetRamFree() { - return AL.Get( (ALGetInteger) AL_EAX_RAM_FREE ); + return AL.Get((ALGetInteger)AL_EAX_RAM_FREE); } /// This enum is used to abstract the need of using AL.GetEnumValue() with the Extension. The values do NOT correspond to AL_STORAGE_* tokens! @@ -127,17 +128,17 @@ namespace OpenTK.Audio /// An array of OpenAL Buffer handles. /// 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 /// True if all the Buffers were successfully set to the requested storage mode, False otherwise. - [CLSCompliant( false )] - public bool SetBufferMode( int n, ref uint buffer, XRamStorage mode ) + [CLSCompliant(false)] + public bool SetBufferMode(int n, ref uint buffer, XRamStorage mode) { - switch ( mode ) + switch (mode) { - case XRamStorage.Accessible: - return Imported_SetBufferMode( n, ref buffer, AL_STORAGE_ACCESSIBLE ); - case XRamStorage.Hardware: - return Imported_SetBufferMode( n, ref buffer, AL_STORAGE_HARDWARE ); - default: - return Imported_SetBufferMode( n, ref buffer, AL_STORAGE_AUTOMATIC ); + case XRamStorage.Accessible: + return Imported_SetBufferMode(n, ref buffer, AL_STORAGE_ACCESSIBLE); + case XRamStorage.Hardware: + return Imported_SetBufferMode(n, ref buffer, AL_STORAGE_HARDWARE); + default: + return Imported_SetBufferMode(n, ref buffer, AL_STORAGE_AUTOMATIC); } } @@ -146,24 +147,24 @@ namespace OpenTK.Audio /// An array of OpenAL Buffer handles. /// 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 /// True if all the Buffers were successfully set to the requested storage mode, False otherwise. - [CLSCompliant( true )] - public bool SetBufferMode( int n, ref int buffer, XRamStorage mode ) + [CLSCompliant(true)] + public bool SetBufferMode(int n, ref int buffer, XRamStorage mode) { - uint temp = (uint) buffer; - return SetBufferMode( n, ref temp, mode ); + uint temp = (uint)buffer; + return SetBufferMode(n, ref temp, mode); } /// This function is used to retrieve the storage Mode of a single OpenAL Buffer. /// The handle of an OpenAL Buffer. /// The current Mode of the Buffer. - [CLSCompliant( false )] - public XRamStorage GetBufferMode( ref uint buffer ) + [CLSCompliant(false)] + public XRamStorage GetBufferMode(ref uint buffer) { - int tempresult = Imported_GetBufferMode( buffer, IntPtr.Zero ); // IntPtr.Zero due to the parameter being unused/reserved atm + int tempresult = Imported_GetBufferMode(buffer, IntPtr.Zero); // IntPtr.Zero due to the parameter being unused/reserved atm - if ( tempresult == AL_STORAGE_ACCESSIBLE ) + if (tempresult == AL_STORAGE_ACCESSIBLE) return XRamStorage.Accessible; - if ( tempresult == AL_STORAGE_HARDWARE ) + if (tempresult == AL_STORAGE_HARDWARE) return XRamStorage.Hardware; // default: return XRamStorage.Automatic; @@ -172,14 +173,15 @@ namespace OpenTK.Audio /// This function is used to retrieve the storage Mode of a single OpenAL Buffer. /// The handle of an OpenAL Buffer. /// The current Mode of the Buffer. - [CLSCompliant( true )] - public XRamStorage GetBufferMode( ref int buffer ) + [CLSCompliant(true)] + public XRamStorage GetBufferMode(ref int buffer) { - uint temp = (uint) buffer; - return GetBufferMode( ref temp ); + uint temp = (uint)buffer; + return GetBufferMode(ref temp); } #endregion Public Methods } } +