00001 #ifndef DEVICE_MM_H
00002 #define DEVICE_MM_H
00003
00004
00005 #include <windows.h>
00006 #include <mmsystem.h>
00007 #include <queue>
00008 #include "internal.h"
00009 #include "device_mixer.h"
00010 #include "utility.h"
00011
00012
00013 namespace audiere {
00014
00015 class MMAudioDevice : public MixerDevice
00016 {
00017 public:
00018 static MMAudioDevice* create(const ParameterList& parameters);
00019
00020 private:
00021 MMAudioDevice(HWAVEOUT device, int rate);
00022 ~MMAudioDevice();
00023
00024 public:
00025 void ADR_CALL update();
00026 const char* ADR_CALL getName();
00027
00028 private:
00029
00030
00031 enum {
00032 BUFFER_COUNT = 16,
00033 BUFFER_LENGTH = 1000 * 4,
00034 };
00035
00036 HWAVEOUT m_device;
00037
00038 int m_current_buffer;
00039 WAVEHDR m_buffers[BUFFER_COUNT];
00040 u8 m_samples[BUFFER_COUNT * BUFFER_LENGTH];
00041
00042 friend class MMOutputStream;
00043 };
00044
00045 }
00046
00047
00048 #endif