# HG changeset patch # User mas01mj # Date 1268394842 0 # Node ID 8bc10774e56b9828c6caac6121c1c11718c60e7b # Parent e2f4924130efcc73768493ef051caf6cce49b598 Disabled query button if no query file selected. diff -r e2f4924130ef -r 8bc10774e56b examples/iAudioDB/AppController.h --- a/examples/iAudioDB/AppController.h Thu Mar 11 17:19:15 2010 +0000 +++ b/examples/iAudioDB/AppController.h Fri Mar 12 11:54:02 2010 +0000 @@ -31,6 +31,7 @@ IBOutlet NSTextField* queryLengthVectors; IBOutlet NSTextField* queryLengthSeconds; IBOutlet NSTextField* queryPath; + IBOutlet NSButton* queryButton; // Main window buttons/fields. diff -r e2f4924130ef -r 8bc10774e56b examples/iAudioDB/AppController.m --- a/examples/iAudioDB/AppController.m Thu Mar 11 17:19:15 2010 +0000 +++ b/examples/iAudioDB/AppController.m Fri Mar 12 11:54:02 2010 +0000 @@ -139,6 +139,19 @@ [dbState release]; } + if(selectedKey) + { + NSLog(@"Released selected key: %@", selectedKey); + [selectedKey release]; + selectedKey = Nil; + NSLog(@"Is now %@", selectedKey); + } + + if(selectedKey) + { + NSLog(@"Still evals"); + } + // Reset query flags [queryPath setStringValue: @"No file selected"]; [queryLengthSeconds setDoubleValue:0]; @@ -221,8 +234,8 @@ { NSLog(@"No db"); [performQueryButton setEnabled:NO]; - [playBothButton setEnabled:FALSE]; - [playResultButton setEnabled:FALSE]; + [playBothButton setEnabled:NO]; + [playResultButton setEnabled:NO]; } } @@ -249,7 +262,7 @@ NSArray *filesToOpen = [panel filenames]; NSString* extractor = [dbState objectForKey:@"extractor"]; - NSString* extractorPath = [NSString stringWithFormat:@"/Users/mikej/Development/audioDB/examples/iAudioDB/rdf/%@.n3", extractor]; + NSString* extractorPath = [NSString stringWithFormat:@"/Applications/iAudioDB.app/rdf/%@.n3", extractor]; // TODO Shift this process into a separate function. // Create the customized extractor config @@ -511,6 +524,7 @@ */ -(IBAction)chooseQuery:(id)sender { + [queryButton setEnabled:(selectedKey ? YES : NO)]; [NSApp beginSheet:querySheet modalForWindow:mainWindow modalDelegate:self didEndSelector:NULL contextInfo:nil]; session = [NSApp beginModalSessionForWindow:querySheet]; [NSApp runModalSession:session]; @@ -542,6 +556,7 @@ [queryKey setStringValue:selectedKey]; [queryPath setStringValue:selectedKey]; selectedFilename = [[panel filename] retain]; + [queryButton setEnabled:YES]; [self resetLengths:self]; } @@ -573,6 +588,8 @@ double secs = [queryLengthSeconds doubleValue]; if(secs > 0) { + // (samples - windowSize) / hopSize + [queryLengthVectors setDoubleValue:ceil(((secs*44100)-winSize)/hopSize)]; } } diff -r e2f4924130ef -r 8bc10774e56b examples/iAudioDB/English.lproj/MainMenu.xib --- a/examples/iAudioDB/English.lproj/MainMenu.xib Thu Mar 11 17:19:15 2010 +0000 +++ b/examples/iAudioDB/English.lproj/MainMenu.xib Fri Mar 12 11:54:02 2010 +0000 @@ -8,11 +8,11 @@ 353.00 YES - - + + YES @@ -1423,6 +1423,7 @@ Query NSPanel + {3.40282e+38, 3.40282e+38} 256 @@ -2144,6 +2145,14 @@ 845 + + + queryButton + + + + 846 + @@ -3326,7 +3335,6 @@ 789.IBPluginDependency 790.IBPluginDependency 792.IBEditorWindowLastContentRect - 792.IBPluginDependency 792.IBWindowTemplateEditedContentRect 792.NSWindowTemplate.visibleAtLaunch 793.IBPluginDependency @@ -3419,8 +3427,8 @@ {74, 862} {{6, 978}, {478, 20}} - {{26, 350}, {606, 477}} - {{26, 350}, {606, 477}} + {{26, 79}, {606, 477}} + {{26, 79}, {606, 477}} {{33, 99}, {480, 360}} {3.40282e+38, 3.40282e+38} @@ -3446,8 +3454,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{169, 544}, {305, 281}} - {{169, 544}, {305, 281}} + {{169, 281}, {305, 281}} + {{169, 281}, {305, 281}} com.apple.InterfaceBuilder.CocoaPlugin {{83, 102}, {201, 183}} @@ -3520,9 +3528,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{333, 87}, {293, 251}} - com.apple.InterfaceBuilder.CocoaPlugin - {{333, 87}, {293, 251}} + {{392, 71}, {293, 251}} + {{392, 71}, {293, 251}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -3583,7 +3590,7 @@ - 845 + 846 @@ -3648,6 +3655,7 @@ performQueryButton playBothButton playResultButton + queryButton queryKey queryLengthSeconds queryLengthVectors @@ -3673,6 +3681,7 @@ NSButton NSButton NSButton + NSButton NSTextField NSTextField NSTextField