Welcome to
www.tdxlibrary.org
Home of the
the TDx_Library...
"RAD DirectX"
for
C++ Builder
...
|
TDx_Sound_Library v2.00 Component Reference
|
|
[ TDx_SoundBuffer::Lock() ]
[ next: OpenStream() ]
[ prev: GetVolume() ]
public:
virtual bool __fastcall Lock( dword pWriteCursor, dword pWriteBytes, void** pAudioPtr1, dword* pAudioBytes1, void** pAudioPtr2, dword* pAudioBytes2, dword pFlags );
TDX_SOUNDBUFFER::LOCK()
[ component method ]
- Description
The
TDx_SoundBuffer::Lock
method
will
return
a
valid
write
pointer
to
the
buffer's
audio
data.
This
method
returns
write
pointers
only,
do
not
attempt
to
use
them
for
the
purpose
of
reading.
The
buffer
should
not
be
locked
for
long
periods
of
time
as
the
play
cursor
may
reach
the
locked
portion
of
the
buffer
and
cause
configuration
dependent
audio
problems.
If
the
method
call
fails,
the
OnError
event
will
be
triggered
with
one
of
the
following
values:
TDX_BADPARAMS
DSERR_BUFFERLOST
DSERR_INVALIDCALL
DSERR_INVALIDPARAM
DSERR_PRIOLEVELNEEDED
- Parameters
WriteCursor
The WriteCursor parameter defines the offset, in bytes, of where the lock is to begin in the buffer.
Setting either of the flags in the flags parameter of this method causes this parameter to be ignored.
WriteBytes
The WriteBytes parameter defines the amount, in bytes, of buffer to be locked.
The space that is locked may wrap around to the start of the buffer, which is conceptually circular, in which case the AudioPtr2 parameter of this method will reference the start of the buffer.
AudioPtr1
The AudioPtr1 parameter will reference the first block of locked sound buffer if this method returns successfully.
AudioBytes1
The AudioBytes1 parameter references the number of bytes referenced by the AudioPtr1 parameter of this method.
When this value is less than the value in the WriteBytes parameter of this method, it means AudioPtr2 will reference a second block of sound data.
AudioPtr2
The AudioPtr2 parameter will reference the second block of locked sound buffer if this method returns successfully.
When this parameter is NULL it means AudioPtr1 references the entire locked region of the sound buffer and any portion of the area that wraps around will not be locked.
AudioBytes2
The AudioBytes2 parameter references the number of bytes referenced by the AudioPtr2 parameter of this method.
When the AudioPtr2 parameter of this method is set to NULL, this parameter will be 0.
Flags
The Flags parameter defines flags indicating modifications to the lock event.
The described effect applies when the flag is set.
DSBLOCK_ENTIREBUFFER
Lock the whole sound buffer.
Setting this flag causes the WriteCursor parameter of this method to be ignored.
DSBLOCK_FROMWRITECURSOR
Use the current write position as the start of the sound buffer lock area.
Setting this flag causes the WriteCursor parameter of this method to be ignored.
- See Also
- Top
If you would like to submit additions or improvements to this page, click: darren_john_dwyer@hotmail.com.
|
|