MuseScore  3.4
Music composition and notation
read206.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2016 Werner Schweer
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 // as published by the Free Software Foundation and appearing in
10 // the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __READ206_H__
14 #define __READ206_H__
15 
16 namespace Ms {
17 
18 class MStyle;
19 
20 //---------------------------------------------------------
21 // @@ PageFormat
22 //---------------------------------------------------------
23 
24 class PageFormat {
25  QSizeF _size;
26  qreal _printableWidth; // _width - left margin - right margin
27  qreal _evenLeftMargin; // values in inch
33  bool _twosided;
34 
35  public:
37 
38  const QSizeF& size() const { return _size; } // size in inch
39  qreal width() const { return _size.width(); }
40  qreal height() const { return _size.height(); }
41  void setSize(const QSizeF& s) { _size = s; }
42 
43  void read(XmlReader&);
44  qreal evenLeftMargin() const { return _evenLeftMargin; }
45  qreal oddLeftMargin() const { return _oddLeftMargin; }
46  qreal evenTopMargin() const { return _evenTopMargin; }
47  qreal evenBottomMargin() const { return _evenBottomMargin; }
48  qreal oddTopMargin() const { return _oddTopMargin; }
49  qreal oddBottomMargin() const { return _oddBottomMargin; }
50  qreal printableWidth() const { return _printableWidth; }
51 
52  void setEvenLeftMargin(qreal val) { _evenLeftMargin = val; }
53  void setOddLeftMargin(qreal val) { _oddLeftMargin = val; }
54  void setEvenTopMargin(qreal val) { _evenTopMargin = val; }
55  void setEvenBottomMargin(qreal val) { _evenBottomMargin = val; }
56  void setOddTopMargin(qreal val) { _oddTopMargin = val; }
57  void setOddBottomMargin(qreal val) { _oddBottomMargin = val; }
58  void setPrintableWidth(qreal val) { _printableWidth = val; }
59 
60  bool twosided() const { return _twosided; }
61  void setTwosided(bool val) { _twosided = val; }
62 
63  // convenience functions
64  qreal evenRightMargin() const { return _size.width() - _printableWidth - _evenLeftMargin; }
65  qreal oddRightMargin() const { return _size.width() - _printableWidth - _oddLeftMargin; }
66  };
67 
69 extern void readAccidental206(Accidental*, XmlReader&);
70 extern void setPageFormat(MStyle*, const PageFormat&);
71 extern void initPageFormat(MStyle*, PageFormat*);
72 extern void readTextStyle206(MStyle* style, XmlReader& e, std::map<QString, std::map<Sid, QVariant>>& excessStyles);
73 //extern void readText206(XmlReader& e, TextBase* t, Element* be);
74 // extern void readVolta206(XmlReader& e, Volta* volta);
75 extern void readTextLine206(XmlReader& e, TextLineBase* tlb);
76 extern void readTrill206(XmlReader& e, Trill* t);
77 extern void readHairpin206(XmlReader& e, Hairpin* h);
78 extern void readSlur206(XmlReader& e, Slur* s);
79 extern void readTie206(XmlReader& e, Tie* t);
80 
81 extern bool readNoteProperties206(Note* note, XmlReader& e);
83 extern bool readTupletProperties206(XmlReader& e, Tuplet* t);
85 extern bool readChordProperties206(XmlReader& e, Chord* ch);
86 }
87 
88 #endif
89 
90 
void setOddBottomMargin(qreal val)
Definition: read206.h:57
qreal _printableWidth
Definition: read206.h:26
void readTextLine206(XmlReader &e, TextLineBase *tlb)
Definition: read206.cpp:2511
Element * readArticulation(Element *parent, XmlReader &e)
Definition: read206.cpp:2556
Definition: xml.h:67
void read(XmlReader &)
Definition: read206.cpp:3919
void readHairpin206(XmlReader &e, Hairpin *h)
Definition: read206.cpp:2437
void setEvenTopMargin(qreal val)
Definition: read206.h:54
Definition: slur.h:55
bool readNoteProperties206(Note *note, XmlReader &e)
Definition: read206.cpp:1334
Base class of score layout elements.
Definition: element.h:158
qreal _evenTopMargin
Definition: read206.h:29
PageFormat()
Definition: read206.h:36
qreal oddBottomMargin() const
Definition: read206.h:49
bool _twosided
Definition: read206.h:33
Definition: hairpin.h:84
qreal printableWidth() const
Definition: read206.h:50
Definition: accidental.h:65
Definition: trill.h:62
qreal height() const
Definition: read206.h:40
Example of 1/8 triplet: _baseLen = 1/8 _actualNotes = 3 _normalNotes = 2 (3 notes played in the time ...
Definition: tuplet.h:37
bool readChordProperties206(XmlReader &e, Chord *ch)
Definition: read206.cpp:2087
qreal _oddTopMargin
Definition: read206.h:31
void initPageFormat(MStyle *style, PageFormat *pf)
Definition: read206.cpp:393
void setOddLeftMargin(qreal val)
Definition: read206.h:53
bool readChordRestProperties206(XmlReader &e, ChordRest *ch)
Definition: read206.cpp:1889
qreal evenLeftMargin() const
Definition: read206.h:44
void setEvenLeftMargin(qreal val)
Definition: read206.h:52
qreal oddLeftMargin() const
Definition: read206.h:45
void readSlur206(XmlReader &e, Slur *s)
Definition: read206.cpp:2710
qreal _oddBottomMargin
Definition: read206.h:32
Definition: aeolus.cpp:26
qreal oddTopMargin() const
Definition: read206.h:48
bool twosided() const
Definition: read206.h:60
Virtual base class for Chord, Rest and Tuplet.
Definition: duration.h:34
qreal evenTopMargin() const
Definition: read206.h:46
void setEvenBottomMargin(qreal val)
Definition: read206.h:55
const QSizeF & size() const
Definition: read206.h:38
qreal oddRightMargin() const
Definition: read206.h:65
qreal evenRightMargin() const
Definition: read206.h:64
a Tie has a Note as startElement/endElement
Definition: tie.h:60
bool readDurationProperties206(XmlReader &e, DurationElement *de)
Definition: read206.cpp:1819
Graphic representation of a chord.
Definition: chord.h:55
QSizeF _size
Definition: read206.h:25
bool readTupletProperties206(XmlReader &e, Tuplet *de)
Definition: read206.cpp:1848
qreal _evenLeftMargin
Definition: read206.h:27
void readTextStyle206(MStyle *style, XmlReader &e, std::map< QString, std::map< Sid, QVariant >> &excessStyles)
Definition: read206.cpp:425
Definition: chordrest.h:48
void readAccidental206(Accidental *a, XmlReader &e)
Definition: read206.cpp:761
void setOddTopMargin(qreal val)
Definition: read206.h:56
Definition: textlinebase.h:70
qreal evenBottomMargin() const
Definition: read206.h:47
void readTrill206(XmlReader &e, Trill *t)
Definition: read206.cpp:2485
Graphic representation of a note.
Definition: note.h:212
void setTwosided(bool val)
Definition: read206.h:61
qreal _evenBottomMargin
Definition: read206.h:30
void setSize(const QSizeF &s)
Definition: read206.h:41
qreal width() const
Definition: read206.h:39
qreal _oddLeftMargin
Definition: read206.h:28
void setPageFormat(MStyle *style, const PageFormat &pf)
Definition: read206.cpp:374
void setPrintableWidth(qreal val)
Definition: read206.h:58
void readTie206(XmlReader &e, Tie *t)
Definition: read206.cpp:2733
Definition: style.h:1293
Definition: read206.h:24