Files
Client/GameTools/SoundLib/WaveLoader.h
LGram16 dd97ddec92 Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code:
- Client: Game client source (moved to Client/Client/)
- Server: Game server source
- GameTools: Development tools
- CryptoSource: Encryption utilities
- database: Database scripts
- Script: Game scripts
- rylCoder_16.02.2008_src: Legacy coder tools
- GMFont, Game: Additional resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 20:17:20 +09:00

58 lines
1.7 KiB
C++

// WaveLoader.h: interface for the CWaveLoader class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_WAVELOADER_H__3687F4CA_E7BA_48A0_93A9_A32858B43DF2__INCLUDED_)
#define AFX_WAVELOADER_H__3687F4CA_E7BA_48A0_93A9_A32858B43DF2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <windows.h>
#include <mmsystem.h>
#include <dsound.h>
#include "DefineSound.h"
#define WAVEFILE_READ 1
#define WAVEFILE_WRITE 2
class CWaveLoader
{
public:
WAVEFORMATEX* m_pwfx; // Pointer to WAVEFORMATEX structure
HMMIO m_hmmio; // MM I/O handle for the WAVE
CHAR* m_pResourceBuffer;
DWORD m_dwSize; // The size of the wave file
BOOL m_bIsReadingFromMemory;
bool m_bEOF;
MMCKINFO m_ck; // Multimedia RIFF chunk
MMCKINFO m_ckRiff; // Use in opening a WAVE file
MMIOINFO m_mmioinfoOut;
DWORD m_dwFlags;
BYTE* m_pbData;
BYTE* m_pbDataCur;
ULONG m_ulDataSize;
protected:
HRESULT ReadMMIO();
HRESULT WriteMMIO( WAVEFORMATEX *pwfxDest );
public:
CWaveLoader();
~CWaveLoader();
bool IsEOF() { return m_bEOF; };
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_WAVELOADER_H__3687F4CA_E7BA_48A0_93A9_A32858B43DF2__INCLUDED_)