LibMusicXML  3.18
msrChords_MUT_DEP.h
1 /*
2  This file is to be included only by msrMutualDependencies.h,
3  to satisfy declarations mutual dependencies.
4 */
5 
6 //______________________________________________________________________________
7 class msrChord : public msrTupletElement
8 {
9  public:
10 
11  static SMARTP<msrChord> create (
12  int inputLineNumber,
13  rational chordSoundingWholeNotes,
14  rational chordDisplayWholeNotes,
15  msrDurationKind chordGraphicDurationKind);
16 
17  // creation from MusicXML
18  // ------------------------------------------------------
19 
20  SMARTP<msrChord> createChordNewbornClone (
21  S_msrPart containingPart);
22 
23  SMARTP<msrChord> createChordDeepCopy (
24  S_msrPart containingPart);
25 
26  protected:
27 
28  // constructors/destructor
29  // ------------------------------------------------------
30 
31  msrChord (
32  int inputLineNumber,
33  rational chordSoundingWholeNotes,
34  rational chordDisplayWholeNotes,
35  msrDurationKind chordGraphicDurationKind);
36 
37  virtual ~msrChord ();
38 
39  public:
40 
41  // set and get
42  // ------------------------------------------------------
43 
44  // whole notes
45  void setChordSoundingWholeNotes (
46  rational wholeNotes);
47 
48  rational getChordSoundingWholeNotes () const
49  // JMI { return fChordSoundingWholeNotes; }
50  { return fMeasureElementSoundingWholeNotes; }
51 
52  void setChordDisplayWholeNotes (
53  rational wholeNotes);
54 
55  rational getChordDisplayWholeNotes () const
56  { return fChordDisplayWholeNotes; }
57 
58  // graphic duration
59  msrDurationKind getChordGraphicDurationKind () const
60  { return fChordGraphicDurationKind; }
61 
62  // chord notes
63  const vector<S_msrNote>&
64  getChordNotesVector () const
65  { return fChordNotesVector; }
66 
67  // stems
68  const list<S_msrStem>&
69  getChordStems () const
70  { return fChordStems; }
71 
72  // beams
73  const list<S_msrBeam>&
74  getChordBeams () const
75  { return fChordBeams; }
76 
77  // articulations
78  const list<S_msrArticulation>&
79  getChordArticulations () const
80  { return fChordArticulations; }
81 
82  // spanners
83  const list<S_msrSpanner>&
84  getChordSpanners () const
85  { return fChordSpanners; }
86 
87  // technicals
88  const list<S_msrTechnical>&
89  getChordTechnicals () const
90  { return fChordTechnicals; }
91 
92  const list<S_msrTechnicalWithInteger>&
93  getChordTechnicalWithIntegers () const
94  { return fChordTechnicalWithIntegers; }
95 
96  const list<S_msrTechnicalWithFloat>&
97  getChordTechnicalWithFloats () const
98  { return fChordTechnicalWithFloats; }
99 
100  const list<S_msrTechnicalWithString>&
101  getChordTechnicalWithStrings () const
102  { return fChordTechnicalWithStrings; }
103 
104  // ornaments
105  const list<S_msrOrnament>&
106  getChordOrnaments () const
107  { return fChordOrnaments; }
108 
109  // glissandos
110  const list<S_msrGlissando>&
111  getChordGlissandos () const
112  { return fChordGlissandos; }
113 
114  // slides
115  const list<S_msrSlide>&
116  getChordSlides () const
117  { return fChordSlides; }
118 
119  // singleTremolo
120  void setChordSingleTremolo (
121  S_msrSingleTremolo trem);
122 
123  S_msrSingleTremolo getChordSingleTremolo () const
124  { return fChordSingleTremolo; }
125 
126  // dynamics
127  const list<S_msrDynamics>&
128  getChordDynamics () const
129  { return fChordDynamics; }
130  const list<S_msrOtherDynamics>&
131  getChordOtherDynamics () const
132  { return fChordOtherDynamics; }
133 
134  const list<S_msrWedge>&
135  getChordWedges () const
136  { return fChordWedges; }
137 
138  // words
139  const list<S_msrWords>&
140  getChordWords () const
141  { return fChordWords; }
142 
143  // ties
144  const list<S_msrTie>&
145  getChordTies () const
146  { return fChordTies; }
147 
148  // slurs
149  const list<S_msrSlur>&
150  getChordSlurs () const
151  { return fChordSlurs; }
152 
153  // ligatures
154  const list<S_msrLigature>&
155  getChordLigatures () const
156  { return fChordLigatures; }
157 
158  // pedals
159  const list<S_msrPedal>&
160  getChordPedals () const
161  { return fChordPedals; }
162 
163  // double tremolo
164  void setChordIsFirstChordInADoubleTremolo ()
165  { fChordIsFirstChordInADoubleTremolo = true; }
166 
167  bool getChordIsFirstChordInADoubleTremolo () const
168  { return fChordIsFirstChordInADoubleTremolo; }
169 
170  void setChordIsSecondChordInADoubleTremolo ()
171  { fChordIsSecondChordInADoubleTremolo = true; }
172 
173  bool getChordIsSecondChordInADoubleTremolo () const
174  { return fChordIsSecondChordInADoubleTremolo; }
175 
176  // grace notes
177  void setChordGraceNotesGroupBefore (
178  S_msrGraceNotesGroup graceNotesGroupBefore)
179  {
180  fChordGraceNotesGroupBefore =
181  graceNotesGroupBefore;
182  }
183 
184  S_msrGraceNotesGroup getChordGraceNotesGroupBefore () const
185  { return fChordGraceNotesGroupBefore; }
186 
187  void setChordGraceNotesGroupAfter (
188  S_msrGraceNotesGroup graceNotesGroupAfter)
189  {
190  fChordGraceNotesGroupAfter =
191  graceNotesGroupAfter;
192  }
193 
194  S_msrGraceNotesGroup getChordGraceNotesGroupAfter () const
195  { return fChordGraceNotesGroupAfter; }
196 
197 
198  // harmony
199  void appendHarmonyToChord (
200  S_msrHarmony harmony)
201  { fChordHarmoniesList.push_back (harmony); }
202 
203  // figured bass
204  void setChordFiguredBass (
205  S_msrFiguredBass figuredBass)
206  { fChordFiguredBass = figuredBass; }
207 
208  const S_msrFiguredBass&
209  getChordFiguredBass () const
210  { return fChordFiguredBass; }
211 
212  // octave shift
213  void setChordOctaveShift (
214  S_msrOctaveShift octaveShift)
215  { fChordOctaveShift = octaveShift; }
216 
217  S_msrOctaveShift getChordOctaveShift () const
218  { return fChordOctaveShift; }
219 
220  // measure upLink
221  void setChordMeasureUpLink (
222  const S_msrMeasure& measure)
223  { fChordMeasureUpLink = measure; }
224 
225  S_msrMeasure getChordMeasureUpLink () const
226  { return fChordMeasureUpLink; }
227 
228  // positions in measures
229  void setChordMembersPositionInMeasure (
230  S_msrMeasure measure,
231  rational positionInMeasure);
232 
233  // services
234  // ------------------------------------------------------
235 
236  // notes
237  void addFirstNoteToChord (
238  S_msrNote note,
239  S_msrVoice voice);
240 
241  void addAnotherNoteToChord (
242  S_msrNote note,
243  S_msrVoice voice);
244 
245  S_msrNote fetchChordFirstNonGraceNote () const;
246 
247  // articulations
248  void appendArticulationToChord (S_msrArticulation art);
249 
250  // spanners
251  void appendSpannerToChord (S_msrSpanner span);
252 
253  // technicals
254  void appendTechnicalToChord (S_msrTechnical tech);
255 
256  void appendTechnicalWithIntegerToChord (
257  S_msrTechnicalWithInteger tech);
258 
259  void appendTechnicalWithFloatToChord (
260  S_msrTechnicalWithFloat tech);
261 
262  void appendTechnicalWithStringToChord (
263  S_msrTechnicalWithString tech);
264 
265  // ornaments
266  void appendOrnamentToChord (S_msrOrnament orn);
267 
268  // glissandos
269  void appendGlissandoToChord (S_msrGlissando gliss);
270 
271  // slides
272  void appendSlideToChord (S_msrSlide slide);
273 
274  // dynamics
275  void appendDynamicsToChord (S_msrDynamics dynamic)
276  {
277  fChordDynamics.push_back (dynamic);
278  }
279  void appendOtherDynamicsToChord (
280  S_msrOtherDynamics otherDynamic)
281  {
282  fChordOtherDynamics.push_back (otherDynamic);
283  }
284 
285  // slashes
286  void appendSlashToChord (S_msrSlash slash)
287  {
288  fChordSlashes.push_back (slash);
289  }
290 
291  // wedges
292  void appendWedgeToChord (S_msrWedge wedge)
293  {
294  fChordWedges.push_back (wedge);
295  }
296 
297  // words
298  void appendWordsToChord (S_msrWords dynamic)
299  {
300  fChordWords.push_back (dynamic);
301  }
302 
303  // ties
304  void appendTieToChord (S_msrTie tie)
305  {
306  fChordTies.push_back (tie);
307  }
308 
309  // slurs
310  void appendSlurToChord (S_msrSlur slur)
311  {
312  fChordSlurs.push_back (slur);
313  }
314 
315  // stems
316  void appendStemToChord (S_msrStem stem)
317  {
318  fChordStems.push_back (stem);
319  }
320 
321  // beams
322  void appendBeamToChord (S_msrBeam beam);
323 
324  // ligatures
325  void appendLigatureToChord (S_msrLigature ligature)
326  {
327  fChordLigatures.push_back (ligature);
328  }
329 
330  // pedals
331  void appendPedalToChord (S_msrPedal pedal)
332  {
333  fChordPedals.push_back (pedal);
334  }
335 
336  // tuplet members
337  /* JMI
338  void applyTupletMemberDisplayedFactorToChordMembers (
339  int actualNotes, int normalNotes);
340 */
341 
342  public:
343 
344  // visitors
345  // ------------------------------------------------------
346 
347  virtual void acceptIn (basevisitor* v);
348  virtual void acceptOut (basevisitor* v);
349 
350  virtual void browseData (basevisitor* v);
351 
352  public:
353 
354  // print
355  // ------------------------------------------------------
356 
357  string asStringwithRawDivisions () const;
358 
359  string asString () const;
360 
361  string asShortString () const;
362 
363  virtual void print (ostream& os) const;
364 
365  private:
366 
367  // fields
368  // ------------------------------------------------------
369 
370  // measure upLink
371  S_msrMeasure fChordMeasureUpLink;
372 
373  // sounding divisions
374 // JMI rational fChordSoundingWholeNotes;
375 
376  // display divisions
377  rational fChordDisplayWholeNotes;
378 
379  // graphic duration is needed for grace notes,
380  // since they don't have any note (sounding) duration
381  msrDurationKind fChordGraphicDurationKind;
382 
383  vector<S_msrNote> fChordNotesVector;
384 
385  // stems
386  list<S_msrStem> fChordStems;
387 
388  // beams
389  list<S_msrBeam> fChordBeams;
390 
391  // articulations
392  list<S_msrArticulation>
393  fChordArticulations;
394 
395  // spanners
396  list<S_msrSpanner> fChordSpanners;
397 
398  // single tremolo
399  S_msrSingleTremolo fChordSingleTremolo;
400 
401  // double tremolo
402  bool fChordIsFirstChordInADoubleTremolo;
403  bool fChordIsSecondChordInADoubleTremolo;
404 
405  // technicals
406  list<S_msrTechnical> fChordTechnicals;
407 
408  list<S_msrTechnicalWithInteger>
409  fChordTechnicalWithIntegers;
410 
411  list<S_msrTechnicalWithFloat>
412  fChordTechnicalWithFloats;
413 
414  list<S_msrTechnicalWithString>
415  fChordTechnicalWithStrings;
416 
417  // ornaments
418  list<S_msrOrnament> fChordOrnaments;
419 
420  // glissandos
421  list<S_msrGlissando> fChordGlissandos;
422 
423  // slides
424  list<S_msrSlide> fChordSlides;
425 
426  // dynamics
427  list<S_msrDynamics> fChordDynamics;
428  list<S_msrOtherDynamics>
429  fChordOtherDynamics;
430 
431  // slashes
432  list<S_msrSlash> fChordSlashes;
433 
434  // wedges
435  list<S_msrWedge> fChordWedges;
436 
437  // octave shift
438  S_msrOctaveShift fChordOctaveShift;
439 
440  // words
441  list<S_msrWords> fChordWords;
442 
443  // ties
444  list<S_msrTie> fChordTies;
445 
446  // slurs
447  list<S_msrSlur> fChordSlurs;
448 
449  // ligatures
450  list<S_msrLigature> fChordLigatures;
451 
452  // pedals
453  list<S_msrPedal> fChordPedals;
454 
455  // grace notes
456  S_msrGraceNotesGroup fChordGraceNotesGroupBefore;
457  S_msrGraceNotesGroup fChordGraceNotesGroupAfter;
458 
459  // harmony
460  list<S_msrHarmony> fChordHarmoniesList;
461 
462  // figured bass
463  S_msrFiguredBass fChordFiguredBass;
464 };
465 typedef SMARTP<msrChord> S_msrChord;
466 EXP ostream& operator<< (ostream& os, const S_msrChord& elt);
467 
msrChord
Definition: msrChords_MUT_DEP.h:8
rational
Rational number representation.
Definition: rational.h:25