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.

103 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef WAVEFILE_H
  7. #define WAVEFILE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "itreeitem.h"
  12. #include "SoundEmitterSystem/isoundemittersystembase.h"
  13. #include "sentence.h"
  14. class CSoundEntry;
  15. class CAudioSource;
  16. class CVCDFile;
  17. class CWaveFile : public ITreeItem
  18. {
  19. public:
  20. // One or both may be valid
  21. CWaveFile( CVCDFile *vcd, CSoundEntry *se, char const *filename );
  22. ~CWaveFile();
  23. static int GetLanguageId();
  24. CVCDFile *GetOwnerVCDFile();
  25. CSoundEntry *GetOwnerSoundEntry();
  26. void SetName( char const *filename );
  27. char const *GetName() const;
  28. char const *GetFileName() const;
  29. char const *GetSentenceText();
  30. void SetSentenceText( char const *newText );
  31. void ValidateTree( mxTreeView *tree, mxTreeViewItem* parent );
  32. bool HasLoadedSentenceInfo() const;
  33. void EnsureSentence();
  34. virtual CWorkspace *GetWorkspace() { return NULL; }
  35. virtual CProject *GetProject() { return NULL; }
  36. virtual CScene *GetScene() { return NULL; }
  37. virtual CVCDFile *GetVCDFile() { return NULL; }
  38. virtual CSoundEntry *GetSoundEntry() { return NULL; }
  39. virtual CWaveFile *GetWaveFile() { return this; }
  40. void Play();
  41. bool GetVoiceDuck();
  42. void SetVoiceDuck( bool duck );
  43. void ToggleVoiceDucking();
  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. void SetThreadLoadedSentence( CSentence& sentence );
  54. void ExportValveDataChunk( char const *tempfile );
  55. void ImportValveDataChunk( char const *tempfile );
  56. void GetPhonemeExportFile( char *path, int maxlen );
  57. private:
  58. CAudioSource *m_pWaveFile;
  59. CSentence m_Sentence;
  60. enum
  61. {
  62. MAX_SOUND_NAME = 256,
  63. MAX_SCRIPT_FILE = 64,
  64. MAX_SOUND_FILENAME = 128,
  65. };
  66. char m_szName[ MAX_SOUND_FILENAME ];
  67. char m_szFileName[ MAX_SOUND_FILENAME ];
  68. CVCDFile *m_pOwner;
  69. CSoundEntry *m_pOwnerSE;
  70. bool m_bSentenceLoaded;
  71. };
  72. #endif // WAVEFILE_H