Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ds_wave_out Class Reference

DirectSound 8 sound renderer. More...

Inheritance diagram for ds_wave_out:

Inheritance graph
[legend]
Collaboration diagram for ds_wave_out:

Collaboration graph
[legend]
List of all members.

Public Methods

 ds_wave_out ()
virtual ~ds_wave_out ()
bool init (int frequency, bool stereo)
 sound output initialisation

bool write (unsigned short *ptr, int size)
 sound data output

bool wait ()
bool stop ()
 stop sound output


Private Attributes

IDirectSound8 * _ds
IDirectSoundBuffer8 * _dsb
int _writepos
int _oldwritepos
int _size
bool _started

Detailed Description

DirectSound 8 sound renderer.

This class implements a DirectSound8 compatible sound renderer.

Todo:
redo the synchronisation layer.
Bug:
The synchronisation takes 100% of CPU cycles.

The synchronisation may fail on unpredictable occasion (the time frame when sync occurs is too small).

Definition at line 45 of file win32.cpp.


Constructor & Destructor Documentation

ds_wave_out::ds_wave_out   [inline]
 

Definition at line 56 of file win32.cpp.

References _ds, _dsb, and _started.

virtual ds_wave_out::~ds_wave_out   [inline, virtual]
 

Definition at line 57 of file win32.cpp.

References _ds, and _dsb.


Member Function Documentation

bool ds_wave_out::init int    frequency,
bool    stereo
[inline, virtual]
 

sound output initialisation

This is called by the mixer when initialisation has to be performed.

Parameters:
frequency  is always 22050 right now.
stereo  is true if the sound output should be stereo (always true right now)
Returns:
true if initialisation was ok, false otherwise

Implements sound_renderer.

Definition at line 63 of file win32.cpp.

References _ds, _dsb, _oldwritepos, _size, _writepos, and GUID_NULL.

bool ds_wave_out::stop   [inline, virtual]
 

stop sound output

This is called by the mixer when sound output should be stopped.

Returns:
true if everything went fine, false otherwise

Implements sound_renderer.

Definition at line 144 of file win32.cpp.

References _ds, _dsb, _size, _started, and _writepos.

bool ds_wave_out::wait   [inline]
 

Definition at line 131 of file win32.cpp.

References _ds, _dsb, _oldwritepos, _started, and _writepos.

bool ds_wave_out::write unsigned short *    ptr,
int    size
[inline, virtual]
 

sound data output

This is called by the mixer to put data to the output.

Parameters:
ptr  buffer containing samples.
size  size of the ptr buffer, in samples (i.e. size in byte / 2)
Returns:
true if everything went fine, false otherwise

Implements sound_renderer.

Definition at line 94 of file win32.cpp.

References _ds, _dsb, _oldwritepos, _size, _started, and _writepos.


Member Data Documentation

IDirectSound8* ds_wave_out::_ds [private]
 

Definition at line 47 of file win32.cpp.

Referenced by ds_wave_out(), init(), stop(), wait(), write(), and ~ds_wave_out().

IDirectSoundBuffer8* ds_wave_out::_dsb [private]
 

Definition at line 48 of file win32.cpp.

Referenced by ds_wave_out(), init(), stop(), wait(), write(), and ~ds_wave_out().

int ds_wave_out::_oldwritepos [private]
 

Definition at line 50 of file win32.cpp.

Referenced by init(), wait(), and write().

int ds_wave_out::_size [private]
 

Definition at line 53 of file win32.cpp.

Referenced by init(), stop(), and write().

bool ds_wave_out::_started [private]
 

Definition at line 54 of file win32.cpp.

Referenced by ds_wave_out(), stop(), wait(), and write().

int ds_wave_out::_writepos [private]
 

Definition at line 49 of file win32.cpp.

Referenced by init(), stop(), wait(), and write().


The documentation for this class was generated from the following file:
Generated on Fri Aug 9 22:54:31 2002 for san_player by doxygen1.2.16