diff --git a/Sources/VLDocument.h b/Sources/VLDocument.h index 65de5e3..e3dc7a8 100644 --- a/Sources/VLDocument.h +++ b/Sources/VLDocument.h @@ -54,6 +54,7 @@ - (NSString *) baseName; - (NSURL *) fileURLWithExtension:(NSString*)extension; - (NSTask *) taskWithLaunchPath:(NSString *)path arguments:(NSArray *)args; +- (void) changedFileWrapper; - (void) willChangeSong; - (void) didChangeSong; diff --git a/Sources/VLDocument.mm b/Sources/VLDocument.mm index b4e8412..fe6d28b 100644 --- a/Sources/VLDocument.mm +++ b/Sources/VLDocument.mm @@ -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"]])); diff --git a/Sources/VLMIDIDocument.mm b/Sources/VLMIDIDocument.mm index 1c694fb..3be4768 100644 --- a/Sources/VLMIDIDocument.mm +++ b/Sources/VLMIDIDocument.mm @@ -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