fix #252201: playback holds during section break

This commit is contained in:
Peter Jonas 2018-03-22 05:49:11 +00:00
parent 2803c7d827
commit 858cb5d852
4 changed files with 16 additions and 11 deletions

View file

@ -2362,7 +2362,7 @@ void Score::getNextMeasure(LayoutContext& lc)
// implement section break rest
//
if (measure->sectionBreak() && measure->pause() != 0.0)
setPause(measure->endTick()-1, measure->pause());
setPause(measure->endTick(), measure->pause());
//
// calculate accidentals and note lines,

View file

@ -178,7 +178,7 @@ void MeasureBase::remove(Element* el)
break;
case LayoutBreak::SECTION:
setSectionBreak(false);
score()->setPause(endTick()-1, 0);
score()->setPause(endTick(), 0);
score()->setLayoutAll();
break;
case LayoutBreak::NOBREAK:

View file

@ -395,7 +395,7 @@ void Score::fixTicks()
// implement section break rest
//
if (isMaster() && m->sectionBreak() && m->pause() != 0.0)
setPause(m->tick() + m->ticks() - 1, m->pause());
setPause(m->tick() + m->ticks(), m->pause());
//
// implement fermata as a tempo change

View file

@ -344,16 +344,20 @@ void ExportMidi::PauseMap::calculate(const Score* s)
int tickOffset = rs->utick - rs->tick;
auto se = tempomap->lower_bound(startTick);
auto ee = tempomap->lower_bound(endTick);
auto ee = tempomap->lower_bound(endTick+1); // +1 to include first tick of next RepeatSegment
for (auto it = se; it != ee; ++it) {
int tick = it->first;
int utick = tick + tickOffset;
if (it->second.pause == 0.0) {
// We have a regular tempo change. Don't include tempo change from first tick of next RepeatSegment (it will be included later).
if (tick != endTick)
tempomapWithPauses->insert(std::pair<const int, TEvent> (this->addPauseTicks(utick), it->second));
}
else {
// We have a pause event. Don't include pauses from first tick of current RepeatSegment (it was included in the previous one).
if (tick != startTick) {
Fraction timeSig(sigmap->timesig(tick).timesig());
qreal quarterNotesPerMeasure = (4.0 * timeSig.numerator()) / timeSig.denominator();
int ticksPerMeasure = quarterNotesPerMeasure * MScore::division; // store a full measure of ticks to keep barlines in same places
@ -364,6 +368,7 @@ void ExportMidi::PauseMap::calculate(const Score* s)
}
}
}
}
//---------------------------------------------------------
// PauseMap::offsetAtUTick