aboutsummaryrefslogtreecommitdiff
path: root/sp/src/game/client/replay/vgui/replaybrowsermovieplayerpanel.h
blob: 968ad58a10d8971b4365510b6dbd628fda2be3fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//=======================================================================================//

#ifndef REPLAYBROWSERMOVIEPLAYERPANEL_H
#define REPLAYBROWSERMOVIEPLAYERPANEL_H
#ifdef _WIN32
#pragma once
#endif

#include "replaybrowserbasepanel.h"
#include "video/ivideoservices.h"

using namespace vgui;

//-----------------------------------------------------------------------------
// Purpose: A panel that plays AVI's
//-----------------------------------------------------------------------------
class CMoviePlayerPanel : public CReplayBasePanel
{
	DECLARE_CLASS_SIMPLE( CMoviePlayerPanel, CReplayBasePanel );
public:
	CMoviePlayerPanel( Panel *pParent, const char *pName, const char *pMovieFilename );
	~CMoviePlayerPanel();

	virtual void	Paint();

	void			Play();
	void			SetLooping( bool bLooping )		{ m_bLooping = bLooping; }

	bool			IsPlaying()						{ return m_bPlaying; }
	void			SetScrubOnMouseOverMode( bool bOn );
	void			FreeMaterial();
	void			ToggleFullscreen();

private:
	virtual void	PerformLayout();
	virtual void	OnMousePressed( MouseCode code );
	virtual void	OnTick();

	IVideoMaterial *m_pVideoMaterial;

	IMaterial		*m_pMaterial;
	float			m_flCurFrame;
	int				m_nNumFrames;
	bool			m_bPlaying;
	bool			m_bLooping;
	float			m_flLastTime;
	int				m_nGlobalPos[2];
	int				m_nLastMouseXPos;
	bool			m_bFullscreen;
	Panel			*m_pOldParent;
	int				m_aOldBounds[4];
	bool			m_bMouseOverScrub;		// In this mode, we don't playback, only scrub on mouse over
};

#endif // REPLAYBROWSERMOVIEPLAYERPANEL_H