LibMusicXML  3.18
msrMeasureElements.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 ___msrMeasureElements___
14 #define ___msrMeasureElements___
15 
16 #include "msrElements.h"
17 
18 
19 namespace MusicXML2
20 {
21 
22 //______________________________________________________________________________
24 {
25  public:
26 
27  // constants
28  // ------------------------------------------------------
29 
30  #define K_NO_MEASURE_NUMBER "*unknown*"
31 
32  #define K_NO_POSITION_MEASURE_NUMBER rational (-222222, 1)
33 
34  #define K_NO_WHOLE_NOTES rational (-444444, 1)
35 
36  protected:
37 
38  // constructors/destructor
39  // ------------------------------------------------------
40 
42  int inputLineNumber);
43 
44  virtual ~msrMeasureElement ();
45 
46  public:
47 
48  // set and get
49  // ------------------------------------------------------
50 
51  void setMeasureElementMeasureNumber (
52  string positionInMeasure)
53  {
54  fMeasureElementMeasureNumber =
55  positionInMeasure;
56  }
57 
58  string getMeasureElementMeasureNumber ()
59  { return fMeasureElementMeasureNumber; }
60 
61  void setMeasureElementPositionInMeasure (
62  rational positionInMeasure,
63  string context);
64 
65  rational getMeasureElementPositionInMeasure ()
66  { return fMeasureElementPositionInMeasure; }
67 
68  void setMeasureElementSoundingWholeNotes (
69  rational wholeNotes,
70  string context);
71 
72  rational getMeasureElementSoundingWholeNotes () const
73  { return fMeasureElementSoundingWholeNotes; }
74 
75  public:
76 
77  // services
78  // ------------------------------------------------------
79 
80  static bool compareMeasureElementsByIncreasingPositionInMeasure (
81  const SMARTP<msrMeasureElement>& first,
82  const SMARTP<msrMeasureElement>& second);
83 
84  public:
85 
86  // visitors
87  // ------------------------------------------------------
88 
89  virtual void acceptIn (basevisitor* v);
90  virtual void acceptOut (basevisitor* v);
91 
92  virtual void browseData (basevisitor* v) = 0;
93 
94  public:
95 
96  // print
97  // ------------------------------------------------------
98 
99  virtual std::string asShortString () const;
100  virtual std::string asString () const;
101 
102  virtual void print (ostream& os) const;
103 
104  virtual void printSummary (ostream& os) {}
105 
106  protected:
107 
108  // fields
109  // ------------------------------------------------------
110 
111  string fMeasureElementMeasureNumber;
112  rational fMeasureElementPositionInMeasure;
113  rational fMeasureElementSoundingWholeNotes;
114 };
116 EXP ostream& operator<< (ostream& os, const S_msrMeasureElement& elt);
117 
118 
119 } // namespace MusicXML2
120 
121 
122 #endif
the smart pointer implementation
Definition: smartpointer.h:58
Definition: basevisitor.h:25
Definition: msrElements.h:26
Definition: msrMeasureElements.h:24
Rational number representation.
Definition: rational.h:25