Mercurial > hg > soniczoomios
view TopButtonViewController.mm @ 26:2e1fdac115af
Help view.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Fri, 01 Feb 2013 18:31:43 +0000 |
parents | f42a00e3f22d |
children | ae4d2c3ce5e0 |
line wrap: on
line source
// // TopButtonViewController.m // sonicZoom // // Created by Robert Tubb on 31/01/2013. // // #import "TopButtonViewController.h" #import "testApp.h" #import "presetManager.h" extern PresetManager presetManager; @interface TopButtonViewController () @end @implementation TopButtonViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. self.playButton.enabled = true; self.pauseButton.enabled = false; self.qButton.enabled = false; } - (void)enableQuestionButton{ self.qButton.enabled = true; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void)setAppRef:(id)theOFApp{ self.theOFAppRef = theOFApp; } - (IBAction)playPressed:(id)sender { ((testApp *)self.theOFAppRef)->seqStartStop(true); self.playButton.enabled = false; self.pauseButton.enabled = true; } - (IBAction)pausePressed:(id)sender { ((testApp *)self.theOFAppRef)->seqStartStop(false); self.pauseButton.enabled = false; self.playButton.enabled = true; } - (IBAction)savePressed:(id)sender { cout << "SAVE PRESET\n"; presetManager.showNameDialog(); } - (IBAction)lockSequencePressed:(id)sender { UIBarButtonItem *button = (UIBarButtonItem *)sender; if([button.title isEqualToString:@"Lock Sequence (X)"]){ ((testApp *)self.theOFAppRef)->lockSequencerPressed(true); button.title = @"Unlock Sequence (X)"; }else if([button.title isEqualToString:@"Unlock Sequence (X)"]){ ((testApp *)self.theOFAppRef)->lockSequencerPressed(false); button.title = @"Lock Sequence (X)"; }else{ NSLog(@"button title error"); } } - (IBAction)lockSynthPressed:(id)sender { UIBarButtonItem *button = (UIBarButtonItem *)sender; if([button.title isEqualToString:@"Lock Synth (Y)"]){ ((testApp *)self.theOFAppRef)->lockSynthPressed(true); button.title = @"Unlock Synth (Y)"; }else if([button.title isEqualToString:@"Unlock Synth (Y)"]){ ((testApp *)self.theOFAppRef)->lockSynthPressed(false); button.title = @"Lock Synth (Y)"; }else{ NSLog(@"button title error"); } } - (IBAction)qPressed:(id)sender { ((testApp *)self.theOFAppRef)->showQuestionnaire(); } - (IBAction)randomise:(id)sender { ((testApp *)self.theOFAppRef)->randomise(); } - (IBAction)helpPressed:(id)sender { [self.helpViewController.view show:self]; self.helpViewController = [[HelpViewController alloc] initWithNibName:@"HelpViewController" bundle:nil]; [self.view addSubview:self.helpViewController.view]; [self.helpViewController show:self]; } - (IBAction)show:(id)sender { self.theOFAppRef = sender; self.view.hidden = NO; } /* helpViewController = [[HelpViewController alloc] initWithNibName:@"HelpViewController" bundle:nil]; [ofxiPhoneGetGLParentView() addSubview:helpViewController.view]; [helpViewController hide:(id)this]; */ - (void)dealloc { [_helpViewController release]; [_playButton release]; [_pauseButton release]; [_qButton release]; [super dealloc]; } - (void)viewDidUnload { [self setPlayButton:nil]; [self setPauseButton:nil]; [self setQButton:nil]; [super viewDidUnload]; } @end