mirror of
https://github.com/microtherion/VocalEasel.git
synced 2025-01-13 05:33:59 +00:00
Actually made manual page break / auto line break work (I promise)
This commit is contained in:
parent
7bfe95eaf1
commit
68067be8b2
|
@ -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
|
||||||
|
@ -93,18 +93,16 @@ void VLLilypondWriter::VisitMeasure(size_t m, VLProperties & p, VLMeasure & meas
|
||||||
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";
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user