VCL RAD DirectX for C++ Builder

Welcome to

www.tdxlibrary.org

Home of the
the TDx_Library...

=- RAD DirectX =-

"RAD DirectX"
for
C++ Builder

...

Welcome to tdxlibrary.org Latest News

Development Tools Demo Applications Step-By-Step Tutorials Component Reference

Register our Tools Available Downloads

Frequently Asked Questions Links to other sites Information about the tdxlibrary.org website


    TDx_Sound_Library v2.00 Component Reference

    -= Click to navigate the reference =-
    Go to the Welcome Page

    [ 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 );





    -= Go to the TDx_SoundBuffer description =-    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.



























Top

Welcome |  Latest News |  Tools |  Demos |  Tutorials |  Reference |  Register |  Downloads
FAQ |  Links |  Site Information

This page is Copyright © 2019 Darren John Dwyer, Australia. All Rights Reserved.
Borland C++ Builder, CBuilder, etc are Trademarks of Borland Corporation.
DirectX, DirectDraw, Windows, etc are Trademarks of Microsoft Corporation.