Actually made manual page break / auto line break work (I promise)

This commit is contained in:
Matthias Neeracher 2008-08-15 13:27:21 +00:00
parent 7bfe95eaf1
commit 68067be8b2
2 changed files with 10 additions and 12 deletions

View File

@ -23,7 +23,7 @@ void VLLilypondWriter::Visit(VLSong & song)
fSeenEnding = 0; fSeenEnding = 0;
fNumEndings = 0; fNumEndings = 0;
fLastProp = 0; fLastProp = 0;
fNumPickup = 0; fPrevBreak = 0;
fAutomaticLayout = true; fAutomaticLayout = true;
for (int i=0; i<song.fMeasures.size(); ++i) for (int i=0; i<song.fMeasures.size(); ++i)
@ -50,7 +50,7 @@ void VLLilypondWriter::VisitMeasure(size_t m, VLProperties & p, VLMeasure & meas
fUseSharps = p.fKey > 0; fUseSharps = p.fKey > 0;
if (fInPickup = fInPickup && !m && meas.NoChords()) if (fInPickup = fInPickup && !m && meas.NoChords())
++fNumPickup; ++fPrevBreak;
// //
// Generate chords // Generate chords
@ -92,19 +92,17 @@ void VLLilypondWriter::VisitMeasure(size_t m, VLProperties & p, VLMeasure & meas
size_t volta; size_t volta;
bool repeat; bool repeat;
bool hasBarLine = false; bool hasBarLine = false;
if (fAutomaticLayout) { if (meas.fBreak & VLMeasure::kNewPage) {
if (m > fNumPickup && !((m-fNumPickup) % 4)) {
fAccum += fIndent+"\\break\n";
hasBarLine = true;
}
} else if (meas.fBreak & VLMeasure::kNewPage) {
fAccum += fIndent+"\\pageBreak\n"; fAccum += fIndent+"\\pageBreak\n";
hasBarLine = true; hasBarLine = true;
fNumPickup = m; fPrevBreak = m;
} else if (meas.fBreak & VLMeasure::kNewSystem) { } else if ((meas.fBreak & VLMeasure::kNewSystem)
|| (fAutomaticLayout && m == fPrevBreak+4)
) {
fAccum += fIndent+"\\break\n"; fAccum += fIndent+"\\break\n";
hasBarLine = true; hasBarLine = true;
fPrevBreak = m;
} }
if (fSong->DoesEndRepeat(m)) { if (fSong->DoesEndRepeat(m)) {
fAccum += "}\n"; fAccum += "}\n";

View File

@ -31,7 +31,7 @@ private:
bool fUseSharps; bool fUseSharps;
bool fInPickup; bool fInPickup;
bool fAutomaticLayout; bool fAutomaticLayout;
int fNumPickup; int fPrevBreak;
size_t fSeenEnding; size_t fSeenEnding;
int fNumEndings; int fNumEndings;
VLNote fPrevNote; VLNote fPrevNote;