Import flat MusicXML files

This commit is contained in:
Matthias Neeracher 2007-09-03 13:58:37 +00:00
parent b048f76565
commit c54aa45bee

View File

@ -56,24 +56,27 @@
- (BOOL)readFromXMLFileWrapper:(NSFileWrapper *)wrapper error:(NSError **)outError - (BOOL)readFromXMLFileWrapper:(NSFileWrapper *)wrapper error:(NSError **)outError
{ {
NSDictionary * wrappers = [wrapper fileWrappers]; if ([wrapper isDirectory]) {
if ((vcsWrapper = [wrappers objectForKey:@"CVS"]) NSDictionary * wrappers = [wrapper fileWrappers];
|| (vcsWrapper = [wrappers objectForKey:@".svn"]) if ((vcsWrapper = [wrappers objectForKey:@"CVS"])
) || (vcsWrapper = [wrappers objectForKey:@".svn"])
[vcsWrapper retain]; )
NSFileWrapper * prop = [wrappers objectForKey:@"Properties"]; [vcsWrapper retain];
if (prop) { NSFileWrapper * prop = [wrappers objectForKey:@"Properties"];
NSUndoManager * undoMgr = [self undoManager]; if (prop) {
[undoMgr disableUndoRegistration]; NSUndoManager * undoMgr = [self undoManager];
[self setValuesForKeysWithDictionary: [undoMgr disableUndoRegistration];
[NSPropertyListSerialization [self setValuesForKeysWithDictionary:
propertyListFromData:[prop regularFileContents] [NSPropertyListSerialization
mutabilityOption:NSPropertyListImmutable propertyListFromData:[prop regularFileContents]
format:nil errorDescription:nil]]; mutabilityOption:NSPropertyListImmutable
[undoMgr enableUndoRegistration]; format:nil errorDescription:nil]];
} [undoMgr enableUndoRegistration];
return [self readFromFileWrapper:[wrappers objectForKey:@"Song"] withFilter:@"VLMusicXMLType" }
error:outError]; return [self readFromFileWrapper:[wrappers objectForKey:@"Song"] withFilter:@"VLMusicXMLType"
error:outError];
} else
return [self readFromFileWrapper:wrapper withFilter:@"VLMusicXMLType" error:outError];
} }
@end @end