LibMusicXML  3.18
msr2Names.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 ___msr2Names___
14 #define ___msr2Names___
15 
16 #include "msr.h"
17 
18 #include "msrOah.h"
19 
20 namespace MusicXML2
21 {
22 
23 //________________________________________________________________________
25 
26  public visitor<S_msrScore>,
27 
28  // parts & part groups
29 
30  public visitor<S_msrPartGroup>,
31 
32  public visitor<S_msrPart>,
33 
34  // staves
35 
36  public visitor<S_msrStaff>,
37 
38  // voices
39 
40  public visitor<S_msrVoice>,
41 
42  // varValAssocs
43 
44  public visitor<S_msrVarValAssoc>,
45  public visitor<S_msrVarValsListAssoc>
46 
47 {
48  public:
49 
51  S_msrOah& msrOpts,
52  indentedOstream& ios);
53 
54  virtual ~msr2NamesVisitor ();
55 
56  void printNamesFromMsrScore (
57  const S_msrScore& score);
58 
59  protected:
60 
61  virtual void visitStart (S_msrScore& elt);
62  virtual void visitEnd (S_msrScore& elt);
63 
64  virtual void visitStart (S_msrPartGroup& elt);
65  virtual void visitEnd (S_msrPartGroup& elt);
66 
67  virtual void visitStart (S_msrPart& elt);
68  virtual void visitEnd (S_msrPart& elt);
69 
70  virtual void visitStart (S_msrStaff& elt);
71  virtual void visitEnd (S_msrStaff& elt);
72 
73  virtual void visitStart (S_msrVoice& elt);
74  virtual void visitEnd (S_msrVoice& elt);
75 
76  virtual void visitStart (S_msrVarValAssoc& elt);
77  virtual void visitEnd (S_msrVarValAssoc& elt);
78  virtual void visitStart (S_msrVarValsListAssoc& elt);
79  virtual void visitEnd (S_msrVarValsListAssoc& elt);
80 
81  private:
82 
83  S_msrOah fMsrOah;
84 
85  indentedOstream& fMsrNamesOutputStream;
86 
87  // score
88  // ------------------------------------------------------
89 
90  // part groups
91  // ------------------------------------------------------
92 
93  int fPartGroupsCounter;
94 
95  // parts
96  // ------------------------------------------------------
97 
98  int fPartsCounter;
99 
100  // staves
101  // ------------------------------------------------------
102 
103  int fStavesCounter;
104 
105  // prevent clef, key and time from being handled twice
106  bool fOnGoingStaff;
107 
108  // voices
109  // ------------------------------------------------------
110 
111  int fVoicesCounter;
112 };
113 
114 
115 }
116 
117 
118 #endif
MusicXML2::msr2NamesVisitor
Definition: msr2Names.h:47
MusicXML2::SMARTP< msrOah >
MusicXML2::visitor
Definition: visitor.h:27
MusicXML2::indentedOstream
Definition: utilities.h:213