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.

95 lines
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef SOUNDENTRY_H
  7. #define SOUNDENTRY_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "itreeitem.h"
  12. #include "SoundEmitterSystem/isoundemittersystembase.h"
  13. #include "sentence.h"
  14. class CAudioSource;
  15. class CVCDFile;
  16. class CWaveFile;
  17. class CSoundEntry : public ITreeItem
  18. {
  19. public:
  20. CSoundEntry( CVCDFile *vcd, char const *name );
  21. ~CSoundEntry();
  22. CVCDFile *GetOwnerVCDFile();
  23. void SetName( char const *name );
  24. char const *GetName() const;
  25. int GetWaveCount() const;
  26. CWaveFile *GetWave( int index );
  27. void ClearWaves();
  28. void AddWave( CWaveFile *wave );
  29. void RemoveWave( CWaveFile *wave );
  30. int FindWave( CWaveFile *wave );
  31. void ValidateTree( mxTreeView *tree, mxTreeViewItem* parent );
  32. virtual CWorkspace *GetWorkspace() { return NULL; }
  33. virtual CProject *GetProject() { return NULL; }
  34. virtual CScene *GetScene() { return NULL; }
  35. virtual CVCDFile *GetVCDFile() { return NULL; }
  36. virtual CSoundEntry *GetSoundEntry() { return this; }
  37. virtual CWaveFile *GetWaveFile() { return NULL; }
  38. void Play();
  39. char const *GetScriptFile() const;
  40. void SetScriptFile( char const *scriptfile );
  41. char const *GetSentenceText( int wavindex );
  42. void GetCCText( wchar_t *out, int maxchars );
  43. CSoundParametersInternal *GetSoundParameters();
  44. virtual void Checkout( bool updatestateicons = true );
  45. virtual void Checkin( bool updatestateicons = true );
  46. bool IsCheckedOut() const;
  47. int GetIconIndex() const;
  48. virtual void MoveChildUp( ITreeItem *child );
  49. virtual void MoveChildDown( ITreeItem *child );
  50. virtual void SetDirty( bool dirty );
  51. virtual bool IsChildFirst( ITreeItem *child );
  52. virtual bool IsChildLast( ITreeItem *child );
  53. private:
  54. CSoundParameters m_Params;
  55. enum
  56. {
  57. MAX_SOUND_NAME = 256,
  58. MAX_SCRIPT_FILE = 64,
  59. MAX_SOUND_FILENAME = 128,
  60. };
  61. char m_szName[ MAX_SOUND_NAME ];
  62. char m_szScriptFile[ MAX_SCRIPT_FILE ];
  63. CVCDFile *m_pOwner;
  64. CUtlVector< CWaveFile * > m_Waves;
  65. int m_nLastPlay;
  66. };
  67. #endif // SOUNDENTRY_H