KLMp3Music.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:1k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //---------------------------------------------------------------------------
  2. // Sword3 Engine (c) 1999-2000 by Kingsoft
  3. //
  4. // File: KLMp3Music.h
  5. // Date: 2000.08.08
  6. // Code: Daniel Wang
  7. // Desc: Header File
  8. //---------------------------------------------------------------------------
  9. #ifndef KLMp3Music_H
  10. #define KLMp3Music_H
  11. //---------------------------------------------------------------------------
  12. #include "KLMusic.h"
  13. #include "KLCFile.h"
  14. //---------------------------------------------------------------------------
  15. class KLMp3Music : public KLMusic
  16. {
  17. private:
  18. KLCFile m_Mp3File;
  19. protected:
  20. PBYTE mp3_buffer;
  21. PBYTE mp3_bufptr;
  22. int mp3_trigger;
  23. int mp3_bufbytes;
  24. int mp3_frmbytes;
  25. BOOL Mp3Init();
  26. BOOL Mp3FillBuffer();
  27. DWORD Mp3Decode(PBYTE lpPcmBuf, DWORD dwBufLen);
  28. protected:
  29. virtual BOOL Mp3FileOpen(LPSTR FileName);
  30. virtual DWORD Mp3FileRead(PBYTE pBuf, DWORD dwLen);
  31. virtual DWORD Mp3FileSeek(LONG lOffset);
  32. public:
  33. virtual BOOL Open(LPSTR FileName);
  34. virtual void Close();
  35. virtual void Seek(int nPercent);
  36. virtual void Rewind();
  37. protected:
  38. void InitSoundFormat();
  39. DWORD ReadWaveData(LPBYTE lpBuf, DWORD dwLen);
  40. };
  41. //---------------------------------------------------------------------------
  42. #endif