MuseScore/libmscore/repeatlist.h
Eric Fontaine 11362dbe35 Fix #65161 repeatlist unwind section by section _rebased
Each section is unwound individually. A giant album should have same repeat list as concatenation of repeatlists from individual scores (provided each score only refered to markers in its score).
Partitions score by section breaks, and is now aware about section breaks occuring on non-measure MeasureBase objects such as horizontal/vertical frames (repeat37 test).
2015-08-18 14:15:03 -04:00

65 lines
1.6 KiB
C++

//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2009-2011 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 __REPEATLIST_H__
#define __REPEATLIST_H__
namespace Ms {
class Score;
class Measure;
//---------------------------------------------------------
// RepeatSegment
//---------------------------------------------------------
class RepeatSegment {
public:
int tick; // start tick
int len;
int utick;
qreal utime;
qreal timeOffset;
RepeatSegment();
};
//---------------------------------------------------------
// RepeatList
//---------------------------------------------------------
class RepeatList: public QList<RepeatSegment*>
{
Score* _score;
mutable unsigned idx1, idx2; // cached values
RepeatSegment* rs; // tmp value during unwind()
Measure* jumpToStartRepeat(Measure*);
void unwindSection(Measure* fm, Measure* em);
public:
RepeatList(Score* s);
void unwind();
int utick2tick(int tick) const;
int tick2utick(int tick) const;
void dump() const;
int utime2utick(qreal) const;
qreal utick2utime(int) const;
void update();
int ticks();
};
} // namespace Ms
#endif