Insert line and page breaks

This commit is contained in:
Matthias Neeracher 2007-12-24 00:10:23 +00:00
parent d78ceb8258
commit 25d151d5af
5 changed files with 1173 additions and 1075 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -58,6 +58,10 @@ void VLLilypondWriter::VisitMeasure(size_t m, VLProperties & p, VLMeasure & meas
bool repeat;
fAccum.clear();
if (meas.fBreak == VLMeasure::kNewPage)
fAccum += fIndent+"\\pageBreak\n";
else if (meas.fBreak == VLMeasure::kNewSystem)
fAccum += fIndent+"\\break\n";
if (fSong->DoesEndRepeat(m)) {
fAccum += "}\n";
fIndent = "";

View File

@ -21,6 +21,9 @@
- (IBAction)editRepeat:(id)sender;
- (IBAction)editRepeatEnding:(id)sender;
- (IBAction)insertStartCoda:(id)sender;
- (IBAction)insertJumpToCoda:(id)sender;
- (IBAction)insertBreak:(id)sender;
@end

View File

@ -75,6 +75,15 @@ static VLSong sPasteboard;
if (fSelStart == fSelEnd) {
[item setState:[self song]->fCoda==fSelStart];
return YES;
} else
return NO;
else if (action == @selector(insertBreak:))
if (fSelStart == fSelEnd && fSelStart > 0) {
VLSong * song = [self song];
[item setState:fSelStart < song->fMeasures.size()
&& song->fMeasures[fSelStart].fBreak == [item tag]];
return YES;
} else
return NO;
@ -262,4 +271,18 @@ static VLSong sPasteboard;
[[self document] didChangeSong];
}
- (IBAction)insertBreak:(id)sender
{
[[self document] willChangeSong];
VLSong * song = [self song];
VLMeasure & meas = song->fMeasures[fSelStart];
if (meas.fBreak == [sender tag])
meas.fBreak = 0;
else
meas.fBreak = [sender tag];
fNeedsRecalc = kRecalc;
[self setNeedsDisplay:YES];
[[self document] didChangeSong];
}
@end