Ejemplo n.º 1
0
void CMediaWin::Stop()
{
	ChangeBtnStatus(true);
	thePlayer->Stop();
	SetTimeText(_T(""));
	SetProgress(0,false);
	_ui.m_pTitle->SetText(_T("逸听视频播放"));
}
Ejemplo n.º 2
0
void ScrubBarComponent::SetProgress( const float progress )
{
	Progress = progress;
	const float seekwidth = ScrubBarWidth * progress;

	Vector3f pos = ScrubBar->GetLocalPosition();
	pos.x = PixelScale( ( ScrubBarWidth - seekwidth ) * -0.5f );
	ScrubBar->SetLocalPosition( pos );
	ScrubBar->SetSurfaceDims( 0, Vector2f( seekwidth, 40.0f ) );
	ScrubBar->RegenerateSurfaceGeometry( 0, false );

	pos = CurrentTime->GetLocalPosition();
	pos.x = PixelScale( ScrubBarWidth * -0.5f + seekwidth );
	CurrentTime->SetLocalPosition( pos );
	SetTimeText( CurrentTime, Duration * progress );
}
Ejemplo n.º 3
0
void CMediaWin::UpdatePlayingProgress()
{
	CDuiString  strTime;
	struct tm   tmCurrent,tmTotal;
	time_t      timeCurrent = thePlayer->GetTime() / 1000;
	time_t      timeTotal   = thePlayer->GetTotalTime() / 1000;
	TCHAR       szCurrent[MAX_PATH],szTotal[MAX_PATH];

	gmtime_s(&tmCurrent, &timeCurrent);
	gmtime_s(&tmTotal, &timeTotal);

	_tcsftime(szCurrent, MAX_PATH, _T("%X"), &tmCurrent);
	_tcsftime(szTotal,   MAX_PATH, _T("%X"), &tmTotal);
	strTime.Format(_T("%s/%s"), szCurrent,szTotal);

	SetTimeText(strTime);
	SetProgress(thePlayer->GetPos(),true);
}
Ejemplo n.º 4
0
eMsgStatus ScrubBarComponent::OnFrame( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
        VRMenuObject * self, VRMenuEvent const & event )
{
	if ( TouchDown )
	{
		if ( ( vrFrame.Input.buttonState & ( BUTTON_A | BUTTON_TOUCH ) ) != 0 )
		{
			OnClick( app, vrFrame, event );
		}
		else
		{
			TouchDown = false;
		}
	}

	SeekTime->SetVisible( HasFocus );
	if ( HasFocus )
	{
		Vector3f hitPos = event.HitResult.RayStart + event.HitResult.RayDir * event.HitResult.t;

		// move hit position into local space
		const Posef modelPose = Background->GetWorldPose();
		Vector3f localHit = modelPose.Orientation.Inverted().Rotate( hitPos - modelPose.Position );

		Bounds3f bounds = Background->GetMenuObject()->GetLocalBounds( app->GetDefaultFont() ) * Background->GetParent()->GetWorldScale();
		const float progress = ( localHit.x - bounds.GetMins().x ) / bounds.GetSize().x;

		if ( ( progress >= 0.0f ) && ( progress <= 1.0f ) )
		{
			const float seekwidth = ScrubBarWidth * progress;
			Vector3f pos = SeekTime->GetLocalPosition();
			pos.x = PixelScale( ScrubBarWidth * -0.5f + seekwidth );
			SeekTime->SetLocalPosition( pos );

			SetTimeText( SeekTime, Duration * progress );
		}
	}

	return MSG_STATUS_ALIVE;
}