Skip to content

Commit

Permalink
fix #39801
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Nov 27, 2014
1 parent 7895c41 commit a3a54fb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions libmscore/groups.cpp
Expand Up @@ -76,6 +76,7 @@ Beam::Mode Groups::endBeam(ChordRest* cr, ChordRest* prev)
const Groups& g = cr->staff()->group(cr->tick());
Fraction stretch = cr->staff()->timeStretch(cr->tick());
int tick = (cr->rtick() * stretch.numerator()) / stretch.denominator();

Beam::Mode val = g.beamMode(tick, d.type());

// context-dependent checks
Expand Down
11 changes: 7 additions & 4 deletions libmscore/score.cpp
Expand Up @@ -471,9 +471,11 @@ void Score::fixTicks()

for (Staff* staff : _staves)
staff->clearTimeSig();

TimeSigMap* smap = sigmap();
Fraction sig(fm->len());
Fraction nsig(fm->timesig());

if (!parentScore()) {
tempomap()->clear();
smap->clear();
Expand All @@ -493,7 +495,7 @@ void Score::fixTicks()
if (m->mmRest())
m->mmRest()->moveTicks(diff);

if (!parentScore()) {
// if (!parentScore()) {
//
// implement section break rest
//
Expand All @@ -514,8 +516,8 @@ void Score::fixTicks()
staff(staffIdx)->addTimeSig(ts);
}
}
else if (s->segmentType() == Segment::Type::ChordRest) {
foreach(Element* e, s->annotations()) {
else if (!parentScore() && (s->segmentType() == Segment::Type::ChordRest)) {
foreach (Element* e, s->annotations()) {
if (e->type() == Element::Type::TEMPO_TEXT) {
const TempoText* tt = static_cast<const TempoText*>(e);
setTempo(tt->segment(), tt->tempo());
Expand Down Expand Up @@ -543,7 +545,7 @@ void Score::fixTicks()
}
}
}
}
// }

//
// update time signature map
Expand All @@ -552,6 +554,7 @@ void Score::fixTicks()
sig = m->len();
smap->add(tick, SigEvent(sig, m->timesig(), m->no()));
}

tick += measureTicks;
}
if (tempomap()->empty())
Expand Down
11 changes: 11 additions & 0 deletions libmscore/staff.cpp
Expand Up @@ -272,6 +272,8 @@ TimeSig* Staff::timeSig(int tick) const
auto i = timesigs.upper_bound(tick);
if (i != timesigs.begin())
--i;
else if (tick < i->first)
return 0;
return (i == timesigs.end()) ? 0 : i->second;
}

Expand Down Expand Up @@ -311,6 +313,15 @@ void Staff::removeTimeSig(TimeSig* timesig)
timesigs.erase(timesig->segment()->tick());
}

//---------------------------------------------------------
// clearTimeSig
//---------------------------------------------------------

void Staff::clearTimeSig()
{
timesigs.clear();
}

//---------------------------------------------------------
// Staff::key
//
Expand Down
2 changes: 1 addition & 1 deletion libmscore/staff.h
Expand Up @@ -160,7 +160,7 @@ class Staff : public QObject {

void addTimeSig(TimeSig*);
void removeTimeSig(TimeSig*);
void clearTimeSig() { timesigs.clear(); }
void clearTimeSig();
Fraction timeStretch(int tick) const;
TimeSig* timeSig(int tick) const;
const Groups& group(int tick) const;
Expand Down

0 comments on commit a3a54fb

Please sign in to comment.