DMusPerformance.h
资源名称:DXGuide.zip [点击查看]
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:2k
源码类别:
DirextX编程
开发平台:
Visual C++
- // Copyright (C) 1999 DXGuide. All Rights Reserved.
- // File: DMusPerformance.h
- #ifndef _DMUSPERFORMANCE__H
- #define _DMUSPERFORMANCE__H
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
- interface IDirectMusic;
- interface IDirectMusicPort;
- interface IDirectMusicPerformance;
- class CDirectMusic;
- class CDMusLoader;
- #pragma warning(disable: 4201)
- #include <dmusici.h>
- #pragma warning(default: 4201)
- class CDMusPerformance
- {
- public:
- CDMusPerformance(void);
- virtual ~CDMusPerformance();
- public:
- bool Create(CDirectMusic* pDirectMusic);
- bool SetSegmentRepeats(DWORD dwRepeats);
- bool Play(DWORD dwFlags);
- bool Stop(DWORD dwFlags);
- public:
- CDirectMusic* GetDirectMusic(void) const
- {
- return m_pDirectMusic;
- }
- CDMusLoader* GetDMusLoader(void) const
- {
- return m_pDMusLoader;
- }
- protected:
- HRESULT Init(IDirectMusic** ppDirectMusic,
- LPDIRECTSOUND pDirectSound, HWND hWnd);
- HRESULT AddPort(IDirectMusicPort* pPort);
- HRESULT RemovePort(IDirectMusicPort* pPort);
- public:
- HRESULT SetParam(REFGUID rguidType,
- DWORD dwGroupBits, DWORD dwIndex,
- MUSIC_TIME mtTime, void* pParam);
- HRESULT SetGlobalParam(REFGUID rguidType,
- void* pParam, DWORD dwSize);
- public:
- HRESULT PlaySegment(IDirectMusicSegment* pSegment,
- DWORD dwFlags, __int64 i64StartTime,
- IDirectMusicSegmentState** ppSegmentState);
- HRESULT AssignPChannelBlock(
- DWORD dwBlockNum, IDirectMusicPort* pPort,
- DWORD dwGroup);
- HRESULT MusicToMIDI(WORD wMusicValue,
- DMUS_CHORD_KEY* pChord, BYTE bPlayMode,
- BYTE bChordLevel, BYTE* pbMIDIValue);
- HRESULT MIDIToMusic(BYTE bMIDIValue,
- DMUS_CHORD_KEY* pChord, BYTE bPlayMode,
- BYTE bChordLevel, WORD* pwMusicValue);
- HRESULT Stop(
- IDirectMusicSegment* pSegment,
- IDirectMusicSegmentState* pSegmentState,
- MUSIC_TIME mtTime, DWORD dwFlags);
- HRESULT SetNotificationHandle(
- HANDLE hNotification, REFERENCE_TIME rtMinimum);
- protected:
- IDirectMusicPerformance* m_lpDirectMusicPerformance;
- CDirectMusic* m_pDirectMusic;
- CDMusLoader* m_pDMusLoader;
- };
- #endif // _DMUSPERFORMANCE__H