LibMusicXML  3.18
msrScaling.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 ___msrScaling___
14 #define ___msrScaling___
15 
16 #include "msrElements.h"
17 
18 #include "msrBasicTypes.h"
19 
20 #include "msrLayouts.h"
21 
22 
23 namespace MusicXML2
24 {
25 
26 //______________________________________________________________________________
27 class msrScaling : public msrElement
28 {
29  public:
30 
31  // creation from MusicXML
32  // ------------------------------------------------------
33 
34  static SMARTP<msrScaling> create (
35  int inputLineNumber);
36 
37  SMARTP<msrScaling> createMsrScalingNewbornClone ();
38 
39  public:
40 
41  // constructors/destructor
42  // ------------------------------------------------------
43 
44  msrScaling (
45  int inputLineNumber);
46 
47  virtual ~msrScaling ();
48 
49  public:
50 
51  // set and get
52  // ------------------------------------------------------
53 
54  // relative to absolute lengths conversion
55  void setMillimeters (float val)
56  { fMillimeters = val; }
57  float getMillimeters () const
58  { return fMillimeters; }
59 
60  void setTenths (int val)
61  { fTenths = val; }
62  float getTenths () const
63  { return float(fTenths); }
64 
65  // page layout
66  void setPageLayout (S_msrPageLayout val)
67  { fPageLayout = val; }
68  S_msrPageLayout getPageLayout () const
69  { return fPageLayout; }
70 
71  public:
72 
73  // services
74  // ------------------------------------------------------
75 
76  float fetchGlobalStaffSize () const;
77 
78  public:
79 
80  // visitors
81  // ------------------------------------------------------
82 
83  virtual void acceptIn (basevisitor* v);
84  virtual void acceptOut (basevisitor* v);
85 
86  virtual void browseData (basevisitor* v);
87 
88  public:
89 
90  // print
91  // ------------------------------------------------------
92 
93  virtual void print (ostream& os) const;
94 
95 
96  private:
97 
98  // fields
99  // ------------------------------------------------------
100 
101  // relative to absolute lengths conversion
102  float fMillimeters;
103  int fTenths;
104 
105  // page layout
106  S_msrPageLayout fPageLayout;
107 };
109 EXP ostream& operator<< (ostream& os, const S_msrScaling& elt);
110 
111 
112 } // namespace MusicXML2
113 
114 
115 #endif
MusicXML2::msrScaling
Definition: msrScaling.h:28
MusicXML2::SMARTP< msrScaling >
MusicXML2::basevisitor
Definition: basevisitor.h:25
MusicXML2::msrElement
Definition: msrElements.h:26