www.pudn.com > DirectDraw.rar > DirectSound.h, change:2007-07-19,size:1221b


// DirectSound.h: interface for the CDirectSound class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_DIRECTSOUND_H__15DD3ACC_0611_4965_8F6E_5E2A23FB2945__INCLUDED_) 
#define AFX_DIRECTSOUND_H__15DD3ACC_0611_4965_8F6E_5E2A23FB2945__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
#include <mmsystem.h> 
#include <dsound.h> 
 
class CDirectSound   
{ 
public: 
	CDirectSound(); 
	virtual ~CDirectSound(); 
public: 
	BOOL Start(); 
	void Stop(); 
	BOOL SetVolume(LONG nVolume); 
	BOOL GetVolume(LONG *pnVolume); 
	void AddAudioData(LPVOID pData,DWORD dwSize); 
	void SetAudioFormat(DWORD dwSamples,WORD wChannels = 1,WORD wBitsPerSample = 16); 
//	void Pause(); 
//	void Resume(); 
private: 
	BOOL Open(); 
	void Close(); 
	void ClearBuffer(); 
	void WriteSilenceData(); 
	DWORD				m_dwWriteOffset; 
	DWORD				m_dwLastPlayPos; 
	DWORD				m_dwBufSize; 
	BOOL				m_bPlaying; 
	LPDIRECTSOUND		m_lpDS; 
	LPDIRECTSOUNDBUFFER m_lpDSBuffer; 
	DWORD				m_nSamples; 
	WORD				m_wChannels; 
	WORD				m_wBitsPerSample; 
	LONG				m_nVolume; 
	HANDLE				m_hMutex; 
}; 
 
#endif // !defined(AFX_DIRECTSOUND_H__15DD3ACC_0611_4965_8F6E_5E2A23FB2945__INCLUDED_)