Mercurial > hg > audiodb
diff examples/iAudioDB/AppController.m @ 684:fed70cb84a92
Double-clicking table now plays result where possible.
author | mas01mj |
---|---|
date | Fri, 05 Mar 2010 17:20:06 +0000 |
parents | df9639a5cad2 |
children | e78e5a80b73d |
line wrap: on
line diff
--- a/examples/iAudioDB/AppController.m Fri Mar 05 16:59:38 2010 +0000 +++ b/examples/iAudioDB/AppController.m Fri Mar 05 17:20:06 2010 +0000 @@ -18,10 +18,20 @@ // A max of 100 results. results = [[NSMutableArray alloc] initWithCapacity: 100]; - return self; } +- (void)awakeFromNib { + [tracksView setTarget:self]; + [tracksView setDoubleAction:@selector(tableDoubleClick:)]; +} + +- (IBAction)tableDoubleClick:(id)sender +{ + [self playResult:Nil]; +// NSLog(@"Table double clicked"); +} + /** * Create a new database, given the selected filename. @@ -379,6 +389,11 @@ -(IBAction)playResult:(id)sender { + if([tracksView selectedRow] == -1) + { + return; + } + NSDictionary* selectedRow = [results objectAtIndex:[tracksView selectedRow]]; NSString* value = [selectedRow objectForKey:@"key"]; float ipos = [[selectedRow objectForKey:@"ipos"] floatValue];