diff --git a/Source/Compatibility/Audio/AudioReader.cs b/Source/Compatibility/Audio/AudioReader.cs
new file mode 100644
index 00000000..fc0abf29
--- /dev/null
+++ b/Source/Compatibility/Audio/AudioReader.cs
@@ -0,0 +1,235 @@
+#region --- License ---
+/* Licensed under the MIT/X11 license.
+ * Copyright (c) 2006-2008 the OpenTK Team.
+ * This notice may not be removed from any source distribution.
+ * See license.txt for licensing details.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+
+namespace OpenTK.Audio
+{
+ ///
+ /// Encapsulates a sound stream and provides decoding and streaming capabilities.
+ ///
+ public class AudioReader : IDisposable
+ {
+ static object reader_lock = new object();
+ static List readers = new List();
+
+ bool disposed;
+ Stream stream;
+ AudioReader implementation;
+
+ #region --- Constructors ---
+
+ #region static AudioReader()
+
+ static AudioReader()
+ {
+ // TODO: Plugin architecture for sound formats. This is overkill now that we only have a WaveReader (future proofing).
+ readers.Add(new WaveReader());
+ }
+
+ #endregion
+
+ #region protected AudioReader()
+
+ protected AudioReader() { }
+
+ #endregion
+
+ #region public AudioReader(string filename)
+
+ /// Creates a new AudioReader that can read the specified sound file.
+ /// The path to the sound file.
+ /// A new OpenTK.Audio.AudioReader, which can be used to read from the specified sound file.
+ public AudioReader(string filename)
+ : this(new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
+ { }
+
+ #endregion
+
+ #region public AudioReader(Stream s)
+
+ /// Creates a new AudioReader that can read the specified soundstream.
+ /// The System.IO.Stream to read from.
+ /// A new OpenTK.Audio.AudioReader, which can be used to read from the specified sound stream.
+ public AudioReader(Stream s)
+ {
+ try
+ {
+ lock (reader_lock)
+ {
+ foreach (AudioReader reader in readers)
+ {
+ long pos = s.Position;
+ if (reader.Supports(s))
+ {
+ s.Position = pos;
+ implementation = (AudioReader)
+ reader.GetType().GetConstructor(
+ System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public |
+ System.Reflection.BindingFlags.Instance,
+ null,
+ new Type[] { typeof(Stream) },
+ null)
+ .Invoke(new object[] { s });
+ return;
+ }
+ s.Position = pos;
+ }
+ }
+ }
+ catch (Exception)
+ {
+ s.Close();
+ throw;
+ }
+ throw new NotSupportedException("Could not find a decoder for the specified sound stream.");
+ }
+
+ #endregion
+
+ #endregion
+
+ #region --- Public Members ---
+
+ #region public virtual bool Supports(Stream s)
+
+ /// When overriden in a derived class, checks if the decoder supports the specified sound stream.
+ /// The System.IO.Stream to check.
+ /// True if the sound stream is supported; false otherwise.
+ public virtual bool Supports(Stream s)
+ {
+ if (implementation != null)
+ return implementation.Supports(s);
+ throw new NotImplementedException();
+ }
+
+ #endregion
+
+ #region public virtual SoundData ReadSamples(long count)
+
+ ///
+ /// When overriden in a derived class, reads and decodes the specified number of samples from the sound stream.
+ ///
+ /// The number of samples to read and decode.
+ /// An OpenTK.Audio.SoundData object that contains the decoded buffer.
+ public virtual SoundData ReadSamples(long count)
+ {
+ if (implementation != null)
+ return implementation.ReadSamples(count);
+ throw new NotImplementedException();
+ }
+
+ #endregion
+
+ #region public virtual SoundData ReadToEnd()
+
+ ///
+ /// When overriden in a derived class, reads and decodes the sound stream.
+ ///
+ /// An OpenTK.Audio.SoundData object that contains the decoded buffer.
+ public virtual SoundData ReadToEnd()
+ {
+ if (implementation != null)
+ return implementation.ReadToEnd();
+ throw new NotImplementedException();
+ }
+
+ #endregion
+
+ #region public virtual int Frequency
+
+ ///
+ ///
+ ///
+ public virtual int Frequency
+ {
+ get
+ {
+ if (implementation != null)
+ return implementation.Frequency;
+ else
+ throw new NotImplementedException();
+ }
+ protected set
+ {
+ if (implementation != null)
+ implementation.Frequency = value;
+ else
+ throw new NotImplementedException();
+ }
+ }
+
+ #endregion
+
+ #region public virtual bool EndOfFile
+
+ ///
+ /// Returns true if the AudioReader has reached the end of the file.
+ ///
+ public virtual bool EndOfFile
+ {
+ get
+ {
+ if (implementation != null)
+ return implementation.EndOfFile;
+
+ return this.Stream.Position >= this.Stream.Length;
+ }
+ }
+ #endregion
+
+ #endregion
+
+ #region --- Protected Members ---
+
+ ///
+ /// Gets or sets the input of the AudioReader.
+ ///
+ protected virtual Stream Stream
+ {
+ get { return stream; }
+ set { stream = value; }
+ }
+
+ #endregion
+
+ #region IDisposable Members
+
+ /// Closes the underlying Stream and disposes of the AudioReader resources.
+ public virtual void Dispose()
+ {
+ this.Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ void Dispose(bool manual)
+ {
+ if (!disposed)
+ {
+ if (manual)
+ if (this.Stream != null)
+ this.Stream.Close();
+
+ disposed = true;
+ }
+ }
+
+ ///
+ /// Finalizes this AudioReader.
+ ///
+ ~AudioReader()
+ {
+ this.Dispose(false);
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Compatibility/Audio/AudioReaderException.cs b/Source/Compatibility/Audio/AudioReaderException.cs
new file mode 100644
index 00000000..e8c34572
--- /dev/null
+++ b/Source/Compatibility/Audio/AudioReaderException.cs
@@ -0,0 +1,24 @@
+#region --- License ---
+/* Licensed under the MIT/X11 license.
+ * Copyright (c) 2006-2008 the OpenTK Team.
+ * This notice may not be removed from any source distribution.
+ * See license.txt for licensing details.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OpenTK.Audio
+{
+ /// Represents exceptions related to OpenTK.Audio.AudioReader objects.
+ public class AudioReaderException : AudioException
+ {
+ /// Constructs a new AudioReaderException.
+ public AudioReaderException() : base() { }
+ /// Constructs a new AudioReaderException with the specified error message.
+ /// The error message of the AudioReaderException.
+ public AudioReaderException(string message) : base(message) { }
+ }
+}
diff --git a/Source/Compatibility/Audio/OpenAL/AL/AL.cs b/Source/Compatibility/Audio/OpenAL/AL/AL.cs
new file mode 100644
index 00000000..8a12923f
--- /dev/null
+++ b/Source/Compatibility/Audio/OpenAL/AL/AL.cs
@@ -0,0 +1,1652 @@
+#region --- OpenTK.OpenAL License ---
+/* AlFunctions.cs
+ * C header: \OpenAL 1.1 SDK\include\Al.h
+ * Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
+ * Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
+ * See license.txt for license details
+ * http://www.OpenTK.net */
+#endregion
+
+using System;
+using System.Runtime.InteropServices;
+using System.Security;
+
+using OpenTK;
+
+/* Type Mapping
+// 8-bit boolean
+typedef char ALboolean;
+ * bool
+// character
+typedef char ALchar;
+ * byte
+// signed 8-bit 2's complement integer
+typedef char ALbyte;
+ * byte
+
+// unsigned 8-bit integer
+typedef unsigned char ALubyte;
+ * byte
+
+// signed 16-bit 2's complement integer
+typedef short ALshort;
+ * short
+
+// unsigned 16-bit integer
+typedef unsigned short ALushort;
+ * ushort
+
+// unsigned 32-bit integer
+typedef unsigned int ALuint;
+ * uint
+
+// signed 32-bit 2's complement integer
+typedef int ALint;
+ * int
+// non-negative 32-bit binary integer size
+typedef int ALsizei;
+ * int
+// enumerated 32-bit value
+typedef int ALenum;
+ * int
+
+// 32-bit IEEE754 floating-point
+typedef float ALfloat;
+ * float
+
+// 64-bit IEEE754 floating-point
+typedef double ALdouble;
+ * double
+
+// void type (for opaque pointers only)
+typedef void ALvoid;
+ * void
+*/
+
+namespace OpenTK.Audio
+{
+ public static partial class AL
+ {
+
+ #region Constants
+
+ public const string Lib = "openal32.dll";
+ private const CallingConvention Style = CallingConvention.Cdecl;
+
+ #endregion Constants
+
+ #region Renderer State management
+
+ /// 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.
+ /// The name of a capability to enable.
+ [DllImport(AL.Lib, EntryPoint = "alEnable", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void Enable(ALCapability capability);
+ //AL_API void AL_APIENTRY alEnable( ALenum capability );
+
+ /// This function disables a feature of the OpenAL driver.
+ /// The name of a capability to disable.
+ [DllImport(AL.Lib, EntryPoint = "alDisable", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void Disable(ALCapability capability);
+ // AL_API void AL_APIENTRY alDisable( ALenum capability );
+
+ /// This function returns a boolean indicating if a specific feature is enabled in the OpenAL driver.
+ /// The name of a capability to enable.
+ /// True if enabled, False if disabled.
+ [DllImport(AL.Lib, EntryPoint = "alIsEnabled", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern bool IsEnabled(ALCapability capability);
+ // AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability );
+
+ #endregion Renderer State management
+
+ #region State retrieval
+
+ [DllImport(AL.Lib, EntryPoint = "alGetString", ExactSpelling = true, CallingConvention = AL.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ private static extern IntPtr GetStringPrivate(ALGetString param); // accepts the enums AlError, AlContextString
+ // AL_API const ALchar* AL_APIENTRY alGetString( ALenum param );
+
+ /// This function retrieves an OpenAL string property.
+ /// The property to be returned: Vendor, Version, Renderer and Extensions
+ /// Returns a pointer to a null-terminated string.
+ public static string Get(ALGetString param)
+ {
+ return Marshal.PtrToStringAnsi(GetStringPrivate(param));
+ }
+
+ /// This function retrieves an OpenAL string property.
+ /// The human-readable errorstring to be returned.
+ /// Returns a pointer to a null-terminated string.
+ public static string GetErrorString(ALError param)
+ {
+ return Marshal.PtrToStringAnsi(GetStringPrivate((ALGetString)param));
+ }
+
+ /* no functions return more than 1 result ..
+ // AL_API void AL_APIENTRY alGetBooleanv( ALenum param, ALboolean* buffer );
+ // AL_API void AL_APIENTRY alGetIntegerv( ALenum param, ALint* buffer );
+ // AL_API void AL_APIENTRY alGetFloatv( ALenum param, ALfloat* buffer );
+ // AL_API void AL_APIENTRY alGetDoublev( ALenum param, ALdouble* buffer );
+ */
+
+ /* disabled due to no token using it
+ /// This function returns a boolean OpenAL state.
+ /// the state to be queried: AL_DOPPLER_FACTOR, AL_SPEED_OF_SOUND, AL_DISTANCE_MODEL
+ /// The boolean state described by param will be returned.
+ [DllImport( AL.Lib, EntryPoint = "alGetBoolean", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
+ public static extern bool Get( ALGetBoolean param );
+ // AL_API ALboolean AL_APIENTRY alGetBoolean( ALenum param );
+ */
+
+ /// This function returns an integer OpenAL state.
+ /// the state to be queried: DistanceModel.
+ /// The integer state described by param will be returned.
+ [DllImport(AL.Lib, EntryPoint = "alGetInteger", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern int Get(ALGetInteger param);
+ // AL_API ALint AL_APIENTRY alGetInteger( ALenum param );
+
+ /// This function returns a floating point OpenAL state.
+ /// the state to be queried: DopplerFactor, SpeedOfSound.
+ /// The floating point state described by param will be returned.
+ [DllImport(AL.Lib, EntryPoint = "alGetFloat", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern float Get(ALGetFloat param);
+ // AL_API ALfloat AL_APIENTRY alGetFloat( ALenum param );
+
+ /* disabled due to no token using it
+ /// This function returns a double precision floating point OpenAL state.
+ /// the state to be queried: AL_DOPPLER_FACTOR, AL_SPEED_OF_SOUND, AL_DISTANCE_MODEL
+ /// The double value described by param will be returned.
+ [DllImport( AL.Lib, EntryPoint = "alGetDouble", ExactSpelling = true, CallingConvention = AL.Style ), SuppressUnmanagedCodeSecurity( )]
+ public static extern double Get( ALGetDouble param );
+ // AL_API ALdouble AL_APIENTRY alGetDouble( ALenum param );
+ */
+
+ /// 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.
+ /// 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.
+ [DllImport(AL.Lib, EntryPoint = "alGetError", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern ALError GetError();
+ // AL_API ALenum AL_APIENTRY alGetError( void );
+
+ #endregion State retrieval
+
+ #region Extension support.
+
+ ///This function tests if a specific Extension is available for the OpenAL driver.
+ /// A string naming the desired extension. Example: "EAX-RAM"
+ /// Returns True if the Extension is available or False if not available.
+ [DllImport(AL.Lib, EntryPoint = "alIsExtensionPresent", ExactSpelling = true, CallingConvention = AL.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ public static extern bool IsExtensionPresent([In] string extname);
+ // AL_API ALboolean AL_APIENTRY alIsExtensionPresent( const ALchar* extname );
+
+ /// This function returns the address of an OpenAL extension function. Handle with care.
+ /// A string containing the function name.
+ /// The return value is a pointer to the specified function. The return value will be IntPtr.Zero if the function is not found.
+ [DllImport(AL.Lib, EntryPoint = "alGetProcAddress", ExactSpelling = true, CallingConvention = AL.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ public static extern IntPtr GetProcAddress([In] string fname);
+ // AL_API void* AL_APIENTRY alGetProcAddress( const ALchar* fname );
+
+ /// This function returns the enumeration value of an OpenAL token, described by a string.
+ /// A string describing an OpenAL token. Example "AL_DISTANCE_MODEL"
+ /// Returns the actual ALenum described by a string. Returns 0 if the string doesn’t describe a valid OpenAL token.
+ [DllImport(AL.Lib, EntryPoint = "alGetEnumValue", ExactSpelling = true, CallingConvention = AL.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ public static extern int GetEnumValue([In] string ename);
+ // AL_API ALenum AL_APIENTRY alGetEnumValue( const ALchar* ename );
+
+ #endregion Extension support.
+
+ /* Listener
+ * Listener represents the location and orientation of the
+ * 'user' in 3D-space.
+ *
+ * Properties include: -
+ *
+ * Gain AL_GAIN ALfloat
+ * Position AL_POSITION ALfloat[3]
+ * Velocity AL_VELOCITY ALfloat[3]
+ * Orientation AL_ORIENTATION ALfloat[6] (Forward then Up vectors)
+ */
+
+ #region Set Listener parameters
+
+ /// This function sets a floating point property for the listener.
+ /// The name of the attribute to be set: ALListenerf.Gain
+ /// The float value to set the attribute to.
+ [DllImport(AL.Lib, EntryPoint = "alListenerf", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void Listener(ALListenerf param, float value);
+ // AL_API void AL_APIENTRY alListenerf( ALenum param, ALfloat value );
+
+ /// This function sets a floating point property for the listener.
+ /// The name of the attribute to set: ALListener3f.Position, ALListener3f.Velocity
+ /// The value to set the attribute to.
+ /// The value to set the attribute to.
+ /// The value to set the attribute to.
+ [DllImport(AL.Lib, EntryPoint = "alListener3f", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void Listener(ALListener3f param, float value1, float value2, float value3);
+ // AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+
+ /// This function sets a Math.Vector3 property for the listener.
+ /// The name of the attribute to set: ALListener3f.Position, ALListener3f.Velocity
+ /// The Math.Vector3 to set the attribute to.
+ public static void Listener(ALListener3f param, ref Vector3 values)
+ {
+ Listener(param, values.X, values.Y, values.Z);
+ }
+
+ [DllImport(AL.Lib, EntryPoint = "alListenerfv", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ unsafe private static extern void ListenerPrivate(ALListenerfv param, float* values);
+ // AL_API void AL_APIENTRY alListenerfv( ALenum param, const ALfloat* values );
+
+ /// This function sets a floating point-vector property of the listener.
+ /// The name of the attribute to be set: ALListener3f.Position, ALListener3f.Velocity, ALListenerfv.Orientation
+ /// Pointer to floating point-vector values.
+ public static void Listener(ALListenerfv param, ref float[] values)
+ {
+ unsafe
+ {
+ fixed (float* ptr = &values[0])
+ {
+ ListenerPrivate(param, ptr);
+ }
+ }
+ }
+
+ /// This function sets two Math.Vector3 properties of the listener.
+ /// The name of the attribute to be set: ALListenerfv.Orientation
+ /// A Math.Vector3 for the At-Vector.
+ /// A Math.Vector3 for the Up-Vector.
+ public static void Listener(ALListenerfv param, ref Vector3 at, ref Vector3 up)
+ {
+ float[] temp = new float[6];
+
+ temp[0] = at.X;
+ temp[1] = at.Y;
+ temp[2] = at.Z;
+
+ temp[3] = up.X;
+ temp[4] = up.Y;
+ temp[5] = up.Z;
+
+ unsafe
+ {
+ fixed (float* ptr = &temp[0])
+ {
+ ListenerPrivate(param, ptr);
+ }
+ }
+ }
+
+ // Not used by any Enums
+ // AL_API void AL_APIENTRY alListeneri( ALenum param, ALint value );
+ // AL_API void AL_APIENTRY alListener3i( ALenum param, ALint value1, ALint value2, ALint value3 );
+ // AL_API void AL_APIENTRY alListeneriv( ALenum param, const ALint* values );
+
+ #endregion Set Listener parameters
+
+ #region Get Listener parameters
+
+ /// This function retrieves a floating point property of the listener.
+ /// the name of the attribute to be retrieved: ALListenerf.Gain
+ /// a pointer to the floating point value being retrieved.
+ [DllImport(AL.Lib, EntryPoint = "alGetListenerf", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void GetListener(ALListenerf param, [Out] out float value);
+ // AL_API void AL_APIENTRY alGetListenerf( ALenum param, ALfloat* value );
+
+ /// This function retrieves a set of three floating point values from a property of the listener.
+ /// The name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity
+ /// Pointers to the three floating point being retrieved.
+ /// Pointers to the three floating point being retrieved.
+ /// Pointers to the three floating point being retrieved.
+ [DllImport(AL.Lib, EntryPoint = "alGetListener3f", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void GetListener(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 );
+
+ /// This function retrieves a Math.Vector3 from a property of the listener.
+ /// The name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity
+ /// A Math.Vector3 to hold the three floats being retrieved.
+ public static void GetListener(ALListener3f param, out Vector3 values)
+ {
+ GetListener(param, out values.X, out values.Y, out values.Z);
+ }
+
+ /// This function retrieves a floating point-vector property of the listener. You must pin it manually.
+ /// the name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity, ALListenerfv.Orientation
+ /// A pointer to the floating point-vector value being retrieved.
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alGetListenerfv", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ unsafe public static extern void GetListener(ALListenerfv param, float* values);
+ // AL_API void AL_APIENTRY alGetListenerfv( ALenum param, ALfloat* values );
+
+ /// This function retrieves two Math.Vector3 properties of the listener.
+ /// the name of the attribute to be retrieved: ALListenerfv.Orientation
+ /// A Math.Vector3 for the At-Vector.
+ /// A Math.Vector3 for the Up-Vector.
+ public static void GetListener(ALListenerfv param, out Vector3 at, out Vector3 up)
+ {
+ float[] pinned = new float[6]; // should lose scope when the function exits
+ unsafe
+ {
+ fixed (float* ptr = &pinned[0])
+ {
+ GetListener(param, ptr);
+
+ at.X = pinned[0];
+ at.Y = pinned[1];
+ at.Z = pinned[2];
+
+ up.X = pinned[3];
+ up.Y = pinned[4];
+ up.Z = pinned[5];
+ }
+ }
+ }
+
+ // Not used by any Enum:
+ // AL_API void AL_APIENTRY alGetListeneri( ALenum param, ALint* value );
+ // AL_API void AL_APIENTRY alGetListener3i( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
+ // AL_API void AL_APIENTRY alGetListeneriv( ALenum param, ALint* values );
+
+ #endregion Get Listener parameters
+
+ /* Source
+ * Sources represent individual sound objects in 3D-space.
+ * Sources take the PCM buffer provided in the specified Buffer,
+ * apply Source-specific modifications, and then
+ * submit them to be mixed according to spatial arrangement etc.
+ *
+ * Properties include: -
+ *
+
+ * Position AL_POSITION ALfloat[3]
+ * Velocity AL_VELOCITY ALfloat[3]
+ * Direction AL_DIRECTION ALfloat[3]
+
+ * Head Relative Mode AL_SOURCE_RELATIVE ALint (AL_TRUE or AL_FALSE)
+ * Looping AL_LOOPING ALint (AL_TRUE or AL_FALSE)
+ *
+ * Reference Distance AL_REFERENCE_DISTANCE ALfloat
+ * Max Distance AL_MAX_DISTANCE ALfloat
+ * RollOff Factor AL_ROLLOFF_FACTOR ALfloat
+ * Pitch AL_PITCH ALfloat
+ * Gain AL_GAIN ALfloat
+ * Min Gain AL_MIN_GAIN ALfloat
+ * Max Gain AL_MAX_GAIN ALfloat
+ * Inner Angle AL_CONE_INNER_ANGLE ALint or ALfloat
+ * Outer Angle AL_CONE_OUTER_ANGLE ALint or ALfloat
+ * Cone Outer Gain AL_CONE_OUTER_GAIN ALint or ALfloat
+ *
+ * MS Offset AL_MSEC_OFFSET ALint or ALfloat
+ * Byte Offset AL_BYTE_OFFSET ALint or ALfloat
+ * Sample Offset AL_SAMPLE_OFFSET ALint or ALfloat
+ * Attached Buffer AL_BUFFER ALint
+ *
+ * State (Query only) AL_SOURCE_STATE ALint
+ * Buffers Queued (Query only) AL_BUFFERS_QUEUED ALint
+ * Buffers Processed (Query only) AL_BUFFERS_PROCESSED ALint
+ */
+
+ #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 );
+
+ /// 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).
+ /// The number of sources to be generated.
+ /// Pointer to an array of uint values which will store the names of the new sources.
+ [CLSCompliant(false)]
+ [DllImport(AL.Lib, EntryPoint = "alGenSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void GenSources(int n, out uint sources);
+
+ /// 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).
+ /// The number of sources to be generated.
+ /// Pointer to an array of int values which will store the names of the new sources.
+ [CLSCompliant(true)]
+ [DllImport(AL.Lib, EntryPoint = "alGenSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void GenSources(int n, out int sources);
+
+ /// 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).
+ /// Pointer to an array of int values which will store the names of the new sources.
+ [CLSCompliant(true)]
+ public static void GenSources(int[] sources)
+ {
+ uint[] temp = new uint[sources.Length];
+ GenSources(temp.Length, out temp[0]);
+ for (int i = 0; i < temp.Length; i++)
+ {
+ sources[i] = (int)temp[i];
+ }
+ }
+
+ /// 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).
+ /// The number of sources to be generated.
+ /// Pointer to an array of int values which will store the names of the new sources.
+ [CLSCompliant(true)]
+ public static int[] GenSources(int n)
+ {
+ uint[] temp = new uint[n];
+ GenSources(temp.Length, out temp[0]);
+ int[] sources = new int[n];
+ for (int i = 0; i < temp.Length; i++)
+ {
+ sources[i] = (int)temp[i];
+ }
+ return sources;
+ }
+
+ /// 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).
+ /// Pointer to an int value which will store the name of the new source.
+ [CLSCompliant(true)]
+ public static int GenSource()
+ {
+ int temp;
+ GenSources(1, out temp);
+ return (int)temp;
+ }
+
+ /// 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)
+ {
+ GenSources(1, out source);
+ }
+
+ #endregion GenSources()
+
+ #region DeleteSources()
+
+ /// This function deletes one or more sources.
+ /// The number of sources to be deleted.
+ /// Pointer to an array of source names identifying the sources to be deleted.
+ [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 );
+
+ /// This function deletes one or more sources.
+ /// The number of sources to be deleted.
+ /// Reference to a single source, or an array of source names identifying the sources to be deleted.
+ [CLSCompliant(false)]
+ [DllImport(AL.Lib, EntryPoint = "alDeleteSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void DeleteSources(int n, ref uint sources);
+
+ /// This function deletes one or more sources.
+ /// The number of sources to be deleted.
+ /// Reference to a single source, or an array of source names identifying the sources to be deleted.
+ [CLSCompliant(true)]
+ [DllImport(AL.Lib, EntryPoint = "alDeleteSources", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void DeleteSources(int n, ref int sources);
+
+ /// This function deletes one or more sources.
+ /// An array of source names identifying the sources to be deleted.
+ [CLSCompliant(false)]
+ public static void DeleteSources(uint[] sources)
+ {
+ if (sources == null) throw new ArgumentNullException();
+ if (sources.Length == 0) throw new ArgumentOutOfRangeException();
+ DeleteBuffers(sources.Length, ref sources[0]);
+ }
+
+ /// This function deletes one or more sources.
+ /// An array of source names identifying the sources to be deleted.
+ [CLSCompliant(true)]
+ public static void DeleteSources(int[] sources)
+ {
+ if (sources == null) throw new ArgumentNullException();
+ if (sources.Length == 0) throw new ArgumentOutOfRangeException();
+ DeleteBuffers(sources.Length, ref sources[0]);
+ }
+
+ /// 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)
+ {
+ DeleteSources(1, ref source);
+ }
+
+ /// This function deletes one source only.
+ /// Pointer to a source name identifying the source to be deleted.
+ [CLSCompliant(true)]
+ public static void DeleteSource(int source)
+ {
+ DeleteSources(1, ref source);
+ }
+
+ #endregion DeleteSources()
+
+ #region IsSource()
+
+ /// This function tests if a source name is valid, returning True if valid and False if not.
+ /// A source name to be tested for validity
+ /// Success.
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alIsSource", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern bool IsSource(uint sid);
+ // AL_API ALboolean AL_APIENTRY alIsSource( ALuint sid );
+
+ /// This function tests if a source name is valid, returning True if valid and False if not.
+ /// A source name to be tested for validity
+ /// Success.
+ [CLSCompliant(true)]
+ public static bool IsSource(int sid)
+ {
+ return IsSource((uint)sid);
+ }
+
+ #endregion IsSource()
+
+ #endregion Create Source objects
+
+ #region Set Source parameters
+
+ #region Sourcef
+
+ /// This function sets a floating point property of a source.
+ /// Source name whose attribute is being set
+ /// The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.
+ /// The value to set the attribute to.
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourcef", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void Source(uint sid, ALSourcef param, float value);
+ // AL_API void AL_APIENTRY alSourcef( ALuint sid, ALenum param, ALfloat value );
+
+ /// This function sets a floating point property of a source.
+ /// Source name whose attribute is being set
+ /// The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.
+ /// The value to set the attribute to.
+ [CLSCompliant(true)]
+ public static void Source(int sid, ALSourcef param, float value)
+ {
+ Source((uint)sid, param, value);
+ }
+
+ #endregion Sourcef
+
+ #region Source3f
+
+ /// This function sets a source property requiring three floating point values.
+ /// Source name whose attribute is being set.
+ /// The name of the attribute to set: ALSource3f.Position, Velocity, Direction.
+ /// The three ALfloat values which the attribute will be set to.
+ /// The three ALfloat values which the attribute will be set to.
+ /// The three ALfloat values which the attribute will be set to.
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSource3f", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void Source(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 );
+
+ /// This function sets a source property requiring three floating point values.
+ /// Source name whose attribute is being set.
+ /// The name of the attribute to set: ALSource3f.Position, Velocity, Direction.
+ /// The three ALfloat values which the attribute will be set to.
+ /// The three ALfloat values which the attribute will be set to.
+ /// The three ALfloat values which the attribute will be set to.
+ [CLSCompliant(true)]
+ public static void Source(int sid, ALSource3f param, float value1, float value2, float value3)
+ {
+ Source((uint)sid, param, value1, value2, value3);
+ }
+
+ /// This function sets a source property requiring three floating point values.
+ /// Source name whose attribute is being set.
+ /// The name of the attribute to set: ALSource3f.Position, Velocity, Direction.
+ /// A Math.Vector3 which the attribute will be set to.
+ [CLSCompliant(false)]
+ public static void Source(uint sid, ALSource3f param, ref Vector3 values)
+ {
+ Source(sid, param, values.X, values.Y, values.Z);
+ }
+
+ /// This function sets a source property requiring three floating point values.
+ /// Source name whose attribute is being set.
+ /// The name of the attribute to set: ALSource3f.Position, Velocity, Direction.
+ /// A Math.Vector3 which the attribute will be set to.
+ [CLSCompliant(true)]
+ public static void Source(int sid, ALSource3f param, ref Vector3 values)
+ {
+ Source((uint)sid, param, values.X, values.Y, values.Z);
+ }
+
+ #endregion Source3f
+
+ #region Sourcei
+
+ /// This function sets an integer property of a source.
+ /// Source name whose attribute is being set.
+ /// The name of the attribute to set: ALSourcei.SourceRelative, ConeInnerAngle, ConeOuterAngle, Looping, Buffer, SourceState.
+ /// The value to set the attribute to.
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSourcei", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void Source(uint sid, ALSourcei param, int value);
+ // AL_API void AL_APIENTRY alSourcei( ALuint sid, ALenum param, ALint value );
+
+ /// This function sets an integer property of a source.
+ /// Source name whose attribute is being set.
+ /// The name of the attribute to set: ALSourcei.SourceRelative, ConeInnerAngle, ConeOuterAngle, Looping, Buffer, SourceState.
+ /// The value to set the attribute to.
+ [CLSCompliant(true)]
+ public static void Source(int sid, ALSourcei param, int value)
+ {
+ Source((uint)sid, param, value);
+ }
+
+ /// This function sets an bool property of a source.
+ /// Source name whose attribute is being set.
+ /// The name of the attribute to set: ALSourceb.SourceRelative, Looping.
+ /// The value to set the attribute to.
+ [CLSCompliant(false)]
+ public static void Source(uint sid, ALSourceb param, bool value)
+ {
+ Source(sid, (ALSourcei)param, (value) ? 1 : 0);
+ }
+
+ /// This function sets an bool property of a source.
+ /// Source name whose attribute is being set.
+ /// The name of the attribute to set: ALSourceb.SourceRelative, Looping.
+ /// The value to set the attribute to.
+ [CLSCompliant(true)]
+ public static void Source(int sid, ALSourceb param, bool value)
+ {
+ Source((uint)sid, (ALSourcei)param, (value) ? 1 : 0);
+ }
+
+ /// (Helper) Binds a Buffer to a Source handle.
+ /// Source name to attach the Buffer to.
+ /// Buffer name which is attached to the Source.
+ [CLSCompliant(false)]
+ public static void BindBufferToSource(uint source, uint buffer)
+ {
+ Source(source, ALSourcei.Buffer, (int)buffer);
+ }
+
+ /// (Helper) Binds a Buffer to a Source handle.
+ /// Source name to attach the Buffer to.
+ /// Buffer name which is attached to the Source.
+ [CLSCompliant(true)]
+ public static void BindBufferToSource(int source, int buffer)
+ {
+ Source((uint)source, ALSourcei.Buffer, buffer);
+ }
+
+ #endregion Sourcei
+
+ #region Source3i
+
+ /// This function sets 3 integer properties of a source. This property is used to establish connections between Sources and Auxiliary Effect Slots.
+ /// Source name whose attribute is being set.
+ /// The name of the attribute to set: EfxAuxiliarySendFilter
+ /// The value to set the attribute to. (EFX Extension) The destination Auxiliary Effect Slot ID
+ /// The value to set the attribute to. (EFX Extension) The Auxiliary Send number.
+ ///The value to set the attribute to. (EFX Extension) optional Filter ID.
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alSource3i", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void Source(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 );
+
+ /// This function sets 3 integer properties of a source. This property is used to establish connections between Sources and Auxiliary Effect Slots.
+ /// Source name whose attribute is being set.
+ /// The name of the attribute to set: EfxAuxiliarySendFilter
+ /// The value to set the attribute to. (EFX Extension) The destination Auxiliary Effect Slot ID
+ /// The value to set the attribute to. (EFX Extension) The Auxiliary Send number.
+ ///The value to set the attribute to. (EFX Extension) optional Filter ID.
+ [CLSCompliant(true)]
+ public static void Source(int sid, 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 );
+
+ #endregion Set Source parameters
+
+ #region Get Source parameters
+
+ #region GetSourcef
+
+ /// This function retrieves a floating point property of a source.
+ /// Source name whose attribute is being retrieved.
+ /// The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.
+ /// A pointer to the floating point value being retrieved
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alGetSourcef", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void GetSource(uint sid, ALSourcef param, [Out] out float value);
+ // AL_API void AL_APIENTRY alGetSourcef( ALuint sid, ALenum param, ALfloat* value );
+
+ /// This function retrieves a floating point property of a source.
+ /// Source name whose attribute is being retrieved.
+ /// The name of the attribute to set: ALSourcef.Pitch, Gain, MinGain, MaxGain, MaxDistance, RolloffFactor, ConeOuterGain, ConeInnerAngle, ConeOuterAngle, ReferenceDistance, EfxAirAbsorptionFactor, EfxRoomRolloffFactor, EfxConeOuterGainHighFrequency.
+ /// A pointer to the floating point value being retrieved
+ [CLSCompliant(true)]
+ public static void GetSource(int sid, ALSourcef param, out float value)
+ {
+ GetSource((uint)sid, param, out value);
+ }
+
+ #endregion GetSourcef
+
+ #region GetSource3f
+
+ /// This function retrieves three floating point values representing a property of a source.
+ /// Source name whose attribute is being retrieved.
+ /// the name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.
+ /// Pointer to the value to retrieve.
+ /// Pointer to the value to retrieve.
+ /// Pointer to the value to retrieve.
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alGetSource3f", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void GetSource(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);
+
+ /// This function retrieves three floating point values representing a property of a source.
+ /// Source name whose attribute is being retrieved.
+ /// the name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.
+ /// Pointer to the value to retrieve.
+ /// Pointer to the value to retrieve.
+ /// Pointer to the value to retrieve.
+ [CLSCompliant(true)]
+ public static void GetSource(int sid, ALSource3f param, out float value1, out float value2, out float value3)
+ {
+ GetSource((uint)sid, param, out value1, out value2, out value3);
+ }
+
+ /// This function retrieves three floating point values representing a property of a source.
+ /// Source name whose attribute is being retrieved.
+ /// the name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.
+ /// A Math.Vector3 to retrieve the values to.
+ [CLSCompliant(false)]
+ public static void GetSource(uint sid, ALSource3f param, out Vector3 values)
+ {
+ GetSource(sid, param, out values.X, out values.Y, out values.Z);
+ }
+
+ /// This function retrieves three floating point values representing a property of a source.
+ /// Source name whose attribute is being retrieved.
+ /// the name of the attribute being retrieved: ALSource3f.Position, Velocity, Direction.
+ /// A Math.Vector3 to retrieve the values to.
+ [CLSCompliant(true)]
+ public static void GetSource(int sid, ALSource3f param, out Vector3 values)
+ {
+ GetSource((uint)sid, param, out values.X, out values.Y, out values.Z);
+ }
+
+ #endregion GetSource3f
+
+ #region GetSourcei
+
+ /// This function retrieves an integer property of a source.
+ /// Source name whose attribute is being retrieved.
+ /// The name of the attribute to retrieve: ALSourcei.SourceRelative, Buffer, SourceState, BuffersQueued, BuffersProcessed.
+ /// A pointer to the integer value being retrieved.
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alGetSourcei", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void GetSource(uint sid, ALGetSourcei param, [Out] out int value);
+ // AL_API void AL_APIENTRY alGetSourcei( ALuint sid, ALenum param, ALint* value );
+
+ /// This function retrieves an integer property of a source.
+ /// Source name whose attribute is being retrieved.
+ /// The name of the attribute to retrieve: ALSourcei.SourceRelative, Buffer, SourceState, BuffersQueued, BuffersProcessed.
+ /// A pointer to the integer value being retrieved.
+ [CLSCompliant(true)]
+ public static void GetSource(int sid, ALGetSourcei param, out int value)
+ {
+ GetSource((uint)sid, param, out value);
+ }
+
+ /// This function retrieves a bool property of a source.
+ /// Source name whose attribute is being retrieved.
+ /// The name of the attribute to get: ALSourceb.SourceRelative, Looping.
+ /// A pointer to the bool value being retrieved.
+ [CLSCompliant(false)]
+ public static void GetSource(uint sid, ALSourceb param, out bool value)
+ {
+ int result;
+ GetSource(sid, (ALGetSourcei)param, out result);
+ value = result != 0;
+ }
+
+ /// This function retrieves a bool property of a source.
+ /// Source name whose attribute is being retrieved.
+ /// The name of the attribute to get: ALSourceb.SourceRelative, Looping.
+ /// A pointer to the bool value being retrieved.
+ [CLSCompliant(true)]
+ public static void GetSource(int sid, ALSourceb param, out bool value)
+ {
+ int result;
+ GetSource((uint)sid, (ALGetSourcei)param, out result);
+ value = result != 0;
+ }
+
+ #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 );
+ // AL_API void AL_APIENTRY alGetSourceiv( ALuint sid, ALenum param, ALint* values );
+
+ #endregion Get Source parameters
+
+ #region Source vector based playback calls
+
+ #region SourcePlay
+
+ /// 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.
+ /// The number of sources to be played.
+ /// A pointer to an array of sources to be played.
+ [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 );
+
+ /// 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.
+ /// The number of sources to be played.
+ /// A pointer to an array of sources to be played.
+ [CLSCompliant(false)]
+ public static void SourcePlay(int ns, uint[] sids)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = sids)
+ {
+ SourcePlay(ns, ptr);
+ }
+ }
+ }
+
+ /// 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.
+ /// The number of sources to be played.
+ /// A pointer to an array of sources to be played.
+ [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);
+ }
+
+ /// 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.
+ /// The number of sources to be played.
+ /// A pointer to an array of sources to be played.
+ [CLSCompliant(false)]
+ public static void SourcePlay(int ns, ref uint sids)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &sids)
+ {
+ SourcePlay(ns, ptr);
+ }
+ }
+ }
+
+ #endregion SourcePlay
+
+ #region SourceStop
+
+ /// This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.
+ /// The number of sources to stop.
+ /// A pointer to an array of sources to be stopped.
+ [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 );
+
+ /// This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.
+ /// The number of sources to stop.
+ /// A pointer to an array of sources to be stopped.
+ [CLSCompliant(false)]
+ public static void SourceStop(int ns, uint[] sids)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = sids)
+ {
+ SourceStop(ns, ptr);
+ }
+ }
+ }
+
+ /// This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.
+ /// The number of sources to stop.
+ /// A pointer to an array of sources to be stopped.
+ [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);
+ }
+
+ /// This function stops a set of sources. The stopped sources will have their state changed to ALSourceState.Stopped.
+ /// The number of sources to stop.
+ /// A pointer to an array of sources to be stopped.
+ [CLSCompliant(false)]
+ public static void SourceStop(int ns, ref uint sids)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &sids)
+ {
+ SourceStop(ns, ptr);
+ }
+ }
+ }
+
+ #endregion SourceStop
+
+ #region SourceRewind
+
+ /// This function stops a set of sources and sets all their states to ALSourceState.Initial.
+ /// The number of sources to be rewound.
+ /// A pointer to an array of sources to be rewound.
+ [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 );
+
+ /// This function stops a set of sources and sets all their states to ALSourceState.Initial.
+ /// The number of sources to be rewound.
+ /// A pointer to an array of sources to be rewound.
+ [CLSCompliant(false)]
+ public static void SourceRewind(int ns, uint[] sids)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = sids)
+ {
+ SourceRewind(ns, ptr);
+ }
+ }
+ }
+
+ /// This function stops a set of sources and sets all their states to ALSourceState.Initial.
+ /// The number of sources to be rewound.
+ /// A pointer to an array of sources to be rewound.
+ [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);
+ }
+
+ /// This function stops a set of sources and sets all their states to ALSourceState.Initial.
+ /// The number of sources to be rewound.
+ /// A pointer to an array of sources to be rewound.
+ [CLSCompliant(false)]
+ public static void SourceRewind(int ns, ref uint sids)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &sids)
+ {
+ SourceRewind(ns, ptr);
+ }
+ }
+ }
+
+ #endregion SourceRewind
+
+ #region SourcePause
+
+ /// This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.
+ /// The number of sources to be paused.
+ /// A pointer to an array of sources to be paused.
+ [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 );
+
+ /// This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.
+ /// The number of sources to be paused.
+ /// A pointer to an array of sources to be paused.
+ [CLSCompliant(false)]
+ public static void SourcePause(int ns, uint[] sids)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = sids)
+ {
+ SourcePause(ns, ptr);
+ }
+ }
+ }
+ /// This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.
+ /// The number of sources to be paused.
+ /// A pointer to an array of sources to be paused.
+ [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);
+ }
+
+ /// This function pauses a set of sources. The paused sources will have their state changed to ALSourceState.Paused.
+ /// The number of sources to be paused.
+ /// A pointer to an array of sources to be paused.
+ [CLSCompliant(false)]
+ public static void SourcePause(int ns, ref uint sids)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &sids)
+ {
+ SourcePause(ns, ptr);
+ }
+ }
+ }
+
+ #endregion SourcePause
+
+ #endregion Source vector based playback calls
+
+ #region Source based playback calls
+
+ #region SourcePlay
+
+ /// 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.
+ /// The name of the source to be played.
+ [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 );
+
+ /// 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.
+ /// The name of the source to be played.
+ [CLSCompliant(true)]
+ public static void SourcePlay(int sid)
+ {
+ SourcePlay((uint)sid);
+ }
+
+ #endregion SourcePlay
+
+ #region SourceStop
+
+ /// This function stops a source. The stopped source will have it's state changed to ALSourceState.Stopped.
+ /// The name of the source to be stopped.
+ [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 );
+
+ /// This function stops a source. The stopped source will have it's state changed to ALSourceState.Stopped.
+ /// The name of the source to be stopped.
+ [CLSCompliant(true)]
+ public static void SourceStop(int sid)
+ {
+ SourceStop((uint)sid);
+ }
+
+ #endregion SourceStop
+
+ #region SourceRewind
+
+ /// This function stops the source and sets its state to ALSourceState.Initial.
+ /// The name of the source to be rewound.
+ [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 );
+
+ /// This function stops the source and sets its state to ALSourceState.Initial.
+ /// The name of the source to be rewound.
+ [CLSCompliant(true)]
+ public static void SourceRewind(int sid)
+ {
+ SourceRewind((uint)sid);
+ }
+
+ #endregion SourceRewind
+
+ #region SourcePause
+
+ /// This function pauses a source. The paused source will have its state changed to ALSourceState.Paused.
+ /// The name of the source to be paused.
+ [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 );
+
+ /// This function pauses a source. The paused source will have its state changed to ALSourceState.Paused.
+ /// The name of the source to be paused.
+ [CLSCompliant(true)]
+ public static void SourcePause(int sid)
+ {
+ SourcePause((uint)sid);
+ }
+
+ #endregion SourcePause
+
+ #endregion Source based playback calls
+
+ #region Source Queuing
+
+ #region SourceQueueBuffers
+
+ /// 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.
+ /// The name of the source to queue buffers onto.
+ /// The number of buffers to be queued.
+ /// A pointer to an array of buffer names to be queued.
+ [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 );
+
+ /// 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.
+ /// The name of the source to queue buffers onto.
+ /// The number of buffers to be queued.
+ /// A pointer to an array of buffer names to be queued.
+ [CLSCompliant(false)]
+ public static void SourceQueueBuffers(uint sid, int numEntries, uint[] bids)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = bids)
+ {
+ SourceQueueBuffers(sid, numEntries, ptr);
+ }
+ }
+ }
+
+ /// 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.
+ /// The name of the source to queue buffers onto.
+ /// The number of buffers to be queued.
+ /// A pointer to an array of buffer names to be queued.
+ [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);
+ }
+
+ /// 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.
+ /// The name of the source to queue buffers onto.
+ /// The number of buffers to be queued.
+ /// A pointer to an array of buffer names to be queued.
+ [CLSCompliant(false)]
+ public static void SourceQueueBuffers(uint sid, int numEntries, ref uint bids)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &bids)
+ {
+ SourceQueueBuffers(sid, numEntries, ptr);
+ }
+ }
+ }
+
+ /// 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.
+ /// The name of the source to queue buffers onto.
+ /// The name of the buffer to be queued.
+ public static void SourceQueueBuffer(int source, int buffer)
+ {
+ unsafe { AL.SourceQueueBuffers((uint)source, 1, (uint*)&buffer); }
+ }
+
+ #endregion SourceQueueBuffers
+
+ #region SourceUnqueueBuffers
+
+ /// 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.
+ /// The name of the source to unqueue buffers from.
+ /// The number of buffers to be unqueued.
+ /// A pointer to an array of buffer names that were removed.
+ [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 );
+
+ /// 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.
+ /// The name of the source to unqueue buffers from.
+ /// The number of buffers to be unqueued.
+ /// A pointer to an array of buffer names that were removed.
+ [CLSCompliant(false)]
+ [DllImport(AL.Lib, EntryPoint = "alSourceUnqueueBuffers"), SuppressUnmanagedCodeSecurity]
+ public static extern void SourceUnqueueBuffers(uint sid, int numEntries, [Out] uint[] bids);
+
+ /// 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.
+ /// The name of the source to unqueue buffers from.
+ /// The number of buffers to be unqueued.
+ /// A pointer to an array of buffer names that were removed.
+ [DllImport(AL.Lib, EntryPoint = "alSourceUnqueueBuffers"), SuppressUnmanagedCodeSecurity]
+ public static extern void SourceUnqueueBuffers(int sid, int numEntries, [Out] int[] bids);
+
+ /// 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.
+ /// The name of the source to unqueue buffers from.
+ /// The number of buffers to be unqueued.
+ /// A pointer to an array of buffer names that were removed.
+ [CLSCompliant(false)]
+ [DllImport(AL.Lib, EntryPoint = "alSourceUnqueueBuffers"), SuppressUnmanagedCodeSecurity]
+ public static extern void SourceUnqueueBuffers(uint sid, int numEntries, ref uint bids);
+
+ /// 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.
+ /// The name of the source to unqueue buffers from.
+ /// The number of buffers to be unqueued.
+ /// A pointer to an array of buffer names that were removed.
+ [DllImport(AL.Lib, EntryPoint = "alSourceUnqueueBuffers"), SuppressUnmanagedCodeSecurity]
+ public static extern void SourceUnqueueBuffers(int sid, int numEntries, ref int bids);
+
+ /// 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.
+ /// The name of the source to unqueue buffers from.
+ public static int SourceUnqueueBuffer(int sid)
+ {
+ uint buf;
+ unsafe { SourceUnqueueBuffers((uint)sid, 1, &buf); }
+ return (int)buf;
+ }
+
+ /// 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.
+ /// The name of the source to unqueue buffers from.
+ /// The number of buffers to be unqueued.
+ public static int[] SourceUnqueueBuffers(int sid, int numEntries)
+ {
+ if (numEntries <= 0) throw new ArgumentOutOfRangeException("numEntries", "Must be greater than zero.");
+ int[] buf = new int[numEntries];
+ SourceUnqueueBuffers(sid, numEntries, buf);
+ return buf;
+ }
+
+ #endregion SourceUnqueueBuffers
+
+ #endregion Source Queuing
+
+ /*
+ * Buffer
+ * Buffer objects are storage space for sample buffer.
+ * Buffers are referred to by Sources. One Buffer can be used
+ * by multiple Sources.
+ *
+ * Properties include: -
+ *
+ * Frequency (Query only) AL_FREQUENCY ALint
+ * Size (Query only) AL_SIZE ALint
+ * Bits (Query only) AL_BITS ALint
+ * Channels (Query only) AL_CHANNELS ALint
+ */
+
+ #region Buffer objects
+
+ #region GenBuffers
+
+ /// 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).
+ /// The number of buffers to be generated.
+ /// Pointer to an array of uint values which will store the names of the new buffers.
+ [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 );
+
+ /// 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).
+ /// The number of buffers to be generated.
+ /// Pointer to an array of uint values which will store the names of the new buffers.
+ [CLSCompliant(false)]
+ [DllImport(AL.Lib, EntryPoint = "alGenBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity]
+ public static extern void GenBuffers(int n, out uint buffers);
+
+ /// 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).
+ /// The number of buffers to be generated.
+ /// Pointer to an array of uint values which will store the names of the new buffers.
+ [CLSCompliant(true)]
+ [DllImport(AL.Lib, EntryPoint = "alGenBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity]
+ public static extern void GenBuffers(int n, out int buffers);
+
+ /// 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).
+ /// The number of buffers to be generated.
+ /// Pointer to an array of uint values which will store the names of the new buffers.
+ [CLSCompliant(true)]
+ public static int[] GenBuffers(int n)
+ {
+ int[] buffers = new int[n];
+ GenBuffers(buffers.Length, out buffers[0]);
+ return buffers;
+ }
+
+ /// 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 name of the new buffer.
+ [CLSCompliant(true)]
+ public static int GenBuffer()
+ {
+ int temp;
+ GenBuffers(1, out temp);
+ return (int)temp;
+ }
+
+ /// 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)
+ {
+ GenBuffers(1, out buffer);
+ }
+
+ #endregion GenBuffers
+
+ #region DeleteBuffers
+
+ /// 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.
+ /// The number of buffers to be deleted.
+ /// Pointer to an array of buffer names identifying the buffers to be deleted.
+ [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 );
+
+ /// 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.
+ /// The number of buffers to be deleted.
+ /// Pointer to an array of buffer names identifying the buffers to be deleted.
+ [CLSCompliant(false)]
+ [DllImport(AL.Lib, EntryPoint = "alDeleteBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void DeleteBuffers(int n, [In] ref uint buffers);
+
+ /// 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.
+ /// The number of buffers to be deleted.
+ /// Pointer to an array of buffer names identifying the buffers to be deleted.
+ [CLSCompliant(true)]
+ [DllImport(AL.Lib, EntryPoint = "alDeleteBuffers", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void DeleteBuffers(int n, [In] ref int buffers);
+
+ /// 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 DeleteBuffers(uint[] buffers)
+ {
+ if (buffers == null) throw new ArgumentNullException();
+ if (buffers.Length == 0) throw new ArgumentOutOfRangeException();
+ DeleteBuffers(buffers.Length, ref buffers[0]);
+ }
+
+ /// 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.
+ /// Pointer to an array of buffer names identifying the buffers to be deleted.
+ [CLSCompliant(true)]
+ public static void DeleteBuffers(int[] buffers)
+ {
+ if (buffers == null) throw new ArgumentNullException();
+ if (buffers.Length == 0) throw new ArgumentOutOfRangeException();
+ DeleteBuffers(buffers.Length, ref buffers[0]);
+ }
+
+ /// 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)
+ {
+ DeleteBuffers(1, ref buffer);
+ }
+
+ /// 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)
+ {
+ DeleteBuffers(1, ref buffer);
+ }
+
+ #endregion DeleteBuffers
+
+ #region IsBuffer
+
+ /// This function tests if a buffer name is valid, returning True if valid, False if not.
+ /// A buffer Handle previously allocated with .
+ /// Success.
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alIsBuffer", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern bool IsBuffer(uint bid);
+ // AL_API ALboolean AL_APIENTRY alIsBuffer( ALuint bid );
+
+ /// This function tests if a buffer name is valid, returning True if valid, False if not.
+ /// A buffer Handle previously allocated with .
+ /// Success.
+ [CLSCompliant(true)]
+ public static bool IsBuffer(int bid)
+ {
+ uint temp = (uint)bid;
+ return IsBuffer(temp);
+ }
+
+ #endregion IsBuffer
+
+ #region BufferData
+
+ /// 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.
+ /// buffer Handle/Name to be filled with buffer.
+ /// Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.
+ /// Pointer to a pinned audio buffer.
+ /// The size of the audio buffer in bytes.
+ /// The frequency of the audio buffer.
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alBufferData", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void BufferData(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 );
+
+ /// 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.
+ /// buffer Handle/Name to be filled with buffer.
+ /// Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.
+ /// Pointer to a pinned audio buffer.
+ /// The size of the audio buffer in bytes.
+ /// The frequency of the audio buffer.
+ [CLSCompliant(true)]
+ public static void BufferData(int bid, ALFormat format, IntPtr buffer, int size, int freq)
+ {
+ BufferData((uint)bid, format, buffer, size, freq);
+ }
+
+ /// 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.
+ /// buffer Handle/Name to be filled with buffer.
+ /// Format type from among the following: ALFormat.Mono8, ALFormat.Mono16, ALFormat.Stereo8, ALFormat.Stereo16.
+ /// The audio buffer.
+ /// The size of the audio buffer in bytes.
+ /// The frequency of the audio buffer.
+ public static void BufferData(int bid, ALFormat format, TBuffer[] buffer, int size, int freq)
+ where TBuffer : struct
+ {
+ if (!BlittableValueType.Check(buffer))
+ throw new ArgumentException("buffer");
+
+ GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
+ try { BufferData(bid, format, handle.AddrOfPinnedObject(), size, freq); }
+ finally { handle.Free(); }
+ }
+
+ /// This function fills a buffer with audio buffer (PCM format).
+ /// Buffer Handle/Name to be filled with buffer.
+ /// A SoundData object containing the buffer to upload.
+ [CLSCompliant(false)]
+ [Obsolete("Use BufferData instead.")]
+ public static void BufferData(uint bid, SoundData buffer)
+ {
+ unsafe
+ {
+ fixed (byte* data_ptr = &buffer.Data[0])
+ BufferData(bid, buffer.SoundFormat.SampleFormatAsOpenALFormat, (IntPtr)data_ptr, buffer.Data.Length,
+ buffer.SoundFormat.SampleRate);
+ }
+ }
+
+ /// This function fills a buffer with audio buffer (PCM format).
+ /// Buffer Handle/Name to be filled with buffer.
+ /// A SoundData object containing the buffer to upload.
+ public static void BufferData(int bid, SoundData data)
+ {
+ unsafe
+ {
+ fixed (byte* data_ptr = &data.Data[0])
+ BufferData(bid, data.SoundFormat.SampleFormatAsOpenALFormat, (IntPtr)data_ptr, data.Data.Length,
+ data.SoundFormat.SampleRate);
+ }
+ }
+
+ #endregion BufferData
+
+ #endregion Buffer objects
+
+ #region Set Buffer parameters (currently parameters can only be read)
+
+ /*
+ Remarks (from Manual)
+ * There are no relevant buffer properties defined in OpenAL 1.1 which can be affected by this call,
+ * but this function may be used by OpenAL extensions.
+
+ // AL_API void AL_APIENTRY alBufferf( ALuint bid, ALenum param, ALfloat value );
+ // AL_API void AL_APIENTRY alBufferfv( ALuint bid, ALenum param, const ALfloat* values );
+ // AL_API void AL_APIENTRY alBufferi( ALuint bid, ALenum param, ALint value );
+ // AL_API void AL_APIENTRY alBuffer3i( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
+ // AL_API void AL_APIENTRY alBufferiv( ALuint bid, ALenum param, const ALint* values );
+ // AL_API void AL_APIENTRY alBuffer3f( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+ */
+
+ /*
+ [DllImport( Al.Lib, EntryPoint = "alBuffer3f", ExactSpelling = true, CallingConvention = Al.Style ), SuppressUnmanagedCodeSecurity( )]
+ public static extern void Buffer3f( uint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+
+ public static void Bufferv3( uint bid, Alenum param, ref Vector3 values )
+ {
+ Buffer3f( bid, param, values.X, values.Y, values.Z );
+ }*/
+
+ #endregion Set Buffer parameters
+
+ #region Get Buffer parameters
+
+ #region GetBufferi
+
+ /// This function retrieves an integer property of a buffer.
+ /// Buffer name whose attribute is being retrieved
+ /// The name of the attribute to be retrieved: ALGetBufferi.Frequency, Bits, Channels, Size, and the currently hidden AL_DATA (dangerous).
+ /// A pointer to an int to hold the retrieved buffer
+ [CLSCompliant(false), DllImport(AL.Lib, EntryPoint = "alGetBufferi", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void GetBuffer(uint bid, ALGetBufferi param, [Out] out int value);
+ // AL_API void AL_APIENTRY alGetBufferi( ALuint bid, ALenum param, ALint* value );
+
+ /// This function retrieves an integer property of a buffer.
+ /// Buffer name whose attribute is being retrieved
+ /// The name of the attribute to be retrieved: ALGetBufferi.Frequency, Bits, Channels, Size, and the currently hidden AL_DATA (dangerous).
+ /// A pointer to an int to hold the retrieved buffer
+ [CLSCompliant(true)]
+ public static void GetBuffer(int bid, 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 );
+ // AL_API void AL_APIENTRY alGetBuffer3i( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
+ // AL_API void AL_APIENTRY alGetBufferiv( ALuint bid, ALenum param, ALint* values );
+
+ #endregion Get Buffer parameters
+
+ #region Global Parameters
+
+ /// AL.DopplerFactor is a simple scaling of source and listener velocities to exaggerate or deemphasize the Doppler (pitch) shift resulting from the calculation.
+ /// 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.
+ [DllImport(AL.Lib, EntryPoint = "alDopplerFactor", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void DopplerFactor(float value);
+ // AL_API void AL_APIENTRY alDopplerFactor( ALfloat value );
+
+ /// This function is deprecated and should not be used.
+ /// The default is 1.0f.
+ [DllImport(AL.Lib, EntryPoint = "alDopplerVelocity", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void DopplerVelocity(float value);
+ // AL_API void AL_APIENTRY alDopplerVelocity( ALfloat value );
+
+ /// 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.
+ /// 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.
+ [DllImport(AL.Lib, EntryPoint = "alSpeedOfSound", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void SpeedOfSound(float value);
+ // AL_API void AL_APIENTRY alSpeedOfSound( ALfloat value );
+
+ /// 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.
+ ///
+ /// The ALDistanceModel .InverseDistance model works according to the following formula:
+ /// gain = ALSourcef.ReferenceDistance / (ALSourcef.ReferenceDistance + ALSourcef.RolloffFactor * (distance – ALSourcef.ReferenceDistance));
+ ///
+ /// The ALDistanceModel .InverseDistanceClamped model works according to the following formula:
+ /// distance = max(distance,ALSourcef.ReferenceDistance);
+ /// distance = min(distance,ALSourcef.MaxDistance);
+ /// gain = ALSourcef.ReferenceDistance / (ALSourcef.ReferenceDistance + ALSourcef.RolloffFactor * (distance – ALSourcef.ReferenceDistance));
+ ///
+ /// The ALDistanceModel.LinearDistance model works according to the following formula:
+ /// distance = min(distance, ALSourcef.MaxDistance) // avoid negative gain
+ /// gain = (1 – ALSourcef.RolloffFactor * (distance – ALSourcef.ReferenceDistance) / (ALSourcef.MaxDistance – ALSourcef.ReferenceDistance))
+ ///
+ /// The ALDistanceModel.LinearDistanceClamped model works according to the following formula:
+ /// distance = max(distance, ALSourcef.ReferenceDistance)
+ /// distance = min(distance, ALSourcef.MaxDistance)
+ /// gain = (1 – ALSourcef.RolloffFactor * (distance – ALSourcef.ReferenceDistance) / (ALSourcef.MaxDistance – ALSourcef.ReferenceDistance))
+ ///
+ /// The ALDistanceModel.ExponentDistance model works according to the following formula:
+ /// gain = (distance / ALSourcef.ReferenceDistance) ^ (- ALSourcef.RolloffFactor)
+ ///
+ /// The ALDistanceModel.ExponentDistanceClamped model works according to the following formula:
+ /// distance = max(distance, ALSourcef.ReferenceDistance)
+ /// distance = min(distance, ALSourcef.MaxDistance)
+ /// gain = (distance / ALSourcef.ReferenceDistance) ^ (- ALSourcef.RolloffFactor)
+ ///
+ /// The ALDistanceModel.None model works according to the following formula:
+ /// gain = 1f;
+ ///
+ ///
+ [DllImport(AL.Lib, EntryPoint = "alDistanceModel", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void DistanceModel(ALDistanceModel distancemodel);
+ // AL_API void AL_APIENTRY alDistanceModel( ALenum distanceModel );
+
+ #endregion Global Parameters
+
+ #region Helpers
+
+ /// (Helper) Returns Source state information.
+ /// The source to be queried.
+ /// state information from OpenAL.
+ [CLSCompliant(false)]
+ public static ALSourceState GetSourceState(uint sid)
+ {
+ int 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)
+ {
+ int 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)
+ {
+ int 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)
+ {
+ int temp;
+ AL.GetSource(sid, ALGetSourcei.SourceType, out temp);
+ return (ALSourceType)temp;
+ }
+
+ [CLSCompliant(true)]
+ public static ALDistanceModel GetDistanceModel()
+ {
+ return (ALDistanceModel)AL.Get(ALGetInteger.DistanceModel);
+ }
+
+ #endregion Helpers
+ }
+}
diff --git a/Source/Compatibility/Audio/OpenAL/AL/ALEnums.cs b/Source/Compatibility/Audio/OpenAL/AL/ALEnums.cs
new file mode 100644
index 00000000..595cace5
--- /dev/null
+++ b/Source/Compatibility/Audio/OpenAL/AL/ALEnums.cs
@@ -0,0 +1,431 @@
+#region --- OpenTK.OpenAL License ---
+/* AlTokens.cs
+ * C header: \OpenAL 1.1 SDK\include\Al.h
+ * Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
+ * Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
+ * See license.txt for license details
+ * http://www.OpenTK.net */
+#endregion
+
+using System;
+
+namespace OpenTK.Audio
+{
+
+ ///A list of valid Enable/Disable/IsEnabled parameters
+ public enum ALCapability : int
+ {
+ ///Currently no state toggles exist for vanilla OpenAL and no Extension uses it.
+ Invalid = -1,
+ }
+
+ ///A list of valid 32-Bits Float Listener/GetListener parameters
+ public enum ALListenerf : int
+ {
+ ///Indicate the gain (Volume amplification) applied. Type: float Range: [0.0f - ? ] A value of 1.0 means un-attenuated/unchanged. Each division by 2 equals an attenuation of -6dB. Each multiplicaton with 2 equals an amplification of +6dB. A value of 0.0f is interpreted as zero volume and the channel is effectively disabled.
+ Gain = 0x100A,
+
+ ///(EFX Extension) This setting is critical if Air Absorption effects are enabled because the amount of Air Absorption applied is directly related to the real-world distance between the Source and the Listener. centimeters 0.01f meters 1.0f kilometers 1000.0f Range [float.MinValue .. float.MaxValue] Default: 1.0f
+ EfxMetersPerUnit = 0x20004,
+ }
+
+ ///A list of valid Math.Vector3 Listener/GetListener parameters
+ public enum ALListener3f : int
+ {
+ ///Specify the current location in three dimensional space. OpenAL, like OpenGL, uses a right handed coordinate system, where in a frontal default view X (thumb) points right, Y points up (index finger), and Z points towards the viewer/camera (middle finger). To switch from a left handed coordinate system, flip the sign on the Z coordinate. Listener position is always in the world coordinate system.
+ Position = 0x1004,
+
+ ///Specify the current velocity in three dimensional space.
+ Velocity = 0x1006,
+ }
+
+ ///A list of valid float[] Listener/GetListener parameters
+ public enum ALListenerfv : int
+ {
+ ///Indicate Listener orientation. Expects two Vector3, At followed by Up.
+ Orientation = 0x100F,
+ }
+
+ ///A list of valid 32-Bits Float Source/GetSource parameters
+ public enum ALSourcef : int
+ {
+ ///Source specific reference distance. Type: float Range: [0.0f - float.PositiveInfinity] At 0.0f, no distance attenuation occurs. Type: float Default: 1.0f.
+ ReferenceDistance = 0x1020,
+
+ ///Indicate distance above which Sources are not attenuated using the inverse clamped distance model. Default: float.PositiveInfinity Type: float Range: [0.0f - float.PositiveInfinity]
+ MaxDistance = 0x1023,
+
+ ///Source specific rolloff factor. Type: float Range: [0.0f - float.PositiveInfinity]
+ RolloffFactor = 0x1021,
+
+ ///Specify the pitch to be applied, either at Source, or on mixer results, at Listener. Range: [0.5f - 2.0f] Default: 1.0f
+ Pitch = 0x1003,
+
+ ///Indicate the gain (volume amplification) applied. Type: float. Range: [0.0f - ? ] A value of 1.0 means un-attenuated/unchanged. Each division by 2 equals an attenuation of -6dB. Each multiplicaton with 2 equals an amplification of +6dB. A value of 0.0f is meaningless with respect to a logarithmic scale; it is interpreted as zero volume - the channel is effectively disabled.
+ Gain = 0x100A,
+
+ ///Indicate minimum Source attenuation. Type: float Range: [0.0f - 1.0f] (Logarthmic)
+ MinGain = 0x100D,
+
+ ///Indicate maximum Source attenuation. Type: float Range: [0.0f - 1.0f] (Logarthmic)
+ MaxGain = 0x100E,
+
+ ///Directional Source, inner cone angle, in degrees. Range: [0-360] Default: 360
+ ConeInnerAngle = 0x1001,
+
+ ///Directional Source, outer cone angle, in degrees. Range: [0-360] Default: 360
+ ConeOuterAngle = 0x1002,
+
+ ///Directional Source, outer cone gain. Default: 0.0f Range: [0.0f - 1.0] (Logarithmic)
+ ConeOuterGain = 0x1022,
+
+ /// The playback position, expressed in seconds.
+ SecOffset = 0x1024, // AL_EXT_OFFSET extension.
+
+ ///(EFX Extension) This property is a multiplier on the amount of Air Absorption applied to the Source. The AL_AIR_ABSORPTION_FACTOR is multiplied by an internal Air Absorption Gain HF value of 0.994 (-0.05dB) per meter which represents normal atmospheric humidity and temperature. Range [0.0f .. 10.0f] Default: 0.0f
+ EfxAirAbsorptionFactor = 0x20007,
+
+ ///(EFX Extension) This property is defined the same way as the Reverb Room Rolloff property: it is one of two methods available in the Effect Extension to attenuate the reflected sound (early reflections and reverberation) according to source-listener distance. Range [0.0f .. 10.0f] Default: 0.0f
+ EfxRoomRolloffFactor = 0x20008,
+
+ ///(EFX Extension) A directed Source points in a specified direction. The Source sounds at full volume when the listener is directly in front of the source; it is attenuated as the listener circles the Source away from the front. Range [0.0f .. 1.0f] Default: 1.0f
+ EfxConeOuterGainHighFrequency = 0x20009,
+
+ }
+
+ ///A list of valid Math.Vector3 Source/GetSource parameters
+ public enum ALSource3f : int
+ {
+ ///Specify the current location in three dimensional space. OpenAL, like OpenGL, uses a right handed coordinate system, where in a frontal default view X (thumb) points right, Y points up (index finger), and Z points towards the viewer/camera (middle finger). To switch from a left handed coordinate system, flip the sign on the Z coordinate. Listener position is always in the world coordinate system.
+ Position = 0x1004,
+
+ ///Specify the current velocity in three dimensional space.
+ Velocity = 0x1006,
+
+ ///Specify the current direction vector.
+ Direction = 0x1005,
+ }
+
+ ///A list of valid 8-Bits boolean Source/GetSource parameters
+ public enum ALSourceb : int
+ {
+ ///Indicate that the Source has relative coordinates. Type: bool Range: [True, False]
+ SourceRelative = 0x202,
+
+ ///Indicate whether the Source is looping. Type: bool Range: [True, False] Default: False.
+ Looping = 0x1007,
+
+ ///(EFX Extension) If this Source property is set to True, this Source’s direct-path is automatically filtered according to the orientation of the source relative to the listener and the setting of the Source property Sourcef.ConeOuterGainHF. Type: bool Range [False, True] Default: True
+ EfxDirectFilterGainHighFrequencyAuto = 0x2000A,
+
+ ///(EFX Extension) If this Source property is set to True, the intensity of this Source’s reflected sound is automatically attenuated according to source-listener distance and source directivity (as determined by the cone parameters). If it is False, the reflected sound is not attenuated according to distance and directivity. Type: bool Range [False, True] Default: True
+ EfxAuxiliarySendFilterGainAuto = 0x2000B,
+
+ ///(EFX Extension) If this Source property is AL_TRUE (its default value), the intensity of this Source’s reflected sound at high frequencies will be automatically attenuated according to the high-frequency source directivity as set by the Sourcef.ConeOuterGainHF property. If this property is AL_FALSE, the Source’s reflected sound is not filtered at all according to the Source’s directivity. Type: bool Range [False, True] Default: True
+ EfxAuxiliarySendFilterGainHighFrequencyAuto = 0x2000C,
+ }
+
+ ///A list of valid Int32 Source parameters
+ public enum ALSourcei : int
+ {
+ ///The playback position, expressed in bytes.
+ ByteOffset = 0x1026, // AL_EXT_OFFSET extension.
+
+ ///The playback position, expressed in samples.
+ SampleOffset = 0x1025, // AL_EXT_OFFSET extension.
+
+ ///Indicate the Buffer to provide sound samples. Type: uint Range: any valid Buffer Handle.
+ Buffer = 0x1009,
+
+ ///Source type (Static, Streaming or undetermined). Use enum AlSourceType for comparison
+ SourceType = 0x1027,
+
+ ///(EFX Extension) This Source property is used to apply filtering on the direct-path (dry signal) of a Source.
+ EfxDirectFilter = 0x20005,
+ }
+
+ ///A list of valid 3x Int32 Source/GetSource parameters
+ public enum ALSource3i : int
+ {
+ ///(EFX Extension) This Source property is used to establish connections between Sources and Auxiliary Effect Slots. For a Source to feed an Effect that has been loaded into an Auxiliary Effect Slot the application must configure one of the Source’s auxiliary sends. This process involves setting 3 variables – the destination Auxiliary Effect Slot ID, the Auxiliary Send number, and an optional Filter ID. Type: uint Range: any valid Filter Handle.
+ EfxAuxiliarySendFilter = 0x20006,
+ }
+
+ ///A list of valid Int32 GetSource parameters
+ public enum ALGetSourcei : int
+ {
+ ///The playback position, expressed in bytes. AL_EXT_OFFSET Extension.
+ ByteOffset = 0x1026,
+
+ ///The playback position, expressed in samples. AL_EXT_OFFSET Extension.
+ SampleOffset = 0x1025,
+
+ ///Indicate the Buffer to provide sound samples. Type: uint Range: any valid Buffer Handle.
+ Buffer = 0x1009,
+
+ /// The state of the source (Stopped, Playing, etc.) Use the enum AlSourceState for comparison.
+ SourceState = 0x1010,
+
+ /// The number of buffers queued on this source.
+ BuffersQueued = 0x1015,
+
+ /// The number of buffers in the queue that have been processed.
+ BuffersProcessed = 0x1016,
+
+ ///Source type (Static, Streaming or undetermined). Use enum AlSourceType for comparison.
+ SourceType = 0x1027,
+ }
+
+ /*
+ public enum ALDeprecated : int
+ {
+ ///Deprecated. Specify the channel mask. (Creative) Type: uint Range: [0 - 255]
+ ChannelMask = 0x3000,
+ }
+ */
+
+ ///Source state information, can be retrieved by AL.Source() with ALSourcei.SourceState.
+ public enum ALSourceState : int
+ {
+ ///Default State when loaded, can be manually set with AL.SourceRewind().
+ Initial = 0x1011,
+
+ ///The source is currently playing.
+ Playing = 0x1012,
+
+ ///The source has paused playback.
+ Paused = 0x1013,
+
+ ///The source is not playing.
+ Stopped = 0x1014,
+ }
+
+ ///Source type information, can be retrieved by AL.Source() with ALSourcei.SourceType.
+ public enum ALSourceType : int
+ {
+ ///Source is Static if a Buffer has been attached using AL.Source with the parameter Sourcei.Buffer.
+ Static = 0x1028,
+
+ ///Source is Streaming if one or more Buffers have been attached using AL.SourceQueueBuffers
+ Streaming = 0x1029,
+
+ ///Source is undetermined when it has a null Buffer attached
+ Undetermined = 0x1030,
+ }
+
+ ///Sound samples: Format specifier.
+ public enum ALFormat : int
+ {
+ ///1 Channel, 8 Bits per sample.
+ Mono8 = 0x1100,
+
+ ///1 Channel, 16 Bits per sample.
+ Mono16 = 0x1101,
+
+ ///2 Channels, 8 Bits per sample each.
+ Stereo8 = 0x1102,
+
+ ///2 Channels, 16 Bits per sample each.
+ Stereo16 = 0x1103,
+
+ /// 1 Channel, A-law encoded data. Requires Extension: AL_EXT_ALAW
+ MonoALawExt = 0x10016,
+
+ /// 2 Channels, A-law encoded data. Requires Extension: AL_EXT_ALAW
+ StereoALawExt = 0x10017,
+
+ /// 1 Channel, µ-law encoded data. Requires Extension: AL_EXT_MULAW
+ MonoMuLawExt = 0x10014,
+
+ /// 2 Channels, µ-law encoded data. Requires Extension: AL_EXT_MULAW
+ StereoMuLawExt = 0x10015,
+
+ /// Ogg Vorbis encoded data. Requires Extension: AL_EXT_vorbis
+ VorbisExt = 0x10003,
+
+ /// MP3 encoded data. Requires Extension: AL_EXT_mp3
+ Mp3Ext = 0x10020,
+
+ /// 1 Channel, IMA4 ADPCM encoded data. Requires Extension: AL_EXT_IMA4
+ MonoIma4Ext = 0x1300,
+
+ /// 2 Channels, IMA4 ADPCM encoded data. Requires Extension: AL_EXT_IMA4
+ StereoIma4Ext = 0x1301,
+
+ /// 1 Channel, single-precision floating-point data. Requires Extension: AL_EXT_float32
+ MonoFloat32Ext = 0x10010,
+
+ /// 2 Channels, single-precision floating-point data. Requires Extension: AL_EXT_float32
+ StereoFloat32Ext = 0x10011,
+
+ /// 1 Channel, double-precision floating-point data. Requires Extension: AL_EXT_double
+ MonoDoubleExt = 0x10012,
+
+ /// 2 Channels, double-precision floating-point data. Requires Extension: AL_EXT_double
+ StereoDoubleExt = 0x10013,
+
+ /// Multichannel 5.1, 16 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ Multi51Chn16Ext = 0x120B,
+
+ /// Multichannel 5.1, 32 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ Multi51Chn32Ext = 0x120C,
+
+ /// Multichannel 5.1, 8 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ Multi51Chn8Ext = 0x120A,
+
+ /// Multichannel 6.1, 16 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ Multi61Chn16Ext = 0x120E,
+
+ /// Multichannel 6.1, 32 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ Multi61Chn32Ext = 0x120F,
+
+ /// Multichannel 6.1, 8 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ Multi61Chn8Ext = 0x120D,
+
+ /// Multichannel 7.1, 16 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ Multi71Chn16Ext = 0x1211,
+
+ /// Multichannel 7.1, 32 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ Multi71Chn32Ext = 0x1212,
+
+ /// Multichannel 7.1, 8 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ Multi71Chn8Ext = 0x1210,
+
+ /// Multichannel 4.0, 16 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ MultiQuad16Ext = 0x1205,
+
+ /// Multichannel 4.0, 32 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ MultiQuad32Ext = 0x1206,
+
+ /// Multichannel 4.0, 8 Bits data. Requires Extension: AL_EXT_MCFORMATS
+ MultiQuad8Ext = 0x1204,
+
+ /// 1 Channel rear speaker, 16 Bits data. See Quadrophonic setups. Requires Extension: AL_EXT_MCFORMATS
+ MultiRear16Ext = 0x1208,
+
+ /// 1 Channel rear speaker, 32 Bits data. See Quadrophonic setups. Requires Extension: AL_EXT_MCFORMATS
+ MultiRear32Ext = 0x1209,
+
+ /// 1 Channel rear speaker, 8 Bits data. See Quadrophonic setups. Requires Extension: AL_EXT_MCFORMATS
+ MultiRear8Ext = 0x1207,
+ }
+
+ ///A list of valid Int32 GetBuffer parameters
+ public enum ALGetBufferi : int
+ {
+ ///Sound sample's frequency, in units of Hertz [Hz]. This is the number of samples per second. Half of the sample frequency marks the maximum significant frequency component.
+ Frequency = 0x2001,
+
+ /// Bit depth of the buffer. Should be 8 or 16.
+ Bits = 0x2002,
+
+ /// Number of channels in buffer. > 1 is valid, but buffer won’t be positioned when played. 1 for Mono, 2 for Stereo.
+ Channels = 0x2003,
+
+ /// size of the Buffer in bytes.
+ Size = 0x2004,
+
+ // Deprecated: From Manual, not in header: AL_DATA ( i, iv ) original location where buffer was copied from generally useless, as was probably freed after buffer creation
+ }
+
+ ///Buffer state. Not supported for public use (yet).
+ public enum ALBufferState : int
+ {
+ ///Buffer state. Not supported for public use (yet).
+ Unused = 0x2010,
+
+ ///Buffer state. Not supported for public use (yet).
+ Pending = 0x2011,
+
+ ///Buffer state. Not supported for public use (yet).
+ Processed = 0x2012,
+ }
+
+ /// Returned by AL.GetError
+ public enum ALError : int
+ {
+ ///No OpenAL Error.
+ NoError = 0,
+
+ ///Invalid Name paramater passed to OpenAL call.
+ InvalidName = 0xA001,
+
+ ///Invalid parameter passed to OpenAL call.
+ IllegalEnum = 0xA002,
+ ///Invalid parameter passed to OpenAL call.
+ InvalidEnum = 0xA002,
+
+ ///Invalid OpenAL enum parameter value.
+ InvalidValue = 0xA003,
+
+ ///Illegal OpenAL call.
+ IllegalCommand = 0xA004,
+ ///Illegal OpenAL call.
+ InvalidOperation = 0xA004,
+
+ ///No OpenAL memory left.
+ OutOfMemory = 0xA005,
+ }
+
+ ///A list of valid string AL.Get() parameters
+ public enum ALGetString : int
+ {
+ /// Gets the Vendor name.
+ Vendor = 0xB001,
+
+ /// Gets the driver version.
+ Version = 0xB002,
+
+ /// Gets the renderer mode.
+ Renderer = 0xB003,
+
+ /// Gets a list of all available Extensions, separated with spaces.
+ Extensions = 0xB004,
+ }
+
+ ///A list of valid 32-Bits Float AL.Get() parameters
+ public enum ALGetFloat : int
+ {
+ ///Doppler scale. Default 1.0f
+ DopplerFactor = 0xC000,
+
+ ///Tweaks speed of propagation. This functionality is deprecated.
+ DopplerVelocity = 0xC001,
+
+ ///Speed of Sound in units per second. Default: 343.3f
+ SpeedOfSound = 0xC003,
+ }
+
+ ///A list of valid Int32 AL.Get() parameters
+ public enum ALGetInteger : int
+ {
+ ///See enum ALDistanceModel.
+ DistanceModel = 0xD000,
+ }
+
+ /// Used by AL.DistanceModel(), the distance model can be retrieved by AL.Get() with ALGetInteger.DistanceModel
+ public enum ALDistanceModel : int
+ {
+ ///Bypasses all distance attenuation calculation for all Sources.
+ None = 0,
+
+ ///InverseDistance is equivalent to the IASIG I3DL2 model with the exception that ALSourcef.ReferenceDistance does not imply any clamping.
+ InverseDistance = 0xD001,
+
+ ///InverseDistanceClamped is the IASIG I3DL2 model, with ALSourcef.ReferenceDistance indicating both the reference distance and the distance below which gain will be clamped.
+ InverseDistanceClamped = 0xD002,
+
+ ///AL_EXT_LINEAR_DISTANCE extension.
+ LinearDistance = 0xD003,
+
+ ///AL_EXT_LINEAR_DISTANCE extension.
+ LinearDistanceClamped = 0xD004,
+
+ ///AL_EXT_EXPONENT_DISTANCE extension.
+ ExponentDistance = 0xD005,
+
+ ///AL_EXT_EXPONENT_DISTANCE extension.
+ ExponentDistanceClamped = 0xD006,
+ }
+
+}
diff --git a/Source/Compatibility/Audio/OpenAL/AL/EffectsExtension.cs b/Source/Compatibility/Audio/OpenAL/AL/EffectsExtension.cs
new file mode 100644
index 00000000..b48d6d5a
--- /dev/null
+++ b/Source/Compatibility/Audio/OpenAL/AL/EffectsExtension.cs
@@ -0,0 +1,1288 @@
+#region --- OpenTK.OpenAL License ---
+/* EfxFunctions.cs
+ * C headers: \OpenAL 1.1 SDK\include\ "efx.h", "efx-creative.h", "Efx-Util.h"
+ * Spec: Effects Extension Guide.pdf (bundled with OpenAL SDK)
+ * Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
+ * See license.txt for license details
+ * http://www.OpenTK.net */
+#endregion
+
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+
+namespace OpenTK.Audio
+{
+ ///
+ /// Provides access to the OpenAL effects extension.
+ ///
+ public partial class EffectsExtension
+ {
+ #region Helpers
+
+ #region BindEffect
+
+ /// (Helper) Selects the Effect type used by this Effect handle.
+ /// Effect id returned from a successful call to GenEffects.
+ /// Effect type.
+ [CLSCompliant(false)]
+ public void BindEffect(uint eid, EfxEffectType type)
+ {
+ Imported_alEffecti(eid, EfxEffecti.EffectType, (int)type);
+ }
+
+ /// (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);
+ }
+
+ #endregion BindEffect
+
+ #region BindFilterToSource
+
+ /// (Helper) reroutes the output of a Source through a Filter.
+ /// A valid Source handle.
+ /// A valid Filter handle.
+ [CLSCompliant(false)]
+ public void BindFilterToSource(uint source, uint filter)
+ {
+ AL.Source(source, ALSourcei.EfxDirectFilter, (int)filter);
+ }
+
+ /// (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);
+ }
+
+ #endregion BindFilterToSource
+
+ #region BindEffectToAuxiliarySlot
+
+ /// (Helper) Attaches an Effect to an Auxiliary Effect Slot.
+ /// The slot handle to attach the Effect to.
+ /// The Effect handle that is being attached.
+ [CLSCompliant(false)]
+ public void BindEffectToAuxiliarySlot(uint auxiliaryeffectslot, uint effect)
+ {
+ AuxiliaryEffectSlot(auxiliaryeffectslot, EfxAuxiliaryi.EffectslotEffect, (int)effect);
+ }
+
+ /// (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);
+ }
+
+ #endregion BindEffectToAuxiliarySlot
+
+ #region BindSourceToAuxiliarySlot
+
+ /// (Helper) Reroutes a Source's output into an Auxiliary Effect Slot.
+ /// The Source handle who's output is forwarded.
+ /// 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.
+ [CLSCompliant(false)]
+ public void BindSourceToAuxiliarySlot(uint source, uint slot, int slotnumber, uint filter)
+ {
+ AL.Source(source, ALSource3i.EfxAuxiliarySendFilter, (int)slot, (int)slotnumber, (int)filter);
+ }
+
+ /// (Helper) Reroutes a Source's output into an Auxiliary Effect Slot.
+ /// The Source handle who's output is forwarded.
+ /// 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);
+ }
+
+ #endregion BindSourceToAuxiliarySlot
+
+ #endregion Helpers
+
+ #region Effect Object
+
+ #region alGenEffects
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alGenEffects(int n, [Out] uint* effects);
+ // typedef void (__cdecl *LPALGENEFFECTS)( ALsizei n, ALuint* effects );
+
+ //[CLSCompliant(false)]
+ private Delegate_alGenEffects Imported_alGenEffects;
+
+ /// The GenEffects function is used to create one or more Effect objects. An Effect object stores an effect type and a set of parameter values to control that Effect. In order to use an Effect it must be attached to an Auxiliary Effect Slot object
+ /// After creation an Effect has no type (EfxEffectType.Null), so before it can be used to store a set of parameters, the application must specify what type of effect should be stored in the object, using Effect() with EfxEffecti.
+ /// Number of Effects to be created.
+ /// Pointer addressing sufficient memory to store n Effect object identifiers.
+ [CLSCompliant(false)]
+ public void GenEffects(int n, out uint effects)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &effects)
+ {
+ Imported_alGenEffects(n, ptr);
+ effects = *ptr;
+ }
+ }
+ }
+
+ /// The GenEffects function is used to create one or more Effect objects. An Effect object stores an effect type and a set of parameter values to control that Effect. In order to use an Effect it must be attached to an Auxiliary Effect Slot object
+ /// After creation an Effect has no type (EfxEffectType.Null), so before it can be used to store a set of parameters, the application must specify what type of effect should be stored in the object, using Effect() with EfxEffecti.
+ /// Number of Effects to be created.
+ /// Pointer addressing sufficient memory to store n Effect object identifiers.
+ public void GenEffects(int n, out int effects)
+ {
+ unsafe
+ {
+ fixed (int* ptr = &effects)
+ {
+ Imported_alGenEffects(n, (uint*)ptr);
+ effects = *ptr;
+ }
+ }
+ }
+
+ /// Generates one or more effect objects.
+ /// Number of Effect object identifiers to generate.
+ ///
+ /// The GenEffects function is used to create one or more Effect objects. An Effect object stores an effect type and a set of parameter values to control that Effect. In order to use an Effect it must be attached to an Auxiliary Effect Slot object.
+ /// After creation an Effect has no type (EfxEffectType.Null), so before it can be used to store a set of parameters, the application must specify what type of effect should be stored in the object, using Effect() with EfxEffecti.
+ ///
+ public int[] GenEffects(int n)
+ {
+ if (n <= 0) throw new ArgumentOutOfRangeException("n", "Must be higher than 0.");
+ int[] effects = new int[n];
+ GenEffects(n, out effects[0]);
+ return effects;
+ }
+
+ /// Generates a single effect object.
+ /// A handle to the generated effect object.
+ ///
+ /// The GenEffects function is used to create one or more Effect objects. An Effect object stores an effect type and a set of parameter values to control that Effect. In order to use an Effect it must be attached to an Auxiliary Effect Slot object.
+ /// After creation an Effect has no type (EfxEffectType.Null), so before it can be used to store a set of parameters, the application must specify what type of effect should be stored in the object, using Effect() with EfxEffecti.
+ ///
+ public int GenEffect()
+ {
+ int temp;
+ GenEffects(1, out temp);
+ return temp;
+ }
+
+ /// Generates a single effect object.
+ /// A handle to the generated effect object.
+ [CLSCompliant(false)]
+ public void GenEffect(out uint effect)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &effect)
+ {
+ Imported_alGenEffects(1, ptr);
+ effect = *ptr;
+ }
+ }
+
+ }
+
+ #endregion alGenEffects
+
+ #region alDeleteEffects
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alDeleteEffects(int n, [In] uint* effects);
+ // typedef void (__cdecl *LPALDELETEEFFECTS)( ALsizei n, ALuint* effects );
+
+ //[CLSCompliant(false)]
+ private Delegate_alDeleteEffects Imported_alDeleteEffects;
+
+ /// The DeleteEffects function is used to delete and free resources for Effect objects previously created with GenEffects.
+ /// Number of Effects to be deleted.
+ /// Pointer to n Effect object identifiers.
+ [CLSCompliant(false)]
+ public void DeleteEffects(int n, ref uint effects)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &effects)
+ {
+ Imported_alDeleteEffects(n, ptr);
+ }
+ }
+ }
+
+ /// The DeleteEffects function is used to delete and free resources for Effect objects previously created with GenEffects.
+ /// Number of Effects to be deleted.
+ /// Pointer to n Effect object identifiers.
+ public void DeleteEffects(int n, ref int effects)
+ {
+ unsafe
+ {
+ fixed (int* ptr = &effects)
+ {
+ Imported_alDeleteEffects(n, (uint*)ptr);
+ }
+ }
+ }
+
+ /// The DeleteEffects function is used to delete and free resources for Effect objects previously created with GenEffects.
+ /// Pointer to n Effect object identifiers.
+ public void DeleteEffects(int[] effects)
+ {
+ if (effects == null) throw new ArgumentNullException("effects");
+ DeleteEffects(effects.Length, ref effects[0]);
+ }
+
+ /// The DeleteEffects function is used to delete and free resources for Effect objects previously created with GenEffects.
+ /// Pointer to n Effect object identifiers.
+ [CLSCompliant(false)]
+ public void DeleteEffects(uint[] effects)
+ {
+ if (effects == null) throw new ArgumentNullException("effects");
+ DeleteEffects(effects.Length, ref effects[0]);
+ }
+
+ /// This function deletes one Effect only.
+ /// Pointer to an effect name/handle identifying the Effect Object to be deleted.
+ public void DeleteEffect(int 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)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &effect)
+ {
+ Imported_alDeleteEffects(1, ptr);
+ }
+ }
+ }
+
+ #endregion alDeleteEffects
+
+ #region alIsEffect
+
+ //[CLSCompliant(false)]
+ private delegate bool Delegate_alIsEffect(uint eid);
+ // typedef ALboolean (__cdecl *LPALISEFFECT)( ALuint eid );
+
+ //[CLSCompliant(false)]
+ private Delegate_alIsEffect Imported_alIsEffect;
+
+ /// 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.
+ [CLSCompliant(false)]
+ public bool IsEffect(uint eid)
+ {
+ return Imported_alIsEffect(eid);
+ }
+
+ /// 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);
+ }
+
+ #endregion alIsEffect
+
+ #region alEffecti
+
+ //[CLSCompliant(false)]
+ private delegate void Delegate_alEffecti(uint eid, EfxEffecti param, int value);
+ // typedef void (__cdecl *LPALEFFECTI)( ALuint eid, ALenum param, ALint value);
+
+ //[CLSCompliant(false)]
+ private Delegate_alEffecti Imported_alEffecti;
+
+ /// This function is used to set integer properties on Effect objects.
+ /// Effect object identifier.
+ /// Effect property to set.
+ /// Integer value.
+ [CLSCompliant(false)]
+ public void Effect(uint eid, EfxEffecti param, int value)
+ {
+ Imported_alEffecti(eid, param, value);
+ }
+
+ /// This function is used to set integer properties on Effect objects.
+ /// Effect object identifier.
+ /// Effect property to set.
+ /// Integer value.
+
+ public void Effect(int eid, EfxEffecti param, int value)
+ {
+ Imported_alEffecti((uint)eid, param, value);
+ }
+
+ #endregion alEffecti
+
+ #region alEffectf
+
+ //[CLSCompliant(false)]
+ private delegate void Delegate_alEffectf(uint eid, EfxEffectf param, float value);
+ // typedef void (__cdecl *LPALEFFECTF)( ALuint eid, ALenum param, ALfloat value);
+
+ //[CLSCompliant(false)]
+ private Delegate_alEffectf Imported_alEffectf;
+
+ /// This function is used to set floating point properties on Effect objects.
+ /// Effect object identifier.
+ /// Effect property to set.
+ /// Floating point value.
+ [CLSCompliant(false)]
+ public void Effect(uint eid, EfxEffectf param, float value)
+ {
+ Imported_alEffectf(eid, param, value);
+ }
+
+ /// This function is used to set floating point properties on Effect objects.
+ /// 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);
+ }
+
+ #endregion alEffectf
+
+ #region alEffectfv
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alEffectfv(uint eid, EfxEffect3f param, [In] float* values);
+ // typedef void (__cdecl *LPALEFFECTFV)( ALuint eid, ALenum param, ALfloat* values );
+
+ //[CLSCompliant(false)]
+ private Delegate_alEffectfv Imported_alEffectfv;
+
+ /// This function is used to set 3 floating point properties on Effect objects.
+ /// Effect object identifier.
+ /// Effect property to set.
+ /// Pointer to Math.Vector3.
+ [CLSCompliant(false)]
+ public void Effect(uint eid, EfxEffect3f param, ref Vector3 values)
+ {
+ unsafe
+ {
+ fixed (float* ptr = &values.X)
+ {
+ Imported_alEffectfv(eid, param, ptr);
+ }
+ }
+ }
+
+ /// This function is used to set 3 floating point properties on Effect objects.
+ /// 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);
+ }
+
+ #endregion alEffectfv
+
+ #region alGetEffecti
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alGetEffecti(uint eid, EfxEffecti pname, [Out] int* value);
+ // typedef void (__cdecl *LPALGETEFFECTI)( ALuint eid, ALenum pname, ALint* value );
+
+ //[CLSCompliant(false)]
+ private Delegate_alGetEffecti Imported_alGetEffecti;
+
+ /// This function is used to retrieve integer properties from Effect objects.
+ /// Effect object identifier.
+ /// Effect property to retrieve.
+ /// Address where integer value will be stored.
+ [CLSCompliant(false)]
+ public void GetEffect(uint eid, EfxEffecti pname, out int value)
+ {
+ unsafe
+ {
+ fixed (int* ptr = &value)
+ {
+ Imported_alGetEffecti(eid, pname, ptr);
+ }
+ }
+ }
+
+ /// This function is used to retrieve integer properties from Effect objects.
+ /// 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);
+ }
+
+ #endregion alGetEffecti
+
+ #region alGetEffectf
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alGetEffectf(uint eid, EfxEffectf pname, [Out]float* value);
+ // typedef void (__cdecl *LPALGETEFFECTF)( ALuint eid, ALenum pname, ALfloat* value );
+
+ //[CLSCompliant(false)]
+ private Delegate_alGetEffectf Imported_alGetEffectf;
+
+ /// This function is used to retrieve floating point properties from Effect objects.
+ /// Effect object identifier.
+ /// Effect property to retrieve.
+ /// Address where floating point value will be stored.
+ [CLSCompliant(false)]
+ public void GetEffect(uint eid, EfxEffectf pname, out float value)
+ {
+ unsafe
+ {
+ fixed (float* ptr = &value)
+ {
+ Imported_alGetEffectf(eid, pname, ptr);
+ }
+ }
+ }
+
+ /// This function is used to retrieve floating point properties from Effect objects.
+ /// 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);
+ }
+
+ #endregion alGetEffectf
+
+ #region alGetEffectfv
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alGetEffectfv(uint eid, EfxEffect3f param, [Out] float* values);
+ // typedef void (__cdecl *LPALGETEFFECTFV)( ALuint eid, ALenum pname, ALfloat* values );
+
+ //[CLSCompliant(false)]
+ private Delegate_alGetEffectfv Imported_alGetEffectfv;
+
+ /// This function is used to retrieve 3 floating point properties from Effect objects.
+ /// Effect object identifier.
+ /// Effect property to retrieve.
+ /// A Math.Vector3 to hold the values.
+ [CLSCompliant(false)]
+ public void GetEffect(uint eid, EfxEffect3f param, out Vector3 values)
+ {
+ unsafe
+ {
+ fixed (float* ptr = &values.X)
+ {
+ Imported_alGetEffectfv(eid, param, ptr);
+ values.X = ptr[0];
+ values.Y = ptr[1];
+ values.Z = ptr[2];
+ }
+ }
+ }
+
+ /// This function is used to retrieve 3 floating point properties from Effect objects.
+ /// 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);
+ }
+
+ #endregion alGetEffectfv
+
+ // Not used:
+ // typedef void (__cdecl *LPALEFFECTIV)( ALuint eid, ALenum param, ALint* values );
+ // typedef void (__cdecl *LPALGETEFFECTIV)( ALuint eid, ALenum pname, ALint* values );
+
+ #endregion Effect Object
+
+ #region Filter Object
+
+ #region alGenFilters
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alGenFilters(int n, [Out] uint* filters);
+ // typedef void (__cdecl *LPALGENFILTERS)( ALsizei n, ALuint* filters );
+
+ //[CLSCompliant(false)]
+ private Delegate_alGenFilters Imported_alGenFilters;
+
+ /// The GenFilters function is used to create one or more Filter objects. A Filter object stores a filter type and a set of parameter values to control that Filter. Filter objects can be attached to Sources as Direct Filters or Auxiliary Send Filters.
+ /// After creation a Filter has no type (EfxFilterType.Null), so before it can be used to store a set of parameters, the application must specify what type of filter should be stored in the object, using Filter() with EfxFilteri.
+ /// Number of Filters to be created.
+ /// Pointer addressing sufficient memory to store n Filter object identifiers.
+ [CLSCompliant(false)]
+ public void GenFilters(int n, out uint filters)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &filters)
+ {
+ Imported_alGenFilters(n, ptr);
+ filters = *ptr;
+ }
+ }
+ }
+
+ /// The GenFilters function is used to create one or more Filter objects. A Filter object stores a filter type and a set of parameter values to control that Filter. Filter objects can be attached to Sources as Direct Filters or Auxiliary Send Filters.
+ /// After creation a Filter has no type (EfxFilterType.Null), so before it can be used to store a set of parameters, the application must specify what type of filter should be stored in the object, using Filter() with EfxFilteri.
+ /// Number of Filters to be created.
+ /// Pointer addressing sufficient memory to store n Filter object identifiers.
+ public void GenFilters(int n, out int filters)
+ {
+ unsafe
+ {
+ fixed (int* ptr = &filters)
+ {
+ Imported_alGenFilters(n, (uint*)ptr);
+ filters = *ptr;
+ }
+ }
+ }
+
+
+ /// The GenFilters function is used to create one or more Filter objects. A Filter object stores a filter type and a set of parameter values to control that Filter. Filter objects can be attached to Sources as Direct Filters or Auxiliary Send Filters.
+ /// After creation a Filter has no type (EfxFilterType.Null), so before it can be used to store a set of parameters, the application must specify what type of filter should be stored in the object, using Filter() with EfxFilteri.
+ /// Number of Filters to be created.
+ /// Pointer addressing sufficient memory to store n Filter object identifiers.
+ public int[] GenFilters(int n)
+ {
+
+ if (n <= 0) throw new ArgumentOutOfRangeException("n", "Must be higher than 0.");
+ int[] filters = new int[n];
+ GenFilters(filters.Length, out filters[0]);
+ return filters;
+ }
+
+ /// This function generates only one Filter.
+ /// Storage Int32 for the new filter name/handle.
+ public int GenFilter()
+ {
+ int filter;
+ GenFilters(1, out filter);
+ return filter;
+ }
+
+ /// This function generates only one Filter.
+ /// Storage UInt32 for the new filter name/handle.
+ [CLSCompliant(false)]
+ unsafe public void GenFilter(out uint filter)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &filter)
+ {
+ Imported_alGenFilters(1, ptr);
+ filter = *ptr;
+ }
+ }
+ }
+
+ #endregion alGenFilters
+
+ #region alDeleteFilters
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alDeleteFilters(int n, [In] uint* filters);
+ // typedef void (__cdecl *LPALDELETEFILTERS)( ALsizei n, ALuint* filters );
+
+ //[CLSCompliant(false)]
+ private Delegate_alDeleteFilters Imported_alDeleteFilters;
+
+ /// The DeleteFilters function is used to delete and free resources for Filter objects previously created with GenFilters.
+ /// Number of Filters to be deleted.
+ /// Pointer to n Filter object identifiers.
+ [CLSCompliant(false)]
+ public void DeleteFilters(int n, ref uint filters)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &filters)
+ {
+ Imported_alDeleteFilters(n, ptr);
+ }
+ }
+ }
+
+ /// The DeleteFilters function is used to delete and free resources for Filter objects previously created with GenFilters.
+ /// Number of Filters to be deleted.
+ /// Pointer to n Filter object identifiers.
+ public void DeleteFilters(int n, ref int filters)
+ {
+ unsafe
+ {
+ fixed (int* ptr = &filters)
+ {
+ Imported_alDeleteFilters(n, (uint*)ptr);
+ }
+ }
+ }
+
+ /// This function deletes one Filter only.
+ /// Pointer to an filter name/handle identifying the Filter Object to be deleted.
+ [CLSCompliant(false)]
+ public void DeleteFilters(uint[] filters)
+ {
+ if (filters == null) throw new ArgumentNullException("filters");
+ DeleteFilters(filters.Length, ref filters[0]);
+ }
+
+ /// This function deletes one Filter only.
+ /// Pointer to an filter name/handle identifying the Filter Object to be deleted.
+ public void DeleteFilters(int[] filters)
+ {
+ if (filters == null) throw new ArgumentNullException("filters");
+ DeleteFilters(filters.Length, ref filters[0]);
+ }
+
+ /// This function deletes one Filter only.
+ /// Pointer to an filter name/handle identifying the Filter Object to be deleted.
+ public void DeleteFilter(int filter)
+ {
+ DeleteFilters(1, ref filter);
+ }
+
+ /// 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)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &filter)
+ {
+ Imported_alDeleteFilters(1, ptr);
+ }
+ }
+ }
+
+ #endregion alDeleteFilters
+
+ #region alIsFilter
+
+ //[CLSCompliant(false)]
+ private delegate bool Delegate_alIsFilter(uint fid);
+ // typedef ALboolean (__cdecl *LPALISFILTER)( ALuint fid );
+
+ //[CLSCompliant(false)]
+ private Delegate_alIsFilter Imported_alIsFilter;
+
+ /// 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.
+ [CLSCompliant(false)]
+ public bool IsFilter(uint fid)
+ {
+ return Imported_alIsFilter(fid);
+ }
+
+ /// 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);
+ }
+
+ #endregion alIsFilter
+
+ #region alFilteri
+
+ //[CLSCompliant(false)]
+ private delegate void Delegate_alFilteri(uint fid, EfxFilteri param, int value);
+ // typedef void (__cdecl *LPALFILTERI)( ALuint fid, ALenum param, ALint value );
+
+ //[CLSCompliant(false)]
+ private Delegate_alFilteri Imported_alFilteri;
+
+ /// This function is used to set integer properties on Filter objects.
+ /// Filter object identifier.
+ /// Effect property to set.
+ /// Integer value.
+ [CLSCompliant(false)]
+ public void Filter(uint fid, EfxFilteri param, int value)
+ {
+ Imported_alFilteri(fid, param, value);
+ }
+
+ /// This function is used to set integer properties on Filter objects.
+ /// Filter object identifier.
+ /// Effect property to set.
+ /// Integer value.
+
+ public void Filter(int fid, EfxFilteri param, int value)
+ {
+ Imported_alFilteri((uint)fid, param, value);
+ }
+
+ #endregion alFilteri
+
+ #region alFilterf
+
+ //[CLSCompliant(false)]
+ private delegate void Delegate_alFilterf(uint fid, EfxFilterf param, float value);
+ // typedef void (__cdecl *LPALFILTERF)( ALuint fid, ALenum param, ALfloat value);
+
+ //[CLSCompliant(false)]
+ private Delegate_alFilterf Imported_alFilterf;
+
+ /// This function is used to set floating point properties on Filter objects.
+ /// Filter object identifier.
+ /// Effect property to set.
+ /// Floating point value.
+ [CLSCompliant(false)]
+ public void Filter(uint fid, EfxFilterf param, float value)
+ {
+ Imported_alFilterf(fid, param, value);
+ }
+
+ /// This function is used to set floating point properties on Filter objects.
+ /// 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);
+ }
+
+ #endregion alFilterf
+
+ #region alGetFilteri
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alGetFilteri(uint fid, EfxFilteri pname, [Out] int* value);
+ // typedef void (__cdecl *LPALGETFILTERI)( ALuint fid, ALenum pname, ALint* value );
+
+ //[CLSCompliant(false)]
+ private Delegate_alGetFilteri Imported_alGetFilteri;
+
+ /// This function is used to retrieve integer properties from Filter objects.
+ /// Filter object identifier.
+ /// Effect property to retrieve.
+ /// Address where integer value will be stored.
+ [CLSCompliant(false)]
+ public void GetFilter(uint fid, EfxFilteri pname, out int value)
+ {
+ unsafe
+ {
+ fixed (int* ptr = &value)
+ {
+ Imported_alGetFilteri(fid, pname, ptr);
+ }
+ }
+ }
+
+ /// This function is used to retrieve integer properties from Filter objects.
+ /// 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);
+ }
+
+ #endregion alGetFilteri
+
+ #region alGetFilterf
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alGetFilterf(uint fid, EfxFilterf pname, [Out] float* value);
+ // typedef void (__cdecl *LPALGETFILTERF)( ALuint fid, ALenum pname, ALfloat* value );
+
+ //[CLSCompliant(false)]
+ private Delegate_alGetFilterf Imported_alGetFilterf;
+
+ /// This function is used to retrieve floating point properties from Filter objects.
+ /// Filter object identifier.
+ /// Effect property to retrieve.
+ /// Address where floating point value will be stored.
+ [CLSCompliant(false)]
+ public void GetFilter(uint fid, EfxFilterf pname, out float value)
+ {
+ unsafe
+ {
+ fixed (float* ptr = &value)
+ {
+ Imported_alGetFilterf(fid, pname, ptr);
+ }
+ }
+ }
+
+ /// This function is used to retrieve floating point properties from Filter objects.
+ /// 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);
+ }
+
+ #endregion alGetFilterf
+
+ // Not used:
+ // typedef void (__cdecl *LPALFILTERIV)( ALuint fid, ALenum param, ALint* values );
+ // typedef void (__cdecl *LPALFILTERFV)( ALuint fid, ALenum param, ALfloat* values );
+ // typedef void (__cdecl *LPALGETFILTERIV)( ALuint fid, ALenum pname, ALint* values );
+ // typedef void (__cdecl *LPALGETFILTERFV)( ALuint fid, ALenum pname, ALfloat* values );
+
+ #endregion Filter Object
+
+ #region Auxiliary Effect Slot Object
+
+ #region alGenAuxiliaryEffectSlots
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alGenAuxiliaryEffectSlots(int n, [Out] uint* slots);
+ // typedef void (__cdecl *LPALGENAUXILIARYEFFECTSLOTS)( ALsizei n, ALuint* slots );
+
+ //[CLSCompliant(false)]
+ private Delegate_alGenAuxiliaryEffectSlots Imported_alGenAuxiliaryEffectSlots;
+
+ /// The GenAuxiliaryEffectSlots function is used to create one or more Auxiliary Effect Slots. The number of slots that can be created will be dependant upon the Open AL device used.
+ /// An application should check the OpenAL error state after making this call to determine if the Effect Slot was successfully created. If the function call fails then none of the requested Effect Slots are created. A good strategy for creating any OpenAL object is to use a for-loop and generate one object each loop iteration and then check for an error condition. If an error is set then the loop can be broken and the application can determine if sufficient resources are available.
+ /// Number of Auxiliary Effect Slots to be created.
+ /// Pointer addressing sufficient memory to store n Effect Slot object identifiers.
+ [CLSCompliant(false)]
+ public void GenAuxiliaryEffectSlots(int n, out uint slots)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &slots)
+ {
+ Imported_alGenAuxiliaryEffectSlots(n, ptr);
+ slots = *ptr;
+ }
+ }
+ }
+
+ /// The GenAuxiliaryEffectSlots function is used to create one or more Auxiliary Effect Slots. The number of slots that can be created will be dependant upon the Open AL device used.
+ /// An application should check the OpenAL error state after making this call to determine if the Effect Slot was successfully created. If the function call fails then none of the requested Effect Slots are created. A good strategy for creating any OpenAL object is to use a for-loop and generate one object each loop iteration and then check for an error condition. If an error is set then the loop can be broken and the application can determine if sufficient resources are available.
+ /// Number of Auxiliary Effect Slots to be created.
+ /// Pointer addressing sufficient memory to store n Effect Slot object identifiers.
+ public void GenAuxiliaryEffectSlots(int n, out int slots)
+ {
+ unsafe
+ {
+ fixed (int* ptr = &slots)
+ {
+ Imported_alGenAuxiliaryEffectSlots(n, (uint*)ptr);
+ slots = *ptr;
+ }
+ }
+ }
+
+ /// The GenAuxiliaryEffectSlots function is used to create one or more Auxiliary Effect Slots. The number of slots that can be created will be dependant upon the Open AL device used.
+ /// An application should check the OpenAL error state after making this call to determine if the Effect Slot was successfully created. If the function call fails then none of the requested Effect Slots are created. A good strategy for creating any OpenAL object is to use a for-loop and generate one object each loop iteration and then check for an error condition. If an error is set then the loop can be broken and the application can determine if sufficient resources are available.
+ /// Number of Auxiliary Effect Slots to be created.
+ /// Pointer addressing sufficient memory to store n Effect Slot object identifiers.
+ public int[] GenAuxiliaryEffectSlots(int n)
+ {
+ if (n <= 0) throw new ArgumentOutOfRangeException("n", "Must be higher than 0.");
+ int[] slots = new int[n];
+ GenAuxiliaryEffectSlots(slots.Length, out slots[0]);
+ return slots;
+ }
+
+ /// This function generates only one Auxiliary Effect Slot.
+ /// Storage Int32 for the new auxiliary effect slot name/handle.
+ public int GenAuxiliaryEffectSlot()
+ {
+ int temp;
+ GenAuxiliaryEffectSlots(1, out temp);
+ return temp;
+ }
+
+ /// 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)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &slot)
+ {
+ Imported_alGenAuxiliaryEffectSlots(1, ptr);
+ slot = *ptr;
+ }
+ }
+ }
+
+ #endregion alGenAuxiliaryEffectSlots
+
+ #region DeleteAuxiliaryEffectSlots
+
+ unsafe private delegate void Delegate_alDeleteAuxiliaryEffectSlots(int n, [In] uint* slots);
+ // typedef void (__cdecl *LPALDELETEAUXILIARYEFFECTSLOTS)( ALsizei n, ALuint* slots );
+
+ private Delegate_alDeleteAuxiliaryEffectSlots Imported_alDeleteAuxiliaryEffectSlots;
+
+ /// The DeleteAuxiliaryEffectSlots function is used to delete and free resources for Auxiliary Effect Slots previously created with GenAuxiliaryEffectSlots.
+ /// Number of Auxiliary Effect Slots to be deleted.
+ /// Pointer to n Effect Slot object identifiers.
+ [CLSCompliant(false)]
+ public void DeleteAuxiliaryEffectSlots(int n, ref uint slots)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &slots)
+ {
+ Imported_alDeleteAuxiliaryEffectSlots(n, ptr);
+ }
+ }
+ }
+
+ /// The DeleteAuxiliaryEffectSlots function is used to delete and free resources for Auxiliary Effect Slots previously created with GenAuxiliaryEffectSlots.
+ /// Number of Auxiliary Effect Slots to be deleted.
+ /// Pointer to n Effect Slot object identifiers.
+ public void DeleteAuxiliaryEffectSlots(int n, ref int slots)
+ {
+ unsafe
+ {
+ fixed (int* ptr = &slots)
+ {
+ Imported_alDeleteAuxiliaryEffectSlots(n, (uint*)ptr);
+ }
+ }
+ }
+
+ /// The DeleteAuxiliaryEffectSlots function is used to delete and free resources for Auxiliary Effect Slots previously created with GenAuxiliaryEffectSlots.
+ /// Pointer to n Effect Slot object identifiers.
+ public void DeleteAuxiliaryEffectSlots(int[] slots)
+ {
+ if (slots == null) throw new ArgumentNullException("slots");
+ DeleteAuxiliaryEffectSlots(slots.Length, ref slots[0]);
+ }
+
+ /// 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 DeleteAuxiliaryEffectSlots(uint[] slots)
+ {
+ if (slots == null) throw new ArgumentNullException("slots");
+ DeleteAuxiliaryEffectSlots(slots.Length, ref slots[0]);
+ }
+
+ /// This function deletes one AuxiliaryEffectSlot only.
+ /// Pointer to an auxiliary effect slot name/handle identifying the Auxiliary Effect Slot Object to be deleted.
+ public void DeleteAuxiliaryEffectSlot(int slot)
+ {
+ DeleteAuxiliaryEffectSlots(1, ref slot);
+ }
+
+ /// 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)
+ {
+ unsafe
+ {
+ fixed (uint* ptr = &slot)
+ {
+ Imported_alDeleteAuxiliaryEffectSlots(1, ptr);
+ }
+ }
+ }
+
+ #endregion alDeleteAuxiliaryEffectSlots
+
+ #region alIsAuxiliaryEffectSlot
+
+ //[CLSCompliant(false)]
+ private delegate bool Delegate_alIsAuxiliaryEffectSlot(uint slot);
+ // typedef ALboolean (__cdecl *LPALISAUXILIARYEFFECTSLOT)( ALuint slot );
+
+ //[CLSCompliant(false)]
+ private Delegate_alIsAuxiliaryEffectSlot Imported_alIsAuxiliaryEffectSlot;
+
+ /// 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.
+ [CLSCompliant(false)]
+ public bool IsAuxiliaryEffectSlot(uint slot)
+ {
+ return Imported_alIsAuxiliaryEffectSlot(slot);
+ }
+
+ /// 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);
+ }
+
+ #endregion alIsAuxiliaryEffectSlot
+
+ #region alAuxiliaryEffectSloti
+
+ //[CLSCompliant(false)]
+ private delegate void Delegate_alAuxiliaryEffectSloti(uint asid, EfxAuxiliaryi param, int value);
+ // typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTI)( ALuint asid, ALenum param, ALint value );
+
+ //[CLSCompliant(false)]
+ private Delegate_alAuxiliaryEffectSloti Imported_alAuxiliaryEffectSloti;
+
+ /// This function is used to set integer properties on Auxiliary Effect Slot objects.
+ /// Auxiliary Effect Slot object identifier.
+ /// Auxiliary Effect Slot property to set.
+ /// Integer value.
+ [CLSCompliant(false)]
+ public void AuxiliaryEffectSlot(uint asid, EfxAuxiliaryi param, int value)
+ {
+ Imported_alAuxiliaryEffectSloti(asid, param, value);
+ }
+
+ /// This function is used to set integer properties on Auxiliary Effect Slot objects.
+ /// 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);
+ }
+
+ #endregion alAuxiliaryEffectSloti
+
+ #region alAuxiliaryEffectSlotf
+
+ //[CLSCompliant(false)]
+ private delegate void Delegate_alAuxiliaryEffectSlotf(uint asid, EfxAuxiliaryf param, float value);
+ // typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTF)( ALuint asid, ALenum param, ALfloat value );
+
+ //[CLSCompliant(false)]
+ private Delegate_alAuxiliaryEffectSlotf Imported_alAuxiliaryEffectSlotf;
+
+ /// This function is used to set floating point properties on Auxiliary Effect Slot objects.
+ /// Auxiliary Effect Slot object identifier.
+ /// Auxiliary Effect Slot property to set.
+ /// Floating point value.
+ [CLSCompliant(false)]
+ public void AuxiliaryEffectSlot(uint asid, EfxAuxiliaryf param, float value)
+ {
+ Imported_alAuxiliaryEffectSlotf(asid, param, value);
+ }
+
+ /// This function is used to set floating point properties on Auxiliary Effect Slot objects.
+ /// 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);
+ }
+
+ #endregion alAuxiliaryEffectSlotf
+
+ #region alGetAuxiliaryEffectSloti
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alGetAuxiliaryEffectSloti(uint asid, EfxAuxiliaryi pname, [Out] int* value);
+ // typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTI)( ALuint asid, ALenum pname, ALint* value );
+
+ //[CLSCompliant(false)]
+ private Delegate_alGetAuxiliaryEffectSloti Imported_alGetAuxiliaryEffectSloti;
+
+ /// This function is used to retrieve integer properties on Auxiliary Effect Slot objects.
+ /// Auxiliary Effect Slot object identifier.
+ /// Auxiliary Effect Slot property to retrieve.
+ /// Address where integer value will be stored.
+ [CLSCompliant(false)]
+ public void GetAuxiliaryEffectSlot(uint asid, EfxAuxiliaryi pname, out int value)
+ {
+ unsafe
+ {
+ fixed (int* ptr = &value)
+ {
+ Imported_alGetAuxiliaryEffectSloti(asid, pname, ptr);
+ }
+ }
+ }
+
+ /// This function is used to retrieve integer properties on Auxiliary Effect Slot objects.
+ /// 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);
+ }
+
+ #endregion alGetAuxiliaryEffectSloti
+
+ #region alGetAuxiliaryEffectSlotf
+
+ //[CLSCompliant(false)]
+ unsafe private delegate void Delegate_alGetAuxiliaryEffectSlotf(uint asid, EfxAuxiliaryf pname, [Out] float* value);
+ // typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTF)( ALuint asid, ALenum pname, ALfloat* value );
+
+ //[CLSCompliant(false)]
+ private Delegate_alGetAuxiliaryEffectSlotf Imported_alGetAuxiliaryEffectSlotf;
+
+ /// This function is used to retrieve floating properties on Auxiliary Effect Slot objects.
+ /// Auxiliary Effect Slot object identifier.
+ /// Auxiliary Effect Slot property to retrieve.
+ /// Address where floating point value will be stored.
+ [CLSCompliant(false)]
+ public void GetAuxiliaryEffectSlot(uint asid, EfxAuxiliaryf pname, out float value)
+ {
+ unsafe
+ {
+ fixed (float* ptr = &value)
+ {
+ Imported_alGetAuxiliaryEffectSlotf(asid, pname, ptr);
+ }
+ }
+ }
+
+ /// This function is used to retrieve floating properties on Auxiliary Effect Slot objects.
+ /// 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);
+ }
+
+ #endregion alGetAuxiliaryEffectSlotf
+
+ // Not used:
+ // typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTIV)( ALuint asid, ALenum param, ALint* values );
+ // typedef void (__cdecl *LPALAUXILIARYEFFECTSLOTFV)( ALuint asid, ALenum param, ALfloat* values );
+ // typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTIV)( ALuint asid, ALenum pname, ALint* values );
+ // typedef void (__cdecl *LPALGETAUXILIARYEFFECTSLOTFV)( ALuint asid, ALenum pname, ALfloat* values );
+
+ #endregion Auxiliary Effect Slot Object
+
+ #region Constructor / Extension Loading
+
+ private bool _valid;
+
+ /// Returns True if the EFX Extension has been found and could be initialized.
+ public bool IsInitialized
+ {
+ get
+ {
+ return _valid;
+ }
+ }
+
+ ///
+ /// Constructs a new EffectsExtension instance.
+ ///
+ public EffectsExtension()
+ {
+ _valid = false;
+
+ if (AudioContext.CurrentContext == null)
+ throw new InvalidOperationException("AL.LoadAll() needs a current AudioContext.");
+
+ if (!AudioContext.CurrentContext.SupportsExtension("ALC_EXT_EFX"))
+ {
+ Debug.WriteLine("EFX Extension (ALC_EXT_EFX) is not supported(AudioContext: {0}).", AudioContext.CurrentContext.ToString());
+ return;
+ }
+ // Console.WriteLine("ALC_EXT_EFX found. Efx can be used.");
+
+ try
+ {
+ Imported_alGenEffects = (Delegate_alGenEffects)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGenEffects"), typeof(Delegate_alGenEffects));
+ Imported_alDeleteEffects = (Delegate_alDeleteEffects)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alDeleteEffects"), typeof(Delegate_alDeleteEffects));
+ Imported_alIsEffect = (Delegate_alIsEffect)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alIsEffect"), typeof(Delegate_alIsEffect));
+ Imported_alEffecti = (Delegate_alEffecti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alEffecti"), typeof(Delegate_alEffecti));
+ Imported_alEffectf = (Delegate_alEffectf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alEffectf"), typeof(Delegate_alEffectf));
+ Imported_alEffectfv = (Delegate_alEffectfv)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alEffectfv"), typeof(Delegate_alEffectfv));
+ Imported_alGetEffecti = (Delegate_alGetEffecti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffecti"), typeof(Delegate_alGetEffecti));
+ Imported_alGetEffectf = (Delegate_alGetEffectf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffectf"), typeof(Delegate_alGetEffectf));
+ Imported_alGetEffectfv = (Delegate_alGetEffectfv)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetEffectfv"), typeof(Delegate_alGetEffectfv));
+ }
+ catch (Exception e)
+ {
+ Debug.WriteLine("Failed to marshal Effect functions. " + e.ToString());
+ return;
+ }
+ // Console.WriteLine("Effect functions appear to be ok.");
+
+ try
+ {
+ Imported_alGenFilters = (Delegate_alGenFilters)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGenFilters"), typeof(Delegate_alGenFilters));
+ Imported_alDeleteFilters = (Delegate_alDeleteFilters)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alDeleteFilters"), typeof(Delegate_alDeleteFilters));
+ Imported_alIsFilter = (Delegate_alIsFilter)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alIsFilter"), typeof(Delegate_alIsFilter));
+ Imported_alFilteri = (Delegate_alFilteri)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alFilteri"), typeof(Delegate_alFilteri));
+ Imported_alFilterf = (Delegate_alFilterf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alFilterf"), typeof(Delegate_alFilterf));
+ Imported_alGetFilteri = (Delegate_alGetFilteri)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetFilteri"), typeof(Delegate_alGetFilteri));
+ Imported_alGetFilterf = (Delegate_alGetFilterf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetFilterf"), typeof(Delegate_alGetFilterf));
+ }
+ catch (Exception e)
+ {
+ Debug.WriteLine("Failed to marshal Filter functions. " + e.ToString());
+ return;
+ }
+ // Console.WriteLine("Filter functions appear to be ok.");
+
+ try
+ {
+ Imported_alGenAuxiliaryEffectSlots = (Delegate_alGenAuxiliaryEffectSlots)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGenAuxiliaryEffectSlots"), typeof(Delegate_alGenAuxiliaryEffectSlots));
+ Imported_alDeleteAuxiliaryEffectSlots = (Delegate_alDeleteAuxiliaryEffectSlots)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alDeleteAuxiliaryEffectSlots"), typeof(Delegate_alDeleteAuxiliaryEffectSlots));
+ Imported_alIsAuxiliaryEffectSlot = (Delegate_alIsAuxiliaryEffectSlot)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alIsAuxiliaryEffectSlot"), typeof(Delegate_alIsAuxiliaryEffectSlot));
+ Imported_alAuxiliaryEffectSloti = (Delegate_alAuxiliaryEffectSloti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alAuxiliaryEffectSloti"), typeof(Delegate_alAuxiliaryEffectSloti));
+ Imported_alAuxiliaryEffectSlotf = (Delegate_alAuxiliaryEffectSlotf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alAuxiliaryEffectSlotf"), typeof(Delegate_alAuxiliaryEffectSlotf));
+ Imported_alGetAuxiliaryEffectSloti = (Delegate_alGetAuxiliaryEffectSloti)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetAuxiliaryEffectSloti"), typeof(Delegate_alGetAuxiliaryEffectSloti));
+ Imported_alGetAuxiliaryEffectSlotf = (Delegate_alGetAuxiliaryEffectSlotf)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("alGetAuxiliaryEffectSlotf"), typeof(Delegate_alGetAuxiliaryEffectSlotf));
+ }
+ catch (Exception e)
+ {
+ Debug.WriteLine("Failed to marshal AuxiliaryEffectSlot functions. " + e.ToString());
+ return;
+ }
+ // Console.WriteLine("Auxiliary Effect Slot functions appear to be ok.");
+
+ // didn't return so far, everything went fine.
+ _valid = true;
+ }
+
+ #endregion Constructor / Extension Loading
+ }
+}
\ No newline at end of file
diff --git a/Source/Compatibility/Audio/OpenAL/AL/EffectsExtensionEnums.cs b/Source/Compatibility/Audio/OpenAL/AL/EffectsExtensionEnums.cs
new file mode 100644
index 00000000..1e860d70
--- /dev/null
+++ b/Source/Compatibility/Audio/OpenAL/AL/EffectsExtensionEnums.cs
@@ -0,0 +1,361 @@
+#region --- OpenTK.OpenAL License ---
+/* EfxTokens.cs
+ * C headers: \OpenAL 1.1 SDK\include\ "efx.h", "efx-creative.h", "Efx-Util.h"
+ * Spec: Effects Extension Guide.pdf (bundled with OpenAL SDK)
+ * Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
+ * See license.txt for license details
+ * http://www.OpenTK.net */
+#endregion
+
+using System;
+
+namespace OpenTK.Audio
+{
+ #region Effect
+
+ ///A list of valid 32-Bits Float Effect/GetEffect parameters
+ public enum EfxEffectf : int
+ {
+ ///Reverb Modal Density controls the coloration of the late reverb. Lowering the value adds more coloration to the late reverb. Range [0.0f .. 1.0f] Default: 1.0f
+ ReverbDensity = 0x0001,
+ ///The Reverb Diffusion property controls the echo density in the reverberation decay. The default 1.0f provides the highest density. Reducing diffusion gives the reverberation a more "grainy" character that is especially noticeable with percussive sound sources. If you set a diffusion value of 0.0f, the later reverberation sounds like a succession of distinct echoes. Range [0.0f .. 1.0f] Default: 1.0f
+ ReverbDiffusion = 0x0002,
+ ///The Reverb Gain property is the master volume control for the reflected sound - both early reflections and reverberation - that the reverb effect adds to all sound sources. Ranges from 1.0 (0db) (the maximum amount) to 0.0 (-100db) (no reflected sound at all) are accepted. Units: Linear gain Range [0.0f .. 1.0f] Default: 0.32f
+ ReverbGain = 0x0003,
+ ///The Reverb Gain HF property further tweaks reflected sound by attenuating it at high frequencies. It controls a low-pass filter that applies globally to the reflected sound of all sound sources feeding the particular instance of the reverb effect. Ranges from 1.0f (0db) (no filter) to 0.0f (-100db) (virtually no reflected sound) are accepted. Units: Linear gain Range [0.0f .. 1.0f] Default: 0.89f
+ ReverbGainHF = 0x0004,
+ ///The Decay Time property sets the reverberation decay time. It ranges from 0.1f (typically a small room with very dead surfaces) to 20.0 (typically a large room with very live surfaces). Unit: Seconds Range [0.1f .. 20.0f] Default: 1.49f
+ ReverbDecayTime = 0x0005,
+ ///The Decay HF Ratio property sets the spectral quality of the Decay Time parameter. It is the ratio of high-frequency decay time relative to the time set by Decay Time.. Unit: linear multiplier Range [0.1f .. 2.0f] Default: 0.83f
+ ReverbDecayHFRatio = 0x0006,
+ ///The Reflections Gain property controls the overall amount of initial reflections relative to the Gain property. The value of Reflections Gain ranges from a maximum of 3.16f (+10 dB) to a minimum of 0.0f (-100 dB) (no initial reflections at all), and is corrected by the value of the Gain property. Unit: Linear gain Range [0.0f .. 3.16f] Default: 0.05f
+ ReverbReflectionsGain = 0x0007,
+ ///The Reflections Delay property is the amount of delay between the arrival time of the direct path from the source to the first reflection from the source. It ranges from 0 to 300 milliseconds. Unit: Seconds Range [0.0f .. 0.3f] Default: 0.007f
+ ReverbReflectionsDelay = 0x0008,
+ ///The Late Reverb Gain property controls the overall amount of later reverberation relative to the Gain property. The value of Late Reverb Gain ranges from a maximum of 10.0f (+20 dB) to a minimum of 0.0f (-100 dB) (no late reverberation at all). Unit: Linear gain Range [0.0f .. 10.0f] Default: 1.26f
+ ReverbLateReverbGain = 0x0009,
+ ///The Late Reverb Delay property defines the begin time of the late reverberation relative to the time of the initial reflection (the first of the early reflections). It ranges from 0 to 100 milliseconds. Unit: Seconds Range [0.0f .. 0.1f] Default: 0.011f
+ ReverbLateReverbDelay = 0x000A,
+ ///The Air Absorption Gain HF property controls the distance-dependent attenuation at high frequencies caused by the propagation medium and applies to reflected sound only. Unit: Linear gain per meter Range [0.892f .. 1.0f] Default: 0.994f
+ ReverbAirAbsorptionGainHF = 0x000B,
+ ///The Room Rolloff Factor property is one of two methods available to attenuate the reflected sound (containing both reflections and reverberation) according to source-listener distance. It's defined the same way as OpenAL's Rolloff Factor, but operates on reverb sound instead of direct-path sound. Unit: Linear multiplier Range [0.0f .. 10.0f] Default: 0.0f
+ ReverbRoomRolloffFactor = 0x000C,
+
+ ///This property sets the modulation rate of the low-frequency oscillator that controls the delay time of the delayed signals. Unit: Hz Range [0.0f .. 10.0f] Default: 1.1f
+ ChorusRate = 0x0003,
+ ///This property controls the amount by which the delay time is modulated by the low-frequency oscillator. Range [0.0f .. 1.0f] Default: 0.1f
+ ChorusDepth = 0x0004,
+ ///This property controls the amount of processed signal that is fed back to the input of the chorus effect. Negative values will reverse the phase of the feedback signal. At full magnitude the identical sample will repeat endlessly. Range [-1.0f .. +1.0f] Default: +0.25f
+ ChorusFeedback = 0x0005,
+ ///This property controls the average amount of time the sample is delayed before it is played back, and with feedback, the amount of time between iterations of the sample. Larger values lower the pitch. Unit: Seconds Range [0.0f .. 0.016f] Default: 0.016f
+ ChorusDelay = 0x0006,
+
+ ///This property controls the shape of the distortion. The higher the value for Edge, the "dirtier" and "fuzzier" the effect. Range [0.0f .. 1.0f] Default: 0.2f
+ DistortionEdge = 0x0001,
+ ///This property allows you to attenuate the distorted sound. Range [0.01f .. 1.0f] Default: 0.05f
+ DistortionGain = 0x0002,
+ ///Input signals can have a low pass filter applied, to limit the amount of high frequency signal feeding into the distortion effect. Unit: Hz Range [80.0f .. 24000.0f] Default: 8000.0f
+ DistortionLowpassCutoff = 0x0003,
+ ///This property controls the frequency at which the post-distortion attenuation (Distortion Gain) is active. Unit: Hz Range [80.0f .. 24000.0f] Default: 3600.0f
+ DistortionEQCenter = 0x0004,
+ ///This property controls the bandwidth of the post-distortion attenuation. Unit: Hz Range [80.0f .. 24000.0f] Default: 3600.0f
+ DistortionEQBandwidth = 0x0005,
+
+ ///This property controls the delay between the original sound and the first "tap", or echo instance. Subsequently, the value for Echo Delay is used to determine the time delay between each "second tap" and the next "first tap". Unit: Seconds Range [0.0f .. 0.207f] Default: 0.1f
+ EchoDelay = 0x0001,
+ ///This property controls the delay between the "first tap" and the "second tap". Subsequently, the value for Echo LR Delay is used to determine the time delay between each "first tap" and the next "second tap". Unit: Seconds Range [0.0f .. 0.404f] Default: 0.1f
+ EchoLRDelay = 0x0002,
+ ///This property controls the amount of high frequency damping applied to each echo. As the sound is subsequently fed back for further echoes, damping results in an echo which progressively gets softer in tone as well as intensity. Range [0.0f .. 0.99f] Default: 0.5f
+ EchoDamping = 0x0003,
+ ///This property controls the amount of feedback the output signal fed back into the input. Use this parameter to create "cascading" echoes. At full magnitude, the identical sample will repeat endlessly. Below full magnitude, the sample will repeat and fade. Range [0.0f .. 1.0f] Default: 0.5f
+ EchoFeedback = 0x0004,
+ ///This property controls how hard panned the individual echoes are. With a value of 1.0f, the first "tap" will be panned hard left, and the second "tap" hard right. –1.0f gives the opposite result and values near to 0.0f result in less emphasized panning. Range [-1.0f .. +1.0f] Default: -1.0f
+ EchoSpread = 0x0005,
+
+ ///The number of times per second the low-frequency oscillator controlling the amount of delay repeats. Range [0.0f .. 10.0f] Default: 0.27f
+ FlangerRate = 0x0003,
+ ///The ratio by which the delay time is modulated by the low-frequency oscillator. Range [0.0f .. 1.0f] Default: 1.0f
+ FlangerDepth = 0x0004,
+ ///This is the amount of the output signal level fed back into the effect's input. A negative value will reverse the phase of the feedback signal. Range [-1.0f .. +1.0f] Default: -0.5f
+ FlangerFeedback = 0x0005,
+ ///The average amount of time the sample is delayed before it is played back. When used with the Feedback property it's the amount of time between iterations of the sample. Unit: Seconds Range [0.0f .. 0.004f] Default: 0.002f
+ FlangerDelay = 0x0006,
+
+ ///This is the carrier frequency. For carrier frequencies below the audible range, the single sideband modulator may produce phaser effects, spatial effects or a slight pitch-shift. As the carrier frequency increases, the timbre of the sound is affected. Unit: Hz Range [0.0f .. 24000.0f] Default: 0.0f
+ FrequencyShifterFrequency = 0x0001,
+
+ ///This controls the frequency of the low-frequency oscillator used to morph between the two phoneme filters. Unit: Hz Range [0.0f .. 10.0f] Default: 1.41f
+ VocalMorpherRate = 0x0006,
+
+ ///This is the frequency of the carrier signal. If the carrier signal is slowly varying (less than 20 Hz), the result is a slow amplitude variation effect (tremolo). Unit: Hz Range [0.0f .. 8000.0f] Default: 440.0f
+ RingModulatorFrequency = 0x0001,
+ ///This controls the cutoff frequency at which the input signal is high-pass filtered before being ring modulated. Unit: Hz Range [0.0f .. 24000.0f] Default: 800.0f
+ RingModulatorHighpassCutoff = 0x0002,
+
+ ///This property controls the time the filtering effect takes to sweep from minimum to maximum center frequency when it is triggered by input signal. Unit: Seconds Range [0.0001f .. 1.0f] Default: 0.06f
+ AutowahAttackTime = 0x0001,
+ ///This property controls the time the filtering effect takes to sweep from maximum back to base center frequency, when the input signal ends. Unit: Seconds Range [0.0001f .. 1.0f] Default: 0.06f
+ AutowahReleaseTime = 0x0002,
+ ///This property controls the resonant peak, sometimes known as emphasis or Q, of the auto-wah band-pass filter. Range [2.0f .. 1000.0f] Default: 1000.0f
+ AutowahResonance = 0x0003,
+ ///This property controls the input signal level at which the band-pass filter will be fully opened. Range [0.00003f .. 31621.0f] Default: 11.22f
+ AutowahPeakGain = 0x0004,
+
+ ///This property controls amount of cut or boost on the low frequency range. Range [0.126f .. 7.943f] Default: 1.0f
+ EqualizerLowGain = 0x0001,
+ ///This property controls the low frequency below which signal will be cut off. Unit: Hz Range [50.0f .. 800.0f] Default: 200.0f
+ EqualizerLowCutoff = 0x0002,
+ ///This property allows you to cut/boost signal on the "mid1" range. Range [0.126f .. 7.943f] Default: 1.0f
+ EqualizerMid1Gain = 0x0003,
+ ///This property sets the center frequency for the "mid1" range. Unit: Hz Range [200.0f .. 3000.0f] Default: 500.0f
+ EqualizerMid1Center = 0x0004,
+ ///This property controls the width of the "mid1" range. Range [0.01f .. 1.0f] Default: 1.0f
+ EqualizerMid1Width = 0x0005,
+ ///This property allows you to cut/boost signal on the "mid2" range. Range [0.126f .. 7.943f] Default: 1.0f
+ EqualizerMid2Gain = 0x0006,
+ ///This property sets the center frequency for the "mid2" range. Unit: Hz Range [1000.0f .. 8000.0f] Default: 3000.0f
+ EqualizerMid2Center = 0x0007,
+ ///This property controls the width of the "mid2" range. Range [0.01f .. 1.0f] Default: 1.0f
+ EqualizerMid2Width = 0x0008,
+ ///This property allows to cut/boost the signal at high frequencies. Range [0.126f .. 7.943f] Default: 1.0f
+ EqualizerHighGain = 0x0009,
+ ///This property controls the high frequency above which signal will be cut off. Unit: Hz Range [4000.0f .. 16000.0f] Default: 6000.0f
+ EqualizerHighCutoff = 0x000A,
+
+ ///Reverb Modal Density controls the coloration of the late reverb. Range [0.0f .. 1.0f] Default: 1.0f
+ EaxReverbDensity = 0x0001,
+ ///The Reverb Diffusion property controls the echo density in the reverberation decay. Range [0.0f .. 1.0f] Default: 1.0f
+ EaxReverbDiffusion = 0x0002,
+ ///Reverb Gain controls the level of the reverberant sound in an environment. A high level of reverb is characteristic of rooms with highly reflective walls and/or small dimensions. Unit: Linear gain Range [0.0f .. 1.0f] Default: 0.32f
+ EaxReverbGain = 0x0003,
+ ///Gain HF is used to attenuate the high frequency content of all the reflected sound in an environment. You can use this property to give a room specific spectral characteristic. Unit: Linear gain Range [0.0f .. 1.0f] Default: 0.89f
+ EaxReverbGainHF = 0x0004,
+ ///Gain LF is the low frequency counterpart to Gain HF. Use this to reduce or boost the low frequency content in an environment. Unit: Linear gain Range [0.0f .. 1.0f] Default: 1.0f
+ EaxReverbGainLF = 0x0005,
+ ///The Decay Time property sets the reverberation decay time. It ranges from 0.1f (typically a small room with very dead surfaces) to 20.0f (typically a large room with very live surfaces). Unit: Seconds Range [0.1f .. 20.0f] Default: 1.49f
+ EaxReverbDecayTime = 0x0006,
+ ///Decay HF Ratio scales the decay time of high frequencies relative to the value of the Decay Time property. By changing this value, you are changing the amount of time it takes for the high frequencies to decay compared to the mid frequencies of the reverb. Range [0.1f .. 2.0f] Default: 0.83f
+ EaxReverbDecayHFRatio = 0x0007,
+ ///Decay LF Ratio scales the decay time of low frequencies in the reverberation in the same manner that Decay HF Ratio handles high frequencies. Unit: Linear multiplier Range [0.1f .. 2.0f] Default: 1.0f
+ EaxReverbDecayLFRatio = 0x0008,
+ ///Reflections Gain sets the level of the early reflections in an environment. Early reflections are used as a cue for determining the size of the environment we are in. Unit: Linear gain Range [0.0f .. 3.16f] Default: 0.05f
+ EaxReverbReflectionsGain = 0x0009,
+ ///Reflections Delay controls the amount of time it takes for the first reflected wave front to reach the listener, relative to the arrival of the direct-path sound. Unit: Seconds Range [0.0f .. 0.3f] Default: 0.007f
+ EaxReverbReflectionsDelay = 0x000A,
+ ///The Late Reverb Gain property controls the overall amount of later reverberation relative to the Gain property. Range [0.0f .. 10.0f] Default: 1.26f
+ EaxReverbLateReverbGain = 0x000C,
+ ///The Late Reverb Delay property defines the begin time of the late reverberation relative to the time of the initial reflection (the first of the early reflections). It ranges from 0 to 100 milliseconds. Unit: Seconds Range [0.0f .. 0.1f] Default: 0.011f
+ EaxReverbLateReverbDelay = 0x000D,
+ ///Echo Time controls the rate at which the cyclic echo repeats itself along the reverberation decay. Range [0.075f .. 0.25f] Default: 0.25f
+ EaxReverbEchoTime = 0x000F,
+ ///Echo Depth introduces a cyclic echo in the reverberation decay, which will be noticeable with transient or percussive sounds. Range [0.0f .. 1.0f] Default: 0.0f
+ EaxReverbEchoDepth = 0x0010,
+ ///Modulation Time controls the speed of the rate of periodic changes in pitch (vibrato). Range [0.04f .. 4.0f] Default: 0.25f
+ EaxReverbModulationTime = 0x0011,
+ ///Modulation Depth controls the amount of pitch change. Low values of Diffusion will contribute to reinforcing the perceived effect by reducing the mixing of overlapping reflections in the reverberation decay. Range [0.0f .. 1.0f] Default: 0.0f
+ EaxReverbModulationDepth = 0x0012,
+ ///The Air Absorption Gain HF property controls the distance-dependent attenuation at high frequencies caused by the propagation medium. It applies to reflected sound only. Range [0.892f .. 1.0f] Default: 0.994f
+ EaxReverbAirAbsorptionGainHF = 0x0013,
+ ///The property HF reference determines the frequency at which the high-frequency effects created by Reverb properties are measured. Unit: Hz Range [1000.0f .. 20000.0f] Default: 5000.0f
+ EaxReverbHFReference = 0x0014,
+ ///The property LF reference determines the frequency at which the low-frequency effects created by Reverb properties are measured. Unit: Hz Range [20.0f .. 1000.0f] Default: 250.0f
+ EaxReverbLFReference = 0x0015,
+ ///The Room Rolloff Factor property is one of two methods available to attenuate the reflected sound (containing both reflections and reverberation) according to source-listener distance. It's defined the same way as OpenAL Rolloff Factor, but operates on reverb sound instead of direct-path sound. Range [0.0f .. 10.0f] Default: 0.0f
+ EaxReverbRoomRolloffFactor = 0x0016,
+ }
+
+ ///A list of valid Math.Vector3 Effect/GetEffect parameters
+ public enum EfxEffect3f : int
+ {
+ /// Reverb Pan does for the Reverb what Reflections Pan does for the Reflections. Unit: Vector3 of length 0f to 1f Default: {0.0f, 0.0f, 0.0f}
+ EaxReverbLateReverbPan = 0x000E,
+ /// This Vector3 controls the spatial distribution of the cluster of early reflections. The direction of this vector controls the global direction of the reflections, while its magnitude controls how focused the reflections are towards this direction. For legacy reasons this Vector3 follows a left-handed co-ordinate system! Note that OpenAL uses a right-handed coordinate system. Unit: Vector3 of length 0f to 1f Default: {0.0f, 0.0f, 0.0f}
+ EaxReverbReflectionsPan = 0x000B,
+ }
+
+ ///A list of valid Int32 Effect/GetEffect parameters
+ public enum EfxEffecti : int
+ {
+ ///This property sets the waveform shape of the low-frequency oscillator that controls the delay time of the delayed signals. Unit: (0) Sinusoid, (1) Triangle Range [0 .. 1] Default: 1
+ ChorusWaveform = 0x0001,
+ ///This property controls the phase difference between the left and right low-frequency oscillators. At zero degrees the two low-frequency oscillators are synchronized. Unit: Degrees Range [-180 .. 180] Default: 90
+ ChorusPhase = 0x0002,
+
+ ///Selects the shape of the low-frequency oscillator waveform that controls the amount of the delay of the sampled signal. Unit: (0) Sinusoid, (1) Triangle Range [0 .. 1] Default: 1
+ FlangerWaveform = 0x0001,
+ ///This changes the phase difference between the left and right low-frequency oscillator's. At zero degrees the two low-frequency oscillators are synchronized. Range [-180 .. +180] Default: 0
+ FlangerPhase = 0x0002,
+
+ ///These select which internal signals are added together to produce the output. Unit: (0) Down, (1) Up, (2) Off Range [0 .. 2] Default: 0
+ FrequencyShifterLeftDirection = 0x0002,
+ ///These select which internal signals are added together to produce the output. Unit: (0) Down, (1) Up, (2) Off Range [0 .. 2] Default: 0
+ FrequencyShifterRightDirection = 0x0003,
+
+ ///Sets the vocal morpher 4-band formant filter A, used to impose vocal tract effects upon the input signal. The vocal morpher is not necessarily intended for use on voice signals; it is primarily intended for pitched noise effects, vocal-like wind effects, etc. Unit: Use enum EfxFormantFilterSettings Range [0 .. 29] Default: 0, "Phoneme A"
+ VocalMorpherPhonemeA = 0x0001,
+ ///This is used to adjust the pitch of phoneme filter A in 1-semitone increments. Unit: Semitones Range [-24 .. +24] Default: 0
+ VocalMorpherPhonemeACoarseTuning = 0x0002,
+ ///Sets the vocal morpher 4-band formant filter B, used to impose vocal tract effects upon the input signal. The vocal morpher is not necessarily intended for use on voice signals; it is primarily intended for pitched noise effects, vocal-like wind effects, etc. Unit: Use enum EfxFormantFilterSettings Range [0 .. 29] Default: 10, "Phoneme ER"
+ VocalMorpherPhonemeB = 0x0003,
+ ///This is used to adjust the pitch of phoneme filter B in 1-semitone increments. Unit: Semitones Range [-24 .. +24] Default: 0
+ VocalMorpherPhonemeBCoarseTuning = 0x0004,
+ ///This controls the shape of the low-frequency oscillator used to morph between the two phoneme filters. Unit: (0) Sinusoid, (1) Triangle, (2) Sawtooth Range [0 .. 2] Default: 0
+ VocalMorpherWaveform = 0x0005,
+
+ ///This sets the number of semitones by which the pitch is shifted. There are 12 semitones per octave. Unit: Semitones Range [-12 .. +12] Default: +12
+ PitchShifterCoarseTune = 0x0001,
+ ///This sets the number of cents between Semitones a pitch is shifted. A Cent is 1/100th of a Semitone. Unit: Cents Range [-50 .. +50] Default: 0
+ PitchShifterFineTune = 0x0002,
+
+ ///This controls which waveform is used as the carrier signal. Traditional ring modulator and tremolo effects generally use a sinusoidal carrier. Unit: (0) Sinusoid, (1) Sawtooth, (2) Square Range [0 .. 2] Default: 0
+ RingModulatorWaveform = 0x0003,
+
+ ///Enabling this will result in audio exhibiting smaller variation in intensity between the loudest and quietest portions. Unit: (0) Off, (1) On Range [0 .. 1] Default: 1
+ CompressorOnoff = 0x0001,
+
+ ///When this flag is set, the high-frequency decay time automatically stays below a limit value that's derived from the setting of the property Air Absorption HF. Unit: (0) False, (1) True Range [False, True] Default: True
+ ReverbDecayHFLimit = 0x000D,
+
+ ///When this flag is set, the high-frequency decay time automatically stays below a limit value that's derived from the setting of the property AirAbsorptionGainHF. Unit: (0) False, (1) True Range [False, True] Default: True
+ EaxReverbDecayHFLimit = 0x0017,
+
+ /// Used with the enum EfxEffectType as it's parameter.
+ EffectType = 0x8001,
+ }
+
+ ///Vocal morpher effect parameters. If both parameters are set to the same phoneme, that determines the filtering effect that will be heard. If these two parameters are set to different phonemes, the filtering effect will morph between the two settings at a rate specified by EfxEffectf.VocalMorpherRate.
+ public enum EfxFormantFilterSettings : int
+ {
+ VocalMorpherPhonemeA = 0,
+ VocalMorpherPhonemeE = 1,
+ VocalMorpherPhonemeI = 2,
+ VocalMorpherPhonemeO = 3,
+ VocalMorpherPhonemeU = 4,
+ VocalMorpherPhonemeAA = 5,
+ VocalMorpherPhonemeAE = 6,
+ VocalMorpherPhonemeAH = 7,
+ VocalMorpherPhonemeAO = 8,
+ VocalMorpherPhonemeEH = 9,
+ VocalMorpherPhonemeER = 10,
+ VocalMorpherPhonemeIH = 11,
+ VocalMorpherPhonemeIY = 12,
+ VocalMorpherPhonemeUH = 13,
+ VocalMorpherPhonemeUW = 14,
+ VocalMorpherPhonemeB = 15,
+ VocalMorpherPhonemeD = 16,
+ VocalMorpherPhonemeF = 17,
+ VocalMorpherPhonemeG = 18,
+ VocalMorpherPhonemeJ = 19,
+ VocalMorpherPhonemeK = 20,
+ VocalMorpherPhonemeL = 21,
+ VocalMorpherPhonemeM = 22,
+ VocalMorpherPhonemeN = 23,
+ VocalMorpherPhonemeP = 24,
+ VocalMorpherPhonemeR = 25,
+ VocalMorpherPhonemeS = 26,
+ VocalMorpherPhonemeT = 27,
+ VocalMorpherPhonemeV = 28,
+ VocalMorpherPhonemeZ = 29,
+ }
+
+ ///Effect type definitions to be used with EfxEffecti.EffectType.
+ public enum EfxEffectType : int
+ {
+ ///No Effect, disable. This Effect type is used when an Effect object is initially created.
+ Null = 0x0000,
+ ///The Reverb effect is the standard Effects Extension's environmental reverberation effect. It is available on all Generic Software and Generic Hardware devices.
+ Reverb = 0x0001,
+ ///The Chorus effect essentially replays the input audio accompanied by another slightly delayed version of the signal, creating a "doubling" effect.
+ Chorus = 0x0002,
+ ///The Distortion effect simulates turning up (overdriving) the gain stage on a guitar amplifier or adding a distortion pedal to an instrument's output.
+ Distortion = 0x0003,
+ ///The Echo effect generates discrete, delayed instances of the input signal.
+ Echo = 0x0004,
+ ///The Flanger effect creates a "tearing" or "whooshing" sound, like a jet flying overhead.
+ Flanger = 0x0005,
+ ///The Frequency shifter is a single-sideband modulator, which translates all the component frequencies of the input signal by an equal amount.
+ FrequencyShifter = 0x0006,
+ ///The Vocal morpher consists of a pair of 4-band formant filters, used to impose vocal tract effects upon the input signal.
+ VocalMorpher = 0x0007,
+ ///The Pitch shifter applies time-invariant pitch shifting to the input signal, over a one octave range and controllable at a semi-tone and cent resolution.
+ PitchShifter = 0x0008,
+ ///The Ring modulator multiplies an input signal by a carrier signal in the time domain, resulting in tremolo or inharmonic effects.
+ RingModulator = 0x0009,
+ ///The Auto-wah effect emulates the sound of a wah-wah pedal used with an electric guitar, or a mute on a brass instrument.
+ Autowah = 0x000A,
+ ///The Compressor will boost quieter portions of the audio, while louder portions will stay the same or may even be reduced.
+ Compressor = 0x000B,
+ ///The Equalizer is very flexible, providing tonal control over four different adjustable frequency ranges.
+ Equalizer = 0x000C,
+ ///The EAX Reverb has a more advanced parameter set than EfxEffectType.Reverb, but is only natively supported on devices that support the EAX 3.0 or above.
+ EaxReverb = 0x8000,
+ }
+
+ #endregion Effect
+
+ #region Auxiliary Effect Slot
+
+ ///A list of valid Int32 AuxiliaryEffectSlot/GetAuxiliaryEffectSlot parameters
+ public enum EfxAuxiliaryi : int
+ {
+ /// This property is used to attach an Effect object to the Auxiliary Effect Slot object. After the attachment, the Auxiliary Effect Slot object will contain the effect type and have the same effect parameters that were stored in the Effect object. Any Sources feeding the Auxiliary Effect Slot will immediate feed the new effect type and new effect parameters.
+ EffectslotEffect = 0x0001,
+
+ /// This property is used to enable or disable automatic send adjustments based on the physical positions of the sources and the listener. This property should be enabled when an application wishes to use a reverb effect to simulate the environment surrounding a listener or a collection of Sources. Range [False, True] Default: True
+ EffectslotAuxiliarySendAuto = 0x0003,
+ }
+
+ ///A list of valid 32-Bits Float AuxiliaryEffectSlot/GetAuxiliaryEffectSlot parameters
+ public enum EfxAuxiliaryf : int
+ {
+ /// This property is used to specify an output level for the Auxiliary Effect Slot. Setting the gain to 0.0f mutes the output. Range [0.0f .. 1.0f] Default: 1.0f
+ EffectslotGain = 0x0002,
+ }
+
+ #endregion Auxiliary Effect Slot
+
+ #region Filter Object
+
+ ///A list of valid 32-Bits Float Filter/GetFilter parameters
+ public enum EfxFilterf : int
+ {
+ ///Range [0.0f .. 1.0f] Default: 1.0f
+ LowpassGain = 0x0001,
+ ///Range [0.0f .. 1.0f] Default: 1.0f
+ LowpassGainHF = 0x0002,
+
+ ///Range [0.0f .. 1.0f] Default: 1.0f
+ HighpassGain = 0x0001,
+ ///Range [0.0f .. 1.0f] Default: 1.0f
+ HighpassGainLF = 0x0002,
+
+ ///Range [0.0f .. 1.0f] Default: 1.0f
+ BandpassGain = 0x0001,
+ ///Range [0.0f .. 1.0f] Default: 1.0f
+ BandpassGainLF = 0x0002,
+ ///Range [0.0f .. 1.0f] Default: 1.0f
+ BandpassGainHF = 0x0003,
+ }
+
+ ///A list of valid Int32 Filter/GetFilter parameters
+ public enum EfxFilteri : int
+ {
+ /// Used with the enum EfxFilterType as Parameter to select a filter logic.
+ FilterType = 0x8001,
+ }
+
+ ///Filter type definitions to be used with EfxFilteri.FilterType.
+ public enum EfxFilterType : int
+ {
+ ///No Filter, disable. This Filter type is used when a Filter object is initially created.
+ Null = 0x0000,
+ /// A low-pass filter is used to remove high frequency content from a signal.
+ Lowpass = 0x0001,
+ ///Currently not implemented. A high-pass filter is used to remove low frequency content from a signal.
+ Highpass = 0x0002,
+ ///Currently not implemented. A band-pass filter is used to remove high and low frequency content from a signal.
+ Bandpass = 0x0003,
+ }
+
+ #endregion Filter Object
+}
diff --git a/Source/Compatibility/Audio/OpenAL/AL/EffectsExtensionPresets.cs b/Source/Compatibility/Audio/OpenAL/AL/EffectsExtensionPresets.cs
new file mode 100644
index 00000000..71b08db5
--- /dev/null
+++ b/Source/Compatibility/Audio/OpenAL/AL/EffectsExtensionPresets.cs
@@ -0,0 +1,369 @@
+#region --- OpenTK.OpenAL License ---
+/* EfxPresets.cs
+ * C headers: \OpenAL 1.1 SDK\include\ "efx.h", "efx-creative.h", "Efx-Util.h"
+ * Spec: Effects Extension Guide.pdf (bundled with OpenAL SDK)
+ * Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
+ * See license.txt for license details
+ * http://www.OpenTK.net */
+#endregion
+
+using System;
+
+
+namespace OpenTK.Audio
+{
+ public partial class EffectsExtension
+ {
+ // Todo: Add documentation
+ // Todo: CLS compliance.
+
+#pragma warning disable 1591
+
+ [CLSCompliant(false)]
+ public struct EaxReverb
+ {
+ public uint Environment; // TODO: EAX-EFX conversion
+ public float EnvironmentSize; // TODO: EAX-EFX conversion
+ public float EnvironmentDiffusion; // TODO: EAX-EFX conversion
+ public int Room; // TODO: EAX-EFX conversion
+ public int RoomHF; // TODO: EAX-EFX conversion
+ public int RoomLF; // TODO: EAX-EFX conversion
+ public float DecayTime;
+ public float DecayHFRatio;
+ public float DecayLFRatio;
+ public int Reflections; // TODO: EAX-EFX conversion
+ public float ReflectionsDelay;
+ public Vector3 ReflectionsPan;
+ public int Reverb; // TODO: EAX-EFX conversion
+ public float ReverbDelay;
+ public Vector3 ReverbPan;
+ public float EchoTime;
+ public float EchoDepth;
+ public float ModulationTime;
+ public float ModulationDepth;
+ public float AirAbsorptionHF;
+ public float HFReference;
+ public float LFReference;
+ public float RoomRolloffFactor;
+ public uint Flags; // TODO: EAX-EFX conversion
+
+ public EaxReverb(uint environment,
+ float environmentSize,
+ float environmentDiffusion,
+ int room,
+ int roomHF,
+ int roomLF,
+ float decayTime,
+ float decayHFRatio,
+ float decayLFRatio,
+ int reflections,
+ float reflectionsDelay,
+ float reflectionsPanX,
+ float reflectionsPanY,
+ float reflectionsPanZ,
+ int reverb,
+ float reverbDelay,
+ float reverbPanX,
+ float reverbPanY,
+ float reverbPanZ,
+ float echoTime,
+ float echoDepth,
+ float modulationTime,
+ float modulationDepth,
+ float airAbsorptionHF,
+ float hfReference,
+ float lfReference,
+ float roomRolloffFactor,
+ uint flags)
+ {
+ Environment = environment;
+ EnvironmentSize = environmentSize;
+ EnvironmentDiffusion = environmentDiffusion;
+ Room = room;
+ RoomHF = roomHF;
+ RoomLF = roomLF;
+ DecayTime = decayTime;
+ DecayHFRatio = decayHFRatio;
+ DecayLFRatio = decayLFRatio;
+ Reflections = reflections;
+ ReflectionsDelay = reflectionsDelay;
+ ReflectionsPan = new Vector3(reflectionsPanX, reflectionsPanY, reflectionsPanZ);
+ Reverb = reverb;
+ ReverbDelay = reverbDelay;
+ ReverbPan = new Vector3(reverbPanX, reverbPanY, reverbPanZ);
+ EchoTime = echoTime;
+ EchoDepth = echoDepth;
+ ModulationTime = modulationTime;
+ ModulationDepth = modulationDepth;
+ AirAbsorptionHF = airAbsorptionHF;
+ HFReference = hfReference;
+ LFReference = lfReference;
+ RoomRolloffFactor = roomRolloffFactor;
+ Flags = flags;
+ }
+
+ }
+
+ // TODO: CLS compliance.
+ [CLSCompliant(false)]
+ public static void GetEaxFromEfxEax(ref EaxReverb input, out EfxEaxReverb output)
+ {
+ output.AirAbsorptionGainHF = 0.995f; // input.AirAbsorptionHF * somegain?
+ output.RoomRolloffFactor = input.RoomRolloffFactor;
+
+ output.Density = 1f; // todo, currently default
+ output.Diffusion = 1f; // todo, currently default
+
+ output.DecayTime = input.DecayTime;
+ output.DecayHFLimit = 1; // todo, currently default
+ output.DecayHFRatio = input.DecayHFRatio;
+ output.DecayLFRatio = input.DecayLFRatio;
+
+ output.EchoDepth = input.EchoDepth;
+ output.EchoTime = input.EchoTime;
+
+ output.Gain = 0.32f; // todo, currently default
+ output.GainHF = 0.89f; // todo, currently default
+ output.GainLF = 1f;// todo, currently default
+
+ output.LFReference = input.LFReference;
+ output.HFReference = input.HFReference;
+
+ output.LateReverbDelay = input.ReverbDelay;
+ output.LateReverbGain = 1.26f; // todo, currently default
+ output.LateReverbPan = input.ReverbPan;
+
+ output.ModulationDepth = input.ModulationDepth;
+ output.ModulationTime = input.ModulationTime;
+
+ output.ReflectionsDelay = input.ReflectionsDelay;
+ output.ReflectionsGain = 0.05f; // todo, currently default
+ output.ReflectionsPan = input.ReflectionsPan;
+ }
+
+ public struct EfxEaxReverb
+ {
+ public float Density;
+ public float Diffusion;
+ public float Gain;
+ public float GainHF;
+ public float GainLF;
+ public float DecayTime;
+ public float DecayHFRatio;
+ public float DecayLFRatio;
+ public float ReflectionsGain;
+ public float ReflectionsDelay;
+ public Vector3 ReflectionsPan;
+ public float LateReverbGain;
+ public float LateReverbDelay;
+ public Vector3 LateReverbPan;
+ public float EchoTime;
+ public float EchoDepth;
+ public float ModulationTime;
+ public float ModulationDepth;
+ public float AirAbsorptionGainHF;
+ public float HFReference;
+ public float LFReference;
+ public float RoomRolloffFactor;
+ public int DecayHFLimit;
+ }
+
+ /*
+ public struct _EAXOBSTRUCTIONPROPERTIES
+ {
+ public int lObstruction;
+ public float flObstructionLFRatio;
+ }
+ _EAXOBSTRUCTIONPROPERTIES EAXOBSTRUCTIONPROPERTIES;//, *LPEAXOBSTRUCTIONPROPERTIES;
+
+ public struct _EAXOCCLUSIONPROPERTIES
+ {
+ public int lOcclusion;
+ public float flOcclusionLFRatio;
+ public float flOcclusionRoomRatio;
+ public float flOcclusionDirectRatio;
+ }
+ _EAXOCCLUSIONPROPERTIES EAXOCCLUSIONPROPERTIES;//, *LPEAXOCCLUSIONPROPERTIES;
+
+ public struct _EAXEXCLUSIONPROPERTIES
+ {
+ public int lExclusion;
+ public float flExclusionLFRatio;
+ }
+ _EAXEXCLUSIONPROPERTIES EAXEXCLUSIONPROPERTIES;//, *LPEAXEXCLUSIONPROPERTIES;
+
+ public struct _EFXLOWPASSFILTER
+ {
+ public float flGain;
+ public float flGainHF;
+ }
+ _EFXLOWPASSFILTER EFXLOWPASSFILTER;//, *LPEFXLOWPASSFILTER;
+
+
+ void ConvertReverbParameters(EAXREVERBPROPERTIES *pEAXProp, EFXEAXREVERBPROPERTIES *pEFXEAXReverb);
+ void ConvertObstructionParameters(EAXOBSTRUCTIONPROPERTIES *pObProp, EFXLOWPASSFILTER *pDirectLowPassFilter);
+ void ConvertExclusionParameters(EAXEXCLUSIONPROPERTIES *pExProp, EFXLOWPASSFILTER *pSendLowPassFilter);
+ void ConvertOcclusionParameters(EAXOCCLUSIONPROPERTIES *pOcProp, EFXLOWPASSFILTER *pDirectLowPassFilter, EFXLOWPASSFILTER *pSendLowPassFilter);
+ */
+
+ // TODO: CLS compliance.
+ ///EAX Reverb Presets in legacy format - use ConvertReverbParameters() to convert to EFX EAX Reverb Presets for use with the OpenAL Effects Extension.
+ [CLSCompliant(false)]
+ public static class ReverbPresets
+ {
+ // CASTLE PRESETS
+
+ public static EaxReverb CastleSmallRoom = new EaxReverb(26, 8.3f, 0.890f, -1000, -800, -2000, 1.22f, 0.83f, 0.31f, -100, 0.022f, 0f, 0f, 0f, 600, 0.011f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
+ public static EaxReverb CastleShortPassage = new EaxReverb(26, 8.3f, 0.890f, -1000, -1000, -2000, 2.32f, 0.83f, 0.31f, -100, 0.007f, 0f, 0f, 0f, 200, 0.023f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
+ public static EaxReverb CastleMediumroom = new EaxReverb(26, 8.3f, 0.930f, -1000, -1100, -2000, 2.04f, 0.83f, 0.46f, -400, 0.022f, 0f, 0f, 0f, 400, 0.011f, 0f, 0f, 0f, 0.155f, 0.030f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
+ public static EaxReverb CastleLongpassage = new EaxReverb(26, 8.3f, 0.890f, -1000, -800, -2000, 3.42f, 0.83f, 0.31f, -100, 0.007f, 0f, 0f, 0f, 300, 0.023f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
+ public static EaxReverb CastleLargeroom = new EaxReverb(26, 8.3f, 0.820f, -1000, -1100, -1800, 2.53f, 0.83f, 0.50f, -700, 0.034f, 0f, 0f, 0f, 200, 0.016f, 0f, 0f, 0f, 0.185f, 0.070f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
+ public static EaxReverb CastleHall = new EaxReverb(26, 8.3f, 0.810f, -1000, -1100, -1500, 3.14f, 0.79f, 0.62f, -1500, 0.056f, 0f, 0f, 0f, 100, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
+ public static EaxReverb CastleCupboard = new EaxReverb(26, 8.3f, 0.890f, -1000, -1100, -2000, 0.67f, 0.87f, 0.31f, 300, 0.010f, 0f, 0f, 0f, 1100, 0.007f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
+ public static EaxReverb CastleCourtyard = new EaxReverb(26, 8.3f, 0.420f, -1000, -700, -1400, 2.13f, 0.61f, 0.23f, -1300, 0.160f, 0f, 0f, 0f, -300, 0.036f, 0f, 0f, 0f, 0.250f, 0.370f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f);
+ public static EaxReverb CastleAlcove = new EaxReverb(26, 8.3f, 0.890f, -1000, -600, -2000, 1.64f, 0.87f, 0.31f, 00, 0.007f, 0f, 0f, 0f, 300, 0.034f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20);
+
+ // FACTORY PRESETS
+
+ public static EaxReverb FactoryAlcove = new EaxReverb(26, 1.8f, 0.590f, -1200, -200, -600, 3.14f, 0.65f, 1.31f, 300, 0.010f, 0f, 0f, 0f, 000, 0.038f, 0f, 0f, 0f, 0.114f, 0.100f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
+ public static EaxReverb FactoryShortpassage = new EaxReverb(26, 1.8f, 0.640f, -1200, -200, -600, 2.53f, 0.65f, 1.31f, 0, 0.010f, 0f, 0f, 0f, 200, 0.038f, 0f, 0f, 0f, 0.135f, 0.230f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
+ public static EaxReverb FactoryMediumroom = new EaxReverb(26, 1.9f, 0.820f, -1200, -200, -600, 2.76f, 0.65f, 1.31f, -1100, 0.022f, 0f, 0f, 0f, 300, 0.023f, 0f, 0f, 0f, 0.174f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
+ public static EaxReverb FactoryLongpassage = new EaxReverb(26, 1.8f, 0.640f, -1200, -200, -600, 4.06f, 0.65f, 1.31f, 0, 0.020f, 0f, 0f, 0f, 200, 0.037f, 0f, 0f, 0f, 0.135f, 0.230f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
+ public static EaxReverb FactoryLargeroom = new EaxReverb(26, 1.9f, 0.750f, -1200, -300, -400, 4.24f, 0.51f, 1.31f, -1500, 0.039f, 0f, 0f, 0f, 100, 0.023f, 0f, 0f, 0f, 0.231f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
+ public static EaxReverb FactoryHall = new EaxReverb(26, 1.9f, 0.750f, -1000, -300, -400, 7.43f, 0.51f, 1.31f, -2400, 0.073f, 0f, 0f, 0f, -100, 0.027f, 0f, 0f, 0f, 0.250f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
+ public static EaxReverb FactoryCupboard = new EaxReverb(26, 1.7f, 0.630f, -1200, -200, -600, 0.49f, 0.65f, 1.31f, 200, 0.010f, 0f, 0f, 0f, 600, 0.032f, 0f, 0f, 0f, 0.107f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
+ public static EaxReverb FactoryCourtyard = new EaxReverb(26, 1.7f, 0.570f, -1000, -1000, -400, 2.32f, 0.29f, 0.56f, -1300, 0.140f, 0f, 0f, 0f, -800, 0.039f, 0f, 0f, 0f, 0.250f, 0.290f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
+ public static EaxReverb FactorySmallroom = new EaxReverb(26, 1.8f, 0.820f, -1000, -200, -600, 1.72f, 0.65f, 1.31f, -300, 0.010f, 0f, 0f, 0f, 500, 0.024f, 0f, 0f, 0f, 0.119f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20);
+
+ // ICE PALACE PRESETS
+
+ public static EaxReverb IcepalaceAlcove = new EaxReverb(26, 2.7f, 0.840f, -1000, -500, -1100, 2.76f, 1.46f, 0.28f, 100, 0.010f, 0f, 0f, 0f, -100, 0.030f, 0f, 0f, 0f, 0.161f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
+ public static EaxReverb IcepalaceShortpassage = new EaxReverb(26, 2.7f, 0.750f, -1000, -500, -1100, 1.79f, 1.46f, 0.28f, -600, 0.010f, 0f, 0f, 0f, 100, 0.019f, 0f, 0f, 0f, 0.177f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
+ public static EaxReverb IcepalaceMediumroom = new EaxReverb(26, 2.7f, 0.870f, -1000, -500, -700, 2.22f, 1.53f, 0.32f, -800, 0.039f, 0f, 0f, 0f, 100, 0.027f, 0f, 0f, 0f, 0.186f, 0.120f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
+ public static EaxReverb IcepalaceLongpassage = new EaxReverb(26, 2.7f, 0.770f, -1000, -500, -800, 3.01f, 1.46f, 0.28f, -200, 0.012f, 0f, 0f, 0f, 200, 0.025f, 0f, 0f, 0f, 0.186f, 0.040f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
+ public static EaxReverb IcepalaceLargeroom = new EaxReverb(26, 2.9f, 0.810f, -1000, -500, -700, 3.14f, 1.53f, 0.32f, -1200, 0.039f, 0f, 0f, 0f, 000, 0.027f, 0f, 0f, 0f, 0.214f, 0.110f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
+ public static EaxReverb IcepalaceHall = new EaxReverb(26, 2.9f, 0.760f, -1000, -700, -500, 5.49f, 1.53f, 0.38f, -1900, 0.054f, 0f, 0f, 0f, -400, 0.052f, 0f, 0f, 0f, 0.226f, 0.110f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
+ public static EaxReverb IcepalaceCupboard = new EaxReverb(26, 2.7f, 0.830f, -1000, -600, -1300, 0.76f, 1.53f, 0.26f, 100, 0.012f, 0f, 0f, 0f, 600, 0.016f, 0f, 0f, 0f, 0.143f, 0.080f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
+ public static EaxReverb IcepalaceCourtyard = new EaxReverb(26, 2.9f, 0.590f, -1000, -1100, -1000, 2.04f, 1.20f, 0.38f, -1000, 0.173f, 0f, 0f, 0f, -1000, 0.043f, 0f, 0f, 0f, 0.235f, 0.480f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
+ public static EaxReverb IcepalaceSmallroom = new EaxReverb(26, 2.7f, 0.840f, -1000, -500, -1100, 1.51f, 1.53f, 0.27f, -100, 0.010f, 0f, 0f, 0f, 300, 0.011f, 0f, 0f, 0f, 0.164f, 0.140f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20);
+
+ // SPACE STATION PRESETS
+
+ public static EaxReverb SpacestationAlcove = new EaxReverb(26, 1.5f, 0.780f, -1000, -300, -100, 1.16f, 0.81f, 0.55f, 300, 0.007f, 0f, 0f, 0f, 000, 0.018f, 0f, 0f, 0f, 0.192f, 0.210f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
+ public static EaxReverb SpacestationMediumroom = new EaxReverb(26, 1.5f, 0.750f, -1000, -400, -100, 3.01f, 0.50f, 0.55f, -800, 0.034f, 0f, 0f, 0f, 100, 0.035f, 0f, 0f, 0f, 0.209f, 0.310f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
+ public static EaxReverb SpacestationShortpassage = new EaxReverb(26, 1.5f, 0.870f, -1000, -400, -100, 3.57f, 0.50f, 0.55f, 0, 0.012f, 0f, 0f, 0f, 100, 0.016f, 0f, 0f, 0f, 0.172f, 0.200f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
+ public static EaxReverb SpacestationLongpassage = new EaxReverb(26, 1.9f, 0.820f, -1000, -400, -100, 4.62f, 0.62f, 0.55f, 0, 0.012f, 0f, 0f, 0f, 200, 0.031f, 0f, 0f, 0f, 0.250f, 0.230f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
+ public static EaxReverb SpacestationLargeroom = new EaxReverb(26, 1.8f, 0.810f, -1000, -400, -100, 3.89f, 0.38f, 0.61f, -1000, 0.056f, 0f, 0f, 0f, -100, 0.035f, 0f, 0f, 0f, 0.233f, 0.280f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
+ public static EaxReverb SpacestationHall = new EaxReverb(26, 1.9f, 0.870f, -1000, -400, -100, 7.11f, 0.38f, 0.61f, -1500, 0.100f, 0f, 0f, 0f, -400, 0.047f, 0f, 0f, 0f, 0.250f, 0.250f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
+ public static EaxReverb SpacestationCupboard = new EaxReverb(26, 1.4f, 0.560f, -1000, -300, -100, 0.79f, 0.81f, 0.55f, 300, 0.007f, 0f, 0f, 0f, 500, 0.018f, 0f, 0f, 0f, 0.181f, 0.310f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
+ public static EaxReverb SpacestationSmallroom = new EaxReverb(26, 1.5f, 0.700f, -1000, -300, -100, 1.72f, 0.82f, 0.55f, -200, 0.007f, 0f, 0f, 0f, 300, 0.013f, 0f, 0f, 0f, 0.188f, 0.260f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20);
+
+ // WOODEN GALLEON PRESETS
+
+ public static EaxReverb WoodenAlcove = new EaxReverb(26, 7.5f, 1f, -1000, -1800, -1000, 1.22f, 0.62f, 0.91f, 100, 0.012f, 0f, 0f, 0f, -300, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
+ public static EaxReverb WoodenShortpassage = new EaxReverb(26, 7.5f, 1f, -1000, -1800, -1000, 1.75f, 0.50f, 0.87f, -100, 0.012f, 0f, 0f, 0f, -400, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
+ public static EaxReverb WoodenMediumroom = new EaxReverb(26, 7.5f, 1f, -1000, -2000, -1100, 1.47f, 0.42f, 0.82f, -100, 0.049f, 0f, 0f, 0f, -100, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
+ public static EaxReverb WoodenLongpassage = new EaxReverb(26, 7.5f, 1f, -1000, -2000, -1000, 1.99f, 0.40f, 0.79f, 000, 0.020f, 0f, 0f, 0f, -700, 0.036f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
+ public static EaxReverb WoodenLargeroom = new EaxReverb(26, 7.5f, 1f, -1000, -2100, -1100, 2.65f, 0.33f, 0.82f, -100, 0.066f, 0f, 0f, 0f, -200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
+ public static EaxReverb WoodenHall = new EaxReverb(26, 7.5f, 1f, -1000, -2200, -1100, 3.45f, 0.30f, 0.82f, -100, 0.088f, 0f, 0f, 0f, -200, 0.063f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
+ public static EaxReverb WoodenCupboard = new EaxReverb(26, 7.5f, 1f, -1000, -1700, -1000, 0.56f, 0.46f, 0.91f, 100, 0.012f, 0f, 0f, 0f, 100, 0.028f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
+ public static EaxReverb WoodenSmallroom = new EaxReverb(26, 7.5f, 1f, -1000, -1900, -1000, 0.79f, 0.32f, 0.87f, 00, 0.032f, 0f, 0f, 0f, -100, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
+ public static EaxReverb WoodenCourtyard = new EaxReverb(26, 7.5f, 0.650f, -1000, -2200, -1000, 1.79f, 0.35f, 0.79f, -500, 0.123f, 0f, 0f, 0f, -2000, 0.032f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f);
+
+ // SPORTS PRESETS
+
+ public static EaxReverb SportEmptystadium = new EaxReverb(26, 7.2f, 1f, -1000, -700, -200, 6.26f, 0.51f, 1.10f, -2400, 0.183f, 0f, 0f, 0f, -800, 0.038f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20);
+ public static EaxReverb SportSquashcourt = new EaxReverb(26, 7.5f, 0.750f, -1000, -1000, -200, 2.22f, 0.91f, 1.16f, -700, 0.007f, 0f, 0f, 0f, -200, 0.011f, 0f, 0f, 0f, 0.126f, 0.190f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20);
+ public static EaxReverb SportSmallswimmingpool = new EaxReverb(26, 36.2f, 0.700f, -1000, -200, -100, 2.76f, 1.25f, 1.14f, -400, 0.020f, 0f, 0f, 0f, -200, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -5f, 5000f, 250f, 0f, 0x0);
+ public static EaxReverb SportLargeswimmingpool = new EaxReverb(26, 36.2f, 0.820f, -1000, -200, 0, 5.49f, 1.31f, 1.14f, -700, 0.039f, 0f, 0f, 0f, -600, 0.049f, 0f, 0f, 0f, 0.222f, 0.550f, 1.159f, 0.210f, -5f, 5000f, 250f, 0f, 0x0);
+ public static EaxReverb SportGymnasium = new EaxReverb(26, 7.5f, 0.810f, -1000, -700, -100, 3.14f, 1.06f, 1.35f, -800, 0.029f, 0f, 0f, 0f, -500, 0.045f, 0f, 0f, 0f, 0.146f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20);
+ public static EaxReverb SportFullstadium = new EaxReverb(26, 7.2f, 1f, -1000, -2300, -200, 5.25f, 0.17f, 0.80f, -2000, 0.188f, 0f, 0f, 0f, -1100, 0.038f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20);
+ public static EaxReverb SportStadimtannoy = new EaxReverb(26, 3f, 0.780f, -1000, -500, -600, 2.53f, 0.88f, 0.68f, -1100, 0.230f, 0f, 0f, 0f, -600, 0.063f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20);
+
+ // PREFAB PRESETS
+
+ public static EaxReverb PrefabWorkshop = new EaxReverb(26, 1.9f, 1f, -1000, -1700, -800, 0.76f, 1f, 1f, 0, 0.012f, 0f, 0f, 0f, 100, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0);
+ public static EaxReverb PrefabSchoolroom = new EaxReverb(26, 1.86f, 0.690f, -1000, -400, -600, 0.98f, 0.45f, 0.18f, 300, 0.017f, 0f, 0f, 0f, 300, 0.015f, 0f, 0f, 0f, 0.095f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20);
+ public static EaxReverb PrefabPractiseroom = new EaxReverb(26, 1.86f, 0.870f, -1000, -800, -600, 1.12f, 0.56f, 0.18f, 200, 0.010f, 0f, 0f, 0f, 300, 0.011f, 0f, 0f, 0f, 0.095f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20);
+ public static EaxReverb PrefabOuthouse = new EaxReverb(26, 80.3f, 0.820f, -1000, -1900, -1600, 1.38f, 0.38f, 0.35f, -100, 0.024f, 0f, 0f, -0f, -400, 0.044f, 0f, 0f, 0f, 0.121f, 0.170f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0);
+ public static EaxReverb PrefabCaravan = new EaxReverb(26, 8.3f, 1f, -1000, -2100, -1800, 0.43f, 1.50f, 1f, 0, 0.012f, 0f, 0f, 0f, 600, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f);
+
+ // DOME AND PIPE PRESETS
+
+ public static EaxReverb DomeTomb = new EaxReverb(26, 51.8f, 0.790f, -1000, -900, -1300, 4.18f, 0.21f, 0.10f, -825, 0.030f, 0f, 0f, 0f, 450, 0.022f, 0f, 0f, 0f, 0.177f, 0.190f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0);
+ public static EaxReverb DomeSaintPauls = new EaxReverb(26, 50.3f, 0.870f, -1000, -900, -1300, 10.48f, 0.19f, 0.10f, -1500, 0.090f, 0f, 0f, 0f, 200, 0.042f, 0f, 0f, 0f, 0.250f, 0.120f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f);
+ public static EaxReverb PipeSmall = new EaxReverb(26, 50.3f, 1f, -1000, -900, -1300, 5.04f, 0.10f, 0.10f, -600, 0.032f, 0f, 0f, 0f, 800, 0.015f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f);
+ public static EaxReverb PipeLongthin = new EaxReverb(26, 1.6f, 0.910f, -1000, -700, -1100, 9.21f, 0.18f, 0.10f, -300, 0.010f, 0f, 0f, 0f, -300, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0);
+ public static EaxReverb PipeLarge = new EaxReverb(26, 50.3f, 1f, -1000, -900, -1300, 8.45f, 0.10f, 0.10f, -800, 0.046f, 0f, 0f, 0f, 400, 0.032f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f);
+ public static EaxReverb PipeResonant = new EaxReverb(26, 1.3f, 0.910f, -1000, -700, -1100, 6.81f, 0.18f, 0.10f, -300, 0.010f, 0f, 0f, 0f, 00, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0);
+
+ // OUTDOORS PRESETS
+
+ public static EaxReverb OutdoorsBackyard = new EaxReverb(26, 80.3f, 0.450f, -1000, -1200, -600, 1.12f, 0.34f, 0.46f, -700, 0.069f, 0f, 0f, -0f, -300, 0.023f, 0f, 0f, 0f, 0.218f, 0.340f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0);
+ public static EaxReverb OutdoorsRollingplains = new EaxReverb(26, 80.3f, 0f, -1000, -3900, -400, 2.13f, 0.21f, 0.46f, -1500, 0.300f, 0f, 0f, -0f, -700, 0.019f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0);
+ public static EaxReverb OutdoorsDeepcanyon = new EaxReverb(26, 80.3f, 0.740f, -1000, -1500, -400, 3.89f, 0.21f, 0.46f, -1000, 0.223f, 0f, 0f, -0f, -900, 0.019f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0);
+ public static EaxReverb OutdoorsCreek = new EaxReverb(26, 80.3f, 0.350f, -1000, -1500, -600, 2.13f, 0.21f, 0.46f, -800, 0.115f, 0f, 0f, -0f, -1400, 0.031f, 0f, 0f, 0f, 0.218f, 0.340f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0);
+ public static EaxReverb OutdoorsValley = new EaxReverb(26, 80.3f, 0.280f, -1000, -3100, -1600, 2.88f, 0.26f, 0.35f, -1700, 0.263f, 0f, 0f, -0f, -800, 0.100f, 0f, 0f, 0f, 0.250f, 0.340f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0);
+
+ // MOOD PRESETS
+
+ public static EaxReverb MoodHeaven = new EaxReverb(26, 19.6f, 0.940f, -1000, -200, -700, 5.04f, 1.12f, 0.56f, -1230, 0.020f, 0f, 0f, 0f, 200, 0.029f, 0f, 0f, 0f, 0.250f, 0.080f, 2.742f, 0.050f, -2f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb MoodHell = new EaxReverb(26, 100f, 0.570f, -1000, -900, -700, 3.57f, 0.49f, 2f, -10000, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.110f, 0.040f, 2.109f, 0.520f, -5f, 5000f, 139.5f, 0f, 0x40);
+ public static EaxReverb MoodMemory = new EaxReverb(26, 8f, 0.850f, -1000, -400, -900, 4.06f, 0.82f, 0.56f, -2800, 0f, 0f, 0f, 0f, 100, 0f, 0f, 0f, 0f, 0.250f, 0f, 0.474f, 0.450f, -10f, 5000f, 250f, 0f, 0x0);
+
+ // DRIVING SIMULATION PRESETS
+
+ public static EaxReverb DrivingCommentator = new EaxReverb(26, 3f, 0f, 1000, -500, -600, 2.42f, 0.88f, 0.68f, -1400, 0.093f, 0f, 0f, 0f, -1200, 0.017f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -10f, 5000f, 250f, 0f, 0x20);
+ public static EaxReverb DrivingPitgarage = new EaxReverb(26, 1.9f, 0.590f, -1000, -300, -500, 1.72f, 0.93f, 0.87f, -500, 0f, 0f, 0f, 0f, 200, 0.016f, 0f, 0f, 0f, 0.250f, 0.110f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0);
+ public static EaxReverb DrivingIncarRacer = new EaxReverb(26, 1.1f, 0.800f, -1000, 0, -200, 0.17f, 2f, 0.41f, 500, 0.007f, 0f, 0f, 0f, -300, 0.015f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10268.2f, 251f, 0f, 0x20);
+ public static EaxReverb DrivingIncarSports = new EaxReverb(26, 1.1f, 0.800f, -1000, -400, 0, 0.17f, 0.75f, 0.41f, 0, 0.010f, 0f, 0f, 0f, -500, 0f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10268.2f, 251f, 0f, 0x20);
+ public static EaxReverb DrivingIncarLuxury = new EaxReverb(26, 1.6f, 1f, -1000, -2000, -600, 0.13f, 0.41f, 0.46f, -200, 0.010f, 0f, 0f, 0f, 400, 0.010f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10268.2f, 251f, 0f, 0x20);
+ public static EaxReverb DrivingFullgrandstand = new EaxReverb(26, 8.3f, 1f, -1000, -1100, -400, 3.01f, 1.37f, 1.28f, -900, 0.090f, 0f, 0f, 0f, -1500, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10420.2f, 250f, 0f, 0x1f);
+ public static EaxReverb DrivingEmptygrandstand = new EaxReverb(26, 8.3f, 1f, -1000, 0, -200, 4.62f, 1.75f, 1.40f, -1363, 0.090f, 0f, 0f, 0f, -1200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10420.2f, 250f, 0f, 0x1f);
+ public static EaxReverb DrivingTunnel = new EaxReverb(26, 3.1f, 0.810f, -1000, -800, -100, 3.42f, 0.94f, 1.31f, -300, 0.051f, 0f, 0f, 0f, -300, 0.047f, 0f, 0f, 0f, 0.214f, 0.050f, 0.250f, 0f, -5f, 5000f, 155.3f, 0f, 0x20);
+
+ // CITY PRESETS
+
+ public static EaxReverb CityStreets = new EaxReverb(26, 3f, 0.780f, -1000, -300, -100, 1.79f, 1.12f, 0.91f, -1100, 0.046f, 0f, 0f, 0f, -1400, 0.028f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20);
+ public static EaxReverb CitySubway = new EaxReverb(26, 3f, 0.740f, -1000, -300, -100, 3.01f, 1.23f, 0.91f, -300, 0.046f, 0f, 0f, 0f, 200, 0.028f, 0f, 0f, 0f, 0.125f, 0.210f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20);
+ public static EaxReverb CityMuseum = new EaxReverb(26, 80.3f, 0.820f, -1000, -1500, -1500, 3.28f, 1.40f, 0.57f, -1200, 0.039f, 0f, 0f, -0f, -100, 0.034f, 0f, 0f, 0f, 0.130f, 0.170f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0);
+ public static EaxReverb CityLibrary = new EaxReverb(26, 80.3f, 0.820f, -1000, -1100, -2100, 2.76f, 0.89f, 0.41f, -900, 0.029f, 0f, 0f, -0f, -100, 0.020f, 0f, 0f, 0f, 0.130f, 0.170f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0);
+ public static EaxReverb CityUnderpass = new EaxReverb(26, 3f, 0.820f, -1000, -700, -100, 3.57f, 1.12f, 0.91f, -800, 0.059f, 0f, 0f, 0f, -100, 0.037f, 0f, 0f, 0f, 0.250f, 0.140f, 0.250f, 0f, -7f, 5000f, 250f, 0f, 0x20);
+ public static EaxReverb CityAbandoned = new EaxReverb(26, 3f, 0.690f, -1000, -200, -100, 3.28f, 1.17f, 0.91f, -700, 0.044f, 0f, 0f, 0f, -1100, 0.024f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -3f, 5000f, 250f, 0f, 0x20);
+
+ // MISC ROOMS
+
+ public static EaxReverb Generic = new EaxReverb(0, 7.5f, 1f, -1000, -100, 0, 1.49f, 0.83f, 1f, -2602, 0.007f, 0f, 0f, 0f, 200, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Paddedcell = new EaxReverb(1, 1.4f, 1f, -1000, -6000, 0, 0.17f, 0.10f, 1f, -1204, 0.001f, 0f, 0f, 0f, 207, 0.002f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Room = new EaxReverb(2, 1.9f, 1f, -1000, -454, 0, 0.40f, 0.83f, 1f, -1646, 0.002f, 0f, 0f, 0f, 53, 0.003f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Bathroom = new EaxReverb(3, 1.4f, 1f, -1000, -1200, 0, 1.49f, 0.54f, 1f, -370, 0.007f, 0f, 0f, 0f, 1030, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Livingroom = new EaxReverb(4, 2.5f, 1f, -1000, -6000, 0, 0.50f, 0.10f, 1f, -1376, 0.003f, 0f, 0f, 0f, -1104, 0.004f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Stoneroom = new EaxReverb(5, 11.6f, 1f, -1000, -300, 0, 2.31f, 0.64f, 1f, -711, 0.012f, 0f, 0f, 0f, 83, 0.017f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Auditorium = new EaxReverb(6, 21.6f, 1f, -1000, -476, 0, 4.32f, 0.59f, 1f, -789, 0.020f, 0f, 0f, 0f, -289, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Concerthall = new EaxReverb(7, 19.6f, 1f, -1000, -500, 0, 3.92f, 0.70f, 1f, -1230, 0.020f, 0f, 0f, 0f, -02, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Cave = new EaxReverb(8, 14.6f, 1f, -1000, 0, 0, 2.91f, 1.30f, 1f, -602, 0.015f, 0f, 0f, 0f, -302, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f);
+ public static EaxReverb Arena = new EaxReverb(9, 36.2f, 1f, -1000, -698, 0, 7.24f, 0.33f, 1f, -1166, 0.020f, 0f, 0f, 0f, 16, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Hangar = new EaxReverb(10, 50.3f, 1f, -1000, -1000, 0, 10.05f, 0.23f, 1f, -602, 0.020f, 0f, 0f, 0f, 198, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Carpettedhallway = new EaxReverb(11, 1.9f, 1f, -1000, -4000, 0, 0.30f, 0.10f, 1f, -1831, 0.002f, 0f, 0f, 0f, -1630, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Hallway = new EaxReverb(12, 1.8f, 1f, -1000, -300, 0, 1.49f, 0.59f, 1f, -1219, 0.007f, 0f, 0f, 0f, 441, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Stonecorridor = new EaxReverb(13, 13.5f, 1f, -1000, -237, 0, 2.70f, 0.79f, 1f, -1214, 0.013f, 0f, 0f, 0f, 395, 0.020f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Alley = new EaxReverb(14, 7.5f, 0.300f, -1000, -270, 0, 1.49f, 0.86f, 1f, -1204, 0.007f, 0f, 0f, 0f, -4, 0.011f, 0f, 0f, 0f, 0.125f, 0.950f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Forest = new EaxReverb(15, 38f, 0.300f, -1000, -3300, 0, 1.49f, 0.54f, 1f, -2560, 0.162f, 0f, 0f, 0f, -229, 0.088f, 0f, 0f, 0f, 0.125f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb City = new EaxReverb(16, 7.5f, 0.500f, -1000, -800, 0, 1.49f, 0.67f, 1f, -2273, 0.007f, 0f, 0f, 0f, -1691, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Mountains = new EaxReverb(17, 100f, 0.270f, -1000, -2500, 0, 1.49f, 0.21f, 1f, -2780, 0.300f, 0f, 0f, 0f, -1434, 0.100f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f);
+ public static EaxReverb Quarry = new EaxReverb(18, 17.5f, 1f, -1000, -1000, 0, 1.49f, 0.83f, 1f, -10000, 0.061f, 0f, 0f, 0f, 500, 0.025f, 0f, 0f, 0f, 0.125f, 0.700f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Plain = new EaxReverb(19, 42.5f, 0.210f, -1000, -2000, 0, 1.49f, 0.50f, 1f, -2466, 0.179f, 0f, 0f, 0f, -1926, 0.100f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Parkinglot = new EaxReverb(20, 8.3f, 1f, -1000, 0, 0, 1.65f, 1.50f, 1f, -1363, 0.008f, 0f, 0f, 0f, -1153, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f);
+ public static EaxReverb Sewerpipe = new EaxReverb(21, 1.7f, 0.800f, -1000, -1000, 0, 2.81f, 0.14f, 1f, 429, 0.014f, 0f, 0f, 0f, 1023, 0.021f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Underwater = new EaxReverb(22, 1.8f, 1f, -1000, -4000, 0, 1.49f, 0.10f, 1f, -449, 0.007f, 0f, 0f, 0f, 1700, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 1.180f, 0.348f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Drugged = new EaxReverb(23, 1.9f, 0.500f, -1000, 0, 0, 8.39f, 1.39f, 1f, -115, 0.002f, 0f, 0f, 0f, 985, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 1f, -5f, 5000f, 250f, 0f, 0x1f);
+ public static EaxReverb Dizzy = new EaxReverb(24, 1.8f, 0.600f, -1000, -400, 0, 17.23f, 0.56f, 1f, -1713, 0.020f, 0f, 0f, 0f, -613, 0.030f, 0f, 0f, 0f, 0.250f, 1f, 0.810f, 0.310f, -5f, 5000f, 250f, 0f, 0x1f);
+ public static EaxReverb Psychotic = new EaxReverb(25, 1f, 0.500f, -1000, -151, 0, 7.56f, 0.91f, 1f, -626, 0.020f, 0f, 0f, 0f, 774, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 4f, 1f, -5f, 5000f, 250f, 0f, 0x1f);
+ public static EaxReverb Dustyroom = new EaxReverb(26, 1.8f, 0.560f, -1000, -200, -300, 1.79f, 0.38f, 0.21f, -600, 0.002f, 0f, 0f, 0f, 200, 0.006f, 0f, 0f, 0f, 0.202f, 0.050f, 0.250f, 0f, -10f, 13046f, 163.3f, 0f, 0x20);
+ public static EaxReverb Chapel = new EaxReverb(26, 19.6f, 0.840f, -1000, -500, 0, 4.62f, 0.64f, 1.23f, -700, 0.032f, 0f, 0f, 0f, -200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0.110f, -5f, 5000f, 250f, 0f, 0x3f);
+ public static EaxReverb Smallwaterroom = new EaxReverb(26, 36.2f, 0.700f, -1000, -698, 0, 1.51f, 1.25f, 1.14f, -100, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -7f, 5000f, 250f, 0f, 0x0);
+ }
+
+#pragma warning restore 1591
+ }
+}
diff --git a/Source/Compatibility/Audio/OpenAL/AL/XRamExtension.cs b/Source/Compatibility/Audio/OpenAL/AL/XRamExtension.cs
new file mode 100644
index 00000000..d32208c7
--- /dev/null
+++ b/Source/Compatibility/Audio/OpenAL/AL/XRamExtension.cs
@@ -0,0 +1,193 @@
+#region --- OpenTK.OpenAL License ---
+/* XRamExtension.cs
+ * C header: \OpenAL 1.1 SDK\include\xram.h
+ * Spec: ?
+ * Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
+ * See license.txt for license details (MIT)
+ * http://www.OpenTK.net */
+#endregion
+
+using System;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+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)]
+ public sealed class XRamExtension
+ {
+ #region Instance state
+
+ private bool _valid = false;
+
+ /// Returns True if the X-Ram Extension has been found and could be initialized.
+ public bool IsInitialized
+ {
+ get { return _valid; }
+ }
+
+ #endregion Instance state
+
+ #region X-RAM Function pointer definitions
+
+ // [CLSCompliant(false)]
+ 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);
+ //typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value);
+
+ //[CLSCompliant(false)]
+ private Delegate_SetBufferMode Imported_SetBufferMode;
+ //[CLSCompliant(false)]
+ private Delegate_GetBufferMode Imported_GetBufferMode;
+
+ #endregion X-RAM Function pointer definitions
+
+ #region X-RAM Tokens
+
+ private int AL_EAX_RAM_SIZE, AL_EAX_RAM_FREE,
+ AL_STORAGE_AUTOMATIC, AL_STORAGE_HARDWARE, AL_STORAGE_ACCESSIBLE;
+
+ #endregion X-RAM Tokens
+
+ #region Constructor / Extension Loading
+
+ public XRamExtension()
+ { // Query if Extension supported and retrieve Tokens/Pointers if it is.
+ _valid = 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");
+
+ // 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 ||
+ AL_EAX_RAM_FREE == 0 ||
+ AL_STORAGE_AUTOMATIC == 0 ||
+ AL_STORAGE_HARDWARE == 0 ||
+ AL_STORAGE_ACCESSIBLE == 0)
+ {
+ Debug.WriteLine("X-Ram: Token values could not be retrieved.");
+ return;
+ }
+
+ // Console.WriteLine("Free Ram: {0} / {1}",GetRamFree( ),GetRamSize( ));
+
+ 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)
+ {
+ Debug.WriteLine("X-Ram: Attempt to marshal function pointers with AL.GetProcAddress failed. " + e.ToString());
+ return;
+ }
+
+ _valid = true;
+ }
+
+ #endregion Constructor / Extension Loading
+
+ #region Public Methods
+
+ /// Query total amount of X-RAM in bytes.
+ public int GetRamSize
+ {
+ get
+ {
+ return AL.Get((ALGetInteger)AL_EAX_RAM_SIZE);
+ }
+ }
+
+ /// Query free X-RAM available in bytes.
+ public int GetRamFree
+ {
+ get
+ {
+ 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!
+ public enum XRamStorage : byte
+ {
+ /// Put an Open AL Buffer into X-RAM if memory is available, otherwise use host RAM. This is the default mode.
+ Automatic = 0,
+ /// Force an Open AL Buffer into X-RAM, good for non-streaming buffers.
+ Hardware = 1,
+ /// Force an Open AL Buffer into 'accessible' (currently host) RAM, good for streaming buffers.
+ Accessible = 2,
+ }
+
+ /// This function is used to set the storage Mode of an array of OpenAL Buffers.
+ /// The number of OpenAL Buffers pointed to by buffer.
+ /// 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)
+ {
+ 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);
+ }
+ }
+
+ /// This function is used to set the storage Mode of an array of OpenAL Buffers.
+ /// The number of OpenAL Buffers pointed to by buffer.
+ /// 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)
+ {
+ 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)
+ {
+ int tempresult = Imported_GetBufferMode(buffer, IntPtr.Zero); // IntPtr.Zero due to the parameter being unused/reserved atm
+
+ if (tempresult == AL_STORAGE_ACCESSIBLE)
+ return XRamStorage.Accessible;
+ if (tempresult == AL_STORAGE_HARDWARE)
+ return XRamStorage.Hardware;
+ // default:
+ return XRamStorage.Automatic;
+ }
+
+ /// 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)
+ {
+ uint temp = (uint)buffer;
+ return GetBufferMode(ref temp);
+ }
+
+ #endregion Public Methods
+ }
+
+}
+
diff --git a/Source/Compatibility/Audio/OpenAL/Alc/Alc.cs b/Source/Compatibility/Audio/OpenAL/Alc/Alc.cs
new file mode 100644
index 00000000..a772450c
--- /dev/null
+++ b/Source/Compatibility/Audio/OpenAL/Alc/Alc.cs
@@ -0,0 +1,406 @@
+#region --- OpenTK.OpenAL License ---
+/* AlcFunctions.cs
+ * C header: \OpenAL 1.1 SDK\include\Alc.h
+ * Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
+ * Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
+ * See license.txt for license details
+ * http://www.OpenTK.net */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Security;
+
+/* Type Mapping
+// 8-bit boolean
+typedef char ALCboolean;
+ * byte
+// character
+typedef char ALCchar;
+ * byte
+// signed 8-bit 2's complement integer
+typedef char ALCbyte;
+ * byte
+
+// unsigned 8-bit integer
+typedef unsigned char ALCubyte;
+ * ubyte
+
+// signed 16-bit 2's complement integer
+typedef short ALCshort;
+ * short
+
+// unsigned 16-bit integer
+typedef unsigned short ALCushort;
+ * ushort
+
+// unsigned 32-bit integer
+typedef unsigned int ALCuint;
+ * uint
+
+// signed 32-bit 2's complement integer
+typedef int ALCint;
+ * int
+// non-negative 32-bit binary integer size
+typedef int ALCsizei;
+ * int
+// enumerated 32-bit value
+typedef int ALCenum;
+ * int
+
+// 32-bit IEEE754 floating-point
+typedef float ALCfloat;
+ * float
+
+// 64-bit IEEE754 floating-point
+typedef double ALCdouble;
+ * double
+
+// void type (for opaque pointers only)
+typedef void ALCvoid;
+ * void
+
+ * ALCdevice
+ * ALCcontext *context
+ * IntPtr
+*/
+
+namespace OpenTK.Audio
+{
+
+ /// Alc = Audio Library Context
+ public static class Alc
+ {
+ #region Constants
+
+ private const string Lib = AL.Lib;
+ private const CallingConvention Style = CallingConvention.Cdecl;
+
+ #endregion Constants
+
+ #region Context Management
+
+ #region CreateContext
+
+ /// This function creates a context using a specified device.
+ /// a pointer to a device
+ /// a pointer to a set of attributes: ALC_FREQUENCY, ALC_MONO_SOURCES, ALC_REFRESH, ALC_STEREO_SOURCES, ALC_SYNC
+ /// Returns a pointer to the new context (NULL on failure). The attribute list can be NULL, or a zero terminated list of integer pairs composed of valid ALC attribute tokens and requested values.
+ [DllImport(Alc.Lib, EntryPoint = "alcCreateContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity]
+ [CLSCompliant(false)]
+ unsafe public static extern ContextHandle CreateContext([In] IntPtr device, [In] int* attrlist);
+ // ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
+
+ /// This function creates a context using a specified device.
+ /// a pointer to a device
+ /// an array of a set of attributes: ALC_FREQUENCY, ALC_MONO_SOURCES, ALC_REFRESH, ALC_STEREO_SOURCES, ALC_SYNC
+ /// Returns a pointer to the new context (NULL on failure).
+ /// The attribute list can be NULL, or a zero terminated list of integer pairs composed of valid ALC attribute tokens and requested values.
+ public static ContextHandle CreateContext(IntPtr device, int[] attriblist)
+ {
+ unsafe
+ {
+ fixed (int* attriblist_ptr = attriblist)
+ {
+ return CreateContext(device, attriblist_ptr);
+ }
+ }
+ }
+
+ #endregion
+
+ /// This function makes a specified context the current context.
+ /// A pointer to the new context.
+ /// Returns True on success, or False on failure.
+ [DllImport(Alc.Lib, EntryPoint = "alcMakeContextCurrent", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern bool MakeContextCurrent([In] ContextHandle context);
+ // ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
+
+ /// 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.
+ /// a pointer to the new context
+ [DllImport(Alc.Lib, EntryPoint = "alcProcessContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void ProcessContext([In] ContextHandle context);
+ // ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context );
+
+ /// 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.
+ /// a pointer to the context to be suspended.
+ [DllImport(Alc.Lib, EntryPoint = "alcSuspendContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void SuspendContext([In] ContextHandle context);
+ // ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context );
+
+ /// This function destroys a context.
+ /// a pointer to the new context.
+ [DllImport(Alc.Lib, EntryPoint = "alcDestroyContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void DestroyContext([In] ContextHandle context);
+ // ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context );
+
+ /// This function retrieves the current context.
+ /// Returns a pointer to the current context.
+ [DllImport(Alc.Lib, EntryPoint = "alcGetCurrentContext", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern ContextHandle GetCurrentContext();
+ // ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void );
+
+ /// This function retrieves a context's device pointer.
+ /// a pointer to a context.
+ /// Returns a pointer to the specified context's device.
+ [DllImport(Alc.Lib, EntryPoint = "alcGetContextsDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern IntPtr GetContextsDevice([In] ContextHandle context);
+ // ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
+
+ #endregion Context Management
+
+ #region Device Management
+
+ /// This function opens a device by name.
+ /// a null-terminated string describing a device.
+ /// Returns a pointer to the opened device. The return value will be NULL if there is an error.
+ [DllImport(Alc.Lib, EntryPoint = "alcOpenDevice", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ public static extern IntPtr OpenDevice([In] string devicename);
+ // ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
+
+ /// This function closes a device by name.
+ /// a pointer to an opened device
+ /// True will be returned on success or False on failure. Closing a device will fail if the device contains any contexts or buffers.
+ [DllImport(Alc.Lib, EntryPoint = "alcCloseDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern bool CloseDevice([In] IntPtr device);
+ // ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
+
+ #endregion Device Management
+
+ #region Error support.
+
+ /// This function retrieves the current context error state.
+ /// a pointer to the device to retrieve the error state from
+ /// Errorcode Int32.
+ [DllImport(Alc.Lib, EntryPoint = "alcGetError", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern AlcError GetError([In] IntPtr device);
+ // ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device );
+
+ #endregion Error support.
+
+ #region Extension support.
+
+ /// This function queries if a specified context extension is available.
+ /// a pointer to the device to be queried for an extension.
+ /// a null-terminated string describing the extension.
+ /// Returns True if the extension is available, False if the extension is not available.
+ [DllImport(Alc.Lib, EntryPoint = "alcIsExtensionPresent", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ public static extern bool IsExtensionPresent([In] IntPtr device, [In] string extname);
+ // ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
+
+ /// This function retrieves the address of a specified context extension function.
+ /// a pointer to the device to be queried for the function.
+ /// a null-terminated string describing the function.
+ /// Returns the address of the function, or NULL if it is not found.
+ [DllImport(Alc.Lib, EntryPoint = "alcGetProcAddress", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ public static extern IntPtr GetProcAddress([In] IntPtr device, [In] string funcname);
+ // ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
+
+ /// This function retrieves the enum value for a specified enumeration name.
+ /// a pointer to the device to be queried.
+ /// a null terminated string describing the enum value.
+ /// Returns the enum value described by the enumName string. This is most often used for querying an enum value for an ALC extension.
+ [DllImport(Alc.Lib, EntryPoint = "alcGetEnumValue", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ public static extern int GetEnumValue([In] IntPtr device, [In] string enumname);
+ // ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
+
+ #endregion Extension support.
+
+ #region Query functions
+
+ [DllImport(Alc.Lib, EntryPoint = "alcGetString", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ private static extern IntPtr GetStringPrivate([In] IntPtr device, AlcGetString param);
+ // ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
+
+ /// This function returns pointers to strings related to the context.
+ ///
+ /// ALC_DEFAULT_DEVICE_SPECIFIER will return the name of the default output device.
+ /// ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER will return the name of the default capture device.
+ /// ALC_DEVICE_SPECIFIER will return the name of the specified output device if a pointer is supplied, or will return a list of all available devices if a NULL device pointer is supplied. A list is a pointer to a series of strings separated by NULL characters, with the list terminated by two NULL characters. See Enumeration Extension for more details.
+ /// ALC_CAPTURE_DEVICE_SPECIFIER will return the name of the specified capture device if a pointer is supplied, or will return a list of all available devices if a NULL device pointer is supplied.
+ /// ALC_EXTENSIONS returns a list of available context extensions, with each extension separated by a space and the list terminated by a NULL character.
+ ///
+ /// a pointer to the device to be queried.
+ /// an attribute to be retrieved: ALC_DEFAULT_DEVICE_SPECIFIER, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER, ALC_DEVICE_SPECIFIER, ALC_CAPTURE_DEVICE_SPECIFIER, ALC_EXTENSIONS
+ /// A string containing the name of the Device.
+ public static string GetString(IntPtr device, AlcGetString param)
+ {
+ return Marshal.PtrToStringAnsi(GetStringPrivate(device, param));
+ }
+
+ /// This function returns a List of strings related to the context.
+ ///
+ /// ALC_DEVICE_SPECIFIER will return the name of the specified output device if a pointer is supplied, or will return a list of all available devices if a NULL device pointer is supplied. A list is a pointer to a series of strings separated by NULL characters, with the list terminated by two NULL characters. See Enumeration Extension for more details.
+ /// ALC_CAPTURE_DEVICE_SPECIFIER will return the name of the specified capture device if a pointer is supplied, or will return a list of all available devices if a NULL device pointer is supplied.
+ /// ALC_EXTENSIONS returns a list of available context extensions, with each extension separated by a space and the list terminated by a NULL character.
+ ///
+ /// a pointer to the device to be queried.
+ /// an attribute to be retrieved: ALC_DEVICE_SPECIFIER, ALC_CAPTURE_DEVICE_SPECIFIER, ALC_ALL_DEVICES_SPECIFIER
+ /// A List of strings containing the names of the Devices.
+ public static IList GetString(IntPtr device, AlcGetStringList param)
+ {
+ List result = new List();
+ IntPtr t = GetStringPrivate(IntPtr.Zero, (AlcGetString)param);
+ System.Text.StringBuilder sb = new System.Text.StringBuilder();
+ byte b;
+ int offset = 0;
+ do
+ {
+ b = Marshal.ReadByte(t, offset++);
+ if (b != 0)
+ sb.Append((char)b);
+ if (b == 0)
+ {
+ result.Add(sb.ToString());
+ if (Marshal.ReadByte(t, offset) == 0) // offset already properly increased through ++
+ break; // 2x null
+ else
+ sb.Remove(0, sb.Length); // 1x null
+ }
+ } while (true);
+
+ return (IList)result;
+ }
+
+ [DllImport(Alc.Lib, EntryPoint = "alcGetIntegerv", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ unsafe static extern void GetInteger(IntPtr device, AlcGetInteger param, int size, int* data);
+ // ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *buffer );
+
+ /// This function returns integers related to the context.
+ /// a pointer to the device to be queried.
+ /// an attribute to be retrieved: ALC_MAJOR_VERSION, ALC_MINOR_VERSION, ALC_ATTRIBUTES_SIZE, ALC_ALL_ATTRIBUTES
+ /// the size of the destination buffer provided, in number of integers.
+ /// a pointer to the buffer to be returned
+ public static void GetInteger(IntPtr device, AlcGetInteger param, int size, out int data)
+ {
+ unsafe
+ {
+ fixed (int* data_ptr = &data)
+ {
+ GetInteger(device, param, size, data_ptr);
+ }
+ }
+ }
+
+ /// This function returns integers related to the context.
+ /// a pointer to the device to be queried.
+ /// an attribute to be retrieved: ALC_MAJOR_VERSION, ALC_MINOR_VERSION, ALC_ATTRIBUTES_SIZE, ALC_ALL_ATTRIBUTES
+ /// the size of the destination buffer provided, in number of integers.
+ /// a pointer to the buffer to be returned
+ public static void GetInteger(IntPtr device, AlcGetInteger param, int size, int[] data)
+ {
+ unsafe
+ {
+ fixed (int* data_ptr = data)
+ {
+ GetInteger(device, param, size, data_ptr);
+ }
+ }
+ }
+
+ #endregion Query functions
+
+ #region Capture functions
+
+ /// This function opens a capture device by name.
+ /// a pointer to a device name string.
+ /// the frequency that the buffer should be captured at.
+ /// the requested capture buffer format.
+ /// the size of the capture buffer in samples, not bytes.
+ /// Returns the capture device pointer, or NULL on failure.
+ [CLSCompliant(false), DllImport(Alc.Lib, EntryPoint = "alcCaptureOpenDevice", ExactSpelling = true, CallingConvention = Alc.Style, CharSet = CharSet.Ansi), SuppressUnmanagedCodeSecurity()]
+ public static extern IntPtr CaptureOpenDevice(string devicename, uint frequency, ALFormat format, int buffersize);
+
+ /// This function opens a capture device by name.
+ /// a pointer to a device name string.
+ /// the frequency that the buffer should be captured at.
+ /// the requested capture buffer format.
+ /// the size of the capture buffer in samples, not bytes.
+ /// Returns the capture device pointer, or NULL on failure.
+ [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 );
+
+ /// This function closes the specified capture device.
+ /// a pointer to a capture device.
+ /// Returns True if the close operation was successful, False on failure.
+ [DllImport(Alc.Lib, EntryPoint = "alcCaptureCloseDevice", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern bool CaptureCloseDevice([In] IntPtr device);
+ // ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
+
+ /// This function begins a capture operation.
+ /// 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.
+ /// a pointer to a capture device.
+ [DllImport(Alc.Lib, EntryPoint = "alcCaptureStart", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void CaptureStart([In] IntPtr device);
+ // ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device );
+
+ /// This function stops a capture operation.
+ /// a pointer to a capture device.
+ [DllImport(Alc.Lib, EntryPoint = "alcCaptureStop", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void CaptureStop([In] IntPtr device);
+ // ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device );
+
+ /// This function completes a capture operation, and does not block.
+ /// a pointer to a capture device.
+ /// a pointer to a buffer, which must be large enough to accommodate the number of samples.
+ /// the number of samples to be retrieved.
+ [DllImport(Alc.Lib, EntryPoint = "alcCaptureSamples", ExactSpelling = true, CallingConvention = Alc.Style), SuppressUnmanagedCodeSecurity()]
+ public static extern void CaptureSamples(IntPtr device, IntPtr buffer, int samples);
+ // ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
+
+ /// This function completes a capture operation, and does not block.
+ /// a pointer to a capture device.
+ /// a reference to a buffer, which must be large enough to accommodate the number of samples.
+ /// the number of samples to be retrieved.
+ public static void CaptureSamples(IntPtr device, ref T buffer, int samples)
+ where T : struct
+ {
+ GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
+ try
+ {
+ CaptureSamples(device, handle.AddrOfPinnedObject(), samples);
+ }
+ finally
+ {
+ handle.Free();
+ }
+ }
+
+ /// This function completes a capture operation, and does not block.
+ /// a pointer to a capture device.
+ /// a buffer, which must be large enough to accommodate the number of samples.
+ /// the number of samples to be retrieved.
+ public static void CaptureSamples(IntPtr device, T[] buffer, int samples)
+ where T : struct
+ {
+ CaptureSamples(device, ref buffer[0], samples);
+ }
+
+ /// This function completes a capture operation, and does not block.
+ /// a pointer to a capture device.
+ /// a buffer, which must be large enough to accommodate the number of samples.
+ /// the number of samples to be retrieved.
+ public static void CaptureSamples(IntPtr device, T[,] buffer, int samples)
+ where T : struct
+ {
+ CaptureSamples(device, ref buffer[0, 0], samples);
+ }
+
+ /// This function completes a capture operation, and does not block.
+ /// a pointer to a capture device.
+ /// a buffer, which must be large enough to accommodate the number of samples.
+ /// the number of samples to be retrieved.
+ public static void CaptureSamples(IntPtr device, T[,,] buffer, int samples)
+ where T : struct
+ {
+ CaptureSamples(device, ref buffer[0, 0, 0], samples);
+ }
+
+ #endregion Capture functions
+
+ }
+
+}
\ No newline at end of file
diff --git a/Source/Compatibility/Audio/OpenAL/Alc/AlcEnums.cs b/Source/Compatibility/Audio/OpenAL/Alc/AlcEnums.cs
new file mode 100644
index 00000000..9c1dba7c
--- /dev/null
+++ b/Source/Compatibility/Audio/OpenAL/Alc/AlcEnums.cs
@@ -0,0 +1,135 @@
+#region --- OpenTK.OpenAL License ---
+/* AlcTokens.cs
+ * C header: \OpenAL 1.1 SDK\include\Alc.h
+ * Spec: http://www.openal.org/openal_webstf/specs/OpenAL11Specification.pdf
+ * Copyright (c) 2008 Christoph Brandtner and Stefanos Apostolopoulos
+ * See license.txt for license details
+ * http://www.OpenTK.net */
+#endregion
+
+using System;
+
+namespace OpenTK.Audio
+{
+ ///
+ /// Defines available context attributes.
+ ///
+ public enum AlcContextAttributes : int
+ {
+ ///Followed by System.Int32 Hz
+ Frequency = 0x1007,
+
+ ///Followed by System.Int32 Hz
+ Refresh = 0x1008,
+
+ ///Followed by AlBoolean.True, or AlBoolean.False
+ Sync = 0x1009,
+
+ ///Followed by System.Int32 Num of requested Mono (3D) Sources
+ MonoSources = 0x1010,
+
+ ///Followed by System.Int32 Num of requested Stereo Sources
+ StereoSources = 0x1011,
+
+ /// (EFX Extension) This Context property can be passed to OpenAL during Context creation (alcCreateContext) to request a maximum number of Auxiliary Sends desired on each Source. It is not guaranteed that the desired number of sends will be available, so an application should query this property after creating the context using alcGetIntergerv. Default: 2
+ EfxMaxAuxiliarySends = 0x20003,
+ }
+
+ ///
+ /// Defines OpenAL context errors.
+ ///
+ public enum AlcError : int
+ {
+ ///There is no current error.
+ NoError = 0,
+
+ ///No Device. The device handle or specifier names an inaccessible driver/server.
+ InvalidDevice = 0xA001,
+
+ ///Invalid context ID. The Context argument does not name a valid context.
+ InvalidContext = 0xA002,
+
+ ///Bad enum. A token used is not valid, or not applicable.
+ InvalidEnum = 0xA003,
+
+ ///Bad value. A value (e.g. Attribute) is not valid, or not applicable.
+ InvalidValue = 0xA004,
+
+ ///Out of memory. Unable to allocate memory.
+ OutOfMemory = 0xA005,
+ }
+
+ ///
+ /// Defines available parameters for .
+ ///
+ public enum AlcGetString : int
+ {
+ ///The specifier string for the default device.
+ DefaultDeviceSpecifier = 0x1004,
+
+ ///A list of available context extensions separated by spaces.
+ Extensions = 0x1006,
+
+ ///The name of the default capture device
+ CaptureDefaultDeviceSpecifier = 0x311, // ALC_EXT_CAPTURE extension.
+
+ /// a list of the default devices.
+ DefaultAllDevicesSpecifier = 0x1012,
+
+ // duplicates from AlcGetStringList:
+
+ ///Will only return the first Device, not a list. Use AlcGetStringList.CaptureDeviceSpecifier. ALC_EXT_CAPTURE_EXT
+ CaptureDeviceSpecifier = 0x310,
+
+ ///Will only return the first Device, not a list. Use AlcGetStringList.DeviceSpecifier
+ DeviceSpecifier = 0x1005,
+
+ /// Will only return the first Device, not a list. Use AlcGetStringList.AllDevicesSpecifier
+ AllDevicesSpecifier = 0x1013,
+ }
+
+ ///
+ /// Defines available parameters for .
+ ///
+ public enum AlcGetStringList : int
+ {
+ ///The name of the specified capture device, or a list of all available capture devices if no capture device is specified. ALC_EXT_CAPTURE_EXT
+ CaptureDeviceSpecifier = 0x310,
+
+ ///The specifier strings for all available devices. ALC_ENUMERATION_EXT
+ DeviceSpecifier = 0x1005,
+
+ /// The specifier strings for all available devices. ALC_ENUMERATE_ALL_EXT
+ AllDevicesSpecifier = 0x1013,
+ }
+
+ ///
+ /// Defines available parameters for .
+ ///
+ public enum AlcGetInteger : int
+ {
+ ///The specification revision for this implementation (major version). NULL is an acceptable device.
+ MajorVersion = 0x1000,
+
+ ///The specification revision for this implementation (minor version). NULL is an acceptable device.
+ MinorVersion = 0x1001,
+
+ ///The size (number of ALCint values) required for a zero-terminated attributes list, for the current context. NULL is an invalid device.
+ AttributesSize = 0x1002,
+
+ ///Expects a destination of ALC_ATTRIBUTES_SIZE, and provides an attribute list for the current context of the specified device. NULL is an invalid device.
+ AllAttributes = 0x1003,
+
+ ///The number of capture samples available. NULL is an invalid device.
+ CaptureSamples = 0x312,
+
+ /// (EFX Extension) This property can be used by the application to retrieve the Major version number of the Effects Extension supported by this OpenAL implementation. As this is a Context property is should be retrieved using alcGetIntegerv.
+ EfxMajorVersion = 0x20001,
+
+ /// (EFX Extension) This property can be used by the application to retrieve the Minor version number of the Effects Extension supported by this OpenAL implementation. As this is a Context property is should be retrieved using alcGetIntegerv.
+ EfxMinorVersion = 0x20002,
+
+ /// (EFX Extension) This Context property can be passed to OpenAL during Context creation (alcCreateContext) to request a maximum number of Auxiliary Sends desired on each Source. It is not guaranteed that the desired number of sends will be available, so an application should query this property after creating the context using alcGetIntergerv. Default: 2
+ EfxMaxAuxiliarySends = 0x20003,
+ }
+}
diff --git a/Source/OpenTK/Audio/OpenAL/Alut/Alut.cs b/Source/Compatibility/Audio/OpenAL/Alut/Alut.cs
similarity index 100%
rename from Source/OpenTK/Audio/OpenAL/Alut/Alut.cs
rename to Source/Compatibility/Audio/OpenAL/Alut/Alut.cs
diff --git a/Source/OpenTK/Audio/OpenAL/Alut/AlutEnums.cs b/Source/Compatibility/Audio/OpenAL/Alut/AlutEnums.cs
similarity index 100%
rename from Source/OpenTK/Audio/OpenAL/Alut/AlutEnums.cs
rename to Source/Compatibility/Audio/OpenAL/Alut/AlutEnums.cs
diff --git a/Source/Compatibility/Audio/Sound.cs b/Source/Compatibility/Audio/Sound.cs
new file mode 100644
index 00000000..19863266
--- /dev/null
+++ b/Source/Compatibility/Audio/Sound.cs
@@ -0,0 +1,87 @@
+#region --- License ---
+/* Licensed under the MIT/X11 license.
+ * Copyright (c) 2006-2008 the OpenTK Team.
+ * This notice may not be removed from any source distribution.
+ * See license.txt for licensing details.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+
+namespace OpenTK.Audio
+{
+#if false
+ /// Defines methods to load and hold sound buffer.
+ public class Sound : IDisposable
+ {
+ bool disposed;
+ SoundReader reader;
+ SoundData data;
+
+ public Sound(Stream s)
+ {
+ if (s == null) throw new ArgumentNullException("s", "Must be a valid System.IO.Stream.");
+
+ reader = SoundReader.Create(s);
+ }
+
+ public Sound(string filename)
+ {
+ if (String.IsNullOrEmpty(filename)) throw new ArgumentNullException("s", "Must be a valid System.IO.Stream.");
+
+ reader = SoundReader.Create(filename);
+ }
+
+ #region --- Public Members ---
+
+ public SoundData ReadSamples(int count)
+ {
+ if (count <= 0) throw new ArgumentOutOfRangeException("count", "Must be larger than zero.");
+ throw new NotImplementedException();
+ }
+
+ public SoundData ReadToEnd()
+ {
+ return reader.ReadToEnd();
+ }
+
+ public SoundData SoundData { get { return data; } }
+
+ public void WriteToBuffer(int buffer, int length)
+ {
+ if (buffer == 0) throw new ArgumentOutOfRangeException("buffer", "May not be zero.");
+ }
+
+ #endregion
+
+ #region --- IDisposable Members ---
+
+ /// Disposes of the sound buffer.
+ public void Dispose()
+ {
+ this.Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ private void Dispose(bool manual)
+ {
+ if (!disposed)
+ {
+ if (manual)
+ reader.Dispose();
+ disposed = true;
+ }
+ }
+
+ ~Sound()
+ {
+ this.Dispose(false);
+ }
+
+ #endregion
+ }
+#endif
+}
diff --git a/Source/OpenTK/Audio/SoundData.cs b/Source/Compatibility/Audio/SoundData.cs
similarity index 100%
rename from Source/OpenTK/Audio/SoundData.cs
rename to Source/Compatibility/Audio/SoundData.cs
diff --git a/Source/OpenTK/Audio/SoundFormat.cs b/Source/Compatibility/Audio/SoundFormat.cs
similarity index 100%
rename from Source/OpenTK/Audio/SoundFormat.cs
rename to Source/Compatibility/Audio/SoundFormat.cs
diff --git a/Source/Compatibility/Audio/WaveReader.cs b/Source/Compatibility/Audio/WaveReader.cs
new file mode 100644
index 00000000..ac4f828a
--- /dev/null
+++ b/Source/Compatibility/Audio/WaveReader.cs
@@ -0,0 +1,266 @@
+#region --- License ---
+/* Licensed under the MIT/X11 license.
+ * Copyright (c) 2006-2008 the OpenTK Team.
+ * This notice may not be removed from any source distribution.
+ * See license.txt for licensing details.
+ */
+#endregion
+
+using System;
+using System.IO;
+
+using OpenTK.Audio;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+
+namespace OpenTK.Audio
+{
+ internal sealed class WaveReader : AudioReader
+ {
+ SoundData decoded_data;
+
+ //RIFF header
+ string signature;
+ int riff_chunck_size;
+ string format;
+
+ //WAVE header
+ string format_signature;
+ int format_chunk_size;
+ short audio_format;
+ short channels;
+ int sample_rate;
+ int byte_rate;
+ short block_align;
+ short bits_per_sample;
+
+ //DATA header
+ string data_signature;
+ int data_chunk_size;
+
+ BinaryReader reader;
+
+ internal WaveReader() { }
+
+ internal WaveReader(Stream s)
+ {
+ if (s == null) throw new ArgumentNullException();
+ if (!s.CanRead) throw new ArgumentException("Cannot read from specified Stream.");
+
+ reader = new BinaryReader(s);
+ this.Stream = s;
+ }
+
+#if false
+ ///
+ /// Writes the WaveSound's data to the specified OpenAL buffer in the correct format.
+ ///
+ ///
+ /// A
+ ///
+ public void WriteToBuffer(uint bid)
+ {
+ unsafe
+ {
+ //fix the array as a byte
+ fixed (byte* p_Data = _Data)
+ {
+ if (Channels == 1)
+ {
+ if (BitsPerSample == 16)
+ {
+ Console.Write("Uploading 16 bit mono data to OpenAL...");
+ AL.BufferData(bid, ALFormat.Mono16, (IntPtr)p_Data, _Data.Length, SampleRate);
+ }
+ else
+ {
+ if (BitsPerSample == 8)
+ {
+ Console.Write("Uploading 8 bit mono data to OpenAL...");
+ AL.BufferData(bid, ALFormat.Mono8, (IntPtr)p_Data, _Data.Length, SampleRate);
+ }
+ }
+
+ }
+ else
+ {
+ if (Channels == 2)
+ {
+ if (BitsPerSample == 16)
+ {
+ Console.Write("Uploading 16 bit stereo data to OpenAL...");
+ AL.BufferData(bid, ALFormat.Stereo16, (IntPtr)p_Data, _Data.Length, SampleRate);
+ }
+ else
+ {
+ if (BitsPerSample == 8)
+ {
+ Console.Write("Uploading 8 bit stereo data to OpenAL...");
+ AL.BufferData(bid, ALFormat.Stereo8, (IntPtr)p_Data, _Data.Length, SampleRate);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ ///
+ /// Writes all relevent information about the WaveSound to the console window.
+ ///
+ public void DumpParamsToConsole()
+ {
+ Console.WriteLine("AudioFormat:" + AudioFormat);
+ Console.WriteLine("Channels:" + Channels);
+ Console.WriteLine("SampleRate:" + SampleRate);
+ Console.WriteLine("ByteRate:" + ByteRate);
+ Console.WriteLine("BlockAlign:" + BlockAlign);
+ Console.WriteLine("BitsPerSample:" + BitsPerSample);
+ }
+
+ ///
+ /// Returns the WaveSound's raw sound data as an array of bytes.
+ ///
+ public byte[] Data
+ {
+ get
+ {
+ return _Data;
+ }
+ }
+#endif
+
+ #region --- Public Members ---
+
+ #region public override bool Supports(Stream s)
+
+ ///
+ /// Checks whether the specified stream contains valid WAVE/RIFF buffer.
+ ///
+ /// The System.IO.Stream to check.
+ /// True if the stream is a valid WAVE/RIFF file; false otherwise.
+ public override bool Supports(Stream s)
+ {
+ BinaryReader reader = new BinaryReader(s);
+ return this.ReadHeaders(reader);
+ }
+
+ #endregion
+
+ #region public override SoundData ReadSamples(int samples)
+
+ ///
+ /// Reads and decodes the specified number of samples from the sound stream.
+ ///
+ /// The number of samples to read and decode.
+ /// An OpenTK.Audio.SoundData object that contains the decoded buffer.
+ public override SoundData ReadSamples(long samples)
+ {
+ if (samples > reader.BaseStream.Length - reader.BaseStream.Position)
+ samples = reader.BaseStream.Length - reader.BaseStream.Position;
+
+ //while (samples > decoded_data.Data.Length * (bits_per_sample / 8))
+ // Array.Resize(ref decoded_data.Data, decoded_data.Data.Length * 2);
+
+ decoded_data = new SoundData(new SoundFormat(channels, bits_per_sample, sample_rate),
+ reader.ReadBytes((int)samples));
+
+ return decoded_data;
+ }
+
+ #endregion
+
+ #region public override SoundData ReadToEnd()
+
+ ///
+ /// Reads and decodes the sound stream.
+ ///
+ /// An OpenTK.Audio.SoundData object that contains the decoded buffer.
+ public override SoundData ReadToEnd()
+ {
+ try
+ {
+ //read the buffer into a byte array, even if the format is 16 bit
+ //decoded_data = new byte[data_chunk_size];
+
+ decoded_data = new SoundData(new SoundFormat(channels, bits_per_sample, sample_rate),
+ reader.ReadBytes((int)reader.BaseStream.Length));
+
+ Debug.WriteLine("decoded!");
+
+ //return new SoundData(decoded_data, new SoundFormat(channels, bits_per_sample, sample_rate));
+ return decoded_data;
+ }
+ catch (AudioReaderException)
+ {
+ reader.Close();
+ throw;
+ }
+ }
+
+ #endregion
+
+ #endregion
+
+ #region --- Protected Members ---
+
+ protected override Stream Stream
+ {
+ get { return base.Stream; }
+ set
+ {
+ base.Stream = value;
+ if (!ReadHeaders(reader))
+ throw new AudioReaderException("Invalid WAVE/RIFF file: invalid or corrupt signature.");
+
+ Debug.Write(String.Format("Opened WAVE/RIFF file: ({0}, {1}, {2}, {3}) ", sample_rate.ToString(), bits_per_sample.ToString(),
+ channels.ToString(), audio_format.ToString()));
+ }
+ }
+
+ #endregion
+
+ #region --- Private Members ---
+
+ // Tries to read the WAVE/RIFF headers, and returns true if they are valid.
+ bool ReadHeaders(BinaryReader reader)
+ {
+ // Don't explicitly call reader.Close()/.Dispose(), as that will close the inner stream.
+ // There's no such danger if the BinaryReader isn't explicitly destroyed.
+
+ // RIFF header
+ signature = new string(reader.ReadChars(4));
+ if (signature != "RIFF")
+ return false;
+
+ riff_chunck_size = reader.ReadInt32();
+
+ format = new string(reader.ReadChars(4));
+ if (format != "WAVE")
+ return false;
+
+ // WAVE header
+ format_signature = new string(reader.ReadChars(4));
+ if (format_signature != "fmt ")
+ return false;
+
+ format_chunk_size = reader.ReadInt32();
+ audio_format = reader.ReadInt16();
+ channels = reader.ReadInt16();
+ sample_rate = reader.ReadInt32();
+ byte_rate = reader.ReadInt32();
+ block_align = reader.ReadInt16();
+ bits_per_sample = reader.ReadInt16();
+
+ data_signature = new string(reader.ReadChars(4));
+ if (data_signature != "data")
+ return false;
+
+ data_chunk_size = reader.ReadInt32();
+
+ return true;
+ }
+
+ #endregion
+ }
+}
diff --git a/Source/Examples/OpenAL/1.1/Parrot.cs b/Source/Examples/OpenAL/1.1/Parrot.cs
index 4c65e8a1..3e12bfd1 100644
--- a/Source/Examples/OpenAL/1.1/Parrot.cs
+++ b/Source/Examples/OpenAL/1.1/Parrot.cs
@@ -34,8 +34,9 @@ using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Threading;
-using OpenTK.Audio;
using OpenTK;
+using OpenTK.Audio;
+using OpenTK.Audio.OpenAL;
namespace Examples
{
diff --git a/Source/Examples/OpenAL/1.1/Playback.cs b/Source/Examples/OpenAL/1.1/Playback.cs
index f19917c7..71834b2a 100644
--- a/Source/Examples/OpenAL/1.1/Playback.cs
+++ b/Source/Examples/OpenAL/1.1/Playback.cs
@@ -11,6 +11,7 @@ using System.Threading;
using System.IO;
using OpenTK.Audio;
+using OpenTK.Audio.OpenAL;
namespace Examples
{
@@ -19,10 +20,65 @@ namespace Examples
{
static readonly string filename = Path.Combine(Path.Combine("Data", "Audio"), "the_ring_that_fell.wav");
+ // Loads a wave/riff audio file.
+ public static byte[] LoadWave(Stream stream, out int channels, out int bits, out int rate)
+ {
+ if (stream == null)
+ throw new ArgumentNullException("stream");
+
+ using (BinaryReader reader = new BinaryReader(stream))
+ {
+ // RIFF header
+ string signature = new string(reader.ReadChars(4));
+ if (signature != "RIFF")
+ throw new NotSupportedException("Specified stream is not a wave file.");
+
+ int riff_chunck_size = reader.ReadInt32();
+
+ string format = new string(reader.ReadChars(4));
+ if (format != "WAVE")
+ throw new NotSupportedException("Specified stream is not a wave file.");
+
+ // WAVE header
+ string format_signature = new string(reader.ReadChars(4));
+ if (format_signature != "fmt ")
+ throw new NotSupportedException("Specified wave file is not supported.");
+
+ int format_chunk_size = reader.ReadInt32();
+ int audio_format = reader.ReadInt16();
+ int num_channels = reader.ReadInt16();
+ int sample_rate = reader.ReadInt32();
+ int byte_rate = reader.ReadInt32();
+ int block_align = reader.ReadInt16();
+ int bits_per_sample = reader.ReadInt16();
+
+ string data_signature = new string(reader.ReadChars(4));
+ if (data_signature != "data")
+ throw new NotSupportedException("Specified wave file is not supported.");
+
+ int data_chunk_size = reader.ReadInt32();
+
+ channels = num_channels;
+ bits = bits_per_sample;
+ rate = sample_rate;
+
+ return reader.ReadBytes((int)reader.BaseStream.Length);
+ }
+ }
+
+ public static ALFormat GetSoundFormat(int channels, int bits)
+ {
+ switch (channels)
+ {
+ case 1: return bits == 8 ? ALFormat.Mono8 : ALFormat.Mono16;
+ case 2: return bits == 8 ? ALFormat.Stereo8 : ALFormat.Stereo16;
+ default: throw new NotSupportedException("The specified sound format is not supported.");
+ }
+ }
+
public static void Main()
{
using (AudioContext context = new AudioContext())
- using (AudioReader sound = new AudioReader(filename))
{
Console.WriteLine("Testing WaveReader({0}).ReadToEnd()", filename);
@@ -30,7 +86,10 @@ namespace Examples
int source = AL.GenSource();
int state;
- AL.BufferData(buffer, sound.ReadToEnd());
+ int channels, bits_per_sample, sample_rate;
+ byte[] sound_data = LoadWave(File.Open(filename, FileMode.Open), out channels, out bits_per_sample, out sample_rate);
+ AL.BufferData(buffer, GetSoundFormat(channels, bits_per_sample), sound_data, sound_data.Length, sample_rate);
+
AL.Source(source, ALSourcei.Buffer, buffer);
AL.SourcePlay(source);
diff --git a/Source/Examples/OpenAL/1.1/StreamingPlayback.cs b/Source/Examples/OpenAL/1.1/StreamingPlayback.cs
index 7f18fd80..61589d05 100644
--- a/Source/Examples/OpenAL/1.1/StreamingPlayback.cs
+++ b/Source/Examples/OpenAL/1.1/StreamingPlayback.cs
@@ -13,6 +13,7 @@ using System.Threading;
using System.ComponentModel;
using OpenTK.Audio;
+using OpenTK.Audio.OpenAL;
namespace Examples.OpenAL
{
@@ -30,7 +31,6 @@ namespace Examples.OpenAL
public static void Main()
{
using (AudioContext context = new AudioContext())
- using (AudioReader sound = new AudioReader(filename))
{
int source = AL.GenSource();
int[] buffers = AL.GenBuffers(buffer_count);
@@ -40,8 +40,8 @@ namespace Examples.OpenAL
Console.Write("Playing");
- foreach (int buffer in buffers)
- AL.BufferData(buffer, sound.ReadSamples(buffer_size));
+ //foreach (int buffer in buffers)
+ // AL.BufferData(buffer, sound.ReadSamples(buffer_size));
AL.SourceQueueBuffers(source, buffers.Length, buffers);
AL.SourcePlay(source);
@@ -59,17 +59,17 @@ namespace Examples.OpenAL
while (processed_count == 0);
Console.WriteLine(processed_count);
- while (processed_count > 0)
- {
- int buffer = AL.SourceUnqueueBuffer(source);
- if (buffer != 0 && !sound.EndOfFile)
- {
- Console.WriteLine(" " + buffer.ToString());
- AL.BufferData(buffer, sound.ReadSamples(buffer_size));
- AL.SourceQueueBuffer(source, buffer);
- }
- --processed_count;
- }
+ //while (processed_count > 0)
+ //{
+ // int buffer = AL.SourceUnqueueBuffer(source);
+ // if (buffer != 0 && !sound.EndOfFile)
+ // {
+ // Console.WriteLine(" " + buffer.ToString());
+ // AL.BufferData(buffer, sound.ReadSamples(buffer_size));
+ // AL.SourceQueueBuffer(source, buffer);
+ // }
+ // --processed_count;
+ //}
AL.GetSource(source, ALGetSourcei.BuffersQueued, out queued_count);
if (queued_count > 0)
diff --git a/Source/Examples/OpenAL/EFX/EFXReverb.cs b/Source/Examples/OpenAL/EFX/EFXReverb.cs
index a4c127ca..e625f5fe 100644
--- a/Source/Examples/OpenAL/EFX/EFXReverb.cs
+++ b/Source/Examples/OpenAL/EFX/EFXReverb.cs
@@ -29,6 +29,7 @@ using System;
using System.Threading;
using System.IO;
using OpenTK.Audio;
+using OpenTK.Audio.OpenAL;
namespace Examples
{
@@ -40,7 +41,6 @@ namespace Examples
public static void Main()
{
using (AudioContext context = new AudioContext())
- using (AudioReader sound = new AudioReader(filename))
{
Console.WriteLine("Testing WaveReader({0}).ReadToEnd()", filename);
@@ -65,7 +65,9 @@ namespace Examples
efx.AuxiliaryEffectSlot(slot, EfxAuxiliaryi.EffectslotEffect, effect);
- AL.BufferData(buffer, sound.ReadToEnd());
+ int channels, bits, rate;
+ byte[] data = Playback.LoadWave(File.Open(filename, FileMode.Open), out channels, out bits, out rate);
+ AL.BufferData(buffer, Playback.GetSoundFormat(channels, bits), data, data.Length, rate);
AL.Source(source, ALSourcef.ConeOuterGain, 1.0f);
AL.Source(source, ALSourcei.Buffer, buffer);
diff --git a/Source/Examples/OpenAL/Test/OpenALDiagnostics.cs b/Source/Examples/OpenAL/Test/OpenALDiagnostics.cs
index 39e8d5c1..e5b99ae4 100644
--- a/Source/Examples/OpenAL/Test/OpenALDiagnostics.cs
+++ b/Source/Examples/OpenAL/Test/OpenALDiagnostics.cs
@@ -33,6 +33,7 @@ using System.Runtime.InteropServices;
using OpenTK;
using OpenTK.Audio;
+using OpenTK.Audio.OpenAL;
namespace Examples
{
diff --git a/Source/Examples/OpenAL/Test/TestAudioContext.cs b/Source/Examples/OpenAL/Test/TestAudioContext.cs
index 4fc44aea..3b9285c1 100644
--- a/Source/Examples/OpenAL/Test/TestAudioContext.cs
+++ b/Source/Examples/OpenAL/Test/TestAudioContext.cs
@@ -7,12 +7,13 @@
#endregion
using System;
+using System.Diagnostics;
using OpenTK.Audio;
+using OpenTK.Audio.OpenAL;
using AlContext = System.IntPtr;
using AlDevice = System.IntPtr;
-using System.Diagnostics;
namespace Examples
{
diff --git a/Source/Examples/OpenTK/Test/Extensions.cs b/Source/Examples/OpenTK/Test/Extensions.cs
index 92d43c1a..197bfb91 100644
--- a/Source/Examples/OpenTK/Test/Extensions.cs
+++ b/Source/Examples/OpenTK/Test/Extensions.cs
@@ -69,13 +69,15 @@ namespace Examples.WinForms
void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
+ Type delegates = typeof(GL).GetNestedType("Delegates", BindingFlags.NonPublic | BindingFlags.Static);
+
foreach (Function f in LoadFunctionsFromType(typeof(GL)))
{
// Only show a function as supported when all relevant overloads are supported.
if (!functions.ContainsKey(f))
- functions.Add(f, GL.SupportsFunction(f.EntryPoint));
+ functions.Add(f, (bool)delegates.GetField(f.EntryPoint).GetValue(null));
else
- functions[f] &= GL.SupportsFunction(f.EntryPoint);
+ functions[f] &= (bool)delegates.GetField(f.EntryPoint).GetValue(null);
}
// Count supported functions using the delegates directly.
diff --git a/Source/OpenTK/Audio/AudioCapture.cs b/Source/OpenTK/Audio/AudioCapture.cs
index a4c72b0b..76498382 100644
--- a/Source/OpenTK/Audio/AudioCapture.cs
+++ b/Source/OpenTK/Audio/AudioCapture.cs
@@ -30,6 +30,8 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
+using OpenTK.Audio.OpenAL;
+
namespace OpenTK.Audio
{
diff --git a/Source/OpenTK/Audio/AudioContext.cs b/Source/OpenTK/Audio/AudioContext.cs
index a277e31b..a181e476 100644
--- a/Source/OpenTK/Audio/AudioContext.cs
+++ b/Source/OpenTK/Audio/AudioContext.cs
@@ -31,7 +31,7 @@ using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
-using OpenTK.Audio;
+using OpenTK.Audio.OpenAL;
namespace OpenTK.Audio
{
diff --git a/Source/OpenTK/Audio/AudioDeviceEnumerator.cs b/Source/OpenTK/Audio/AudioDeviceEnumerator.cs
index 60753341..5eb1b3b0 100644
--- a/Source/OpenTK/Audio/AudioDeviceEnumerator.cs
+++ b/Source/OpenTK/Audio/AudioDeviceEnumerator.cs
@@ -28,7 +28,9 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
-using System.Diagnostics;
+using System.Diagnostics;
+
+using OpenTK.Audio.OpenAL;
namespace OpenTK.Audio
{
diff --git a/Source/OpenTK/Audio/AudioDeviceErrorChecker.cs b/Source/OpenTK/Audio/AudioDeviceErrorChecker.cs
index 4ebe572e..cdf0a279 100644
--- a/Source/OpenTK/Audio/AudioDeviceErrorChecker.cs
+++ b/Source/OpenTK/Audio/AudioDeviceErrorChecker.cs
@@ -29,6 +29,8 @@ using System;
using System.Collections.Generic;
using System.Text;
+using OpenTK.Audio.OpenAL;
+
namespace OpenTK.Audio
{
struct AudioDeviceErrorChecker : IDisposable
diff --git a/Source/OpenTK/Audio/OpenAL/AL/AL.cs b/Source/OpenTK/Audio/OpenAL/AL/AL.cs
index 8a12923f..4e763d91 100644
--- a/Source/OpenTK/Audio/OpenAL/AL/AL.cs
+++ b/Source/OpenTK/Audio/OpenAL/AL/AL.cs
@@ -63,7 +63,7 @@ typedef void ALvoid;
* void
*/
-namespace OpenTK.Audio
+namespace OpenTK.Audio.OpenAL
{
public static partial class AL
{
@@ -1448,34 +1448,6 @@ namespace OpenTK.Audio
finally { handle.Free(); }
}
- /// This function fills a buffer with audio buffer (PCM format).
- /// Buffer Handle/Name to be filled with buffer.
- /// A SoundData object containing the buffer to upload.
- [CLSCompliant(false)]
- [Obsolete("Use BufferData instead.")]
- public static void BufferData(uint bid, SoundData buffer)
- {
- unsafe
- {
- fixed (byte* data_ptr = &buffer.Data[0])
- BufferData(bid, buffer.SoundFormat.SampleFormatAsOpenALFormat, (IntPtr)data_ptr, buffer.Data.Length,
- buffer.SoundFormat.SampleRate);
- }
- }
-
- /// This function fills a buffer with audio buffer (PCM format).
- /// Buffer Handle/Name to be filled with buffer.
- /// A SoundData object containing the buffer to upload.
- public static void BufferData(int bid, SoundData data)
- {
- unsafe
- {
- fixed (byte* data_ptr = &data.Data[0])
- BufferData(bid, data.SoundFormat.SampleFormatAsOpenALFormat, (IntPtr)data_ptr, data.Data.Length,
- data.SoundFormat.SampleRate);
- }
- }
-
#endregion BufferData
#endregion Buffer objects
diff --git a/Source/OpenTK/Audio/OpenAL/AL/ALEnums.cs b/Source/OpenTK/Audio/OpenAL/AL/ALEnums.cs
index 595cace5..6a07b6a4 100644
--- a/Source/OpenTK/Audio/OpenAL/AL/ALEnums.cs
+++ b/Source/OpenTK/Audio/OpenAL/AL/ALEnums.cs
@@ -9,7 +9,7 @@
using System;
-namespace OpenTK.Audio
+namespace OpenTK.Audio.OpenAL
{
///A list of valid Enable/Disable/IsEnabled parameters
diff --git a/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs b/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs
index b48d6d5a..8c1ed591 100644
--- a/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs
+++ b/Source/OpenTK/Audio/OpenAL/AL/EffectsExtension.cs
@@ -12,7 +12,7 @@ using System.Diagnostics;
using System.Runtime.InteropServices;
-namespace OpenTK.Audio
+namespace OpenTK.Audio.OpenAL
{
///
/// Provides access to the OpenAL effects extension.
diff --git a/Source/OpenTK/Audio/OpenAL/AL/EffectsExtensionEnums.cs b/Source/OpenTK/Audio/OpenAL/AL/EffectsExtensionEnums.cs
index 1e860d70..062d3bf3 100644
--- a/Source/OpenTK/Audio/OpenAL/AL/EffectsExtensionEnums.cs
+++ b/Source/OpenTK/Audio/OpenAL/AL/EffectsExtensionEnums.cs
@@ -9,7 +9,7 @@
using System;
-namespace OpenTK.Audio
+namespace OpenTK.Audio.OpenAL
{
#region Effect
diff --git a/Source/OpenTK/Audio/OpenAL/AL/EffectsExtensionPresets.cs b/Source/OpenTK/Audio/OpenAL/AL/EffectsExtensionPresets.cs
index 71b08db5..cd87ef32 100644
--- a/Source/OpenTK/Audio/OpenAL/AL/EffectsExtensionPresets.cs
+++ b/Source/OpenTK/Audio/OpenAL/AL/EffectsExtensionPresets.cs
@@ -10,7 +10,7 @@
using System;
-namespace OpenTK.Audio
+namespace OpenTK.Audio.OpenAL
{
public partial class EffectsExtension
{
diff --git a/Source/OpenTK/Audio/OpenAL/AL/XRamExtension.cs b/Source/OpenTK/Audio/OpenAL/AL/XRamExtension.cs
index d32208c7..27ae494f 100644
--- a/Source/OpenTK/Audio/OpenAL/AL/XRamExtension.cs
+++ b/Source/OpenTK/Audio/OpenAL/AL/XRamExtension.cs
@@ -11,7 +11,7 @@ using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
-namespace OpenTK.Audio
+namespace OpenTK.Audio.OpenAL
{
///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.
diff --git a/Source/OpenTK/Audio/OpenAL/Alc/Alc.cs b/Source/OpenTK/Audio/OpenAL/Alc/Alc.cs
index a772450c..b0026e11 100644
--- a/Source/OpenTK/Audio/OpenAL/Alc/Alc.cs
+++ b/Source/OpenTK/Audio/OpenAL/Alc/Alc.cs
@@ -66,7 +66,7 @@ typedef void ALCvoid;
* IntPtr
*/
-namespace OpenTK.Audio
+namespace OpenTK.Audio.OpenAL
{
/// Alc = Audio Library Context
diff --git a/Source/OpenTK/Audio/OpenAL/Alc/AlcEnums.cs b/Source/OpenTK/Audio/OpenAL/Alc/AlcEnums.cs
index 9c1dba7c..8ff1cb9d 100644
--- a/Source/OpenTK/Audio/OpenAL/Alc/AlcEnums.cs
+++ b/Source/OpenTK/Audio/OpenAL/Alc/AlcEnums.cs
@@ -9,7 +9,7 @@
using System;
-namespace OpenTK.Audio
+namespace OpenTK.Audio.OpenAL
{
///
/// Defines available context attributes.