MuseScore  3.4
Music composition and notation
layout.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2002-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 __LAYOUT_H__
14 #define __LAYOUT_H__
15 
16 namespace Ms {
17 
18 class Segment;
19 class Page;
20 
21 //---------------------------------------------------------
22 // LayoutContext
23 // temp values used during layout
24 //---------------------------------------------------------
25 
26 struct LayoutContext {
27  Score* score { 0 };
28  bool startWithLongNames { true };
29  bool firstSystem { true };
30  Page* page { 0 };
31  int curPage { 0 }; // index in Score->page()s
32  Fraction tick { 0, 1 };
33 
34  QList<System*> systemList; // reusable systems
35  std::set<Spanner*> processedSpanners;
36 
37  System* prevSystem { 0 }; // used during page layout
38  System* curSystem { 0 };
39 
42  bool rangeDone { false };
43 
47  int measureNo { 0 };
50 
52  LayoutContext(const LayoutContext&) = delete;
53  LayoutContext& operator=(const LayoutContext&) = delete;
55 
56  void layoutLinear();
57 
58  void layout();
60  void getNextPage();
61  void collectPage();
62  };
63 
64 //---------------------------------------------------------
65 // VerticalAlignRange
66 //---------------------------------------------------------
67 
68 enum class VerticalAlignRange {
70  };
71 
72 extern bool isTopBeam(ChordRest* cr);
73 extern bool notTopBeam(ChordRest* cr);
74 extern bool isTopTuplet(ChordRest* cr);
75 extern bool notTopTuplet(ChordRest* cr);
76 
77 } // namespace Ms
78 #endif
79 
bool firstSystem
Definition: layout.h:29
System * prevSystem
Definition: layout.h:37
void getNextPage()
Definition: layout.cpp:1724
Virtual base class for Measure, HBox and VBox.
Definition: measurebase.h:61
MeasureBase * nextMeasure
Definition: layout.h:46
MeasureBase * curMeasure
Definition: layout.h:45
int adjustMeasureNo(MeasureBase *)
Definition: layout.cpp:2247
void layout()
Definition: layout.cpp:4503
void layoutLinear()
Definition: layoutlinear.cpp:202
QList< System * > systemList
Definition: layout.h:34
LayoutContext(Score *s)
Definition: layout.h:51
Fraction tick
Definition: layout.h:32
Definition: score.h:391
Fraction startTick
Definition: layout.h:48
int measureNo
Definition: layout.h:47
std::set< Spanner * > processedSpanners
Definition: layout.h:35
MeasureBase * systemOldMeasure
Definition: layout.h:40
Definition: layout.h:26
MeasureBase * pageOldMeasure
Definition: layout.h:41
~LayoutContext()
Definition: layout.cpp:4547
System * curSystem
Definition: layout.h:38
Definition: aeolus.cpp:26
Fraction endTick
Definition: layout.h:49
VerticalAlignRange
Definition: layout.h:68
bool isTopTuplet(ChordRest *cr)
Definition: layout.cpp:2836
bool rangeDone
Definition: layout.h:42
bool startWithLongNames
Definition: layout.h:28
LayoutContext & operator=(const LayoutContext &)=delete
Definition: chordrest.h:48
bool notTopBeam(ChordRest *cr)
Definition: layout.cpp:2807
MeasureBase * prevMeasure
Definition: layout.h:44
int curPage
Definition: layout.h:31
Score * score
Definition: layout.h:27
bool notTopTuplet(ChordRest *cr)
Definition: layout.cpp:2859
One row of measures for all instruments; a complete piece of the timeline.
Definition: system.h:79
Definition: fraction.h:46
bool isTopBeam(ChordRest *cr)
Definition: layout.cpp:2778
Page * page
Definition: layout.h:30
Definition: page.h:34
void collectPage()
Definition: layout.cpp:4095