00001
00002
00003
00004
00005
00006 #ifndef header_directsound
00007 #define header_directsound
00008
00009 #include <dsound.h>
00010
00011 class CL_CSOutput
00012 {
00013 public:
00014 CL_CSOutput();
00015 ~CL_CSOutput();
00016
00017 void silence();
00018
00019
00020
00021 bool is_full();
00022
00023
00024 int get_frag_size() const { return frag_size; }
00025
00026
00027 void write_fragment(short *data);
00028
00029
00030 void wait();
00031
00032
00033 private:
00034 LPDIRECTSOUND directsound;
00035 LPDIRECTSOUNDBUFFER soundbuffer;
00036 int frag_size, buffer_size, bytes_per_sample;
00037 HANDLE sleep_event;
00038 LPDIRECTSOUNDNOTIFY notify;
00039 };
00040
00041 #endif