Esempio n. 1
0
void CPlayer::FilePlayerThread()
{
	int nRet = RET_ERROR;

	UpdateStatus(MAP_STATUS_WAIT);
	if (!PreparePlayback()) {
		UnpreparePlayback(FALSE, TRUE);
		return;
	}
	UpdateStatus(MAP_STATUS_PLAY);

retry:
	if(m_fOpen == OPEN_MPG_FILE)
	{
		__try
		{
			nRet = MpgPlayerThread(); 
		}
		__finally
		{
			switch (nRet) 
			{
				case RET_EOF:
					UnpreparePlayback(FALSE,TRUE);
					//PostMessage(m_hwndMessage, MAP_MSG_PEEK, 0, 0);
					UpdateStatus(MAP_STATUS_STOP,FALSE,TRUE);
					//UpdateStatus(FMOD_STATUS_END,FALSE);
					break;
				case RET_STOP:
					UnpreparePlayback(FALSE,FALSE);
					//PostMessage(m_hwndMessage, MAP_MSG_PEEK, 0, 0);
					UpdateStatus(MAP_STATUS_STOP,FALSE,FALSE);
					break;
				default:
					//case RET_ERROR:
					UnpreparePlayback( TRUE,FALSE);
					//PostMessage(m_hwndMessage, MAP_MSG_PEEK, 0, 0);
					UpdateStatus(MAP_STATUS_STOP,TRUE,FALSE);
					break;
			}

		}
	}
Esempio n. 2
0
void CPlayer::FilePlayerThread()
{
	int nRet = RET_ERROR;

	UpdateStatus(MAP_STATUS_WAIT);
	if (!PreparePlayback()) {
		UnpreparePlayback(FALSE, TRUE);
		return;
	}
	UpdateStatus(MAP_STATUS_PLAY);

retry:
	switch (m_fOpen) {
	case OPEN_PLUGIN:
		nRet = PlugInPlayerThread(); break;
	case OPEN_MPG_FILE:
		nRet = MpgPlayerThread(); break;
	case OPEN_OV_FILE:
		nRet = OvPlayerThread(); break;
	case OPEN_WAV_FILE:
		nRet = WavPlayerThread(); break;
	}

	switch (nRet) {
	case RET_EOF:
		if (!UnpreparePlayback(TRUE))
			goto retry;
		break;
	case RET_STOP:
		UnpreparePlayback();
		break;
	case RET_ERROR:
		UnpreparePlayback(FALSE, TRUE);
		break;
	}
}