The X-Ram Extension is provided on the top-end Sound Blaster X-Fi solutions (Sound Blaster X-Fi Fatal1ty, Sound Blaster X-Fi Elite Pro, or later). These products feature 64MB of X-Ram that can only be used for audio purposes, which can be controlled by this Extension. /summary>. More...
Public Types | |
| enum | XRamStorage { Automatic = 0, Hardware = 1, Accessible = 2 } |
This enum is used to abstract the need of using AL.GetEnumValue() with the Extension. The values do NOT correspond to AL_STORAGE_* tokens! More... | |
Public Member Functions | |
| XRamExtension () | |
| Constructs a new XRamExtension instance. | |
| bool | SetBufferMode (int n, ref uint buffer, XRamStorage mode) |
| This function is used to set the storage Mode of an array of OpenAL Buffers. | |
| bool | SetBufferMode (int n, ref int buffer, XRamStorage mode) |
| This function is used to set the storage Mode of an array of OpenAL Buffers. | |
| XRamStorage | GetBufferMode (ref uint buffer) |
| This function is used to retrieve the storage Mode of a single OpenAL Buffer. | |
| XRamStorage | GetBufferMode (ref int buffer) |
| This function is used to retrieve the storage Mode of a single OpenAL Buffer. | |
Properties | |
| bool | IsInitialized [get] |
| Returns True if the X-Ram Extension has been found and could be initialized. | |
| int | GetRamSize [get] |
| Query total amount of X-RAM in bytes. | |
| int | GetRamFree [get] |
| Query free X-RAM available in bytes. | |
The X-Ram Extension is provided on the top-end Sound Blaster X-Fi solutions (Sound Blaster X-Fi Fatal1ty, Sound Blaster X-Fi Elite Pro, or later). These products feature 64MB of X-Ram that can only be used for audio purposes, which can be controlled by this Extension. /summary>.
Definition at line 22 of file XRamExtension.cs.
This enum is used to abstract the need of using AL.GetEnumValue() with the Extension. The values do NOT correspond to AL_STORAGE_* tokens!
Definition at line 128 of file XRamExtension.cs.
| OpenTK.Audio.OpenAL.XRamExtension.XRamExtension | ( | ) |
Constructs a new XRamExtension instance.
Definition at line 65 of file XRamExtension.cs.
00066 { // Query if Extension supported and retrieve Tokens/Pointers if it is. 00067 _valid = false; 00068 if (AL.IsExtensionPresent("EAX-RAM") == false) 00069 return; 00070 00071 AL_EAX_RAM_SIZE = AL.GetEnumValue("AL_EAX_RAM_SIZE"); 00072 AL_EAX_RAM_FREE = AL.GetEnumValue("AL_EAX_RAM_FREE"); 00073 AL_STORAGE_AUTOMATIC = AL.GetEnumValue("AL_STORAGE_AUTOMATIC"); 00074 AL_STORAGE_HARDWARE = AL.GetEnumValue("AL_STORAGE_HARDWARE"); 00075 AL_STORAGE_ACCESSIBLE = AL.GetEnumValue("AL_STORAGE_ACCESSIBLE"); 00076 00077 // 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); 00078 00079 if (AL_EAX_RAM_SIZE == 0 || 00080 AL_EAX_RAM_FREE == 0 || 00081 AL_STORAGE_AUTOMATIC == 0 || 00082 AL_STORAGE_HARDWARE == 0 || 00083 AL_STORAGE_ACCESSIBLE == 0) 00084 { 00085 Debug.WriteLine("X-Ram: Token values could not be retrieved."); 00086 return; 00087 } 00088 00089 // Console.WriteLine("Free Ram: {0} / {1}",GetRamFree( ),GetRamSize( )); 00090 00091 try 00092 { 00093 Imported_GetBufferMode = (Delegate_GetBufferMode)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("EAXGetBufferMode"), typeof(Delegate_GetBufferMode)); 00094 Imported_SetBufferMode = (Delegate_SetBufferMode)Marshal.GetDelegateForFunctionPointer(AL.GetProcAddress("EAXSetBufferMode"), typeof(Delegate_SetBufferMode)); 00095 } 00096 catch (Exception e) 00097 { 00098 Debug.WriteLine("X-Ram: Attempt to marshal function pointers with AL.GetProcAddress failed. " + e.ToString()); 00099 return; 00100 } 00101 00102 _valid = true; 00103 }
| XRamStorage OpenTK.Audio.OpenAL.XRamExtension.GetBufferMode | ( | ref int | buffer | ) |
This function is used to retrieve the storage Mode of a single OpenAL Buffer.
| buffer | The handle of an OpenAL Buffer. |
Definition at line 189 of file XRamExtension.cs.
00190 { 00191 uint temp = (uint)buffer; 00192 return GetBufferMode(ref temp); 00193 }
| XRamStorage OpenTK.Audio.OpenAL.XRamExtension.GetBufferMode | ( | ref uint | buffer | ) |
This function is used to retrieve the storage Mode of a single OpenAL Buffer.
| buffer | The handle of an OpenAL Buffer. |
Definition at line 173 of file XRamExtension.cs.
00174 { 00175 int tempresult = Imported_GetBufferMode(buffer, IntPtr.Zero); // IntPtr.Zero due to the parameter being unused/reserved atm 00176 00177 if (tempresult == AL_STORAGE_ACCESSIBLE) 00178 return XRamStorage.Accessible; 00179 if (tempresult == AL_STORAGE_HARDWARE) 00180 return XRamStorage.Hardware; 00181 // default: 00182 return XRamStorage.Automatic; 00183 }
| bool OpenTK.Audio.OpenAL.XRamExtension.SetBufferMode | ( | int | n, | |
| ref int | buffer, | |||
| XRamStorage | mode | |||
| ) |
This function is used to set the storage Mode of an array of OpenAL Buffers.
| n | The number of OpenAL Buffers pointed to by buffer. | |
| buffer | An array of OpenAL Buffer handles. | |
| mode | The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible |
Definition at line 163 of file XRamExtension.cs.
00164 { 00165 uint temp = (uint)buffer; 00166 return SetBufferMode(n, ref temp, mode); 00167 }
| bool OpenTK.Audio.OpenAL.XRamExtension.SetBufferMode | ( | int | n, | |
| ref uint | buffer, | |||
| XRamStorage | mode | |||
| ) |
This function is used to set the storage Mode of an array of OpenAL Buffers.
| n | The number of OpenAL Buffers pointed to by buffer. | |
| buffer | An array of OpenAL Buffer handles. | |
| mode | The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible |
Definition at line 144 of file XRamExtension.cs.
00145 { 00146 switch (mode) 00147 { 00148 case XRamStorage.Accessible: 00149 return Imported_SetBufferMode(n, ref buffer, AL_STORAGE_ACCESSIBLE); 00150 case XRamStorage.Hardware: 00151 return Imported_SetBufferMode(n, ref buffer, AL_STORAGE_HARDWARE); 00152 default: 00153 return Imported_SetBufferMode(n, ref buffer, AL_STORAGE_AUTOMATIC); 00154 } 00155 }
int OpenTK.Audio.OpenAL.XRamExtension.GetRamFree [get] |
Query free X-RAM available in bytes.
Definition at line 120 of file XRamExtension.cs.
int OpenTK.Audio.OpenAL.XRamExtension.GetRamSize [get] |
Query total amount of X-RAM in bytes.
Definition at line 111 of file XRamExtension.cs.
bool OpenTK.Audio.OpenAL.XRamExtension.IsInitialized [get] |
Returns True if the X-Ram Extension has been found and could be initialized.
Definition at line 30 of file XRamExtension.cs.
1.6.1