1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-2016 Werner Schweer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENCE.GPL
//=============================================================================
#ifndef __LAYOUT_H__
#define __LAYOUT_H__
namespace Ms {
class Segment;
class Page;
//---------------------------------------------------------
// LayoutContext
// temp values used during layout
//---------------------------------------------------------
struct LayoutContext {
Score* score { 0 };
bool startWithLongNames { true };
bool firstSystem { true };
Page* page { 0 };
int curPage { 0 }; // index in Score->page()s
Fraction tick { 0, 1 };
QList<System*> systemList; // reusable systems
std::set<Spanner*> processedSpanners;
System* prevSystem { 0 }; // used during page layout
System* curSystem { 0 };
MeasureBase* systemOldMeasure;
MeasureBase* pageOldMeasure;
bool rangeDone { false };
MeasureBase* prevMeasure { 0 };
MeasureBase* curMeasure { 0 };
MeasureBase* nextMeasure { 0 };
int measureNo { 0 };
Fraction startTick;
Fraction endTick;
LayoutContext() = default;
LayoutContext(const LayoutContext&) = delete;
LayoutContext& operator=(const LayoutContext&) = delete;
~LayoutContext();
void layoutLinear();
#if 0 // unused
void layoutMeasureLinear(MeasureBase*);
#endif
void layout();
int adjustMeasureNo(MeasureBase*);
void getNextPage();
void collectPage();
};
//---------------------------------------------------------
// VerticalAlignRange
//---------------------------------------------------------
enum class VerticalAlignRange {
SEGMENT, MEASURE, SYSTEM
};
extern bool isTopBeam(ChordRest* cr);
extern bool notTopBeam(ChordRest* cr);
extern bool isTopTuplet(ChordRest* cr);
extern bool notTopTuplet(ChordRest* cr);
} // namespace Ms
#endif
|