LibMusicXML 3.18
msrScores.h
1/*
2 MusicXML Library
3 Copyright (C) Grame 2006-2013
4
5 This Source Code Form is subject to the terms of the Mozilla Public
6 License, v. 2.0. If a copy of the MPL was not distributed with this
7 file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9 Grame Research Laboratory, 11, cours de Verdun Gensoul 69002 Lyon - France
10 research@grame.fr
11*/
12
13#ifndef ___msrScores___
14#define ___msrScores___
15
16#include <iostream>
17
18#include <list>
19#include <set>
20
21#include "msrIdentification.h"
22#include "msrScaling.h"
23#include "msrLayouts.h"
24#include "msrCredits.h"
25
26
27namespace MusicXML2
28{
29
30//______________________________________________________________________________
31class msrPart;
32typedef SMARTP<msrPart> S_msrPart;
33
34class msrPartGroup;
35typedef SMARTP<msrPartGroup> S_msrPartGroup;
36
37class msrVoice;
38typedef SMARTP<msrVoice> S_msrVoice;
39
40//______________________________________________________________________________
41class msrScore : public msrElement
42{
43 public:
44
45 // creation from MusicXML
46 // ------------------------------------------------------
47
48 static SMARTP<msrScore> create (
49 int inputLineNumber);
50
51 SMARTP<msrScore> createScoreNewbornClone ();
52
53 protected:
54
55 // constructors/destructor
56 // ------------------------------------------------------
57
58 msrScore (
59 int inputLineNumber);
60
61 virtual ~msrScore ();
62
63 public:
64
65 // set and get
66 // ------------------------------------------------------
67
68 S_msrIdentification getIdentification () const
69 { return fIdentification; }
70
71 void setScaling (
72 S_msrScaling scaling)
73 { fScaling = scaling; }
74
75 S_msrScaling getScaling () const
76 { return fScaling; }
77
78 void setPageLayout (
79 S_msrPageLayout pageLayout)
80 { fPageLayout = pageLayout; }
81
82 S_msrPageLayout getPageLayout () const
83 { return fPageLayout; }
84
85 const list<S_msrPartGroup>&
86 getPartGroupsList () const
87 { return fPartGroupsList; }
88
89//* JMI
90 void setScoreMasterVoice (
91 S_msrVoice masterVoice);
92
93 S_msrVoice getScoreMasterVoice () const;
94
95/* JMI
96 void setScoreMasterVoice (
97 S_msrVoice masterVoice)
98 { fScoreMasterVoice = masterVoice; }
99
100 S_msrVoice getScoreMasterVoice () const
101 { return fScoreMasterVoice; }
102*/
103
104 const list<S_msrCredit>&
105 getCreditsList () const
106 { return fCreditsList; }
107
108 void setScoreNumberOfMeasures (
109 int scoreNumberOfMeasures)
110 {
111 fScoreNumberOfMeasures =
112 scoreNumberOfMeasures;
113 }
114
115 int getScoreNumberOfMeasures () const
116 { return fScoreNumberOfMeasures; }
117
118 void setStaffContainsRestMeasures (
119 bool staffContainsRestMeasures)
120 {
121 fStaffContainsRestMeasures =
122 staffContainsRestMeasures;
123 }
124
125 bool getStaffContainsRestMeasures () const
126 { return fStaffContainsRestMeasures; }
127
128 // part group names max length
129
130 void setScorePartGroupNamesMaxLength (int value)
131 { fScorePartGroupNamesMaxLength = value; }
132
133 int getScorePartGroupNamesMaxLength () const
134 { return fScorePartGroupNamesMaxLength; }
135
136 // part names max length
137
138 void setScorePartNamesMaxLength (int value)
139 { fScorePartNamesMaxLength = value; }
140
141 int getScorePartNamesMaxLength () const
142 { return fScorePartNamesMaxLength; }
143
144 // instrument names max lengthes
145
146 void setScoreInstrumentNamesMaxLength (int value)
147 { fScoreInstrumentNamesMaxLength = value; }
148
149 int getScoreInstrumentNamesMaxLength () const
150 { return fScoreInstrumentNamesMaxLength; }
151
152 void setScoreInstrumentAbbreviationsMaxLength (int value)
153 { fScoreInstrumentAbbreviationsMaxLength = value; }
154
155 int getScoreInstrumentAbbreviationsMaxLength () const
156 { return fScoreInstrumentAbbreviationsMaxLength; }
157
158 // inhibiting browsing
159
160 void setInhibitMeasuresRepeatReplicasBrowsing ()
161 {
162 fInhibitMeasuresRepeatReplicasBrowsing =
163 true;
164 }
165
166 bool getInhibitMeasuresRepeatReplicasBrowsing ()
167 const
168 {
169 return
170 fInhibitMeasuresRepeatReplicasBrowsing;
171 };
172
173 void setInhibitRestMeasuresBrowsing ()
174 {
175 fInhibitRestMeasuresBrowsing =
176 true;
177 }
178
179 bool getInhibitRestMeasuresBrowsing ()
180 const
181 {
182 return
183 fInhibitRestMeasuresBrowsing;
184 };
185
186 public:
187
188 // services
189 // ------------------------------------------------------
190
191 void addPartGroupToScore (
193
194 void appendCreditToScore (
195 S_msrCredit credit);
196
197 S_msrPart fetchPartFromScoreByItsPartID (
198 int inputLineNumber,
199 string partID);
200
201 void fetchIdentificationFromCreditsIfAny (
202 int inputLineNumber);
203
204/* JMI
205 void setHeaderFromOptionsIfAny (
206 int inputLineNumber);
207*/
208
209 void collectScorePartsList (
210 int inputLineNumber,
211 list<S_msrPart>& partsList);
212
213 public:
214
215 // visitors
216 // ------------------------------------------------------
217
218 virtual void acceptIn (basevisitor* v);
219 virtual void acceptOut (basevisitor* v);
220
221 virtual void browseData (basevisitor* v);
222
223 public:
224
225 // print
226 // ------------------------------------------------------
227
228 virtual void print (ostream& os) const;
229
230 virtual void printSummary (ostream& os);
231
232 private:
233
234 // fields
235 // ------------------------------------------------------
236
237 S_msrIdentification fIdentification;
238
239 S_msrScaling fScaling;
240
241 S_msrPageLayout fPageLayout;
242
243 list<S_msrCredit> fCreditsList;
244
245 set<S_msrPartGroup> fScorePartGroupsSet;
246
247 list<S_msrPartGroup> fPartGroupsList;
248
249 // master voice
250
251// JMI
252 S_msrVoice fScoreMasterVoice;
253
254 // number of measures
255
256 int fScoreNumberOfMeasures;
257
258 // rest measures
259
260 bool fStaffContainsRestMeasures;
261
262 // part group names max length
263
264 int fScorePartGroupNamesMaxLength;
265
266 // part names max length
267
268 int fScorePartNamesMaxLength;
269
270 // instrument names max lengthes
271
272 int fScoreInstrumentNamesMaxLength;
273 int fScoreInstrumentAbbreviationsMaxLength;
274
275 // inhibiting browsing
276
277 // in <measure-repeat/>, the measure replicas are explicit,
278 // whereas LilyPond only needs the repeated measure
279 bool fInhibitMeasuresRepeatReplicasBrowsing;
280
281 // in <multiple-rest/>, the rest measures are explicit,
282 // whereas LilyPond only needs the number of rest measures
283 bool fInhibitRestMeasuresBrowsing;
284};
286EXP ostream& operator<< (ostream& os, const S_msrScore& elt);
287
288
289}
290
291#endif
Definition: basevisitor.h:25
Definition: msrElements.h:26
Definition: msrScores.h:42
Definition: partlistvisitor.h:29
Definition: msrParts_MUT_DEP.h:8
Definition: msrVoices_MUT_DEP.h:8