mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 19:23:59 +00:00
Added properties file
This commit is contained in:
parent
9d2eef93b2
commit
9f52fc0010
|
@ -269,14 +269,6 @@ const char * sSteps = "C DbD EbE F GbG AbA BbB ";
|
||||||
objectForInfoDictionaryKey:@"CFBundleVersion"]]]];
|
objectForInfoDictionaryKey:@"CFBundleVersion"]]]];
|
||||||
[identification addChild:encoding];
|
[identification addChild:encoding];
|
||||||
|
|
||||||
NSXMLElement * misc = [NSXMLNode elementWithName:@"miscellaneous"];
|
|
||||||
NSXMLElement * groove = [NSXMLNode elementWithName:@"miscellaneous-field"
|
|
||||||
stringValue:songGroove];
|
|
||||||
[groove addAttribute: [NSXMLNode attributeWithName:@"name"
|
|
||||||
stringValue:@"VocalEasel-groove"]];
|
|
||||||
[misc addChild: groove];
|
|
||||||
[identification addChild: misc];
|
|
||||||
|
|
||||||
return identification;
|
return identification;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -444,6 +436,17 @@ const char * sSteps = "C DbD EbE F GbG AbA BbB ";
|
||||||
return [doc XMLDataWithOptions:NSXMLNodePrettyPrint|NSXMLNodeCompactEmptyElement];
|
return [doc XMLDataWithOptions:NSXMLNodePrettyPrint|NSXMLNodeCompactEmptyElement];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSArray *)propertyKeys
|
||||||
|
{
|
||||||
|
static NSArray * sPropertyKeys = nil;
|
||||||
|
|
||||||
|
if (!sPropertyKeys)
|
||||||
|
sPropertyKeys = [[NSArray alloc] initWithObjects:
|
||||||
|
@"songGroove", @"songTempo", nil];
|
||||||
|
|
||||||
|
return sPropertyKeys;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSFileWrapper *)XMLFileWrapperWithError:(NSError **)outError flat:(BOOL)flat;
|
- (NSFileWrapper *)XMLFileWrapperWithError:(NSError **)outError flat:(BOOL)flat;
|
||||||
{
|
{
|
||||||
NSData * contents = [self XMLDataWithError:outError];
|
NSData * contents = [self XMLDataWithError:outError];
|
||||||
|
@ -461,6 +464,13 @@ const char * sSteps = "C DbD EbE F GbG AbA BbB ";
|
||||||
autorelease];
|
autorelease];
|
||||||
[wrap addRegularFileWithContents:contents
|
[wrap addRegularFileWithContents:contents
|
||||||
preferredFilename:@"Song"];
|
preferredFilename:@"Song"];
|
||||||
|
NSDictionary * prop =
|
||||||
|
[self dictionaryWithValuesForKeys:[self propertyKeys]];
|
||||||
|
[wrap addRegularFileWithContents:
|
||||||
|
[NSPropertyListSerialization dataFromPropertyList:prop
|
||||||
|
format:NSPropertyListXMLFormat_v1_0
|
||||||
|
errorDescription:nil]
|
||||||
|
preferredFilename:@"Properties"];
|
||||||
if (vcsWrapper)
|
if (vcsWrapper)
|
||||||
[wrap addFileWrapper:vcsWrapper];
|
[wrap addFileWrapper:vcsWrapper];
|
||||||
|
|
||||||
|
@ -719,6 +729,13 @@ int8_t sStepToPitch[] = {
|
||||||
|| (vcsWrapper = [wrappers objectForKey:@".svn"])
|
|| (vcsWrapper = [wrappers objectForKey:@".svn"])
|
||||||
)
|
)
|
||||||
[vcsWrapper retain];
|
[vcsWrapper retain];
|
||||||
|
NSFileWrapper * prop = [wrappers objectForKey:@"Properties"];
|
||||||
|
if (prop)
|
||||||
|
[self setValuesForKeysWithDictionary:
|
||||||
|
[NSPropertyListSerialization
|
||||||
|
propertyListFromData:[prop regularFileContents]
|
||||||
|
mutabilityOption:NSPropertyListImmutable
|
||||||
|
format:nil errorDescription:nil]];
|
||||||
return [self readFromXMLData:
|
return [self readFromXMLData:
|
||||||
[[wrappers objectForKey:@"Song"] regularFileContents]
|
[[wrappers objectForKey:@"Song"] regularFileContents]
|
||||||
error:outError];
|
error:outError];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user