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.

104 lines
3.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef REPLAYMOVIE_H
  5. #define REPLAYMOVIE_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "replay/ireplaymovie.h"
  11. #include "replay/basereplayserializeable.h"
  12. #include "replay/replaytime.h"
  13. #include "replay/rendermovieparams.h"
  14. #include "utlstring.h"
  15. //----------------------------------------------------------------------------------------
  16. #define REPLAY_MOVIE_HANDLE_FIRST_VALID ((ReplayHandle_t)5000)
  17. //----------------------------------------------------------------------------------------
  18. class CReplayMovie : public CBaseReplaySerializeable,
  19. public IReplayMovie
  20. {
  21. typedef CBaseReplaySerializeable BaseClass;
  22. public:
  23. CReplayMovie();
  24. //
  25. // IReplaySerializeable
  26. //
  27. virtual bool Read( KeyValues *pIn );
  28. virtual void Write( KeyValues *pOut );
  29. virtual const char *GetSubKeyTitle() const;
  30. virtual const char *GetPath() const;
  31. virtual void OnDelete();
  32. //
  33. // IReplayMovie
  34. //
  35. virtual ReplayHandle_t GetMovieHandle() const;
  36. virtual ReplayHandle_t GetReplayHandle() const;
  37. virtual const ReplayRenderSettings_t &GetRenderSettings();
  38. virtual void GetFrameDimensions( int &nWidth, int &nHeight );
  39. virtual void SetIsRendered( bool bIsRendered );
  40. virtual void SetMovieFilename( const char *pFilename );
  41. virtual const char *GetMovieFilename() const;
  42. virtual void SetMovieTitle( const wchar_t *pTitle );
  43. virtual void SetRenderTime( float flRenderTime );
  44. virtual float GetRenderTime() const;
  45. virtual void CaptureRecordTime();
  46. virtual void SetLength( float flLength );
  47. virtual bool IsUploaded() const;
  48. virtual void SetUploaded( bool bUploaded );
  49. virtual void SetUploadURL( const char *pURL );
  50. virtual const char *GetUploadURL() const;
  51. //
  52. // IQueryableReplayItem
  53. //
  54. virtual const CReplayTime & GetItemDate() const;
  55. virtual bool IsItemRendered() const;
  56. virtual CReplay *GetItemReplay();
  57. virtual ReplayHandle_t GetItemReplayHandle() const;
  58. virtual QueryableReplayItemHandle_t GetItemHandle() const;
  59. virtual const wchar_t *GetItemTitle() const;
  60. virtual void SetItemTitle( const wchar_t *pTitle );
  61. virtual float GetItemLength() const;
  62. virtual void *GetUserData();
  63. virtual void SetUserData( void *pUserData );
  64. virtual bool IsItemAMovie() const;
  65. CReplay *GetReplay() const;
  66. bool ReadRenderSettings( KeyValues *pIn );
  67. void WriteRenderSettings( KeyValues *pOut );
  68. ReplayHandle_t m_hReplay; // The replay associated with this movie, or 0 if the replay has been deleted
  69. wchar_t m_wszTitle[256];// Title for the movie
  70. CUtlString m_strFilename; // Relative (to game dir) path and filename of the movie
  71. CUtlString m_strUploadURL; // Link to uploaded YouTube video
  72. bool m_bRendered; // Has the movie finished rendering?
  73. void *m_pUserData;
  74. bool m_bUploaded;
  75. float m_flRenderTime; // How many seconds it took to render the movie
  76. CReplayTime m_RecordTime; // What date/time was this movie recorded?
  77. float m_flLength; // The movie length
  78. ReplayRenderSettings_t m_RenderSettings;
  79. };
  80. //----------------------------------------------------------------------------------------
  81. inline CReplayMovie *ToMovie( IReplaySerializeable *pMovie )
  82. {
  83. return static_cast< CReplayMovie * >( pMovie );
  84. }
  85. //----------------------------------------------------------------------------------------
  86. #endif // REPLAYMOVIE_H