Beispiel #1
0
BOOL CPlayer::Seek(long lTime)
{
	CAutoLock lock(&m_csecInterface);
	CAutoLock lock2(&m_csecThread);
	if (m_fOpen == OPEN_NONE)
		return FALSE;
	
	// 時間のチェック
	if (lTime < 0)
		lTime = 0;
	if (lTime >= int((double)m_nDuration / m_Info.nSamplingRate * 1000))
		return FALSE;

	BOOL fRet = FALSE;
	if (m_fOpen == OPEN_PLUGIN)
		fRet = PlugInSeekFile(lTime);
	else if (m_fOpen == OPEN_MPG_FILE)
		fRet = MpgSeekFile(lTime);
	else if (m_fOpen == OPEN_OV_FILE)
		fRet = OvSeekFile(lTime);
	else if (m_fOpen == OPEN_WAV_FILE)
		fRet = WavSeekFile(lTime);

	m_fFileBegin = m_nSeek == 0;
	if (fRet) {
		m_nWritten = 0;
		m_fSuppress = FALSE;

		SetThreadPriority(m_hThread, INITIAL_THREAD_PRIORITY);
	}

	return fRet;
}
Beispiel #2
0
void CPlayer::OvStop()
{
	if (m_hOvd) OvSeekFile(0);
}