DSDM_GETPOSITION
This message is called when DirectSound is querying the current position of the specified sound buffer.
typedef struct {
DWORD dwMsg;
DWORD dwInstance;
PDWORD pdwPlay;
PDWORD pdwWrite;
} DSDMP_GETPOSITION;
Members
- dwMsg
Equals DSDM_GETPOSITION. - dwInstance
DirectSoundBuffer instance data. - pdwPlay
Pointer to a DWORD into which the driver should write the current play cursor. - pdwWrite
Pointer to a DWORD into which the driver should write the current write-cursor.
Return Values
Returns DS_OK if successful, or one of the following error values otherwise.
Error value | Description |
---|---|
DSERR_INVALIDCALL | This call is not valid for the current state of this object. |
DSERR_INVALIDPARAM | An invalid parameter was passed to the returning function. |
Remarks
The driver returns two values, the current play cursor and the current write cursor. The play cursor is the position that is currently being played. The write cursor is the next position at which it is acceptable to write new data into the buffer. The write cursor should be as close as possible to the play cursor, preferably within one or two samples. DirectSound does not return these exact values to applications. Instead it adds a buffer zone of about 10 milliseconds to the write cursor to cover multi-tasking delays.
Some hardware may not be able to notify DirectSound when a one-shot buffer has finished playing. Therefore, if the driver returns a position that is equal to the length of the buffer, DirectSound assumes that the buffer has finished playing and should stop. DirectSound then calls DSDM_STOP on that buffer. This should only happen for one-shot secondary buffers.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Dsdriver.h.
See Also
Last updated on Tuesday, May 18, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.