LibMusicXML  3.18
msrTechnicals.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 ___msrTechnicals___
14 #define ___msrTechnicals___
15 
16 #include "msrElements.h"
17 
18 #include "msrBasicTypes.h"
19 
20 
21 namespace MusicXML2
22 {
23 
24 //______________________________________________________________________________
25 class msrTechnical : public msrElement
26 {
27  public:
28 
29  // data types
30  // ------------------------------------------------------
31 
32  enum msrTechnicalKind {
33  kArrow, // rich JMI
34  kDoubleTongue,
35  kDownBow,
36  kFingernails,
37  kHarmonic,
38  kHeel,
39  kHole, // rich JMI
40  kOpenString,
41  kSnapPizzicato,
42  kStopped,
43  kTap,
44  kThumbPosition,
45  kToe,
46  kTripleTongue,
47  kUpBow};
48 
49  static string technicalKindAsString (
50  msrTechnicalKind technicalKind);
51 
52 /* JMI
53  enum msrTechnicalAccidentalMarkKind {
54  kNatural, kSharp, kFlat};
55 
56  static string technicalAccidentalMarkKindAsString (
57  msrTechnicalAccidentalMarkKind technicalAccidentalMarkKind);
58  */
59 
60  // creation from MusicXML
61  // ------------------------------------------------------
62 
63  static SMARTP<msrTechnical> create (
64  int inputLineNumber,
65  msrTechnicalKind technicalKind,
66  msrPlacementKind technicalPlacementKind);
67 
68  protected:
69 
70  // constructors/destructor
71  // ------------------------------------------------------
72 
73  msrTechnical (
74  int inputLineNumber,
75  msrTechnicalKind technicalKind,
76  msrPlacementKind technicalPlacementKind);
77 
78  virtual ~msrTechnical ();
79 
80  public:
81 
82  // set and get
83  // ------------------------------------------------------
84 
85  msrTechnicalKind getTechnicalKind () const
86  { return fTechnicalKind; }
87 
88  void setTechnicalPlacementKind (
89  msrPlacementKind technicalPlacementKind)
90  {
91  fTechnicalPlacementKind =
92  technicalPlacementKind;
93  }
94 
95  msrPlacementKind getTechnicalPlacementKind () const
96  { return fTechnicalPlacementKind; }
97 
98  /* JMI
99  void setTechnicalAccidentalMarkKind (
100  msrTechnicalAccidentalMarkKind
101  technicalAccidentalMarkKind)
102  {
103  fTechnicalAccidentalMarkKind =
104  technicalAccidentalMarkKind;
105  }
106 
107  msrTechnicalAccidentalMarkKind
108  getTechnicalAccidentalMarkKind () const
109  { return fTechnicalAccidentalMarkKind; }
110 */
111 
112  // services
113  // ------------------------------------------------------
114 
115  string technicalKindAsString () const;
116 
117  string technicalPlacementKindAsString () const;
118 
119  string technicalAccidentalMarkKindAsString () const;
120 
121  string asString () const;
122 
123  public:
124 
125  // visitors
126  // ------------------------------------------------------
127 
128  virtual void acceptIn (basevisitor* v);
129  virtual void acceptOut (basevisitor* v);
130 
131  virtual void browseData (basevisitor* v);
132 
133  public:
134 
135  // print
136  // ------------------------------------------------------
137 
138  virtual void print (ostream& os) const;
139 
140  private:
141 
142  // fields
143  // ------------------------------------------------------
144 
145  msrTechnicalKind fTechnicalKind;
146 
147  msrPlacementKind fTechnicalPlacementKind;
148 
149 // JMI msrTechnicalAccidentalMarkKind fTechnicalAccidentalMarkKind;
150 };
152 EXP ostream& operator<< (ostream& os, const S_msrTechnical& elt);
153 
154 //______________________________________________________________________________
156 {
157  public:
158 
159  // data types
160  // ------------------------------------------------------
161 
162  enum msrTechnicalWithIntegerKind {
163  kFingering,
164  kFret,
165  kString };
166 
167  static string technicalWithIntegerKindAsString (
168  msrTechnicalWithIntegerKind technicalWithIntegerKind);
169 
170  // creation from MusicXML
171  // ------------------------------------------------------
172 
173  static SMARTP<msrTechnicalWithInteger> create (
174  int inputLineNumber,
175  msrTechnicalWithIntegerKind technicalWithIntegerKind,
176  int technicalWithIntegerValue,
177  msrPlacementKind technicalWithIntegerPlacementKind);
178 
179  protected:
180 
181  // constructors/destructor
182  // ------------------------------------------------------
183 
185  int inputLineNumber,
186  msrTechnicalWithIntegerKind technicalWithIntegerKind,
187  int technicalWithIntegerValue,
188  msrPlacementKind technicalWithIntegerPlacementKind);
189 
190  virtual ~msrTechnicalWithInteger ();
191 
192  public:
193 
194  // set and get
195  // ------------------------------------------------------
196 
197  msrTechnicalWithIntegerKind
198  getTechnicalWithIntegerKind () const
199  { return fTechnicalWithIntegerKind; }
200 
201  int getTechnicalWithIntegerValue () const
202  { return fTechnicalWithIntegerValue; }
203 
204  void setTechnicalWithIntegerPlacementKind (
205  msrPlacementKind
206  technicalWithIntegerPlacementKind)
207  {
208  fTechnicalWithIntegerPlacementKind =
209  technicalWithIntegerPlacementKind;
210  }
211 
212  msrPlacementKind getTechnicalWithIntegerPlacementKind () const
213  { return fTechnicalWithIntegerPlacementKind; }
214 
215  // services
216  // ------------------------------------------------------
217 
218  string technicalWithIntegerKindAsString () const;
219 
220  string technicalWithIntegerPlacementKindAsString () const;
221 
222  string technicalWithIntegerAccidentalMarkKindAsString () const;
223 
224  string asString () const;
225 
226  public:
227 
228  // visitors
229  // ------------------------------------------------------
230 
231  virtual void acceptIn (basevisitor* v);
232  virtual void acceptOut (basevisitor* v);
233 
234  virtual void browseData (basevisitor* v);
235 
236  public:
237 
238  // print
239  // ------------------------------------------------------
240 
241  virtual void print (ostream& os) const;
242 
243  private:
244 
245  // fields
246  // ------------------------------------------------------
247 
248  msrTechnicalWithIntegerKind fTechnicalWithIntegerKind;
249 
250  int fTechnicalWithIntegerValue;
251 
252  msrPlacementKind fTechnicalWithIntegerPlacementKind;
253 };
255 EXP ostream& operator<< (ostream& os, const S_msrTechnicalWithInteger& elt);
256 
257 //______________________________________________________________________________
259 {
260  public:
261 
262  // data types
263  // ------------------------------------------------------
264 
265  enum msrTechnicalWithFloatKind {
266  kBend };
267 
268  static string technicalWithFloatKindAsString (
269  msrTechnicalWithFloatKind technicalWithFloatKind);
270 
271  // creation from MusicXML
272  // ------------------------------------------------------
273 
274  static SMARTP<msrTechnicalWithFloat> create (
275  int inputLineNumber,
276  msrTechnicalWithFloatKind technicalWithFloatKind,
277  float technicalWithFloatValue,
278  msrPlacementKind technicalWithFloatPlacementKind);
279 
280  protected:
281 
282  // constructors/destructor
283  // ------------------------------------------------------
284 
286  int inputLineNumber,
287  msrTechnicalWithFloatKind technicalWithFloatKind,
288  float technicalWithFloatValue,
289  msrPlacementKind technicalWithFloatPlacementKind);
290 
291  virtual ~msrTechnicalWithFloat ();
292 
293  public:
294 
295  // set and get
296  // ------------------------------------------------------
297 
298  msrTechnicalWithFloatKind
299  getTechnicalWithFloatKind () const
300  { return fTechnicalWithFloatKind; }
301 
302  float getTechnicalWithFloatValue () const
303  { return fTechnicalWithFloatValue; }
304 
305  void setTechnicalWithFloatPlacementKind (
306  msrPlacementKind
307  technicalWithFloatPlacementKind)
308  {
309  fTechnicalWithFloatPlacementKind =
310  technicalWithFloatPlacementKind;
311  }
312 
313  msrPlacementKind getTechnicalWithFloatPlacementKind () const
314  { return fTechnicalWithFloatPlacementKind; }
315 
316  // services
317  // ------------------------------------------------------
318 
319  string technicalWithFloatKindAsString () const;
320 
321  string technicalWithFloatPlacementKindAsString () const;
322 
323  string technicalWithFloatAccidentalMarkKindAsString () const;
324 
325  string asString () const;
326 
327  public:
328 
329  // visitors
330  // ------------------------------------------------------
331 
332  virtual void acceptIn (basevisitor* v);
333  virtual void acceptOut (basevisitor* v);
334 
335  virtual void browseData (basevisitor* v);
336 
337  public:
338 
339  // print
340  // ------------------------------------------------------
341 
342  virtual void print (ostream& os) const;
343 
344  private:
345 
346  // fields
347  // ------------------------------------------------------
348 
349  msrTechnicalWithFloatKind fTechnicalWithFloatKind;
350 
351  float fTechnicalWithFloatValue;
352 
353  msrPlacementKind fTechnicalWithFloatPlacementKind;
354 };
356 EXP ostream& operator<< (ostream& os, const S_msrTechnicalWithFloat& elt);
357 
358 //______________________________________________________________________________
360 {
361  public:
362 
363  // data types
364  // ------------------------------------------------------
365 
366  enum msrTechnicalWithStringKind {
367  kHammerOn,
368  kHandbell,
369  kOtherTechnical,
370  kPluck,
371  kPullOff};
372 
373  static string technicalWithStringKindAsString (
374  msrTechnicalWithStringKind technicalWithStringKind);
375 
376  // creation from MusicXML
377  // ------------------------------------------------------
378 
379  static SMARTP<msrTechnicalWithString> create (
380  int inputLineNumber,
381  msrTechnicalWithStringKind technicalWithStringKind,
382  msrTechnicalTypeKind technicalWithStringTypeKind,
383  string technicalWithStringValue,
384  msrPlacementKind technicalWithStringPlacementKind);
385 
386  protected:
387 
388  // constructors/destructor
389  // ------------------------------------------------------
390 
392  int inputLineNumber,
393  msrTechnicalWithStringKind technicalWithStringKind,
394  msrTechnicalTypeKind technicalWithStringTypeKind,
395  string technicalWithStringValue,
396  msrPlacementKind technicalWithStringPlacementKind);
397 
398  virtual ~msrTechnicalWithString ();
399 
400  public:
401 
402  // set and get
403  // ------------------------------------------------------
404 
405  msrTechnicalWithStringKind
406  getTechnicalWithStringKind () const
407  { return fTechnicalWithStringKind; }
408 
409  msrTechnicalTypeKind getTechnicalWithStringTypeKind () const
410  { return fTechnicalWithStringTypeKind; }
411 
412  string getTechnicalWithStringValue () const
413  { return fTechnicalWithStringValue; }
414 
415  void setTechnicalWithStringPlacementKind (
416  msrPlacementKind
417  technicalWithStringPlacementKind)
418  {
419  fTechnicalWithStringPlacementKind =
420  technicalWithStringPlacementKind;
421  }
422 
423  msrPlacementKind getTechnicalWithStringPlacementKind () const
424  { return fTechnicalWithStringPlacementKind; }
425 
426  // services
427  // ------------------------------------------------------
428 
429  string technicalWithStringKindAsString () const;
430 
431  string technicalWithStringTypeKindAsString () const;
432 
433  string technicalWithStringPlacementKindAsString () const;
434 
435  string technicalWithStringAccidentalMarkKindAsString () const;
436 
437  string asString () const;
438 
439  public:
440 
441  // visitors
442  // ------------------------------------------------------
443 
444  virtual void acceptIn (basevisitor* v);
445  virtual void acceptOut (basevisitor* v);
446 
447  virtual void browseData (basevisitor* v);
448 
449  public:
450 
451  // print
452  // ------------------------------------------------------
453 
454  virtual void print (ostream& os) const;
455 
456  private:
457 
458  // fields
459  // ------------------------------------------------------
460 
461  msrTechnicalWithStringKind
462  fTechnicalWithStringKind;
463 
464  msrTechnicalTypeKind fTechnicalWithStringTypeKind;
465 
466  string fTechnicalWithStringValue;
467 
468  msrPlacementKind fTechnicalWithStringPlacementKind;
469 };
471 EXP ostream& operator<< (ostream& os, const S_msrTechnicalWithString& elt);
472 
473 
474 } // namespace MusicXML2
475 
476 
477 #endif
MusicXML2::msrTechnicalWithInteger
Definition: msrTechnicals.h:156
MusicXML2::msrTechnicalWithFloat
Definition: msrTechnicals.h:259
MusicXML2::msrTechnicalWithString
Definition: msrTechnicals.h:360
MusicXML2::msrTechnical
Definition: msrTechnicals.h:26
MusicXML2::SMARTP
the smart pointer implementation
Definition: smartpointer.h:58
MusicXML2::basevisitor
Definition: basevisitor.h:25
MusicXML2::msrElement
Definition: msrElements.h:26