coastline 0.0.4
Loading...
Searching...
No Matches
EarDirectSoundPlaybackState Class Reference

Device buffer reference and cached byte cursors for Windows DirectSound or the SDL mixer. More...

#include <directsoundstate.h>

Public Types

using Buffer = IDirectSoundBuffer
 Windows device buffer type.

Public Member Functions

void Initialize ()
 Reset the buffer pointer and both cached byte cursors without releasing prior resources.
Buffer * GetBuffer () const
void ClearBuffer ()
 Clear the buffer reference without stopping or releasing the buffer.
DWORD GetPlayCursor () const
void SetPlayCursor (DWORD cursor)
 Replace the cached cursor without seeking the device.
HRESULT CreateBuffer (IDirectSound *device, _DSBUFFERDESC *description)
 Create a Windows buffer and store the returned reference without releasing a prior buffer.
void UpdateCursors ()
 Query both cached byte cursors from a non-null device buffer.

Detailed Description

Device buffer reference and cached byte cursors for Windows DirectSound or the SDL mixer.

Buffer release is explicit; resetting or replacing the reference does not release a buffer.

Member Typedef Documentation

◆ Buffer

Windows device buffer type.

Member Function Documentation

◆ Initialize()

void EarDirectSoundPlaybackState::Initialize ( )

Reset the buffer pointer and both cached byte cursors without releasing prior resources.

Ghidra address:
EAR: 0x10012e50

◆ GetBuffer()

Buffer * EarDirectSoundPlaybackState::GetBuffer ( ) const
inline
Returns
The borrowed device buffer, or null; releasing the buffer invalidates pointers.

◆ ClearBuffer()

void EarDirectSoundPlaybackState::ClearBuffer ( )
inline

Clear the buffer reference without stopping or releasing the buffer.

◆ GetPlayCursor()

DWORD EarDirectSoundPlaybackState::GetPlayCursor ( ) const
inline
Returns
The cached playback position in buffer bytes, without querying the device.

◆ SetPlayCursor()

void EarDirectSoundPlaybackState::SetPlayCursor ( DWORD cursor)
inline

Replace the cached cursor without seeking the device.

Parameters
cursorThe byte offset to store without validation.

◆ CreateBuffer()

HRESULT EarDirectSoundPlaybackState::CreateBuffer ( IDirectSound * device,
_DSBUFFERDESC * description )

Create a Windows buffer and store the returned reference without releasing a prior buffer.

Parameters
deviceThe non-null borrowed DirectSound device.
descriptionThe non-null DirectSound buffer descriptor.
Returns
The HRESULT from CreateSoundBuffer(), with DS_OK indicating success.

◆ UpdateCursors()

void EarDirectSoundPlaybackState::UpdateCursors ( )

Query both cached byte cursors from a non-null device buffer.

SDL uses the playback cursor for both positions. Windows query results are copied back without checking the result code; output arguments initially have the cached values.


The documentation for this class was generated from the following file: