Skip to content

Commit

Permalink
fix #64206: Repeat Measure sign in one staff of multi-stave inst. cau…
Browse files Browse the repository at this point in the history
…ses repeated playback of all staves
  • Loading branch information
lasconic committed Jun 8, 2015
1 parent 2c74356 commit 80cc88f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions libmscore/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ AccidentalVal Measure::findAccidental(Segment* s, int staffIdx, int line) const
int startTrack = staffIdx * VOICES;
int endTrack = startTrack + VOICES;
for (Segment* segment = first(st); segment; segment = segment->next(st)) {
if (segment == s) {
if (segment == s && staff->isPitchedStaff()) {
ClefType clef = staff->clef(s->tick());
int l = relStep(line, clef);
return tversatz.accidentalVal(l);
Expand Down Expand Up @@ -2865,12 +2865,11 @@ bool Measure::isFullMeasureRest()
// isRepeatMeasure
//---------------------------------------------------------

bool Measure::isRepeatMeasure(Part* part)
bool Measure::isRepeatMeasure(Staff* staff)
{
int firstStaffIdx = score()->staffIdx(part);
int nextStaffIdx = firstStaffIdx + part->nstaves();
int strack = firstStaffIdx * VOICES;
int etrack = nextStaffIdx * VOICES;
int staffIdx = score()->staffIdx(staff);
int strack = staffIdx * VOICES;
int etrack = (staffIdx + 1) * VOICES;
Segment* s = first(Segment::Type::ChordRest);

if (s == 0)
Expand Down
2 changes: 1 addition & 1 deletion libmscore/measure.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class Measure : public MeasureBase {
bool hasVoice(int track) const;
bool isMeasureRest(int staffIdx);
bool isFullMeasureRest();
bool isRepeatMeasure(Part* part);
bool isRepeatMeasure(Staff* staff);
bool visible(int staffIdx) const;
bool slashStyle(int staffIdx) const;

Expand Down
2 changes: 1 addition & 1 deletion libmscore/rendermidi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ void Score::renderStaff(EventMap* events, Staff* staff)
int endTick = startTick + rs->len;
int tickOffset = rs->utick - rs->tick;
for (Measure* m = tick2measure(startTick); m; m = m->nextMeasure()) {
if (lastMeasure && m->isRepeatMeasure(staff->part())) {
if (lastMeasure && m->isRepeatMeasure(staff)) {
int offset = m->tick() - lastMeasure->tick();
collectMeasureEvents(events, lastMeasure, staff, tickOffset + offset);
}
Expand Down

0 comments on commit 80cc88f

Please sign in to comment.