summaryrefslogtreecommitdiff
path: root/utils/scenemanager/wavebrowser.h
blob: b21f7e9d158f53ce287e52910a405e91bd83c921 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//=============================================================================//

#ifndef WAVEBROWSER_H
#define WAVEBROWSER_H
#ifdef _WIN32
#pragma once
#endif

#include "mxtk/mxListView.h"
#include "commctrl.h"
#include "utldict.h"

class CWorkspace;
class CProject;
class CScene;
class CVCDFile;
class CWaveFile;

class CWaveList;
class CWorkspaceManager;
class CWaveFilterTab;
class CWaveOptionsWindow;
class CWaveFileTree;

class CWaveBrowser : public mxWindow
{
	typedef mxWindow BaseClass;
public:

	CWaveBrowser( mxWindow *parent, CWorkspaceManager *manager, int id );

	virtual		int handleEvent( mxEvent *event );
	virtual		void OnDelete();

	CWorkspaceManager *GetManager();

	void		RepopulateTree();

	void		BuildSelectionList( CUtlVector< CWaveFile * >& selected );

	void		OnPlay();

	void		JumpToItem( CWaveFile *wav );

	CWaveFile	*FindEntry( char const *wavname, bool jump = false );


	int			GetSoundCount() const;
	CWaveFile	*GetSound( int index );

	void		OnSearch();

private:

	char const	*GetSearchString();

	bool		LoadWaveFilesInDirectory( CUtlDict< CWaveFile *, int >& soundlist, char const* pDirectoryName, int nDirectoryNameLen );
	bool		InitDirectoryRecursive( CUtlDict< CWaveFile *, int >& soundlist, char const* pDirectoryName );

	void		OnWaveProperties();
	void		OnEnableVoiceDucking();
	void		OnDisableVoiceDucking();
	void		OnCheckout();
	void		OnCheckin();

	void		OnImportSentence();
	void		OnExportSentence();

	void		OnGetSentence();

	void		PopulateTree( char const *subdirectory, bool textsearch = false );

	void		ShowContextMenu( void );

	void		LoadAllSounds();
	void		RemoveAllSounds();

	CWaveList *m_pListView;

	enum
	{
		NUM_BITMAPS = 6,
	};

	CWorkspaceManager *m_pManager;

	CUtlDict< CWaveFile *, int > m_AllSounds;
	CUtlSymbolTable			m_ScriptTable;

	CUtlVector< CUtlSymbol >	m_Scripts;

	CWaveOptionsWindow		*m_pOptions;
	CWaveFileTree		*m_pFileTree;

	CUtlVector< CWaveFile * > m_CurrentSelection;
};

#endif // WAVEBROWSER_H