2012-04-19 14:35:52 +08:00
|
|
|
|
#ifndef _MCI_PLAYER_WIN32_H_
|
|
|
|
|
#define _MCI_PLAYER_WIN32_H_
|
|
|
|
|
|
2013-01-18 21:54:48 +08:00
|
|
|
|
#include "CCStdC.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
#include <mmsystem.h>
|
|
|
|
|
|
|
|
|
|
namespace CocosDenshion {
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
|
HWND _wnd;
|
|
|
|
|
MCIDEVICEID _dev;
|
|
|
|
|
UINT _soundID;
|
|
|
|
|
UINT _times;
|
|
|
|
|
bool _playing;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // end of namespace CocosDenshion
|
|
|
|
|
|
|
|
|
|
#endif
|