device_mm.h

Go to the documentation of this file.
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     // 16 buffers of 1000 frames is 4000 frames at 44100 Hz is about
00030     // 364 milliseconds of audio
00031     enum {
00032       BUFFER_COUNT  = 16,
00033       BUFFER_LENGTH = 1000 * 4, // 1000 samples, 4000 bytes
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

Generated on Mon Feb 13 23:07:46 2006 for audiere by  doxygen 1.4.6