Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef REPLAYBROWSERMOVIEPLAYERPANEL_H
  5. #define REPLAYBROWSERMOVIEPLAYERPANEL_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. #include "replaybrowserbasepanel.h"
  10. #include "video/ivideoservices.h"
  11. using namespace vgui;
  12. //-----------------------------------------------------------------------------
  13. // Purpose: A panel that plays AVI's
  14. //-----------------------------------------------------------------------------
  15. class CMoviePlayerPanel : public CReplayBasePanel
  16. {
  17. DECLARE_CLASS_SIMPLE( CMoviePlayerPanel, CReplayBasePanel );
  18. public:
  19. CMoviePlayerPanel( Panel *pParent, const char *pName, const char *pMovieFilename );
  20. ~CMoviePlayerPanel();
  21. virtual void Paint();
  22. void Play();
  23. void SetLooping( bool bLooping ) { m_bLooping = bLooping; }
  24. bool IsPlaying() { return m_bPlaying; }
  25. void SetScrubOnMouseOverMode( bool bOn );
  26. void FreeMaterial();
  27. void ToggleFullscreen();
  28. private:
  29. virtual void PerformLayout();
  30. virtual void OnMousePressed( MouseCode code );
  31. virtual void OnTick();
  32. IVideoMaterial *m_pVideoMaterial;
  33. IMaterial *m_pMaterial;
  34. float m_flCurFrame;
  35. int m_nNumFrames;
  36. bool m_bPlaying;
  37. bool m_bLooping;
  38. float m_flLastTime;
  39. int m_nGlobalPos[2];
  40. int m_nLastMouseXPos;
  41. bool m_bFullscreen;
  42. Panel *m_pOldParent;
  43. int m_aOldBounds[4];
  44. bool m_bMouseOverScrub; // In this mode, we don't playback, only scrub on mouse over
  45. };
  46. #endif // REPLAYBROWSERMOVIEPLAYERPANEL_H