diff --git a/Sources/VLLilypondWriter.cpp b/Sources/VLLilypondWriter.cpp index 7a83404..22be3ef 100644 --- a/Sources/VLLilypondWriter.cpp +++ b/Sources/VLLilypondWriter.cpp @@ -23,7 +23,7 @@ void VLLilypondWriter::Visit(VLSong & song) fSeenEnding = 0; fNumEndings = 0; fLastProp = 0; - fNumPickup = 0; + fPrevBreak = 0; fAutomaticLayout = true; for (int i=0; i 0; if (fInPickup = fInPickup && !m && meas.NoChords()) - ++fNumPickup; + ++fPrevBreak; // // Generate chords @@ -92,19 +92,17 @@ void VLLilypondWriter::VisitMeasure(size_t m, VLProperties & p, VLMeasure & meas size_t volta; bool repeat; bool hasBarLine = false; - - if (fAutomaticLayout) { - if (m > fNumPickup && !((m-fNumPickup) % 4)) { - fAccum += fIndent+"\\break\n"; - hasBarLine = true; - } - } else if (meas.fBreak & VLMeasure::kNewPage) { + + if (meas.fBreak & VLMeasure::kNewPage) { fAccum += fIndent+"\\pageBreak\n"; hasBarLine = true; - fNumPickup = m; - } else if (meas.fBreak & VLMeasure::kNewSystem) { + fPrevBreak = m; + } else if ((meas.fBreak & VLMeasure::kNewSystem) + || (fAutomaticLayout && m == fPrevBreak+4) + ) { fAccum += fIndent+"\\break\n"; hasBarLine = true; + fPrevBreak = m; } if (fSong->DoesEndRepeat(m)) { fAccum += "}\n"; diff --git a/Sources/VLLilypondWriter.h b/Sources/VLLilypondWriter.h index c2433e1..ff039cf 100644 --- a/Sources/VLLilypondWriter.h +++ b/Sources/VLLilypondWriter.h @@ -31,7 +31,7 @@ private: bool fUseSharps; bool fInPickup; bool fAutomaticLayout; - int fNumPickup; + int fPrevBreak; size_t fSeenEnding; int fNumEndings; VLNote fPrevNote;