Add document size options

This commit is contained in:
Matthias Neeracher 2008-01-26 16:38:30 +00:00
parent 83438255fd
commit 30815a6acc
7 changed files with 2681 additions and 1931 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -72,9 +72,11 @@ vlExceptions = #(append
\score {
<<
\override Score.ChordName #'font-family = #'Didot
\override Score.ChordName #'font-size = #<{CHORDSIZE}>
\override Score.LyricText #'font-family = #'Baskerville
\override Score.LyricText #'font-size = #<{LYRICSIZE}>
\context ChordNames \chords {
\override ChordName #'font-family = #'BitstreamVeraSansMono
\override ChordName #'font-size = #6
\set chordNameExceptions = #vlExceptions
\set chordNameSeparator = ""
\set chordRootNamer = #note-name->markup

View File

@ -35,6 +35,9 @@ enum {
NSString * songArranger;
NSString * songGroove;
NSNumber * songTempo;
float chordSize;
float lyricSize;
float staffSize;
int playElements;
NSString * tmpPath;
NSFileWrapper * vcsWrapper;

View File

@ -76,7 +76,10 @@
songComposer = @"";
songArranger = @"";
songGroove = @"Swing";
songTempo = [[NSNumber numberWithInt:120] retain];
songTempo = [[NSNumber alloc] initWithInt:120];
chordSize = 6.0f;
lyricSize = 0.0f;
staffSize = 20.0f;
playElements = kVLPlayAccompaniment|kVLPlayMelody|kVLPlayCountIn;
sheetWin = nil;
pdfWin = nil;
@ -258,6 +261,24 @@
[self didChangeSong];
}
- (void) setChordSize:(float)size
{
[[[self undoManager] prepareWithInvocationTarget:self] setChordSize:chordSize];
chordSize = size;
}
- (void) setLyricSize:(float)size
{
[[[self undoManager] prepareWithInvocationTarget:self] setLyricSize:lyricSize];
lyricSize = size;
}
- (void) setStaffSize:(float)size
{
[[[self undoManager] prepareWithInvocationTarget:self] setStaffSize:staffSize];
staffSize = size;
}
- (int) repeatVolta
{
return repeatVolta;

View File

@ -126,6 +126,12 @@
[ly substituteMacro:@"FORMATTING" withValue:@"ragged-last-bottom = ##f"];
[ly substituteMacro:@"VLVERSION" withValue:
[bndl objectForInfoDictionaryKey:@"CFBundleVersion"]];
[ly substituteMacro:@"CHORDSIZE" withValue:
[NSString stringWithFormat:@"%.1f", chordSize]];
[ly substituteMacro:@"LYRICSIZE" withValue:
[NSString stringWithFormat:@"%.1f", lyricSize]];
[ly substituteMacro:@"STAFFSIZE" withValue:
[NSString stringWithFormat:@"%.1f", staffSize]];
[ly substituteMacro:@"CHORDS" withValue:
[NSString stringWithUTF8String:writer.Chords().c_str()]];
[ly substituteMacro:@"NOTES" withValue:

View File

@ -1061,6 +1061,10 @@ static int8_t sSharpAcc[] = {
- (IBAction)editDisplayOptions:(id)sender
{
NSUndoManager * undoMgr = [[self document] undoManager];
[undoMgr setGroupsByEvent:NO];
[undoMgr beginUndoGrouping];
VLSheetWindow * wc = [[self window] windowController];
[wc setValue:[NSNumber numberWithInt:fNumTopLedgers]
forKey:@"editNumTopLedgers"];
@ -1078,6 +1082,11 @@ static int8_t sSharpAcc[] = {
- (void)didEndDisplaySheet:(NSWindow *)sheet returnCode:(int)returnCode
contextInfo:(void *)ctx
{
NSUndoManager * undoMgr = [[self document] undoManager];
[undoMgr setActionName:@"Display Options"];
[undoMgr endUndoGrouping];
[undoMgr setGroupsByEvent:YES];
switch (returnCode) {
case NSAlertFirstButtonReturn: {
VLSheetWindow * wc = [[self window] windowController];
@ -1088,6 +1097,7 @@ static int8_t sSharpAcc[] = {
[self setNeedsDisplay:YES];
} break;
default:
[undoMgr undo];
break;
}
[sheet orderOut:self];