AeAssetBase.h
2.35 KB
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
//
// AeAssetBase
//
// This class represents the database for audio assets.
//
// It stores references to all the assets either imported or
// created by the user. Assets are stored in bins according
// to their type for easier access by editor clients.
//
// It also stores references to all registered clients of the
// database. Clients are notified whenever a modification is
// made to asset data. Note that since clients may have their
// own references to the assets they modify, clients are
// responsible for notifying the database of any data modification
// so that it can dispatch to all the other clients.
//
#ifndef __AeAssetBase__
#define __AeAssetBase__
#include "AeTypes.h"
#include "AeAsset.h"
template<class T> class GList;
class AeClient;
class AeAssetBin;
class AeAsset;
class AeAssetBase
{
public:
AeAssetBase (void);
virtual ~AeAssetBase (void);
int GetNumBins (void);
AeAssetBin * GetIndexedBin (int index);
GList<AeAssetBin *> * GetBinList (void) { return fBinList; }
void AppendAsset (AeAsset *);
void AppendAssetList (GList<AeAsset *> *);
void DeleteAsset (AeAsset *);
void DeleteAllAssets (void);
void AppendClient (AeClient *);
void RemoveClient (AeClient *);
void NotifyCreate (AeAsset *);
void NotifyUpdate (AeAsset *);
void NotifyDelete (AeAsset *);
void NotifySelect (AeAsset *);
void NotifyOnline (AeAsset *);
void NotifySuspend (void);
void NotifyResume (void);
Boolean FindTypedBin (TAssetType, AeAssetBin* & bin);
private:
void createBins (void);
void appendAssetList (GList<AeAsset *> *);
void appendAssetRefs (AeAsset *);
void appendPrim (AeAsset *);
void deleteAssetRefs (AeAsset *);
void deletePrim (AeAsset *);
GList<AeAssetBin *> * fBinList;
GList<AeClient *> * fClientList;
short fNotifySuspended;
#ifndef NDEBUG
public:
void MakeTestAssets (void);
private:
void MakeBankFileAssets (void);
void MakeBankAssets (class AeContainerAsset *, String);
void MakeInstAssets (class AeBankAsset *, String);
void MakeSoundAssets (class AeInstAsset *, String);
AeEnvAsset * MakeEnvAsset (String);
AeKeymapAsset * MakeKeymapAsset (String);
AeWaveAsset * MakeWaveAsset (String);
#endif
};
#endif __AeAssetBase__