///<summary>The X-Ram Extension is provided on the top-end Sound Blaster X-Fi solutions (Sound Blaster X-Fi Fatal1ty, Sound Blaster X-Fi Elite Pro, or later). These products feature 64MB of X-Ram that can only be used for audio purposes, which can be controlled by this Extension.</summary>
[CLSCompliant( true )]
publicsealedclassXRamExtension
{
#regionInstancestate
privatebool_valid=false;
/// <summary>Returns True if the X-Ram Extension has been found and could be initialized.</summary>
Debug.WriteLine("X-Ram: Attempt to marshal function pointers with AL.GetProcAddress failed. "+e.ToString());
return;
}
_valid=true;
}
#endregionConstructor/ExtensionLoading
#regionPublicMethods
/// <summary>Query total amount of X-RAM in bytes.</summary>
publicintGetRamSize()
{
returnAL.Get((ALGetInteger)AL_EAX_RAM_SIZE);
}
/// <summary>Query free X-RAM available in bytes.</summary>
publicintGetRamFree()
{
returnAL.Get((ALGetInteger)AL_EAX_RAM_FREE);
}
/// <summary>This enum is used to abstract the need of using AL.GetEnumValue() with the Extension. The values do NOT correspond to AL_STORAGE_* tokens!</summary>
publicenumXRamStorage:byte
{
/// <summary>Put an Open AL Buffer into X-RAM if memory is available, otherwise use host RAM. This is the default mode.</summary>
Automatic=0,
/// <summary>Force an Open AL Buffer into X-RAM, good for non-streaming buffers.</summary>
Hardware=1,
/// <summary>Force an Open AL Buffer into 'accessible' (currently host) RAM, good for streaming buffers.</summary>
Accessible=2,
}
/// <summary>This function is used to set the storage Mode of an array of OpenAL Buffers.</summary>
/// <param name="n">The number of OpenAL Buffers pointed to by buffer.</param>
/// <param name="buffer">An array of OpenAL Buffer handles.</param>
/// <param name="mode">The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible</param>
/// <returns>True if all the Buffers were successfully set to the requested storage mode, False otherwise.</returns>
/// <summary>This function is used to set the storage Mode of an array of OpenAL Buffers.</summary>
/// <param name="n">The number of OpenAL Buffers pointed to by buffer.</param>
/// <param name="buffer">An array of OpenAL Buffer handles.</param>
/// <param name="mode">The storage mode that should be used for all the given buffers. Should be the value of one of the following enum names: XRamStorage.Automatic, XRamStorage.Hardware, XRamStorage.Accessible</param>
/// <returns>True if all the Buffers were successfully set to the requested storage mode, False otherwise.</returns>