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.

90 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef VCDFILE_H
  7. #define VCDFILE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. class CSoundEntry;
  12. class CScene;
  13. #include "itreeitem.h"
  14. #include "ichoreoeventcallback.h"
  15. class CChoreoScene;
  16. class CVCDFile : public ITreeItem, public IChoreoEventCallback
  17. {
  18. public:
  19. CVCDFile( CScene *scene, char const *filename );
  20. ~CVCDFile();
  21. CScene *GetOwnerScene();
  22. char const *GetName() const;
  23. char const *GetComments();
  24. void SetComments( char const *comments );
  25. int GetSoundEntryCount() const;
  26. CSoundEntry *GetSoundEntry( int index );
  27. void ValidateTree( mxTreeView *tree, mxTreeViewItem* parent );
  28. // ITreeItem
  29. virtual CWorkspace *GetWorkspace() { return NULL; }
  30. virtual CProject *GetProject() { return NULL; }
  31. virtual CScene *GetScene() { return NULL; }
  32. virtual CVCDFile *GetVCDFile() { return this; }
  33. virtual CSoundEntry *GetSoundEntry() { return NULL; }
  34. virtual CWaveFile *GetWaveFile() { return NULL; }
  35. // IChoreoEventCallback stubs
  36. virtual void StartEvent( float currenttime, CChoreoScene *scene, CChoreoEvent *event ) {}
  37. // Only called for events with HasEndTime() == true
  38. virtual void EndEvent( float currenttime, CChoreoScene *scene, CChoreoEvent *event ) {}
  39. // Called for events which have been started but aren't done yet
  40. virtual void ProcessEvent( float currenttime, CChoreoScene *scene, CChoreoEvent *event ) {}
  41. // Called for events that are part of a pause condition
  42. virtual bool CheckEvent( float currenttime, CChoreoScene *scene, CChoreoEvent *event ) { return false; }
  43. virtual void Checkout( bool updatestateicons = true );
  44. virtual void Checkin( bool updatestateicons = true );
  45. bool IsCheckedOut() const;
  46. int GetIconIndex() const;
  47. virtual void MoveChildUp( ITreeItem *child );
  48. virtual void MoveChildDown( ITreeItem *child );
  49. void SetDirty( bool dirty );
  50. virtual bool IsChildFirst( ITreeItem *child );
  51. virtual bool IsChildLast( ITreeItem *child );
  52. private:
  53. CChoreoScene *LoadScene( char const *filename );
  54. void LoadSoundsFromScene( CChoreoScene *scene );
  55. enum
  56. {
  57. MAX_VCD_NAME = 128,
  58. };
  59. char m_szName[ MAX_VCD_NAME ];
  60. char *m_pszComments;
  61. CUtlVector< CSoundEntry * > m_Sounds;
  62. CChoreoScene *m_pScene;
  63. CScene *m_pOwner;
  64. };
  65. #endif // VCDFILE_H