SecondaryBuffer.AcquireResources Method |
Language: |
Allocates resources for a SecondaryBuffer object that was created with the DeferLocation flag set in the BufferDescription.
Visual Basic .NET Public Function AcquireResources( _
ByVal flags As Integer, _
ByVal effectsCount As Integer _
) As EffectsReturnValue()C# public EffectsReturnValue[] AcquireResources(
int flags,
int effectsCount
);Managed C++ public: EffectsReturnValue AcquireResources(
int flags,
int effectsCount
) __gc[];JScript .NET public function AcquireResources(
flags : int,
effectsCount : int
) : EffectsReturnValue[];
flags System.Int32. Specifies how resources are to be allocated for the SecondaryBuffer object. For a list of values, see the voice management and voice allocation flags in the BufferPlayFlags enumeration. effectsCount System.Int32. Number of Microsoft® DirectSound® effect objects in the SecondaryBuffer set by the SetEffects method.
Microsoft.DirectX.DirectSound.EffectsReturnValue[]. An array that contains one element for each of the Microsoft® DirectSound® effect objects that was assigned to the SecondaryBuffer object by the SetEffects method. One of the following values is returned for each Microsoft® DirectSound® effect object.
In order to use the BufferPlayFlags enumeration in the flags parameter, you must cast it to an integer, as done in the following code.
[C#]
int flags = (int)(BufferPlayFlags.LocateInSoftware | BufferPlayFlags.TerminateByTime); EffectsReturnValue[] returnval = buffer.AcquireResources(flags,1);If the DeferLocation flag is not set in the BufferDescription of the SecondaryBuffer object, an InvalidCallException is thrown.
If one of the BufferPlayFlags is set in the flags parameter and is not supported, a ControlUnavailableException is thrown.
Exceptions
ArgumentException An invalid parameter was passed to the called method. ArgumentNullException A parameter is null. ControlUnavailableException The buffer control (volume, pan, and so on) requested by the caller is not available. Controls must be specified when the buffer is created. InvalidCallException The method call is invalid for the current state of this object.
Feedback? Please provide us with your comments on this topic.