| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#include <boca.h> |
| 14 |
#include <dsound.h> |
| 15 |
|
| 16 |
BoCA_BEGIN_COMPONENT(OutputDirectSound) |
| 17 |
|
| 18 |
namespace BoCA |
| 19 |
{ |
| 20 |
class OutputDirectSound : public CS::OutputComponent |
| 21 |
{ |
| 22 |
private: |
| 23 |
IDirectSound8 *directSound; |
| 24 |
|
| 25 |
IDirectSoundBuffer *primaryBuffer; |
| 26 |
IDirectSoundBuffer *workBuffer; |
| 27 |
|
| 28 |
UnsignedInt bufferSize; |
| 29 |
UnsignedInt bufferPos; |
| 30 |
|
| 31 |
Bool firstBlock; |
| 32 |
public: |
| 33 |
static const String &GetComponentSpecs(); |
| 34 |
|
| 35 |
static Void Initialize(); |
| 36 |
static Void Cleanup(); |
| 37 |
|
| 38 |
OutputDirectSound(); |
| 39 |
~OutputDirectSound(); |
| 40 |
|
| 41 |
Bool Activate(); |
| 42 |
Bool Deactivate(); |
| 43 |
|
| 44 |
Int WriteData(Buffer<UnsignedByte> &); |
| 45 |
Bool Finish(); |
| 46 |
|
| 47 |
Int CanWrite(); |
| 48 |
|
| 49 |
Int SetPause(Bool); |
| 50 |
Bool IsPlaying(); |
| 51 |
}; |
| 52 |
}; |
| 53 |
|
| 54 |
BoCA_DEFINE_OUTPUT_COMPONENT(OutputDirectSound) |
| 55 |
|
| 56 |
BoCA_END_COMPONENT(OutputDirectSound) |