-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathARMusicalVoiceState.h
More file actions
128 lines (95 loc) · 3.94 KB
/
ARMusicalVoiceState.h
File metadata and controls
128 lines (95 loc) · 3.94 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
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
#ifndef ARMusicalVoiceState_H
#define ARMusicalVoiceState_H
/*
GUIDO Library
Copyright (C) 2002 Holger Hoos, Juergen Kilian, Kai Renz
Copyright (C) 2002-2017 Grame
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
research@grame.fr
*/
#include <typeinfo>
#include "TagList.h" // is a typedef
#include "defines.h" // for TYPE_TIMEPOSITION
#include "GUIDOTypes.h" // for GuidoPos
class ARMusicalTag;
class ARPositionTag;
class ARMeter;
class ARDisplayDuration;
class ARBeamState;
class ARAuto;
class ARGrace;
class ARChordTag;
template <class T> class KF_IPointerList;
typedef KF_IPointerList<ARPositionTag> PositionTagList;
/** \brief This class manage the state of a voice. Here additional information for
voices will be stored (i.e..: Stemstate (Stemsup, down, auto).
*/
class ARMusicalVoiceState
{
friend class ARMusic;
friend class ARMusicalVoice;
friend class ARVoiceManager;
friend class GRVoiceManager;
public:
ARMusicalVoiceState();
ARMusicalVoiceState(const ARMusicalVoiceState &vst);
ARMusicalVoiceState & operator=(const ARMusicalVoiceState & vst);
virtual ~ARMusicalVoiceState();
ARMusicalTag * getCurStateTag (const std::type_info & ti);
ARMusicalTag * RemoveCurStateTag(const std::type_info & ti);
void DeleteAddedAndRemovedPTags();
const TagList * getCurTags() const { return curtags; }
const TagList * getCurStateTags() const { return curstatetags; }
const PositionTagList * getCurPositionTags() const { return curpositiontags; }
void AddStateTag (ARMusicalTag * ntag);
void AddTag (ARMusicalTag * ntag);
void RemoveTag (ARMusicalTag * ntag);
void AddPositionTag (ARPositionTag * ntag, int addtoaddedlist = 1);
void RemovePositionTag (ARPositionTag * ntag, int addtoremovedlist = 1);
void DeleteAll();
const PositionTagList * addedPTags() const { return addedpositiontags; }
const PositionTagList * removedPTags() const { return removedpositiontags; }
const PositionTagList * currentPTags() const { return curpositiontags; }
const ARMeter * curMeter() const { return curmeter; }
const ARDisplayDuration * curDispDur() const { return fCurdispdur; }
protected:
// The timeposition of the last barline.
TYPE_TIMEPOSITION curlastbartp;
GuidoPos curlastbarpos;
// ptagpos indicates the current position within the ptaglist.
GuidoPos ptagpos;
TYPE_TIMEPOSITION curtp;
// Distinguish between Tags, that allow a range and those, who don't
TagList * curstatetags; // A list of Tags, that determine the State of
// the voice (e.g. clef, key, meter, etc. )
// All the tags, that have no range ...
// the tags that are just tags in the musical voice, like e.g. ARText
// or ARFermata ... (the ones without ranges)
TagList * curtags;
GuidoPos vpos; // Position within the voice
// now we save the current meter
// which is actually also a state-tag -> this is handled so that autobeaming can be done elegantly
ARMeter * curmeter;
// the current displayduration (if set) ...
ARDisplayDuration * fCurdispdur;
// we also save the beamstate ... makes it more elegant for autobeaming ...
ARBeamState * curbeamstate;
ARAuto * curautostate;
ARGrace * curgracetag;
ARChordTag * curchordtag;
ARMusicalVoiceState * chordState;
ARMusicalVoiceState * prevchordState;
private:
// these describe those position tags that have been Added in the last
// operation on the Voice with the given state.
PositionTagList * addedpositiontags;
// this list holds all the position tags that have been removed in the last
// operation on the Voice with the state.
PositionTagList * removedpositiontags;
// this list holds all the position tags that are currently active.
PositionTagList * curpositiontags;
};
#endif