MuseScore  3.4
Music composition and notation
musicxml.h
Go to the documentation of this file.
1 //=============================================================================
2 // MusE Score
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2002-2015 Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __MUSICXML_H__
21 #define __MUSICXML_H__
22 
28 #include "libmscore/fraction.h"
29 #include "libmscore/mscore.h"
31 #include "libmscore/line.h"
32 #include "importxmlfirstpass.h"
33 #include "musicxmlsupport.h"
34 
35 namespace Ms {
36 
37 //---------------------------------------------------------
38 // MusicXmlPartGroup
39 //---------------------------------------------------------
40 
42  int span;
43  int start;
46  };
47 
48 const int MAX_LYRICS = 16;
49 const int MAX_PART_GROUPS = 8;
50 const int MAX_NUMBER_LEVEL = 6; // maximum number of overlapping MusicXML objects
51 
52 //---------------------------------------------------------
53 // CreditWords
54 // a single parsed MusicXML credit-words element
55 //---------------------------------------------------------
56 
57 struct CreditWords {
58  double defaultX;
59  double defaultY;
60  QString justify;
61  QString hAlign;
62  QString vAlign;
63  QString words;
64  CreditWords(double a, double b, QString c, QString d, QString e, QString f)
65  {
66  defaultX = a;
67  defaultY = b;
68  justify = c;
69  hAlign = d;
70  vAlign = e;
71  words = f;
72  }
73  };
74 
75 typedef QList<CreditWords*> CreditWordsList;
76 typedef CreditWordsList::iterator iCreditWords;
77 typedef CreditWordsList::const_iterator ciCreditWords;
78 
79 //---------------------------------------------------------
80 // JumpMarkerDesc
81 //---------------------------------------------------------
82 
90 
91 public:
92  JumpMarkerDesc(Element* el, Measure* meas) : _el(el), _meas(meas) {}
93  Element* el() const { return _el; }
94  Measure* meas() const { return _meas; }
95  };
96 
97 typedef QList<JumpMarkerDesc> JumpMarkerDescList;
98 
99 //---------------------------------------------------------
100 // SlurDesc
101 //---------------------------------------------------------
102 
107 class SlurDesc {
108 public:
109  enum class State : char { NONE, START, STOP };
110  SlurDesc() : _slur(0), _state(State::NONE) {}
111  Slur* slur() const { return _slur; }
112  void start(Slur* slur) { _slur = slur; _state = State::START; }
113  void stop(Slur* slur) { _slur = slur; _state = State::STOP; }
114  bool isStart() const { return _state == State::START; }
115  bool isStop() const { return _state == State::STOP; }
116 private:
119  };
120 
121 //---------------------------------------------------------
122 // MusicXml
123 //---------------------------------------------------------
124 
125 typedef std::vector<MusicXmlPartGroup*> MusicXmlPartGroupList;
126 typedef QMap<SLine*, QPair<int, int> > MusicXmlSpannerMap;
127 
128 enum {
129  NoSystem = 0,
133  };
134 
135 } // namespace Ms
136 #endif
const int MAX_PART_GROUPS
Definition: musicxml.h:49
CreditWords(double a, double b, QString c, QString d, QString e, QString f)
Definition: musicxml.h:64
int start
Definition: musicxml.h:43
const int MAX_LYRICS
Definition: musicxml.h:48
JumpMarkerDesc(Element *el, Measure *meas)
Definition: musicxml.h:92
SlurDesc()
Definition: musicxml.h:110
one measure in a system
Definition: measure.h:65
CreditWordsList::const_iterator ciCreditWords
Definition: musicxml.h:77
The description of Slurs being handled.
Definition: musicxml.h:107
CreditWordsList::iterator iCreditWords
Definition: musicxml.h:76
Definition: slur.h:55
Base class of score layout elements.
Definition: element.h:158
QString hAlign
Definition: musicxml.h:61
QString vAlign
Definition: musicxml.h:62
State
Definition: musicxml.h:109
Measure * meas() const
Definition: musicxml.h:94
The description of Jumps and Markers to be added later.
Definition: musicxml.h:87
Definition: musicxml.h:131
const int MAX_NUMBER_LEVEL
Definition: musicxml.h:50
QList< CreditWords * > CreditWordsList
Definition: musicxml.h:75
void start(Slur *slur)
Definition: musicxml.h:112
QMap< SLine *, QPair< int, int > > MusicXmlSpannerMap
Definition: musicxml.h:126
bool isStart() const
Definition: musicxml.h:114
bool barlineSpan
Definition: musicxml.h:45
BracketType type
Definition: musicxml.h:44
Measure * _meas
Definition: musicxml.h:89
Definition: musicxml.h:129
Definition: aeolus.cpp:26
State _state
Definition: musicxml.h:118
bool isStop() const
Definition: musicxml.h:115
double defaultX
Definition: musicxml.h:58
BracketType
Definition: mscore.h:107
Definition: musicxml.h:130
Element * el() const
Definition: musicxml.h:93
double defaultY
Definition: musicxml.h:59
QList< JumpMarkerDesc > JumpMarkerDescList
Definition: musicxml.h:97
Slur * _slur
Definition: musicxml.h:117
int span
Definition: musicxml.h:42
QString justify
Definition: musicxml.h:60
Definition: musicxml.h:41
Slur * slur() const
Definition: musicxml.h:111
Definition: musicxml.h:57
std::vector< MusicXmlPartGroup * > MusicXmlPartGroupList
Definition: musicxml.h:125
Element * _el
Definition: musicxml.h:88
QString words
Definition: musicxml.h:63
void stop(Slur *slur)
Definition: musicxml.h:113
Definition: musicxml.h:132