Skip to content
Permalink
Browse files

fix #8604, fix #4525, fix #6091, fix #48456, fix #148276, fix #230531…

…, fix #267778: improve volta playback

unwindSection using RepeatList as how a human will notate the volta: using the n-th time a startRepeat is taken, also slightly modified the jump detection logic to have it check for jumps only upon the last passage of a measure
  • Loading branch information...
jeetee authored and lasconic committed Dec 27, 2017
1 parent 3087920 commit dd2050e2f1d820570e0f7e05e7fec51a3a6380ec

Large diffs are not rendered by default.

@@ -44,8 +44,9 @@ class RepeatList: public QList<RepeatSegment*>

RepeatSegment* rs; // tmp value during unwind()

Measure* jumpToStartRepeat(Measure*);
void unwindSection(Measure* fm, Measure* em);
Measure* findStartRepeat(Measure*);
int findStartFromRepeatCount(Measure * const startFrom, Measure * const sectionEndMeasure);

public:
RepeatList(Score* s);
@@ -904,7 +904,7 @@ class Score : public QObject, ScoreElement {
void adjustBracketsIns(int sidx, int eidx);
void adjustKeySigs(int sidx, int eidx, KeyList km);

Measure* searchLabel(const QString& s);
Measure* searchLabel(const QString& s, Measure* startMeasure = nullptr, Measure* endMeasure = nullptr);
Measure* searchLabelWithinSectionFirst(const QString& s, Measure* sectionStartMeasure, Measure* sectionEndMeasure);
virtual inline RepeatList* repeatList() const;
qreal utick2utime(int tick) const;
@@ -264,6 +264,17 @@ bool Volta::hasEnding(int repeat) const
return false;
}

//---------------------------------------------------------
// lastEnding
//---------------------------------------------------------

int Volta::lastEnding() const
{
if (_endings.isEmpty())
return 0;
return _endings.last();
}

//---------------------------------------------------------
// getProperty
//---------------------------------------------------------
@@ -74,6 +74,7 @@ class Volta final : public TextLineBase {
QString text() const;

bool hasEnding(int repeat) const;
int lastEnding() const;
void setVoltaType(Volta::Type); // deprecated
Type voltaType() const; // deprecated

@@ -112,6 +112,13 @@
</BarLine>
</Measure>
<Measure number="5">
<Jump>
<style>Repeat Text Right</style>
<text>D.C. al Coda</text>
<jumpTo>start</jumpTo>
<playUntil>coda</playUntil>
<continueAt>codab</continueAt>
</Jump>
<Rest>
<durationType>measure</durationType>
<duration>4/4</duration>
@@ -91,9 +91,9 @@ class TestRepeat : public QObject, public MTest
void repeat42() { repeat("repeat42.mscx", "1;2;1;3;5;1;4;5"); } // #148276 Open volta lines must extend over entire ending: next volta
void repeat43() { repeat("repeat43.mscx", "1;2;1;2;1;3;1;2;1;4;1;5"); } // #8604 Complex alternate endings 1.2.4. / 3./ 5.
void repeat44() { repeat("repeat44.mscx", "1;2;3;4;5;3;6;3;4;1;7"); } // Jump from within a volta

void repeat45() { repeat("repeat45.mscx", "1;2;3;4;3;5;6;2;3;4;3;5;6;7"); } // repeat12 but with 'play repeats' enabled
void repeat46() { repeat("repeat46.mscx", "1;2;3;4;5;3;4;2;3;4;5;3;4;5;6"); } // repeat24 but with 'play repeats' enabled
void repeat46() { repeat("repeat46.mscx", "1;2;3;4;5;3;4;2;3;4;5;3;4;5;6"); } // repeat24 but with 'play repeats' enabled
};

//---------------------------------------------------------

0 comments on commit dd2050e

Please sign in to comment.
You can’t perform that action at this time.