UI for codas

This commit is contained in:
Matthias Neeracher 2007-01-21 11:34:56 +00:00
parent 1f60eb1a44
commit 54ae06ae81
9 changed files with 240 additions and 33 deletions

View File

@ -4,6 +4,8 @@
ACTIONS = {
editRepeat = id;
editRepeatEnding = id;
insertJumpToCoda = id;
insertStartCoda = id;
zoomIn = id;
zoomOut = id;
zoomToActualSize = id;

View File

@ -10,13 +10,13 @@
<string>320 324 349 44 0 0 1280 778 </string>
</dict>
<key>IBFramework Version</key>
<string>454.0</string>
<string>455.0</string>
<key>IBOpenObjects</key>
<array>
<integer>217</integer>
<integer>29</integer>
<integer>217</integer>
</array>
<key>IBSystem Version</key>
<string>9A321</string>
<string>9A343</string>
</dict>
</plist>

Binary file not shown.

168
Resources/Music/coda.eps Normal file
View File

@ -0,0 +1,168 @@
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: -267.25 -351 267.25 351.081
%%Pages: 0
%%Title: scripts.coda from feta26
%%Creator: FontForge
%%Author: Matthias Neeracher
%%CreationDate: 21:46 20-1-2007
%%EndComments
%%BeginPreview: 56 74 4 74
%00000000000000000000000000011000000000000000000000000000
%000000000000000000000000002EE200000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%00000000000000000000000158BFFB84000000000000000000000000
%00000000000000000000029EFFFFFFFFE92000000000000000000000
%000000000000000000008FFFFFFFFFFFFFF700000000000000000000
%0000000000000000001CFFFFA47FF64AFFFFB1000000000000000000
%000000000000000001DFFFE4006FF5004EFFFD100000000000000000
%00000000000000001CFFFE30005FF50003EFFFC10000000000000000
%0000000000000000AFFFF600005FF500006FFFFA0000000000000000
%0000000000000005FFFFD000005FF500000CFFFF5000000000000000
%000000000000001EFFFF6000005FF5000006FFFFE100000000000000
%000000000000008FFFFF1000005FF5000001EFFFF800000000000000
%00000000000001EFFFFB0000005FF5000000BFFFFE10000000000000
%00000000000007FFFFF70000005FF50000007FFFFF70000000000000
%0000000000000DFFFFF40000005FF50000004FFFFFD0000000000000
%0000000000003FFFFFF20000005FF50000001FFFFFF3000000000000
%0000000000008FFFFFF00000005FF50000000EFFFFF8000000000000
%000000000000CFFFFFD00000005FF50000000CFFFFFC000000000000
%000000000001FFFFFFB00000005FF50000000BFFFFFF100000000000
%000000000005FFFFFFA00000005FF50000000AFFFFFF500000000000
%000000000008FFFFFF900000005FF500000009FFFFFF800000000000
%00000000000AFFFFFF800000005FF500000008FFFFFFA00000000000
%00000000000CFFFFFF700000005FF500000007FFFFFFC00000000000
%00000000000EFFFFFF700000005FF500000007FFFFFFE00000000000
%00000000001FFFFFFF600000005FF500000006FFFFFFF10000000000
%00000000002FFFFFFF600000005FF500000006FFFFFFF20000000000
%03555555558FFFFFFF955555559FF955555559FFFFFFF75555555530
%6FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6
%6FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6
%03555555558FFFFFFF955555559FF955555559FFFFFFF85555555530
%00000000002FFFFFFF600000005FF500000006FFFFFFF20000000000
%00000000001FFFFFFF600000005FF500000006FFFFFFF00000000000
%00000000000EFFFFFF600000005FF500000007FFFFFFE00000000000
%00000000000CFFFFFF700000005FF500000007FFFFFFC00000000000
%00000000000AFFFFFF800000005FF500000008FFFFFFA00000000000
%000000000008FFFFFF800000005FF500000009FFFFFF700000000000
%000000000005FFFFFF900000005FF50000000AFFFFFF400000000000
%000000000001FFFFFFB00000005FF50000000BFFFFFF100000000000
%000000000000CFFFFFC00000005FF50000000CFFFFFC000000000000
%0000000000008FFFFFE00000005FF50000000EFFFFF8000000000000
%0000000000003FFFFFF10000005FF50000001FFFFFF3000000000000
%0000000000000DFFFFF40000005FF50000004FFFFFD0000000000000
%00000000000007FFFFF70000005FF50000007FFFFF70000000000000
%00000000000001EFFFFB0000005FF5000000BFFFFE10000000000000
%000000000000008FFFFE1000005FF5000001EFFFF800000000000000
%000000000000001EFFFF6000005FF5000006FFFFE100000000000000
%0000000000000005FFFFC000005FF500000CFFFF5000000000000000
%0000000000000000AFFFF600005FF500006FFFFA0000000000000000
%00000000000000001CFFFE30005FF50003EFFFC10000000000000000
%000000000000000001DFFFE4005FF5004EFFFD100000000000000000
%0000000000000000001CFFFF936FF64AFFFFC1000000000000000000
%000000000000000000008FFFFFFFFFFFFFF800000000000000000000
%00000000000000000000029EFFFFFFFFE92000000000000000000000
%00000000000000000000000048BFFB85100000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000005FF500000000000000000000000000
%000000000000000000000000002EE200000000000000000000000000
%00000000000000000000000000011000000000000000000000000000
%%EndPreview
%%EndProlog
%%Page "scripts.coda" 1
gsave newpath
-7 349 moveto
-1 353 7 351 11 345 curveto
13 342 13 339 13 295 curveto
13 249 lineto
19 249 lineto
32 247 51 241 65 233 curveto
121 202 159 125 166 29 curveto
167 21 167 14 167 14 curveto
167 13 187 13 212 13 curveto
262 13 261 13 265 7 curveto
268 3 268 -3 265 -7 curveto
261 -13 262 -13 212 -13 curveto
187 -13 167 -13 167 -14 curveto
167 -14 167 -21 166 -28 curveto
158 -133 115 -214 51 -240 curveto
42 -244 27 -248 19 -249 curveto
13 -249 lineto
13 -295 lineto
13 -339 13 -342 11 -345 curveto
6 -353 -6 -353 -11 -345 curveto
-13 -342 -13 -339 -13 -295 curveto
-13 -249 lineto
-19 -249 lineto
-32 -247 -51 -241 -65 -233 curveto
-121 -202 -159 -125 -166 -28 curveto
-167 -21 -167 -14 -167 -14 curveto
-167 -13 -187 -13 -212 -13 curveto
-262 -13 -261 -13 -265 -7 curveto
-268 -3 -268 3 -265 7 curveto
-261 13 -262 13 -212 13 curveto
-187 13 -167 13 -167 14 curveto
-167 14 -167 21 -166 29 curveto
-158 133 -115 214 -51 240 curveto
-42 244 -27 248 -19 249 curveto
-13 249 lineto
-13 295 lineto
-13 346 -13 345 -7 349 curveto
closepath
-13 118 moveto
-13 217 -13 223 -15 223 curveto
-18 223 -32 218 -37 216 curveto
-66 199 -83 162 -89 99 curveto
-91 81 -93 46 -93 27 curveto
-93 13 lineto
-53 13 lineto
-13 13 lineto
-13 118 lineto
closepath
26 220 moveto
23 221 19 222 17 223 curveto
13 223 lineto
13 118 lineto
13 13 lineto
53 13 lineto
93 13 lineto
93 40 lineto
91 120 82 163 62 193 curveto
53 206 40 216 26 220 curveto
closepath
-13 -118 moveto
-13 -13 lineto
-53 -13 lineto
-93 -13 lineto
-93 -40 lineto
-92 -72 -91 -89 -88 -111 curveto
-80 -179 -56 -215 -17 -223 curveto
-13 -223 lineto
-13 -118 lineto
closepath
93 -40 moveto
93 -13 lineto
53 -13 lineto
13 -13 lineto
13 -118 lineto
13 -223 lineto
17 -223 lineto
56 -215 80 -179 88 -111 curveto
91 -89 92 -72 93 -40 curveto
closepath
fill grestore
%%EOF

View File

@ -36,6 +36,7 @@ enum VLMusicElement {
kMusicNaturalCursor,
kMusicRestCursor,
kMusicKillCursor,
kMusicCoda,
kMusicElements
};

View File

@ -42,7 +42,8 @@ static NSString * sElementNames[kMusicElements] = {
@"sharpcursor",
@"naturalcursor",
@"restcursor",
@"killcursor"
@"killcursor",
@"coda"
};
static float sSharpPos[] = {
@ -407,6 +408,10 @@ VLMusicElement sSemi2Accidental[12][12] = {
[bz removeAllPoints];
[bz setLineWidth:2.0];
}
if (song->fGoToCoda == m || song->fCoda == m)
[[self musicElement:kMusicCoda]
compositeToPoint: NSMakePoint(x+kCodaX, yy+kCodaY)
operation: NSCompositeSourceOver];
}
}
@ -518,15 +523,19 @@ VLMusicElement sSemi2Accidental[12][12] = {
- (IBAction) setKey:(id)sender
{
[[NSAlert alertWithMessageText:@"Transpose Song?"
defaultButton:@"Transpose"
alternateButton:@"Cancel"
otherButton:@"Change Key"
informativeTextWithFormat:
@"Do you want to transpose the song into the new key?"]
beginSheetModalForWindow:[self window]
modalDelegate:self didEndSelector:@selector(setKey:returnCode:contextInfo:)
contextInfo:sender];
if ([self song]->IsNonEmpty())
[[NSAlert alertWithMessageText:@"Transpose Song?"
defaultButton:@"Transpose"
alternateButton:@"Cancel"
otherButton:@"Change Key"
informativeTextWithFormat:
@"Do you want to transpose the song into the new key?"]
beginSheetModalForWindow:[self window]
modalDelegate:self
didEndSelector:@selector(setKey:returnCode:contextInfo:)
contextInfo:sender];
else
[self setKey:nil returnCode:NSAlertOtherReturn contextInfo:sender];
}
- (void)setKey:(NSAlert *)alert returnCode:(int)returnCode contextInfo:(id)sender

View File

@ -39,4 +39,6 @@ const float kStemH = 30.0f;
const float kWholeRestY = 20.0f;
const float kHalfRestY = 15.0f;
const float kTieDepth = 10.0f;
const float kCodaX =-10.0f;
const float kCodaY = 5.0f;
const int kMaxLedgers = 3;

View File

@ -59,6 +59,27 @@ static VLSong sPasteboard;
fCursorRegion = kRegionMeasure;
}
- (BOOL)validateMenuItem:(id) item
{
SEL action = [item action];
if (action == @selector(insertJumpToCoda:))
if (fSelStart == fSelEnd) {
[item setState:[self song]->fGoToCoda==fSelStart];
return YES;
} else
return NO;
else if (action == @selector(insertStartCoda:))
if (fSelStart == fSelEnd) {
[item setState:[self song]->fCoda==fSelStart];
return YES;
} else
return NO;
else
return [self validateUserInterfaceItem:item];
}
- (BOOL)validateUserInterfaceItem:(id) item
{
SEL action = [item action];
@ -215,4 +236,28 @@ static VLSong sPasteboard;
fVolta &= ~mask;
}
- (IBAction)insertJumpToCoda:(id)sender
{
[[self document] willChangeSong];
VLSong * song = [self song];
if (song->fGoToCoda == fSelStart)
song->fGoToCoda = -1;
else
song->fGoToCoda = fSelStart;
[self setNeedsDisplay:YES];
[[self document] didChangeSong];
}
- (IBAction)insertStartCoda:(id)sender
{
[[self document] willChangeSong];
VLSong * song = [self song];
if (song->fCoda == fSelStart)
song->fCoda = -1;
else
song->fCoda = fSelStart;
[self setNeedsDisplay:YES];
[[self document] didChangeSong];
}
@end

View File

@ -13,15 +13,9 @@
8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
95009B280B0ECF9000EB33A4 /* AUOutputBL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95009B220B0ECF9000EB33A4 /* AUOutputBL.cpp */; };
95009B290B0ECF9000EB33A4 /* AUOutputBL.h in Copy MMA Library */ = {isa = PBXBuildFile; fileRef = 95009B230B0ECF9000EB33A4 /* AUOutputBL.h */; };
95009B2A0B0ECF9000EB33A4 /* CAAudioFileFormats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95009B240B0ECF9000EB33A4 /* CAAudioFileFormats.cpp */; };
95009B2B0B0ECF9000EB33A4 /* CAAudioFileFormats.h in Copy MMA Library */ = {isa = PBXBuildFile; fileRef = 95009B250B0ECF9000EB33A4 /* CAAudioFileFormats.h */; };
95009B2C0B0ECF9000EB33A4 /* CAStreamBasicDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95009B260B0ECF9000EB33A4 /* CAStreamBasicDescription.cpp */; };
95009B2D0B0ECF9000EB33A4 /* CAStreamBasicDescription.h in Copy MMA Library */ = {isa = PBXBuildFile; fileRef = 95009B270B0ECF9000EB33A4 /* CAStreamBasicDescription.h */; };
95009B500B0ED0BB00EB33A4 /* CADebugMacros.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95009B4E0B0ED0BB00EB33A4 /* CADebugMacros.cpp */; };
95009B510B0ED0BB00EB33A4 /* CADebugMacros.h in Copy MMA Library */ = {isa = PBXBuildFile; fileRef = 95009B4F0B0ED0BB00EB33A4 /* CADebugMacros.h */; };
95009B640B0ED18700EB33A4 /* CAConditionalMacros.h in Copy MMA Library */ = {isa = PBXBuildFile; fileRef = 95009B620B0ED18700EB33A4 /* CAConditionalMacros.h */; };
95009B650B0ED18700EB33A4 /* CAMath.h in Copy MMA Library */ = {isa = PBXBuildFile; fileRef = 95009B630B0ED18700EB33A4 /* CAMath.h */; };
95009B7E0B0EDC7400EB33A4 /* AUOutputBL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95009B220B0ECF9000EB33A4 /* AUOutputBL.cpp */; };
95009B7F0B0EDC7900EB33A4 /* CAAudioFileFormats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95009B240B0ECF9000EB33A4 /* CAAudioFileFormats.cpp */; };
95009B800B0EDC7B00EB33A4 /* CADebugMacros.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95009B4E0B0ED0BB00EB33A4 /* CADebugMacros.cpp */; };
@ -39,9 +33,7 @@
95498DBD0AE3812F006B5F81 /* VLSoundSched.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95498DBC0AE3812F006B5F81 /* VLSoundSched.mm */; };
954BBD860AEDDE5300BBFD5F /* VLAppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 954BBD850AEDDE5300BBFD5F /* VLAppController.mm */; };
954BBD9A0AEDE81500BBFD5F /* VLPitchTransformer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 954BBD990AEDE81500BBFD5F /* VLPitchTransformer.mm */; };
954DD4B90B444B220056C504 /* VLSheetViewSelection.h in Copy MMA Library */ = {isa = PBXBuildFile; fileRef = 954DD4B70B444B220056C504 /* VLSheetViewSelection.h */; };
954DD4E60B44E67F0056C504 /* VLSheetViewSelection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 954DD4E50B44E67F0056C504 /* VLSheetViewSelection.mm */; };
955CBA4E0B2366DD001CF4A1 /* VLKeyValueUndo.h in Copy MMA Library */ = {isa = PBXBuildFile; fileRef = 955CBA4C0B2366DD001CF4A1 /* VLKeyValueUndo.h */; };
955CBA4F0B2366DD001CF4A1 /* VLKeyValueUndo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 955CBA4D0B2366DD001CF4A1 /* VLKeyValueUndo.mm */; };
955E58E5095658AB0045FDA5 /* VLModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 955E58E4095658AB0045FDA5 /* VLModel.cpp */; };
955E59610957C1400045FDA5 /* TVLChord.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 955E59600957C1400045FDA5 /* TVLChord.cpp */; };
@ -72,9 +64,7 @@
95E04DAB0AEB4886006F30A0 /* VLXMLDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95F5F50E0ADCC433003980B2 /* VLXMLDocument.mm */; };
95E04DC70AEB4B57006F30A0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
95E04DCE0AEB4D9B006F30A0 /* Templates in Resources */ = {isa = PBXBuildFile; fileRef = 95E04DCA0AEB4D9B006F30A0 /* Templates */; };
95E299BF0B2006F5001977D2 /* VLSheetViewLyrics.h in Copy MMA Library */ = {isa = PBXBuildFile; fileRef = 95E299BD0B2006F5001977D2 /* VLSheetViewLyrics.h */; };
95E299C00B2006F5001977D2 /* VLSheetViewLyrics.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95E299BE0B2006F5001977D2 /* VLSheetViewLyrics.mm */; };
95EDA5AA0B06DE46004D8D6E /* VLMIDIDocument.h in Copy MMA Library */ = {isa = PBXBuildFile; fileRef = 95EDA5A80B06DE46004D8D6E /* VLMIDIDocument.h */; };
95EDA5AB0B06DE47004D8D6E /* VLMIDIDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95EDA5A90B06DE46004D8D6E /* VLMIDIDocument.mm */; };
95F5F50F0ADCC433003980B2 /* VLXMLDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95F5F50E0ADCC433003980B2 /* VLXMLDocument.mm */; };
95F5F5340ADCCFBB003980B2 /* DTD in Resources */ = {isa = PBXBuildFile; fileRef = 95F5F51E0ADCCFBB003980B2 /* DTD */; };
@ -103,16 +93,6 @@
95C461FE0B04432700649F92 /* MMA in Copy MMA Library */,
95C461C40B043E8900649F92 /* includes in Copy MMA Library */,
95C461C50B043E8900649F92 /* lib in Copy MMA Library */,
95EDA5AA0B06DE46004D8D6E /* VLMIDIDocument.h in Copy MMA Library */,
95009B290B0ECF9000EB33A4 /* AUOutputBL.h in Copy MMA Library */,
95009B2B0B0ECF9000EB33A4 /* CAAudioFileFormats.h in Copy MMA Library */,
95009B2D0B0ECF9000EB33A4 /* CAStreamBasicDescription.h in Copy MMA Library */,
95009B510B0ED0BB00EB33A4 /* CADebugMacros.h in Copy MMA Library */,
95009B640B0ED18700EB33A4 /* CAConditionalMacros.h in Copy MMA Library */,
95009B650B0ED18700EB33A4 /* CAMath.h in Copy MMA Library */,
95E299BF0B2006F5001977D2 /* VLSheetViewLyrics.h in Copy MMA Library */,
955CBA4E0B2366DD001CF4A1 /* VLKeyValueUndo.h in Copy MMA Library */,
954DD4B90B444B220056C504 /* VLSheetViewSelection.h in Copy MMA Library */,
);
name = "Copy MMA Library";
runOnlyForDeploymentPostprocessing = 0;