LibMusicXML 3.18
lpsrParts.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 ___lpsrParts___
14#define ___lpsrParts___
15
16#include "lpsrContexts.h"
17
18#include "lpsrStaves.h"
19
20
21namespace MusicXML2
22{
23
24//______________________________________________________________________________
26{
27 public:
28
29 // creation from MusicXML
30 // ------------------------------------------------------
31
32 static SMARTP<lpsrPartBlock> create (
33 S_msrPart part);
34
35 protected:
36
37 // constructors/destructor
38 // ------------------------------------------------------
39
41 S_msrPart part);
42
43 virtual ~lpsrPartBlock ();
44
45 public:
46
47 // set and get
48 // ------------------------------------------------------
49
50 S_msrPart getPart () const
51 { return fPart; }
52
53 const list<S_msrElement>&
54 getPartBlockElementsList () const
55 { return fPartBlockElementsList; }
56
57 void setPartBlockInstrumentName (
58 string instrumentName)
59 {
60 fPartBlockInstrumentName =
61 instrumentName;
62 }
63
64 string getPartBlockInstrumentName () const
65 { return fPartBlockInstrumentName; }
66
67 void setPartBlockShortInstrumentName (
68 string shortInstrumentName)
69 {
70 fPartBlockShortInstrumentName =
71 shortInstrumentName;
72 }
73
74 string getPartBlockShortInstrumentName () const
75 { return fPartBlockShortInstrumentName; }
76
77 public:
78
79 // pbulic services
80 // ------------------------------------------------------
81
82 void appendStaffBlockToPartBlock (
83 S_lpsrStaffBlock staffBlock);
84
85 void appendChordNamesContextToPartBlock (
86 int inputLineNumber,
87 S_lpsrChordNamesContext chordNamesContext);
88
89 void appendFiguredBassContextToPartBlock (
91
92 private:
93
94 // private services
95 // ------------------------------------------------------
96
97 // voices ordering in staves
98
99 static bool compareElementsToHaveHarmoniesAboveCorrespondingStaff (
100 const S_msrElement& first,
101 const S_msrElement& second);
102
103 static bool compareStaffBlockWithOtherElement (
104 const S_lpsrStaffBlock& staffBlock,
105 const S_msrElement& otherElement);
106
107 static bool compareChordNamesContextWithOtherElement (
108 const S_lpsrChordNamesContext& chordNamesContext,
109 const S_msrElement& otherElement);
110
111 public:
112
113 // visitors
114 // ------------------------------------------------------
115
116 virtual void acceptIn (basevisitor* v);
117 virtual void acceptOut (basevisitor* v);
118
119 virtual void browseData (basevisitor* v);
120
121 public:
122
123 public:
124
125 // print
126 // ------------------------------------------------------
127
128 virtual void print (ostream& os) const;
129
130 private:
131
132 // fields
133 // ------------------------------------------------------
134
135 S_msrPart fPart;
136
137 list<S_msrElement> fPartBlockElementsList;
138
139 string fPartBlockInstrumentName; // JMI
140 string fPartBlockShortInstrumentName; // JMI
141};
143EXP ostream& operator<< (ostream& os, const S_lpsrPartBlock& elt);
144
145
146}
147
148
149#endif
Definition: basevisitor.h:25
Definition: lpsrElements.h:24
Definition: lpsrParts.h:26