DMusPerformance.h
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:2k
源码类别:

DirextX编程

开发平台:

Visual C++

  1. // Copyright (C) 1999 DXGuide.  All Rights Reserved.
  2. // File: DMusPerformance.h
  3. #ifndef _DMUSPERFORMANCE__H
  4. #define _DMUSPERFORMANCE__H
  5. #if _MSC_VER >= 1000
  6. #pragma once
  7. #endif // _MSC_VER >= 1000
  8. interface IDirectMusic;
  9. interface IDirectMusicPort;
  10. interface IDirectMusicPerformance;
  11. class CDirectMusic;
  12. class CDMusLoader;
  13. #pragma warning(disable: 4201)
  14. #include <dmusici.h>
  15. #pragma warning(default: 4201)
  16. class CDMusPerformance
  17. {
  18. public:
  19. CDMusPerformance(void);
  20. virtual ~CDMusPerformance();
  21. public:
  22. bool Create(CDirectMusic*  pDirectMusic);
  23. bool SetSegmentRepeats(DWORD  dwRepeats);
  24. bool Play(DWORD  dwFlags);
  25. bool Stop(DWORD  dwFlags);
  26. public:
  27. CDirectMusic* GetDirectMusic(void) const
  28. {
  29. return  m_pDirectMusic;
  30. }
  31. CDMusLoader* GetDMusLoader(void) const
  32. {
  33. return  m_pDMusLoader;
  34. }
  35. protected:
  36. HRESULT Init(IDirectMusic**  ppDirectMusic,
  37. LPDIRECTSOUND  pDirectSound, HWND  hWnd);
  38. HRESULT AddPort(IDirectMusicPort*  pPort);
  39. HRESULT RemovePort(IDirectMusicPort*  pPort);
  40. public:
  41. HRESULT SetParam(REFGUID  rguidType,
  42. DWORD  dwGroupBits, DWORD  dwIndex,
  43. MUSIC_TIME  mtTime, void*  pParam);
  44. HRESULT SetGlobalParam(REFGUID  rguidType,
  45. void*  pParam, DWORD  dwSize);
  46. public:
  47. HRESULT PlaySegment(IDirectMusicSegment*  pSegment,
  48. DWORD  dwFlags, __int64  i64StartTime,
  49. IDirectMusicSegmentState**  ppSegmentState);
  50. HRESULT AssignPChannelBlock(
  51. DWORD  dwBlockNum, IDirectMusicPort*  pPort,
  52. DWORD  dwGroup);
  53. HRESULT MusicToMIDI(WORD  wMusicValue,
  54. DMUS_CHORD_KEY*  pChord, BYTE  bPlayMode,
  55. BYTE  bChordLevel,  BYTE*  pbMIDIValue);
  56. HRESULT MIDIToMusic(BYTE  bMIDIValue,
  57. DMUS_CHORD_KEY*  pChord, BYTE  bPlayMode,
  58. BYTE  bChordLevel, WORD*  pwMusicValue);
  59. HRESULT Stop(
  60. IDirectMusicSegment*  pSegment,
  61. IDirectMusicSegmentState*  pSegmentState,
  62. MUSIC_TIME  mtTime, DWORD  dwFlags);
  63. HRESULT SetNotificationHandle(
  64. HANDLE  hNotification, REFERENCE_TIME  rtMinimum);
  65. protected:
  66. IDirectMusicPerformance* m_lpDirectMusicPerformance;
  67. CDirectMusic* m_pDirectMusic;
  68. CDMusLoader* m_pDMusLoader;
  69. };
  70. #endif // _DMUSPERFORMANCE__H