cWavFile.h
上传用户:sycq158
上传日期:2008-10-22
资源大小:15361k
文件大小:2k
- // cWavFile.h: interface for the cWavFile class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_CWAVFILE_H__0E167DB5_3E6F_4805_8CB7_7D28193DABD1__INCLUDED_)
- #define AFX_CWAVFILE_H__0E167DB5_3E6F_4805_8CB7_7D28193DABD1__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include <mmsystem.h>
- #include <dxerr8.h>
- #include <dsound.h>
- #define WAVEFILE_READ 1
- #define WAVEFILE_WRITE 2
- class cWavFile
- {
- public:
- WAVEFORMATEX* m_pwfx; // Pointer to WAVEFORMATEX structure
- HMMIO m_hmmio; // MM I/O handle for the WAVE
- MMCKINFO m_ck; // Multimedia RIFF chunk
- MMCKINFO m_ckRiff; // Use in opening a WAVE file
- DWORD m_dwSize; // The size of the wave file
- MMIOINFO m_mmioinfoOut;
- DWORD m_dwFlags;
- BOOL m_bIsReadingFromMemory;
- BYTE* m_pbData;
- BYTE* m_pbDataCur;
- ULONG m_ulDataSize;
- CHAR* m_pResourceBuffer;
- protected:
- HRESULT ReadMMIO();
- HRESULT WriteMMIO( WAVEFORMATEX *pwfxDest );
- public:
- cWavFile();
- ~cWavFile();
- HRESULT Open( LPTSTR strFileName, WAVEFORMATEX* pwfx, DWORD dwFlags );
- HRESULT OpenFromMemory( BYTE* pbData, ULONG ulDataSize, WAVEFORMATEX* pwfx, DWORD dwFlags );
- HRESULT Close();
- HRESULT Read( BYTE* pBuffer, DWORD dwSizeToRead, DWORD* pdwSizeRead );
- HRESULT Write( UINT nSizeToWrite, BYTE* pbData, UINT* pnSizeWrote );
- DWORD GetSize();
- HRESULT ResetFile();
- WAVEFORMATEX* GetFormat() { return m_pwfx; };
- };
- #endif // !defined(AFX_CWAVFILE_H__0E167DB5_3E6F_4805_8CB7_7D28193DABD1__INCLUDED_)