mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 19:23:59 +00:00
Flexible display options (# of ledgers/lyrics)
This commit is contained in:
parent
6e92752255
commit
75a06d832c
67
English.lproj/VLDocument.nib/classes.nib
generated
67
English.lproj/VLDocument.nib/classes.nib
generated
|
@ -1,67 +0,0 @@
|
||||||
{
|
|
||||||
IBClasses = (
|
|
||||||
{
|
|
||||||
ACTIONS = {
|
|
||||||
endRepeatSheet = id;
|
|
||||||
engrave = id;
|
|
||||||
showLog = id;
|
|
||||||
showOutput = id;
|
|
||||||
zoomIn = id;
|
|
||||||
zoomOut = id;
|
|
||||||
};
|
|
||||||
CLASS = FirstResponder;
|
|
||||||
LANGUAGE = ObjC;
|
|
||||||
SUPERCLASS = NSObject;
|
|
||||||
},
|
|
||||||
{CLASS = VLDocument; LANGUAGE = ObjC; SUPERCLASS = NSDocument; },
|
|
||||||
{CLASS = VLEditable; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
|
|
||||||
{
|
|
||||||
CLASS = VLPDFWindow;
|
|
||||||
LANGUAGE = ObjC;
|
|
||||||
OUTLETS = {
|
|
||||||
nextPageItem = id;
|
|
||||||
pdfView = id;
|
|
||||||
prevPageItem = id;
|
|
||||||
zoomInItem = id;
|
|
||||||
zoomOutItem = id;
|
|
||||||
};
|
|
||||||
SUPERCLASS = NSWindowController;
|
|
||||||
},
|
|
||||||
{
|
|
||||||
ACTIONS = {
|
|
||||||
endRepeatSheet = id;
|
|
||||||
hideFieldEditor = id;
|
|
||||||
selectGroove = id;
|
|
||||||
setDivisions = id;
|
|
||||||
setKey = id;
|
|
||||||
setTime = id;
|
|
||||||
};
|
|
||||||
CLASS = VLSheetView;
|
|
||||||
LANGUAGE = ObjC;
|
|
||||||
OUTLETS = {
|
|
||||||
fEndingMsg = id;
|
|
||||||
fEndingSheet = id;
|
|
||||||
fFieldEditor = id;
|
|
||||||
fGrooveMenu = id;
|
|
||||||
fRepeatMsg = id;
|
|
||||||
fRepeatSheet = id;
|
|
||||||
};
|
|
||||||
SUPERCLASS = NSView;
|
|
||||||
},
|
|
||||||
{
|
|
||||||
CLASS = VLSheetWindow;
|
|
||||||
LANGUAGE = ObjC;
|
|
||||||
OUTLETS = {
|
|
||||||
logToolItem = id;
|
|
||||||
outputToolItem = id;
|
|
||||||
playToolItem = id;
|
|
||||||
progressToolItem = id;
|
|
||||||
stopToolItem = id;
|
|
||||||
zoomInToolItem = id;
|
|
||||||
zoomOutToolItem = id;
|
|
||||||
};
|
|
||||||
SUPERCLASS = NSWindowController;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
IBVersion = 1;
|
|
||||||
}
|
|
6457
English.lproj/VLDocument.nib/designable.nib
generated
Normal file
6457
English.lproj/VLDocument.nib/designable.nib
generated
Normal file
File diff suppressed because it is too large
Load Diff
19
English.lproj/VLDocument.nib/info.nib
generated
19
English.lproj/VLDocument.nib/info.nib
generated
|
@ -1,19 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>IBDocumentLocation</key>
|
|
||||||
<string>427 29 356 240 0 0 1280 778 </string>
|
|
||||||
<key>IBFramework Version</key>
|
|
||||||
<string>460.0</string>
|
|
||||||
<key>IBOpenObjects</key>
|
|
||||||
<array>
|
|
||||||
<integer>216</integer>
|
|
||||||
<integer>144</integer>
|
|
||||||
<integer>5</integer>
|
|
||||||
<integer>196</integer>
|
|
||||||
</array>
|
|
||||||
<key>IBSystem Version</key>
|
|
||||||
<string>9A412</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
BIN
English.lproj/VLDocument.nib/keyedobjects.nib
generated
BIN
English.lproj/VLDocument.nib/keyedobjects.nib
generated
Binary file not shown.
BIN
Resources/display.tiff
Normal file
BIN
Resources/display.tiff
Normal file
Binary file not shown.
|
@ -1089,6 +1089,55 @@ size_t VLSong::CountStanzas() const
|
||||||
return stanzas;
|
return stanzas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t VLSong::CountTopLedgers() const
|
||||||
|
{
|
||||||
|
int8_t maxPitch = VLNote::kMiddleC;
|
||||||
|
|
||||||
|
for (size_t measure=0; measure<fMeasures.size(); ++measure) {
|
||||||
|
VLNoteList::const_iterator i = fMeasures[measure].fMelody.begin();
|
||||||
|
VLNoteList::const_iterator e = fMeasures[measure].fMelody.end();
|
||||||
|
|
||||||
|
for (; i!=e; ++i)
|
||||||
|
if (i->fPitch != VLNote::kNoPitch)
|
||||||
|
maxPitch = std::max(maxPitch, i->fPitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (maxPitch > 89) // F''
|
||||||
|
return 4;
|
||||||
|
else if (maxPitch > 86) // D''
|
||||||
|
return 3;
|
||||||
|
else if (maxPitch > 83) // B'
|
||||||
|
return 2;
|
||||||
|
else if (maxPitch > 79) // G'
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t VLSong::CountBotLedgers() const
|
||||||
|
{
|
||||||
|
int8_t minPitch = VLNote::kMiddleC+VLNote::kOctave;
|
||||||
|
|
||||||
|
for (size_t measure=0; measure<fMeasures.size(); ++measure) {
|
||||||
|
VLNoteList::const_iterator i = fMeasures[measure].fMelody.begin();
|
||||||
|
VLNoteList::const_iterator e = fMeasures[measure].fMelody.end();
|
||||||
|
|
||||||
|
for (; i!=e; ++i)
|
||||||
|
if (i->fPitch != VLNote::kNoPitch)
|
||||||
|
minPitch = std::min(minPitch, i->fPitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (minPitch < 52) // E,
|
||||||
|
return 4;
|
||||||
|
else if (minPitch < 55) // G,
|
||||||
|
return 3;
|
||||||
|
else if (minPitch < 59) // B,
|
||||||
|
return 2;
|
||||||
|
else if (minPitch < 62) // D
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void VLSong::LilypondNotes(std::string & notes) const
|
void VLSong::LilypondNotes(std::string & notes) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -348,6 +348,8 @@ struct VLSong {
|
||||||
|
|
||||||
size_t CountMeasures() const { return fMeasures.size(); }
|
size_t CountMeasures() const { return fMeasures.size(); }
|
||||||
size_t CountStanzas() const;
|
size_t CountStanzas() const;
|
||||||
|
size_t CountTopLedgers() const;
|
||||||
|
size_t CountBotLedgers() const;
|
||||||
void LilypondNotes(std::string & notes) const;
|
void LilypondNotes(std::string & notes) const;
|
||||||
void LilypondChords(std::string & chords) const;
|
void LilypondChords(std::string & chords) const;
|
||||||
void LilypondStanza(std::string & lyrics, size_t stanza) const;
|
void LilypondStanza(std::string & lyrics, size_t stanza) const;
|
||||||
|
|
|
@ -79,12 +79,16 @@ enum VLRecalc {
|
||||||
size_t fCursorStanza;
|
size_t fCursorStanza;
|
||||||
int fSelStart;
|
int fSelStart;
|
||||||
int fSelEnd;
|
int fSelEnd;
|
||||||
|
int fNumTopLedgers;
|
||||||
|
int fNumBotLedgers;
|
||||||
|
int fNumStanzas;
|
||||||
size_t fVolta;
|
size_t fVolta;
|
||||||
size_t fVoltaOK;
|
size_t fVoltaOK;
|
||||||
|
|
||||||
IBOutlet id fFieldEditor;
|
IBOutlet id fFieldEditor;
|
||||||
IBOutlet id fRepeatSheet;
|
IBOutlet id fRepeatSheet;
|
||||||
IBOutlet id fEndingSheet;
|
IBOutlet id fEndingSheet;
|
||||||
|
IBOutlet id fDisplaySheet;
|
||||||
IBOutlet id fRepeatMsg;
|
IBOutlet id fRepeatMsg;
|
||||||
IBOutlet id fEndingMsg;
|
IBOutlet id fEndingMsg;
|
||||||
IBOutlet id fGrooveMenu;
|
IBOutlet id fGrooveMenu;
|
||||||
|
@ -94,8 +98,9 @@ enum VLRecalc {
|
||||||
- (IBAction) setTime:(id)sender;
|
- (IBAction) setTime:(id)sender;
|
||||||
- (IBAction) setDivisions:(id)sender;
|
- (IBAction) setDivisions:(id)sender;
|
||||||
- (IBAction) hideFieldEditor:(id)sender;
|
- (IBAction) hideFieldEditor:(id)sender;
|
||||||
- (IBAction) endRepeatSheet:(id)sender;
|
- (IBAction) endSheetWithButton:(id)sender;
|
||||||
- (IBAction) selectGroove:(id)sender;
|
- (IBAction) selectGroove:(id)sender;
|
||||||
|
- (IBAction) editDisplayOptions:(id)sender;
|
||||||
|
|
||||||
- (VLDocument *) document;
|
- (VLDocument *) document;
|
||||||
- (VLSong *) song;
|
- (VLSong *) song;
|
||||||
|
|
|
@ -90,6 +90,9 @@ static float sFlatPos[] = {
|
||||||
fCursorPitch = VLNote::kNoPitch;
|
fCursorPitch = VLNote::kNoPitch;
|
||||||
fSelStart = 0;
|
fSelStart = 0;
|
||||||
fSelEnd = -1;
|
fSelEnd = -1;
|
||||||
|
fNumTopLedgers = 0;
|
||||||
|
fNumBotLedgers = 2;
|
||||||
|
fNumStanzas = 2;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -128,7 +131,7 @@ static float sFlatPos[] = {
|
||||||
{
|
{
|
||||||
NSRect b = [self bounds];
|
NSRect b = [self bounds];
|
||||||
|
|
||||||
return kSystemY+b.origin.y+b.size.height-(system+1)*kSystemH;
|
return kSystemBaseline+b.origin.y+b.size.height-(system+1)*kSystemH;
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t sSemi2Pitch[2][12] = {{
|
int8_t sSemi2Pitch[2][12] = {{
|
||||||
|
@ -206,7 +209,7 @@ VLMusicElement sSemi2Accidental[12][12] = {
|
||||||
- (void) scrollMeasureToVisible:(int)measure
|
- (void) scrollMeasureToVisible:(int)measure
|
||||||
{
|
{
|
||||||
NSRect r = NSMakeRect(fClefKeyW+(measure%fMeasPerSystem)*fMeasureW,
|
NSRect r = NSMakeRect(fClefKeyW+(measure%fMeasPerSystem)*fMeasureW,
|
||||||
[self systemY:measure/fMeasPerSystem]-kSystemY,
|
[self systemY:measure/fMeasPerSystem]-kSystemBaseline,
|
||||||
fMeasureW, kSystemH);
|
fMeasureW, kSystemH);
|
||||||
[self scrollRectToVisible:r];
|
[self scrollRectToVisible:r];
|
||||||
}
|
}
|
||||||
|
@ -423,8 +426,8 @@ VLMusicElement sSemi2Accidental[12][12] = {
|
||||||
[[NSColor colorWithDeviceWhite:0.8f alpha:1.0f] set];
|
[[NSColor colorWithDeviceWhite:0.8f alpha:1.0f] set];
|
||||||
for (int measure = 0; measure<fMeasPerSystem; ++measure) {
|
for (int measure = 0; measure<fMeasPerSystem; ++measure) {
|
||||||
const float mx = fClefKeyW+measure*fMeasureW;
|
const float mx = fClefKeyW+measure*fMeasureW;
|
||||||
const float y0 = kSystemY-2.0f*kLineH;
|
const float y0 = kSystemY-(fNumBotLedgers+1)*kLineH;
|
||||||
const float yy = kSystemY+6.0f*kLineH;
|
const float yy = kSystemY+(fNumTopLedgers+5)*kLineH;
|
||||||
for (int group = 0; group < fGroups; ++group) {
|
for (int group = 0; group < fGroups; ++group) {
|
||||||
for (int div = 0; div < fDivPerGroup; ++div) {
|
for (int div = 0; div < fDivPerGroup; ++div) {
|
||||||
const float x = mx+(group*(fDivPerGroup+1)+div+1)*kNoteW;
|
const float x = mx+(group*(fDivPerGroup+1)+div+1)*kNoteW;
|
||||||
|
@ -471,11 +474,31 @@ VLMusicElement sSemi2Accidental[12][12] = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)drawBackgroundForSystem:(int)system
|
||||||
|
{
|
||||||
|
const float kSystemY = [self systemY:system];
|
||||||
|
const float kLineW = fClefKeyW + fMeasPerSystem*fMeasureW;
|
||||||
|
|
||||||
|
NSArray * colors = [NSColor controlAlternatingRowBackgroundColors];
|
||||||
|
[NSGraphicsContext saveGraphicsState];
|
||||||
|
[[colors objectAtIndex:1] setFill];
|
||||||
|
[NSBezierPath fillRect:
|
||||||
|
NSMakeRect(kLineX, kSystemY-kSystemBaseline,
|
||||||
|
kLineW, fNumStanzas*kLyricsH)];
|
||||||
|
[NSBezierPath fillRect:
|
||||||
|
NSMakeRect(kLineX, kSystemY+kChordY, kLineW, kChordH)];
|
||||||
|
[[colors objectAtIndex:0] setFill];
|
||||||
|
[NSBezierPath fillRect:
|
||||||
|
NSMakeRect(kLineX, kSystemY-kSystemBaseline+fNumStanzas*kLyricsH,
|
||||||
|
kLineW, kSystemBaseline+kChordY-fNumStanzas*kLyricsH)];
|
||||||
|
[NSGraphicsContext restoreGraphicsState];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)highlightSelectionForSystem:(int)system
|
- (void)highlightSelectionForSystem:(int)system
|
||||||
{
|
{
|
||||||
int startMeas = std::max(fSelStart-system*fMeasPerSystem, 0);
|
int startMeas = std::max(fSelStart-system*fMeasPerSystem, 0);
|
||||||
int endMeas = std::min(fSelEnd-system*fMeasPerSystem, fMeasPerSystem);
|
int endMeas = std::min(fSelEnd-system*fMeasPerSystem, fMeasPerSystem);
|
||||||
const float kRawSystemY = [self systemY:system]-kSystemY;
|
const float kRawSystemY = [self systemY:system]-kSystemBaseline;
|
||||||
|
|
||||||
[NSGraphicsContext saveGraphicsState];
|
[NSGraphicsContext saveGraphicsState];
|
||||||
[[NSColor selectedTextBackgroundColor] setFill];
|
[[NSColor selectedTextBackgroundColor] setFill];
|
||||||
|
@ -496,14 +519,20 @@ VLMusicElement sSemi2Accidental[12][12] = {
|
||||||
[self recalculateDimensions];
|
[self recalculateDimensions];
|
||||||
rect = [self bounds];
|
rect = [self bounds];
|
||||||
}
|
}
|
||||||
|
[NSGraphicsContext saveGraphicsState];
|
||||||
|
[[NSColor whiteColor] setFill];
|
||||||
|
[NSBezierPath fillRect:rect];
|
||||||
|
[NSGraphicsContext restoreGraphicsState];
|
||||||
|
|
||||||
size_t stanzas = [self song]->CountStanzas();
|
size_t stanzas = [self song]->CountStanzas();
|
||||||
const float kLineW = fClefKeyW + fMeasPerSystem*fMeasureW;
|
const float kLineW = fClefKeyW + fMeasPerSystem*fMeasureW;
|
||||||
for (int system = 0; system<fNumSystems; ++system) {
|
for (int system = 0; system<fNumSystems; ++system) {
|
||||||
const float kSystemY = [self systemY:system];
|
const float kSystemY = [self systemY:system];
|
||||||
NSRect systemRect = NSMakeRect(kLineX, kSystemY+kClefY, kLineW, kSystemH-kClefY);
|
NSRect systemRect = NSMakeRect(kLineX, kSystemY-kSystemBaseline, kLineW, kSystemH);
|
||||||
if (!NSIntersectsRect(rect, systemRect))
|
if (!NSIntersectsRect(rect, systemRect))
|
||||||
continue; // This system does not need to be drawn
|
continue; // This system does not need to be drawn
|
||||||
|
|
||||||
|
[self drawBackgroundForSystem:system];
|
||||||
//
|
//
|
||||||
// When highlighting, draw highlight FIRST and then draw our stuff
|
// When highlighting, draw highlight FIRST and then draw our stuff
|
||||||
// on top.
|
// on top.
|
||||||
|
@ -694,7 +723,7 @@ static int8_t sSharpAcc[] = {
|
||||||
loc.y = fmodf(loc.y, kSystemH);
|
loc.y = fmodf(loc.y, kSystemH);
|
||||||
|
|
||||||
loc.x -= fClefKeyW;
|
loc.x -= fClefKeyW;
|
||||||
if (loc.y > kSystemY && loc.y < kSystemY+4.0f*kLineH
|
if (loc.y > kSystemBaseline && loc.y < kSystemBaseline+4.0f*kLineH
|
||||||
&& fmodf(loc.x+kMeasTol, fMeasureW) < 2*kMeasTol
|
&& fmodf(loc.x+kMeasTol, fMeasureW) < 2*kMeasTol
|
||||||
) {
|
) {
|
||||||
int measure = static_cast<int>((loc.x+kMeasTol)/fMeasureW);
|
int measure = static_cast<int>((loc.x+kMeasTol)/fMeasureW);
|
||||||
|
@ -724,20 +753,20 @@ static int8_t sSharpAcc[] = {
|
||||||
if (fCursorMeasure > [self song]->fMeasures.size())
|
if (fCursorMeasure > [self song]->fMeasures.size())
|
||||||
return fCursorRegion = kRegionNowhere;
|
return fCursorRegion = kRegionNowhere;
|
||||||
|
|
||||||
if (loc.y >= kSystemY+kChordY) {
|
if (loc.y >= kSystemBaseline+kChordY) {
|
||||||
//
|
//
|
||||||
// Chord, round to quarters
|
// Chord, round to quarters
|
||||||
//
|
//
|
||||||
int scale = fCursorAt.fDenom / 4;
|
int scale = fCursorAt.fDenom / 4;
|
||||||
fCursorAt = VLFraction(fCursorAt.fNum / scale, 4);
|
fCursorAt = VLFraction(fCursorAt.fNum / scale, 4);
|
||||||
return fCursorRegion = kRegionChord;
|
return fCursorRegion = kRegionChord;
|
||||||
} else if (loc.y < kSystemY+kLyricsY) {
|
} else if (loc.y < kSystemBaseline+kLyricsY) {
|
||||||
fCursorStanza = static_cast<size_t>((kSystemY+kLyricsY-loc.y) / kLyricsH)
|
fCursorStanza = static_cast<size_t>((kSystemBaseline+kLyricsY-loc.y) / kLyricsH)
|
||||||
+ 1;
|
+ 1;
|
||||||
return fCursorRegion = kRegionLyrics;
|
return fCursorRegion = kRegionLyrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
loc.y -= kSystemY+kSemiFloor;
|
loc.y -= kSystemBaseline+kSemiFloor;
|
||||||
int semi = static_cast<int>(roundf(loc.y / (0.5f*kLineH)));
|
int semi = static_cast<int>(roundf(loc.y / (0.5f*kLineH)));
|
||||||
fCursorPitch = sSemiToPitch[semi];
|
fCursorPitch = sSemiToPitch[semi];
|
||||||
|
|
||||||
|
@ -891,11 +920,18 @@ static int8_t sSharpAcc[] = {
|
||||||
|
|
||||||
- (void)awakeFromNib
|
- (void)awakeFromNib
|
||||||
{
|
{
|
||||||
[[self document] addObserver:self];
|
VLDocument * doc = [self document];
|
||||||
[[self document] addObserver:self forKeyPath:@"song" options:0 context:nil];
|
|
||||||
[[self document] addObserver:self forKeyPath:@"songKey" options:0 context:nil];
|
[doc addObserver:self];
|
||||||
[[self document] addObserver:self forKeyPath:@"songGroove" options:0 context:nil];
|
[doc addObserver:self forKeyPath:@"song" options:0 context:nil];
|
||||||
[self setGrooveMenu:[[self document] valueForKey:@"songGroove"]];
|
[doc addObserver:self forKeyPath:@"songKey" options:0 context:nil];
|
||||||
|
[doc addObserver:self forKeyPath:@"songGroove" options:0 context:nil];
|
||||||
|
[self setGrooveMenu:[doc valueForKey:@"songGroove"]];
|
||||||
|
|
||||||
|
VLSong * song = [self song];
|
||||||
|
fNumTopLedgers = std::max<int>(song->CountTopLedgers(), 1);
|
||||||
|
fNumBotLedgers = std::max<int>(song->CountBotLedgers(), 1);
|
||||||
|
fNumStanzas = std::max<int>(song->CountStanzas(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)removeObservers:(id)target
|
- (void)removeObservers:(id)target
|
||||||
|
@ -917,7 +953,7 @@ static int8_t sSharpAcc[] = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)endRepeatSheet:(id)sender
|
- (IBAction)endSheetWithButton:(id)sender
|
||||||
{
|
{
|
||||||
[NSApp endSheet:[sender window] returnCode:[sender tag]];
|
[NSApp endSheet:[sender window] returnCode:[sender tag]];
|
||||||
}
|
}
|
||||||
|
@ -950,4 +986,38 @@ static int8_t sSharpAcc[] = {
|
||||||
[[NSUserDefaults standardUserDefaults] setObject:grooves forKey:@"VLGrooves"];
|
[[NSUserDefaults standardUserDefaults] setObject:grooves forKey:@"VLGrooves"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)editDisplayOptions:(id)sender
|
||||||
|
{
|
||||||
|
VLSheetWindow * wc = [[self window] windowController];
|
||||||
|
[wc setValue:[NSNumber numberWithInt:fNumTopLedgers]
|
||||||
|
forKey:@"editNumTopLedgers"];
|
||||||
|
[wc setValue:[NSNumber numberWithInt:fNumBotLedgers]
|
||||||
|
forKey:@"editNumBotLedgers"];
|
||||||
|
[wc setValue:[NSNumber numberWithInt:fNumStanzas]
|
||||||
|
forKey:@"editNumStanzas"];
|
||||||
|
|
||||||
|
[NSApp beginSheet:fDisplaySheet modalForWindow:[self window]
|
||||||
|
modalDelegate:self
|
||||||
|
didEndSelector:@selector(didEndDisplaySheet:returnCode:contextInfo:)
|
||||||
|
contextInfo:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)didEndDisplaySheet:(NSWindow *)sheet returnCode:(int)returnCode
|
||||||
|
contextInfo:(void *)ctx
|
||||||
|
{
|
||||||
|
switch (returnCode) {
|
||||||
|
case NSAlertFirstButtonReturn: {
|
||||||
|
VLSheetWindow * wc = [[self window] windowController];
|
||||||
|
fNumTopLedgers = [[wc valueForKey:@"editNumTopLedgers"] intValue];
|
||||||
|
fNumBotLedgers = [[wc valueForKey:@"editNumBotLedgers"] intValue];
|
||||||
|
fNumStanzas = [[wc valueForKey:@"editNumStanzas"] intValue];
|
||||||
|
fNeedsRecalc = kRecalc;
|
||||||
|
[self setNeedsDisplay:YES];
|
||||||
|
} break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
[sheet orderOut:self];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -8,8 +8,9 @@
|
||||||
|
|
||||||
const float kLineX = 5.0;
|
const float kLineX = 5.0;
|
||||||
const float kLineH = 10.0;
|
const float kLineH = 10.0;
|
||||||
const float kSystemH = 15.0f*kLineH;
|
#define kSystemBaseline ((fNumBotLedgers+1)*kLineH+fNumStanzas*kLyricsH)
|
||||||
const float kSystemY = 5.0f*kLineH;
|
#define kSystemAscent ((fNumTopLedgers+7)*kLineH+kChordH)
|
||||||
|
#define kSystemH (kSystemBaseline+kSystemAscent)
|
||||||
const float kClefX = 20.5f;
|
const float kClefX = 20.5f;
|
||||||
const float kClefY =-15.0f;
|
const float kClefY =-15.0f;
|
||||||
const float kClefW = 30.0f;
|
const float kClefW = 30.0f;
|
||||||
|
@ -26,10 +27,10 @@ const float kSharpW =-11.0f;
|
||||||
const float kFlatW = -9.0f;
|
const float kFlatW = -9.0f;
|
||||||
const float kNaturalW = -7.0f;
|
const float kNaturalW = -7.0f;
|
||||||
const float kImgScale = 0.04f;
|
const float kImgScale = 0.04f;
|
||||||
const float kChordY = 7.0f*kLineH;
|
#define kChordY ((fNumTopLedgers+6)*kLineH)
|
||||||
const float kChordW = 40.0f;
|
const float kChordW = 40.0f;
|
||||||
const float kChordH = 25.0f;
|
const float kChordH = 25.0f;
|
||||||
const float kLyricsY = -3.0*kLineH;
|
#define kLyricsY (-(fNumBotLedgers+1)*kLineH)
|
||||||
const float kLyricsH = 1.5*kLineH;
|
const float kLyricsH = 1.5*kLineH;
|
||||||
const float kNoteX = 7.0f;
|
const float kNoteX = 7.0f;
|
||||||
const float kNoteY = 5.0f;
|
const float kNoteY = 5.0f;
|
||||||
|
|
|
@ -31,6 +31,11 @@
|
||||||
IBOutlet id zoomInToolItem;
|
IBOutlet id zoomInToolItem;
|
||||||
IBOutlet id zoomOutToolItem;
|
IBOutlet id zoomOutToolItem;
|
||||||
IBOutlet id progressToolItem;
|
IBOutlet id progressToolItem;
|
||||||
|
IBOutlet id displayToolItem;
|
||||||
|
|
||||||
|
int editNumTopLedgers;
|
||||||
|
int editNumBotLedgers;
|
||||||
|
int editNumStanzas;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (VLEditable *) editTarget;
|
- (VLEditable *) editTarget;
|
||||||
|
|
|
@ -50,6 +50,7 @@ static NSString* sStopToolbarItemIdentifier = @"Stop Toolbar Item Identifier";
|
||||||
static NSString* sZoomInToolbarItemIdentifier = @"Zoom In Toolbar Item Identifier";
|
static NSString* sZoomInToolbarItemIdentifier = @"Zoom In Toolbar Item Identifier";
|
||||||
static NSString* sZoomOutToolbarItemIdentifier = @"Zoom Out Toolbar Item Identifier";
|
static NSString* sZoomOutToolbarItemIdentifier = @"Zoom Out Toolbar Item Identifier";
|
||||||
static NSString* sProgressToolbarItemIdentifier = @"Progress Toolbar Item Identifier";
|
static NSString* sProgressToolbarItemIdentifier = @"Progress Toolbar Item Identifier";
|
||||||
|
static NSString* sDisplayToolbarItemIdentifier = @"Display Toolbar Item Identifier";
|
||||||
|
|
||||||
- (id)initWithWindow:(NSWindow *)window
|
- (id)initWithWindow:(NSWindow *)window
|
||||||
{
|
{
|
||||||
|
@ -97,6 +98,8 @@ static NSString* sProgressToolbarItemIdentifier = @"Progress Toolbar Item Identi
|
||||||
prototype = zoomInToolItem;
|
prototype = zoomInToolItem;
|
||||||
else if ([itemIdent isEqual: sZoomOutToolbarItemIdentifier])
|
else if ([itemIdent isEqual: sZoomOutToolbarItemIdentifier])
|
||||||
prototype = zoomOutToolItem;
|
prototype = zoomOutToolItem;
|
||||||
|
else if ([itemIdent isEqual: sDisplayToolbarItemIdentifier])
|
||||||
|
prototype = displayToolItem;
|
||||||
|
|
||||||
if (prototype) {
|
if (prototype) {
|
||||||
toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];
|
toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];
|
||||||
|
@ -127,6 +130,7 @@ static NSString* sProgressToolbarItemIdentifier = @"Progress Toolbar Item Identi
|
||||||
sZoomInToolbarItemIdentifier,
|
sZoomInToolbarItemIdentifier,
|
||||||
sZoomOutToolbarItemIdentifier,
|
sZoomOutToolbarItemIdentifier,
|
||||||
NSToolbarFlexibleSpaceItemIdentifier,
|
NSToolbarFlexibleSpaceItemIdentifier,
|
||||||
|
sDisplayToolbarItemIdentifier,
|
||||||
sLogToolbarItemIdentifier,
|
sLogToolbarItemIdentifier,
|
||||||
sProgressToolbarItemIdentifier,
|
sProgressToolbarItemIdentifier,
|
||||||
nil];
|
nil];
|
||||||
|
@ -140,6 +144,7 @@ static NSString* sProgressToolbarItemIdentifier = @"Progress Toolbar Item Identi
|
||||||
sZoomOutToolbarItemIdentifier,
|
sZoomOutToolbarItemIdentifier,
|
||||||
sOutputToolbarItemIdentifier,
|
sOutputToolbarItemIdentifier,
|
||||||
sLogToolbarItemIdentifier,
|
sLogToolbarItemIdentifier,
|
||||||
|
sDisplayToolbarItemIdentifier,
|
||||||
sProgressToolbarItemIdentifier,
|
sProgressToolbarItemIdentifier,
|
||||||
NSToolbarCustomizeToolbarItemIdentifier,
|
NSToolbarCustomizeToolbarItemIdentifier,
|
||||||
NSToolbarFlexibleSpaceItemIdentifier,
|
NSToolbarFlexibleSpaceItemIdentifier,
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
952CBBB5095FD34F00434E43 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 952CBBB3095FD34F00434E43 /* AudioUnit.framework */; };
|
952CBBB5095FD34F00434E43 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 952CBBB3095FD34F00434E43 /* AudioUnit.framework */; };
|
||||||
952CBBB6095FD37300434E43 /* VLModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 955E58E4095658AB0045FDA5 /* VLModel.cpp */; };
|
952CBBB6095FD37300434E43 /* VLModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 955E58E4095658AB0045FDA5 /* VLModel.cpp */; };
|
||||||
952DCD78096BBB11001C2316 /* VLSheetViewChords.mm in Sources */ = {isa = PBXBuildFile; fileRef = 952DCD77096BBB11001C2316 /* VLSheetViewChords.mm */; };
|
952DCD78096BBB11001C2316 /* VLSheetViewChords.mm in Sources */ = {isa = PBXBuildFile; fileRef = 952DCD77096BBB11001C2316 /* VLSheetViewChords.mm */; };
|
||||||
|
9530A7020BD9E16700635FEC /* display.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 9530A7010BD9E16700635FEC /* display.tiff */; };
|
||||||
953722670AE9F0E100B6E483 /* VLLilypondDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 953722660AE9F0E100B6E483 /* VLLilypondDocument.mm */; };
|
953722670AE9F0E100B6E483 /* VLLilypondDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 953722660AE9F0E100B6E483 /* VLLilypondDocument.mm */; };
|
||||||
95498DBD0AE3812F006B5F81 /* VLSoundSched.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95498DBC0AE3812F006B5F81 /* VLSoundSched.mm */; };
|
95498DBD0AE3812F006B5F81 /* VLSoundSched.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95498DBC0AE3812F006B5F81 /* VLSoundSched.mm */; };
|
||||||
954BBD860AEDDE5300BBFD5F /* VLAppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 954BBD850AEDDE5300BBFD5F /* VLAppController.mm */; };
|
954BBD860AEDDE5300BBFD5F /* VLAppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 954BBD850AEDDE5300BBFD5F /* VLAppController.mm */; };
|
||||||
|
@ -152,6 +153,7 @@
|
||||||
952CBBB3095FD34F00434E43 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
|
952CBBB3095FD34F00434E43 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = "<absolute>"; };
|
||||||
952DCD76096BBB11001C2316 /* VLSheetViewChords.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLSheetViewChords.h; path = Sources/VLSheetViewChords.h; sourceTree = "<group>"; };
|
952DCD76096BBB11001C2316 /* VLSheetViewChords.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLSheetViewChords.h; path = Sources/VLSheetViewChords.h; sourceTree = "<group>"; };
|
||||||
952DCD77096BBB11001C2316 /* VLSheetViewChords.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VLSheetViewChords.mm; path = Sources/VLSheetViewChords.mm; sourceTree = "<group>"; };
|
952DCD77096BBB11001C2316 /* VLSheetViewChords.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VLSheetViewChords.mm; path = Sources/VLSheetViewChords.mm; sourceTree = "<group>"; };
|
||||||
|
9530A7010BD9E16700635FEC /* display.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = display.tiff; path = Resources/display.tiff; sourceTree = "<group>"; };
|
||||||
953722650AE9F0E100B6E483 /* VLLilypondDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLLilypondDocument.h; path = Sources/VLLilypondDocument.h; sourceTree = "<group>"; };
|
953722650AE9F0E100B6E483 /* VLLilypondDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLLilypondDocument.h; path = Sources/VLLilypondDocument.h; sourceTree = "<group>"; };
|
||||||
953722660AE9F0E100B6E483 /* VLLilypondDocument.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VLLilypondDocument.mm; path = Sources/VLLilypondDocument.mm; sourceTree = "<group>"; };
|
953722660AE9F0E100B6E483 /* VLLilypondDocument.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VLLilypondDocument.mm; path = Sources/VLLilypondDocument.mm; sourceTree = "<group>"; };
|
||||||
95498DBB0AE3812F006B5F81 /* VLSoundSched.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = VLSoundSched.h; path = Sources/VLSoundSched.h; sourceTree = "<group>"; };
|
95498DBB0AE3812F006B5F81 /* VLSoundSched.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = VLSoundSched.h; path = Sources/VLSoundSched.h; sourceTree = "<group>"; };
|
||||||
|
@ -388,6 +390,7 @@
|
||||||
954DD4DF0B44E61E0056C504 /* VLDocument.nib */,
|
954DD4DF0B44E61E0056C504 /* VLDocument.nib */,
|
||||||
954DD4DA0B44E6000056C504 /* MainMenu.nib */,
|
954DD4DA0B44E6000056C504 /* MainMenu.nib */,
|
||||||
95FC66BC0AF0A4D4003D9C11 /* console.icns */,
|
95FC66BC0AF0A4D4003D9C11 /* console.icns */,
|
||||||
|
9530A7010BD9E16700635FEC /* display.tiff */,
|
||||||
95FC66BD0AF0A4D4003D9C11 /* music.tiff */,
|
95FC66BD0AF0A4D4003D9C11 /* music.tiff */,
|
||||||
950795E00B4A34D9008911A6 /* stop.tiff */,
|
950795E00B4A34D9008911A6 /* stop.tiff */,
|
||||||
95FC66BE0AF0A4D4003D9C11 /* nextpage.tiff */,
|
95FC66BE0AF0A4D4003D9C11 /* nextpage.tiff */,
|
||||||
|
@ -603,6 +606,7 @@
|
||||||
959420EC0B44E77A006BC62C /* VLDocument.nib in Resources */,
|
959420EC0B44E77A006BC62C /* VLDocument.nib in Resources */,
|
||||||
950795E10B4A34D9008911A6 /* stop.tiff in Resources */,
|
950795E10B4A34D9008911A6 /* stop.tiff in Resources */,
|
||||||
9599ED960B73185800A6A2F7 /* VLGroove.nib in Resources */,
|
9599ED960B73185800A6A2F7 /* VLGroove.nib in Resources */,
|
||||||
|
9530A7020BD9E16700635FEC /* display.tiff in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user