Skip to content

Commit

Permalink
Merge pull request #1329 from MarcSabatella/31901-lyrics-voice
Browse files Browse the repository at this point in the history
Fix issues with lyrics & multiple voices
  • Loading branch information
lasconic committed Sep 22, 2014
2 parents d6701c5 + 84fa467 commit daf130a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion libmscore/measure.cpp
Expand Up @@ -2110,7 +2110,9 @@ void Measure::read(XmlReader& e, int staffIdx)
element->setTrack(e.track());
element->read(e);
segment = getSegment(Segment::Type::ChordRest, e.tick());
ChordRest* cr = static_cast<ChordRest*>(segment->element(e.track()));
ChordRest* cr = static_cast<ChordRest*>(segment->element(element->track()));
if (!cr)
cr = static_cast<ChordRest*>(segment->element(e.track())); // in case lyric itself has bad track info
if (!cr)
qDebug("Internal error: no chord/rest for lyrics");
else
Expand Down
11 changes: 5 additions & 6 deletions libmscore/system.cpp
Expand Up @@ -839,17 +839,16 @@ static Lyrics* searchNextLyrics(Segment* s, int staffIdx, int verse)
while ((s = s->next1(Segment::Type::ChordRest))) {
int strack = staffIdx * VOICES;
int etrack = strack + VOICES;
QList<Lyrics*>* nll = 0;
// search through all tracks of current staff looking for a lyric in specified verse
for (int track = strack; track < etrack; ++track) {
ChordRest* cr = static_cast<ChordRest*>(s->element(track));
if (cr && !cr->lyricsList().isEmpty()) {
nll = &cr->lyricsList();
break;
// cr with lyrics found, but does it have a syllable in specified verse?
l = cr->lyricsList().value(verse);
if (l)
break;
}
}
if (!nll)
continue;
l = nll->value(verse);
if (l)
break;
}
Expand Down

0 comments on commit daf130a

Please sign in to comment.