Added changedFileWrapper to avoid annoying warnings

This commit is contained in:
Matthias Neeracher 2007-01-12 09:01:19 +00:00
parent 8a9e650e75
commit 44f4f86173
3 changed files with 25 additions and 0 deletions

View File

@ -54,6 +54,7 @@
- (NSString *) baseName;
- (NSURL *) fileURLWithExtension:(NSString*)extension;
- (NSTask *) taskWithLaunchPath:(NSString *)path arguments:(NSArray *)args;
- (void) changedFileWrapper;
- (void) willChangeSong;
- (void) didChangeSong;

View File

@ -316,6 +316,16 @@
}
}
- (void) changedFileWrapper
{
if (NSURL * url = [self fileURL])
if (NSDate * modDate =
[[[NSFileManager defaultManager] fileAttributesAtPath:[url path]
traverseLink:YES]
objectForKey:NSFileModificationDate])
[self setFileModificationDate:modDate];
}
- (NSTask *) taskWithLaunchPath:(NSString *)launch arguments:(NSArray *)args;
{
NSTask * task = [[NSTask alloc] init];
@ -372,6 +382,7 @@
} else {
NSBeep();
}
[self changedFileWrapper];
}
- (IBAction) play:(id)sender
@ -379,6 +390,7 @@
NSError * err;
[self writeToURL:[self fileURLWithExtension:@"mid"]
ofType:@"VLMIDIType" error:&err];
[self changedFileWrapper];
VLSoundOut::Instance()->PlayFile(
CFDataRef([NSData dataWithContentsOfURL:
[self fileURLWithExtension:@"mid"]]));

View File

@ -20,6 +20,7 @@
NSError * err;
NSURL * mmaURL = [self fileURLWithExtension:@"mma"];
[self writeToURL: mmaURL ofType:@"VLMMAType" error:&err];
[self changedFileWrapper];
NSString * launch =
[mainBundle pathForResource:@"mmaWrapper" ofType:@""
@ -50,4 +51,15 @@
}
}
- (void)mmaDone:(NSNotification *)notification {
[[NSNotificationCenter defaultCenter] removeObserver: self];
int status = [[notification object] terminationStatus];
if (!status) {
;
} else {
NSBeep();
}
}
@end