LibMusicXML  3.18
msrDoubleTremolos_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 msrDoubleTremolo : public msrMeasureElement
8 {
9  public:
10 
11  // data types
12  // ------------------------------------------------------
13 
14  enum msrDoubleTremoloKind {
15  kNotesDoubleTremolo, kChordsDoubleTremolo};
16 
17  static string msrDoubleTremoloKindAsString (
18  msrDoubleTremoloKind doubleTremolotKind);
19 
20  // creation from MusicXML
21  // ------------------------------------------------------
22 
23  static SMARTP<msrDoubleTremolo> create (
24  int inputLineNumber,
25  msrDoubleTremoloKind doubleTremoloKind,
26  msrTremoloTypeKind doubleTremoloTypeKind,
27  int doubleTremoloMarksNumber,
28  msrPlacementKind doubleTremoloPlacementKind);
29 
30 
31  SMARTP<msrDoubleTremolo> createDoubleTremoloNewbornClone (
32  S_msrElement doubleTremoloFirstElement,
33  S_msrElement doubleTremoloSecondElement);
34 
35  protected:
36 
37  // constructors/destructor
38  // ------------------------------------------------------
39 
41  int inputLineNumber,
42  msrDoubleTremoloKind doubleTremoloKind,
43  msrTremoloTypeKind doubleTremoloTypeKind,
44  int doubleTremoloMarksNumber,
45  msrPlacementKind doubleTremoloPlacementKind);
46 
47  virtual ~msrDoubleTremolo ();
48 
49  public:
50 
51  // set and get
52  // ------------------------------------------------------
53 
54  // double tremolo kind
55 
56  void setDoubleTremoloKind (
57  msrDoubleTremoloKind doubleTremoloKind)
58  { fDoubleTremoloKind = doubleTremoloKind; }
59 
60  msrDoubleTremoloKind getDoubleTremoloKind () const
61  { return fDoubleTremoloKind; }
62 
63  // double tremolo type kind
64 
65  void setDoubleTremoloTypeKind (
66  msrTremoloTypeKind doubleTremoloTypeKind)
67  { fDoubleTremoloTypeKind = doubleTremoloTypeKind; }
68 
69  msrTremoloTypeKind getDoubleTremoloTypeKind () const
70  { return fDoubleTremoloTypeKind; }
71 
72  // double tremolo placement
73 
74  void setDoubleTremoloPlacementKind (
75  msrPlacementKind
76  doubleTremoloPlacementKind)
77  {
78  fDoubleTremoloPlacementKind =
79  doubleTremoloPlacementKind;
80  }
81 
82  msrPlacementKind getDoubleTremoloPlacementKind () const
83  { return fDoubleTremoloPlacementKind; }
84 
85  // double tremolo marks number
86 
87  int getDoubleTremoloMarksNumber () const
88  { return fDoubleTremoloMarksNumber; }
89 
90  // double tremolo elements duration
91 
92  rational getDoubleTremoloElementsDuration () const
93  { return fDoubleTremoloElementsDuration; }
94 
95  // double tremolo number of repeats
96 
97  void setDoubleTremoloNumberOfRepeats (
98  int doubleTremoloNumberOfRepeats)
99  {
100  fDoubleTremoloNumberOfRepeats =
101  doubleTremoloNumberOfRepeats;
102  }
103 
104  int getDoubleTremoloNumberOfRepeats () const
105  {
106  return
107  fDoubleTremoloNumberOfRepeats;
108  }
109 
110 
111  // double tremolo placement
112 
113  void setDoubleTremoloNoteFirstElement (
114  S_msrNote note);
115 
116  void setDoubleTremoloChordFirstElement (
117  S_msrChord chord);
118 
119  // double tremolo first element
120 
121  S_msrElement getDoubleTremoloFirstElement () const
122  { return fDoubleTremoloFirstElement; }
123 
124  // double tremolo second element
125 
126  void setDoubleTremoloNoteSecondElement (
127  S_msrNote note);
128 
129  void setDoubleTremoloChordSecondElement (
130  S_msrChord chord);
131 
132  S_msrElement getDoubleTremoloSecondElement () const
133  { return fDoubleTremoloSecondElement; }
134 
135  // sounding whole notes
136 
137  void setDoubleTremoloSoundingWholeNotes (
138  rational wholeNotes)
139  {
140  // JMI fDoubleTremoloSoundingWholeNotes =
141  fMeasureElementSoundingWholeNotes =
142  wholeNotes;
143  }
144 
145  rational getDoubleTremoloSoundingWholeNotes () const
146  {
147  return
148  // JMI fDoubleTremoloSoundingWholeNotes;
149  fMeasureElementSoundingWholeNotes;
150  }
151 
152  // measure number
153 
154  void setDoubleTremoloMeasureNumber (
155  string measureNumber);
156 
157  // position in measure
158 
159  void setDoubleTremoloPositionInMeasure (
160  rational positionInMeasure);
161 
162  // services
163  // ------------------------------------------------------
164 
165  // tremolo first note
166 
167  void setDoubleTremoloFirstNotePositionInMeasure (
168  rational positionInMeasure);
169 
170  void setDoubleTremoloFirstNoteMeasureNumber (
171  string measureNumber);
172 
173  public:
174 
175  // visitors
176  // ------------------------------------------------------
177 
178  virtual void acceptIn (basevisitor* v);
179  virtual void acceptOut (basevisitor* v);
180 
181  virtual void browseData (basevisitor* v);
182 
183  public:
184 
185  // print
186  // ------------------------------------------------------
187 
188  string doubleTremoloPlacementKindAsString () const;
189 
190  string asShortString () const;
191  string asString () const;
192 
193  virtual void print (ostream& os) const;
194 
195  private:
196 
197  // fields
198  // ------------------------------------------------------
199 
200  // sounding whole notes JMI
201  // the same as the displayed divisions of both members
202 // JMI rational fDoubleTremoloSoundingWholeNotes;
203  rational fDoubleTremoloSoundingWholeNotes;
204 
205  msrDoubleTremoloKind fDoubleTremoloKind;
206 
207  msrTremoloTypeKind fDoubleTremoloTypeKind;
208 
209  int fDoubleTremoloMarksNumber;
210 
211  rational fDoubleTremoloElementsDuration;
212 
213  int fDoubleTremoloNumberOfRepeats;
214 
215  msrPlacementKind fDoubleTremoloPlacementKind;
216 
217  // the two elements of a double tremole are notes or chords
218  S_msrElement fDoubleTremoloFirstElement;
219  S_msrElement fDoubleTremoloSecondElement;
220 };
221 typedef SMARTP<msrDoubleTremolo> S_msrDoubleTremolo;
222 EXP ostream& operator<< (ostream& os, const S_msrDoubleTremolo& elt);
223 
msrDoubleTremolo
Definition: msrDoubleTremolos_MUT_DEP.h:8
rational
Rational number representation.
Definition: rational.h:25