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.

72 lines
2.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef DMETIMESELECTION_H
  7. #define DMETIMESELECTION_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "datamodel/dmelement.h"
  12. #include "movieobjects/timeutils.h"
  13. #include "movieobjects/dmetimeselectiontimes.h"
  14. enum RecordingState_t;
  15. class CDmeTimeSelection : public CDmElement
  16. {
  17. DEFINE_ELEMENT( CDmeTimeSelection, CDmElement );
  18. public:
  19. bool IsEnabled() const;
  20. void SetEnabled( bool state );
  21. bool IsRelative() const;
  22. void SetRelative( DmeTime_t time, bool state );
  23. DmeTime_t GetAbsFalloff( DmeTime_t time, int side );
  24. DmeTime_t GetAbsHold( DmeTime_t time, int side );
  25. DmeTime_t GetRelativeFalloff( DmeTime_t time, int side );
  26. DmeTime_t GetRelativeHold( DmeTime_t time, int side );
  27. void SetAbsFalloff( DmeTime_t time, int side, DmeTime_t absfallofftime );
  28. void SetAbsHold ( DmeTime_t time, int side, DmeTime_t absholdtime );
  29. int GetFalloffInterpolatorType( int side );
  30. void SetFalloffInterpolatorType( int side, int interpolatorType );
  31. void GetAlphaForTime( DmeTime_t t, DmeTime_t curtime, byte &alpha );
  32. float GetAmountForTime( DmeTime_t t, DmeTime_t curtime );
  33. float AdjustFactorForInterpolatorType( float factor, int side );
  34. void CopyFrom( const CDmeTimeSelection &src );
  35. void GetCurrent( DmeTime_t pTimes[TS_TIME_COUNT] );
  36. void SetCurrent( DmeTime_t* pTimes );
  37. float GetThreshold();
  38. void SetRecordingState( RecordingState_t state );
  39. RecordingState_t GetRecordingState() const;
  40. private:
  41. CDmeTimeSelection & operator =( const CDmeTimeSelection& src );
  42. void ConvertToRelative( DmeTime_t time );
  43. void ConvertToAbsolute( DmeTime_t time );
  44. CDmaVar< bool > m_bEnabled;
  45. CDmaVar< bool > m_bRelative;
  46. // These are all offsets from the "current" head position in seconds, or they are absolute times if not using relative mode
  47. CDmaVar< int > m_falloff[ 2 ];
  48. CDmaVar< int > m_hold[ 2 ];
  49. CDmaVar< int > m_nFalloffInterpolatorType[ 2 ];
  50. CDmaVar< float > m_threshold;
  51. CDmaVar< int > m_nRecordingState;
  52. };
  53. #endif // DMETIMESELECTION_H