Sanitize broken syllabic information

This commit is contained in:
Matthias Neeracher 2008-01-29 23:22:13 +00:00
parent fe39f675ba
commit 9ec2e9d50e

View File

@ -219,6 +219,8 @@ void VLPlistVisitor::VisitChord(VLChord & c)
VLFraction at(0);
VLFraction tiedStart(0);
VLLyricsNote tiedNote;
uint8_t prevKind[20];
memset(prevKind, 0, 20);
for (NSEnumerator * ne = [melody objectEnumerator];
NSDictionary * ndict = [ne nextObject];
@ -262,6 +264,17 @@ void VLPlistVisitor::VisitChord(VLChord & c)
}
}
//
// Sanitize syllabic information which was corrupt in early
// versions.
//
for (size_t i = 0; i<note.fLyrics.size(); ++i)
if (note.fLyrics[i].fText.size()) {
if (!(prevKind[i] & VLSyllable::kHasNext))
note.fLyrics[i].fKind &= ~VLSyllable::kHasPrev;
prevKind[i] = note.fLyrics[i].fKind;
}
tiedStart = at;
tiedNote = note;