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; - (NSString *) baseName;
- (NSURL *) fileURLWithExtension:(NSString*)extension; - (NSURL *) fileURLWithExtension:(NSString*)extension;
- (NSTask *) taskWithLaunchPath:(NSString *)path arguments:(NSArray *)args; - (NSTask *) taskWithLaunchPath:(NSString *)path arguments:(NSArray *)args;
- (void) changedFileWrapper;
- (void) willChangeSong; - (void) willChangeSong;
- (void) didChangeSong; - (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 *) taskWithLaunchPath:(NSString *)launch arguments:(NSArray *)args;
{ {
NSTask * task = [[NSTask alloc] init]; NSTask * task = [[NSTask alloc] init];
@ -372,6 +382,7 @@
} else { } else {
NSBeep(); NSBeep();
} }
[self changedFileWrapper];
} }
- (IBAction) play:(id)sender - (IBAction) play:(id)sender
@ -379,6 +390,7 @@
NSError * err; NSError * err;
[self writeToURL:[self fileURLWithExtension:@"mid"] [self writeToURL:[self fileURLWithExtension:@"mid"]
ofType:@"VLMIDIType" error:&err]; ofType:@"VLMIDIType" error:&err];
[self changedFileWrapper];
VLSoundOut::Instance()->PlayFile( VLSoundOut::Instance()->PlayFile(
CFDataRef([NSData dataWithContentsOfURL: CFDataRef([NSData dataWithContentsOfURL:
[self fileURLWithExtension:@"mid"]])); [self fileURLWithExtension:@"mid"]]));

View File

@ -20,6 +20,7 @@
NSError * err; NSError * err;
NSURL * mmaURL = [self fileURLWithExtension:@"mma"]; NSURL * mmaURL = [self fileURLWithExtension:@"mma"];
[self writeToURL: mmaURL ofType:@"VLMMAType" error:&err]; [self writeToURL: mmaURL ofType:@"VLMMAType" error:&err];
[self changedFileWrapper];
NSString * launch = NSString * launch =
[mainBundle pathForResource:@"mmaWrapper" ofType:@"" [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 @end