|
Public Types |
enum | hw { HW_HARDWARE,
HW_SOFTWARE,
HW_DONT_CARE
} |
enum | { DYNAMIC_SAMPLERATE = -1
} |
Public Member Functions |
| DSoundBuf () |
CString | Init (DSound &ds, hw hardware, int channels, int samplerate, int samplebits, int writeahead) |
bool | get_output_buf (char **buffer, unsigned *bufsiz, int chunksize) |
void | release_output_buf (char *buffer, unsigned bufsiz) |
void | Play () |
void | Stop () |
void | SetVolume (float vol) |
void | SetSampleRate (int hz) |
int | GetSampleRate () |
| ~DSoundBuf () |
int64_t | GetPosition () const |
int64_t | GetOutputPosition () const |
Private Member Functions |
int | buffersize_frames () const |
int | bytes_per_frame () const |
void | CheckWriteahead (int cursorstart, int cursorend) |
void | CheckUnderrun (int cursorstart, int cursorend) |
Private Attributes |
IDirectSoundBuffer * | buf |
int | channels |
int | samplerate |
int | samplebits |
int | writeahead |
int | volume |
int | buffersize |
int | write_cursor |
int | buffer_bytes_filled |
int | extra_writeahead |
int64_t | write_cursor_pos |
int64_t | LastPosition |
bool | playing |
bool | buffer_locked |
char * | locked_buf1 |
char * | locked_buf2 |
int | locked_size1 |
int | locked_size2 |
char * | temp_buffer |
int | last_cursors [4][2] |