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.

125 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef WAVEBROWSER_H
  7. #define WAVEBROWSER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "mxtk/mxListView.h"
  12. #include "commctrl.h"
  13. #include "utldict.h"
  14. #include "faceposertoolwindow.h"
  15. class CWaveFile;
  16. class CWaveList;
  17. class CWaveFileTree;
  18. class CWaveOptionsWindow;
  19. class CChoreoEvent;
  20. struct _IMAGELIST;
  21. typedef struct _IMAGELIST NEAR* HIMAGELIST;
  22. enum
  23. {
  24. /// IMAGE_WORKSPACE = 0,
  25. // IMAGE_WORKSPACE_CHECKEDOUT,
  26. // IMAGE_PROJECT,
  27. // IMAGE_PROJECT_CHECKEDOUT,
  28. // IMAGE_SCENE,
  29. // IMAGE_SCENE_CHECKEDOUT,
  30. // IMAGE_VCD,
  31. // IMAGE_VCD_CHECKEDOUT,
  32. // IMAGE_WAV,
  33. // IMAGE_WAV_CHECKEDOUT,
  34. // IMAGE_SPEAK,
  35. // IMAGE_SPEAK_CHECKEDOUT,
  36. NUM_IMAGES,
  37. };
  38. class CWaveBrowser : public mxWindow, public IFacePoserToolWindow
  39. {
  40. typedef mxWindow BaseClass;
  41. public:
  42. CWaveBrowser( mxWindow *parent );
  43. virtual void Think( float dt );
  44. virtual int handleEvent( mxEvent *event );
  45. virtual void OnDelete();
  46. void RepopulateTree();
  47. void BuildSelectionList( CUtlVector< CWaveFile * >& selected );
  48. void OnPlay();
  49. void JumpToItem( CWaveFile *wav );
  50. CWaveFile *FindEntry( char const *wavname, bool jump = false );
  51. int GetSoundCount() const;
  52. CWaveFile *GetSound( int index );
  53. void OnSearch();
  54. void OnCancelSearch();
  55. HIMAGELIST CreateImageList();
  56. void SetEvent( CChoreoEvent *event );
  57. void SetCurrent( char const *fn );
  58. private:
  59. char const *GetSearchString();
  60. bool LoadWaveFilesInDirectory( CUtlDict< CWaveFile *, int >& soundlist, char const* pDirectoryName, int nDirectoryNameLen );
  61. bool InitDirectoryRecursive( CUtlDict< CWaveFile *, int >& soundlist, char const* pDirectoryName );
  62. void OnWaveProperties();
  63. void OnEnableVoiceDucking();
  64. void OnDisableVoiceDucking();
  65. // void OnCheckout();
  66. // void OnCheckin();
  67. void OnImportSentence();
  68. void OnExportSentence();
  69. void PopulateTree( char const *subdirectory );
  70. void ShowContextMenu( void );
  71. void LoadAllSounds();
  72. void RemoveAllSounds();
  73. CWaveList *m_pListView;
  74. enum
  75. {
  76. NUM_BITMAPS = 6,
  77. };
  78. CUtlDict< CWaveFile *, int > m_AllSounds;
  79. CUtlSymbolTable m_ScriptTable;
  80. CUtlVector< CUtlSymbol > m_Scripts;
  81. CWaveOptionsWindow *m_pOptions;
  82. CWaveFileTree *m_pFileTree;
  83. CUtlVector< CWaveFile * > m_CurrentSelection;
  84. int m_nPrevProcessed;
  85. bool m_bTextSearch;
  86. };
  87. extern CWaveBrowser *g_pWaveBrowser;
  88. #endif // WAVEBROWSER_H