Implement debug menu, document dump

This commit is contained in:
Matthias Neeracher 2007-08-12 21:30:40 +00:00
parent 9ff65437d7
commit c9d56d01b2
7 changed files with 969 additions and 822 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -13,6 +13,7 @@
@interface VLAppController : NSObject { @interface VLAppController : NSObject {
IBOutlet id lilypondPath; IBOutlet id lilypondPath;
IBOutlet id mirrorWin; IBOutlet id mirrorWin;
IBOutlet id debugMenu;
NSString * toolPath; NSString * toolPath;
NSString * appPath; NSString * appPath;

View File

@ -11,6 +11,7 @@
#import "VLAppController.h" #import "VLAppController.h"
#import "VLPitchTransformer.h" #import "VLPitchTransformer.h"
#import "VLSoundOut.h" #import "VLSoundOut.h"
#import "VLDebugFlags.h"
#import <Carbon/Carbon.h> #import <Carbon/Carbon.h>
@ -53,6 +54,8 @@
+ (void)initialize + (void)initialize
{ {
VLDebugFlags::Update();
[self setupDefaults]; [self setupDefaults];
[self setupTransformers]; [self setupTransformers];
} }
@ -178,6 +181,12 @@
[defaults setObject:toolPath forKey:@"VLLilypondPath"]; [defaults setObject:toolPath forKey:@"VLLilypondPath"];
} }
[lilypondPath selectItemWithTag:wantTool ? 0 : 1]; [lilypondPath selectItemWithTag:wantTool ? 0 : 1];
if (VLDebugFlags::ShowDebugMenu()) {
NSMenuItem * debug = [debugMenu itemAtIndex:0];
[debugMenu removeItem:debug];
[[NSApp mainMenu] addItem:debug];
}
} }
- (BOOL)promptForSoftwareInstallation:(NSString *)label - (BOOL)promptForSoftwareInstallation:(NSString *)label

View File

@ -27,4 +27,6 @@
withFilter:(NSString *)filterName withFilter:(NSString *)filterName
error:(NSError **)outError; error:(NSError **)outError;
- (IBAction) dump:(id)sender;
@end @end

View File

@ -62,7 +62,8 @@ NSDictionary * VLPlistVisitor::EncodeProperties(const VLProperties & properties)
[NSNumber numberWithInt: properties.fTime.fDenom], @"timeDenom", [NSNumber numberWithInt: properties.fTime.fDenom], @"timeDenom",
[NSNumber numberWithInt: properties.fKey], @"key", [NSNumber numberWithInt: properties.fKey], @"key",
[NSNumber numberWithInt: properties.fMode], @"mode", [NSNumber numberWithInt: properties.fMode], @"mode",
[NSNumber numberWithInt: properties.fDivisions], @"divisions"]; [NSNumber numberWithInt: properties.fDivisions], @"divisions",
nil];
} }
NSArray * VLPlistVisitor::EncodeRepeats(const std::vector<VLRepeat> & repeats) NSArray * VLPlistVisitor::EncodeRepeats(const std::vector<VLRepeat> & repeats)
@ -85,11 +86,13 @@ NSDictionary * VLPlistVisitor::EncodeRepeat(const VLRepeat & repeat)
[ea addObject:[NSDictionary dictionaryWithObjectsAndKeys: [ea addObject:[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt: i->fBegin], @"begin", [NSNumber numberWithInt: i->fBegin], @"begin",
[NSNumber numberWithInt: i->fEnd], @"end", [NSNumber numberWithInt: i->fEnd], @"end",
[NSNumber numberWithInt: i->fVolta], @"volta"]]; [NSNumber numberWithInt: i->fVolta], @"volta",
nil]];
return [NSDictionary dictionaryWithObjectsAndKeys: return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt: repeat.fTimes], @"times", [NSNumber numberWithInt: repeat.fTimes], @"times",
ea, @"endings"]; ea, @"endings",
nil];
} }
void VLPlistVisitor::Visit(VLSong & song) void VLPlistVisitor::Visit(VLSong & song)
@ -115,8 +118,8 @@ void VLPlistVisitor::VisitMeasure(size_t m, VLProperties & p, VLMeasure & meas)
[NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:m], @"measure", [NSNumber numberWithInt:m], @"measure",
[NSNumber numberWithInt:meas.fPropIdx], @"properties", [NSNumber numberWithInt:meas.fPropIdx], @"properties",
fNotes, @"melody", fNotes, @"melody", fChords, @"chords",
fChords, @"chords"]; nil];
[fMeasures addObject:md]; [fMeasures addObject:md];
} }
@ -128,7 +131,8 @@ void VLPlistVisitor::VisitNote(VLLyricsNote & n)
[NSNumber numberWithInt:n.fDuration.fDenom], @"durDenom", [NSNumber numberWithInt:n.fDuration.fDenom], @"durDenom",
[NSNumber numberWithInt:n.fPitch], @"pitch", [NSNumber numberWithInt:n.fPitch], @"pitch",
[NSNumber numberWithInt:n.fTied], @"tied", [NSNumber numberWithInt:n.fTied], @"tied",
[NSNumber numberWithInt:n.fVisual], @"visual"]; [NSNumber numberWithInt:n.fVisual], @"visual",
nil];
[fNotes addObject:nd]; [fNotes addObject:nd];
} }
@ -140,7 +144,8 @@ void VLPlistVisitor::VisitChord(VLChord & c)
[NSNumber numberWithInt:c.fDuration.fDenom], @"durDenom", [NSNumber numberWithInt:c.fDuration.fDenom], @"durDenom",
[NSNumber numberWithInt:c.fPitch], @"pitch", [NSNumber numberWithInt:c.fPitch], @"pitch",
[NSNumber numberWithInt:c.fSteps], @"steps", [NSNumber numberWithInt:c.fSteps], @"steps",
[NSNumber numberWithInt:c.fRootPitch], @"root"]; [NSNumber numberWithInt:c.fRootPitch], @"root",
nil];
[fChords addObject: cd]; [fChords addObject: cd];
} }
@ -167,6 +172,11 @@ void VLPlistVisitor::VisitChord(VLChord & c)
return plist; return plist;
} }
- (IBAction)dump:(id)sender
{
NSLog(@"%@\n", [self plistInPerformanceOrder:NO]);
}
- (BOOL)readFromPlist:(id)plist error:(NSError **)outError - (BOOL)readFromPlist:(id)plist error:(NSError **)outError
{ {
return NO; return NO;

View File

@ -48,6 +48,7 @@
955E59640957C15A0045FDA5 /* VLModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 955E58E4095658AB0045FDA5 /* VLModel.cpp */; }; 955E59640957C15A0045FDA5 /* VLModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 955E58E4095658AB0045FDA5 /* VLModel.cpp */; };
95784D870BFAD795009ABEA4 /* VLMirrorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95784D860BFAD795009ABEA4 /* VLMirrorWindow.mm */; }; 95784D870BFAD795009ABEA4 /* VLMirrorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95784D860BFAD795009ABEA4 /* VLMirrorWindow.mm */; };
9588363C0C6F9C7D004B4162 /* VLPListDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9588363B0C6F9C7D004B4162 /* VLPListDocument.mm */; }; 9588363C0C6F9C7D004B4162 /* VLPListDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9588363B0C6F9C7D004B4162 /* VLPListDocument.mm */; };
9588365C0C6FABBA004B4162 /* VLDebugFlags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9588365A0C6FABBA004B4162 /* VLDebugFlags.cpp */; };
95932B91096527700008B0DB /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 952CBBB3095FD34F00434E43 /* AudioUnit.framework */; }; 95932B91096527700008B0DB /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 952CBBB3095FD34F00434E43 /* AudioUnit.framework */; };
95932B92096527710008B0DB /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 952CBBB2095FD34F00434E43 /* AudioToolbox.framework */; }; 95932B92096527710008B0DB /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 952CBBB2095FD34F00434E43 /* AudioToolbox.framework */; };
9593E4E80AE0ED1F00035816 /* vlsong.icns in Resources */ = {isa = PBXBuildFile; fileRef = 9593E4E60AE0ED1F00035816 /* vlsong.icns */; }; 9593E4E80AE0ED1F00035816 /* vlsong.icns in Resources */ = {isa = PBXBuildFile; fileRef = 9593E4E60AE0ED1F00035816 /* vlsong.icns */; };
@ -193,6 +194,8 @@
95784D860BFAD795009ABEA4 /* VLMirrorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VLMirrorWindow.mm; path = Sources/VLMirrorWindow.mm; sourceTree = "<group>"; }; 95784D860BFAD795009ABEA4 /* VLMirrorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VLMirrorWindow.mm; path = Sources/VLMirrorWindow.mm; sourceTree = "<group>"; };
9588363A0C6F9C7D004B4162 /* VLPListDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLPListDocument.h; path = Sources/VLPListDocument.h; sourceTree = "<group>"; }; 9588363A0C6F9C7D004B4162 /* VLPListDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLPListDocument.h; path = Sources/VLPListDocument.h; sourceTree = "<group>"; };
9588363B0C6F9C7D004B4162 /* VLPListDocument.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VLPListDocument.mm; path = Sources/VLPListDocument.mm; sourceTree = "<group>"; }; 9588363B0C6F9C7D004B4162 /* VLPListDocument.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = VLPListDocument.mm; path = Sources/VLPListDocument.mm; sourceTree = "<group>"; };
9588365A0C6FABBA004B4162 /* VLDebugFlags.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VLDebugFlags.cpp; path = Sources/VLDebugFlags.cpp; sourceTree = "<group>"; };
9588365B0C6FABBA004B4162 /* VLDebugFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLDebugFlags.h; path = Sources/VLDebugFlags.h; sourceTree = "<group>"; };
9593E4E60AE0ED1F00035816 /* vlsong.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = vlsong.icns; path = Resources/vlsong.icns; sourceTree = "<group>"; }; 9593E4E60AE0ED1F00035816 /* vlsong.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = vlsong.icns; path = Resources/vlsong.icns; sourceTree = "<group>"; };
9593E4E70AE0ED1F00035816 /* vlapp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = vlapp.icns; path = Resources/vlapp.icns; sourceTree = "<group>"; }; 9593E4E70AE0ED1F00035816 /* vlapp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = vlapp.icns; path = Resources/vlapp.icns; sourceTree = "<group>"; };
959408A0096922CA007CCCF8 /* TVLEdit */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TVLEdit; sourceTree = BUILT_PRODUCTS_DIR; }; 959408A0096922CA007CCCF8 /* TVLEdit */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TVLEdit; sourceTree = BUILT_PRODUCTS_DIR; };
@ -348,6 +351,8 @@
2A37F4ABFDCFA73011CA2CEA /* Classes */ = { 2A37F4ABFDCFA73011CA2CEA /* Classes */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
9588365A0C6FABBA004B4162 /* VLDebugFlags.cpp */,
9588365B0C6FABBA004B4162 /* VLDebugFlags.h */,
9588363A0C6F9C7D004B4162 /* VLPListDocument.h */, 9588363A0C6F9C7D004B4162 /* VLPListDocument.h */,
9588363B0C6F9C7D004B4162 /* VLPListDocument.mm */, 9588363B0C6F9C7D004B4162 /* VLPListDocument.mm */,
9545C5C10C092F4600251547 /* VLMMAWriter.cpp */, 9545C5C10C092F4600251547 /* VLMMAWriter.cpp */,
@ -699,6 +704,7 @@
955DA2960C0551EC008F73B8 /* VLLilypondWriter.cpp in Sources */, 955DA2960C0551EC008F73B8 /* VLLilypondWriter.cpp in Sources */,
9545C5C30C092F4600251547 /* VLMMAWriter.cpp in Sources */, 9545C5C30C092F4600251547 /* VLMMAWriter.cpp in Sources */,
9588363C0C6F9C7D004B4162 /* VLPListDocument.mm in Sources */, 9588363C0C6F9C7D004B4162 /* VLPListDocument.mm in Sources */,
9588365C0C6FABBA004B4162 /* VLDebugFlags.cpp in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };