Platform_Win32_Sound_SoundStream_WMM.h
Go to the documentation of this file.00001 00011 #ifndef __Platform_Win32_Sound_SoundStream_WMM_H__ 00012 #define __Platform_Win32_Sound_SoundStream_WMM_H__ 00013 00014 // Includes 00015 #include "Platform_Sound_SoundStream.h" 00016 00017 // Forward declares 00018 class Platform_Win32_Sound_WMM; 00019 struct HWAVEOUT__; 00020 00021 // Platform_Win32_Sound_SoundStream_WMM 00022 class Platform_Win32_Sound_SoundStream_WMM : public Platform_Sound_SoundStream 00023 { 00024 public: 00025 Platform_Win32_Sound_SoundStream_WMM( 00026 Platform_Win32_Sound_WMM* manager, 00027 int channels, 00028 int frequency, 00029 int bitsPerSample, 00030 int size 00031 ); 00032 virtual ~Platform_Win32_Sound_SoundStream_WMM(); 00033 00034 00035 virtual void Play(); 00036 virtual void Stop(); 00037 00038 virtual int GetPosition(); 00039 virtual void SetPosition(int position); 00040 00041 virtual void CopySoundToBuffer(int bufferOffset, const void* soundData, int bytesToCopy); 00042 virtual void ClearBuffer(int bufferOffset, int bytesToClear); 00043 00044 virtual int GetChannels(); 00045 virtual int GetFrequency(); 00046 virtual int GetBitsPerSample(); 00047 virtual int GetSize(); 00048 00049 virtual void Update(); 00050 00051 virtual void SetVolume(float level); 00052 virtual float GetVolume(); 00053 00054 private: 00055 static void CALLBACK waveOutProc(HWAVEOUT hWaveOut, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2); 00056 00057 private: 00058 Platform_Win32_Sound_WMM* manager_; 00059 00060 static CRITICAL_SECTION waveCriticalSection_; 00061 00062 void* soundBuffer_; 00063 int soundPosition_; 00064 00065 HWAVEOUT__* hWaveOut_; 00066 static const int WaveBlockSize = 8192; 00067 static const int WaveBlockCount = 8; 00068 WAVEHDR* waveBlocks_; 00069 int firstUsedWaveBlock_; 00070 int lastUsedWaveBlock_; 00071 void* waveBlocksBuffer_; 00072 00073 bool playing_; 00074 00075 int channels_; 00076 int frequency_; 00077 int bitsPerSample_; 00078 int size_; 00079 }; 00080 00081 #endif /* __Platform_Win32_Sound_SoundStream_WMM_H__ */
Reproduction/republishing of any material on this site without permission is strictly prohibited.
