-
Notifications
You must be signed in to change notification settings - Fork 1
/
TGFactory.h
127 lines (113 loc) · 3.01 KB
/
TGFactory.h
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#ifndef TG_FACTORY_H
#define TG_FACTORY_H
#define AUTOMATIC_DELETE 1
#include <cstdlib>
#include <vector>
#include <string>
#include "DumbAllocator.h"
class TGBeat;
class TGChannel;
class TGChord;
class TGDuration;
class TGLyric;
class TGMarker;
class TGMeasure;
class TGMeasureHeader;
class TGNote;
class TGNoteEffect;
class TGScale;
class TGSong;
class TGString;
class TGStroke;
class TGTempo;
class TGText;
class TGTimeSignature;
class TGTrack;
class TGTupleto;
class TGVelocities;
class TGVoice;
class TGEffectBend;
class TGEffectTremoloBar;
class TGEffectTremoloPicking;
class TGEffectGrace;
class TGEffectHarmonic;
class TGEffectTrill;
typedef std::vector<TGChannel*, dumb_allocator<TGChannel*> > TGChannelList;
typedef std::vector<TGBeat*, dumb_allocator<TGBeat*> > TGBeatList;
typedef std::vector<TGTrack*, dumb_allocator<TGTrack*> > TGTrackList;
typedef std::vector<TGMeasure*, dumb_allocator<TGMeasure*> > TGMeasureList;
typedef std::vector<TGMeasureHeader*, dumb_allocator<TGMeasureHeader*> > TGMeasureHeaderList;
typedef std::vector<TGNote*, dumb_allocator<TGNote*> > TGNoteList;
typedef std::vector<TGString*, dumb_allocator<TGString*> > TGStringList;
typedef std::basic_string<char, std::char_traits<char>, dumb_allocator<char> > TGStdString;
enum
{
PRODUCT_TGSong=0,
PRODUCT_TGLyric,
PRODUCT_TGMarker,
PRODUCT_TGChord,
PRODUCT_TGScale,
PRODUCT_TGTupleto,
PRODUCT_TGDuration,
PRODUCT_TGTimeSignature,
PRODUCT_TGTempo,
PRODUCT_TGChannel,
PRODUCT_TGTrack,
PRODUCT_TGMeasureHeader,
PRODUCT_TGMeasure,
PRODUCT_TGBeat,
PRODUCT_TGVoice,
PRODUCT_TGNote,
PRODUCT_TGString,
PRODUCT_TGStroke,
PRODUCT_TGText,
PRODUCT_TGNoteEffect,
PRODUCT_TGEffectBend,
PRODUCT_TGEffectTremoloBar,
PRODUCT_TGEffectGrace,
PRODUCT_TGEffectHarmonic,
PRODUCT_TGEffectTrill,
PRODUCT_TGEffectTremoloPicking,
PRODUCT_TGChannelList,
PRODUCT_MAX,
};
class TGFactory {
public:
TGFactory() {
for (int i=0; i<PRODUCT_MAX; ++i)
{
newCount[i] = 0;
}
}
~TGFactory();
static int newCount[PRODUCT_MAX];
TGSong *newSong();
TGLyric *newLyric();
TGMarker *newMarker();
TGChord *newChord(int length);
TGScale *newScale();
TGTupleto *newTupleto();
static TGTupleto *newTupleto2();
TGDuration *newDuration();
TGTimeSignature *newTimeSignature();
TGTempo *newTempo();
TGChannel *newChannel();
TGTrack *newTrack();
TGMeasureHeader *newHeader();
TGMeasure *newMeasure(TGMeasureHeader *header);
TGBeat *newBeat();
TGVoice *newVoice(int index);
TGNote *newNote();
TGString *newString();
TGStroke *newStroke();
TGText *newText();
TGNoteEffect *newEffect();
TGEffectBend *newEffectBend();
TGEffectTremoloBar *newEffectTremoloBar();
TGEffectGrace *newEffectGrace();
TGEffectHarmonic *newEffectHarmonic();
TGEffectTrill *newEffectTrill();
TGEffectTremoloPicking *newEffectTremoloPicking();
TGChannelList *newChannelList();
};
#endif