2010-10-22 09:39:14 +08:00
|
|
|
|
#ifndef _MCI_PLAYER_UPHONE_H_
|
|
|
|
|
#define _MCI_PLAYER_UPHONE_H_
|
|
|
|
|
|
|
|
|
|
#include<windows.h>
|
|
|
|
|
#include <mmsystem.h>
|
|
|
|
|
|
2010-12-15 18:28:18 +08:00
|
|
|
|
namespace CocosDenshion {
|
|
|
|
|
|
2010-10-22 09:39:14 +08:00
|
|
|
|
class MciPlayer
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
MciPlayer();
|
|
|
|
|
~MciPlayer();
|
|
|
|
|
|
|
|
|
|
void Close();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|
|
|
|
@param pFileName <EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƣ<EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>·<EFBFBD><EFBFBD>
|
|
|
|
|
@param nTimes <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ѭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD>ֵΪ 1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void Open(const char* pFileName, UINT uId);
|
|
|
|
|
|
|
|
|
|
void Play(UINT uTimes = 1);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@brief <EFBFBD><EFBFBD>ͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void Pause();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void Resume();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@brief ֹͣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void Stop();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@brief <EFBFBD><EFBFBD><EFBFBD>²<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
void Rewind();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@brief <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
*/
|
|
|
|
|
bool IsPlaying();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@brief <EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><EFBFBD><EFBFBD>Ч ID
|
|
|
|
|
@return <EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ŵ<EFBFBD><EFBFBD><EFBFBD>ЧID
|
|
|
|
|
*/
|
|
|
|
|
UINT GetSoundID();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
friend LRESULT WINAPI _SoundPlayProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
|
|
|
|
|
|
|
|
|
void _SendGenericCommand(int nCommand);
|
|
|
|
|
|
|
|
|
|
HWND m_hWnd;
|
|
|
|
|
MCIDEVICEID m_hDev;
|
|
|
|
|
UINT m_nSoundID;
|
|
|
|
|
UINT m_uTimes;
|
|
|
|
|
bool m_bPlaying;
|
|
|
|
|
};
|
|
|
|
|
|
2010-12-15 18:28:18 +08:00
|
|
|
|
} // end of namespace CocosDenshion
|
|
|
|
|
|
2010-10-22 09:39:14 +08:00
|
|
|
|
#endif
|