//##CLASS////////////////////////////////////////////////////////////
//Programming		:	Satoshi Fujiwara.
//Project Name	:	GENX
//File			:	GDSound.h
//Content 		:	サウンド基底クラス
//Implementaion	:	GDSound.h
//##CLASS_END/////////////////////////////////////////////////////////#ifndef _GDSOUND
#include <windows.h>
#include <windowsx.h>
#include "mmsystem.h"
#include "dsound.h"
#ifndef _GDSOUND
#define _GDSOUND
//////////////////////////////////////////////////////////////////////////////////
// GDSound Class
//////////////////////////////////////////////////////////////////////////////////
class GDSound
{
private:
protected:
	static DSCAPS DSCaps;
	static LPDIRECTSOUND lpDS;
 	static BOOL fSoundSupport;
public:
	GDSound(void);
	GDSound(HWND hwnd);
	~GDSound(void);
	HRESULT Init(HWND hwnd);
	void   Release(void);
	HRESULT GDSound::GetCaps(void);
	BOOL isSoundSupport(void){return fSoundSupport;};
protected:
	IDirectSoundBuffer *DSLoadSoundBuffer(IDirectSound *pDS, LPCTSTR lpName);
	IDirectSoundBuffer *DSLoad3DSoundBuffer(IDirectSound *pDS, LPCTSTR lpName);
	BOOL DSReloadSoundBuffer(IDirectSoundBuffer *pDSB, LPCTSTR lpName);
	BOOL DSGetWaveResource(HMODULE hModule, LPCTSTR lpName,
    WAVEFORMATEX **ppWaveHeader, BYTE **ppbWaveData, DWORD *pdwWaveSize);
	BOOL DSGetWaveFile(HMODULE hModule, LPCTSTR lpName, WAVEFORMATEX **ppWaveHeader,
	    BYTE **ppbWaveData, DWORD *pdwWaveSize, void **ppvBase);
	BOOL DSFillSoundBuffer(IDirectSoundBuffer *pDSB, BYTE *pbWaveData, DWORD dwWaveSize);
	BOOL DSParseWaveResource(void *pvRes, WAVEFORMATEX **ppWaveHeader, BYTE **ppbWaveData, DWORD *pdwWaveSize);
};
#endif



