-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathGRPositionTag.h
More file actions
117 lines (83 loc) · 3.3 KB
/
Copy pathGRPositionTag.h
File metadata and controls
117 lines (83 loc) · 3.3 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
#ifndef GRPositionTag_H
#define GRPositionTag_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 "GRTag.h"
#include "kf_ilist.h"
class GRSystem;
class GRNotationElement;
/** \brief This class is used to determine when a position tag ends.
The endposition is the position within the voice. When this position has been parsed
in the GRVoiceManager,
then we know, that the positiontag-range has ended.
*/
class GRSystemStartEndStruct
{
public:
enum setflag { LEFTMOST, RIGHTMOST, OPENLEFT, OPENRIGHT, NOTKNOWN };
GRSystemStartEndStruct() {}
virtual ~GRSystemStartEndStruct();
GRSystem * grsystem = 0;
GRNotationElement * startElement = 0;
GRNotationElement * endElement = 0;
setflag startflag = NOTKNOWN;
setflag endflag = NOTKNOWN;
// these give the position in the associated lists ...
// so that the tag later knows, where it's sub-parts start and end.
GuidoPos startpos = 0;
GuidoPos endpos = 0;
void * p = 0;
};
typedef KF_IPointerList<GRSystemStartEndStruct> SSEList;
// the position tag owns this list.
/** \brief The GRPositionTag is the base class for representing range tags.
The GRPositionTag also has a list of staffs, start and end elements as well as a
void-pointer that is used to handle position tags that reach over multiple systems,
that is, that they have been broken either by newSystem/newPage or by automatic Break-routines.
*/
class GRPositionTag : public GRTag
{
public:
class GRSaveStruct
{
public:
GRSaveStruct() {};
virtual ~GRSaveStruct() {};
};
GRPositionTag(const ARMusicalTag * armt = 0);
GRPositionTag(GuidoPos p_ep, const ARMusicalTag * armt = 0);
virtual ~GRPositionTag() {}
virtual void ResumeTag(GRStaff * grstaff, GuidoPos assocpos);
virtual void BreakTag(GRStaff * grstaff, GuidoPos & assocpos);
virtual void StaffBegin(GRStaff * grstaff = 0);
virtual void StaffFinished(GRStaff * grstaff = 0);
virtual void FinishPTag (GRStaff *) {}
virtual void RangeEnd(GRStaff * grstaff = 0);
virtual bool DeleteStaff(GRStaff * grstaff);
void changeCurrentSystem(GRSystem * psystem);
void DeleteAllSSEs();
GuidoPos getEndPos() const { return fEndPos; }
GRSystemStartEndStruct * getSystemStartEndStruct(const GRSystem * grsystem) const;
void addSystemStartEndStruct(GRSystemStartEndStruct * sse) { mStartEndList.AddTail(sse); }
protected:
virtual void setStartElement(const GRStaff * grstaff, GRNotationElement * n_element);
virtual void setEndElement(const GRStaff * grstaff, GRNotationElement * n_element);
virtual void addAssociation(GRNotationElement * grnot);
virtual void removeAssociation(GRNotationElement * grnot);
virtual GRPositionTag::GRSaveStruct * getNewGRSaveStruct() { return new GRSaveStruct; }
SSEList mStartEndList; // the Range tag Start-End List
GRSystemStartEndStruct::setflag lastendflag;
GRNotationElement * lastendElement;
GuidoPos lastendpos;
private:
GuidoPos fEndPos = nullptr;
};
#endif