annotate TopButtonViewController.mm @ 24:a4908ad8c78e

Top and bottom toolbars. Intro page.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 01 Feb 2013 11:16:56 +0000
parents
children f42a00e3f22d
rev   line source
rt300@24 1 //
rt300@24 2 // TopButtonViewController.m
rt300@24 3 // sonicZoom
rt300@24 4 //
rt300@24 5 // Created by Robert Tubb on 31/01/2013.
rt300@24 6 //
rt300@24 7 //
rt300@24 8
rt300@24 9 #import "TopButtonViewController.h"
rt300@24 10 #import "testApp.h"
rt300@24 11 #import "presetManager.h"
rt300@24 12
rt300@24 13 extern PresetManager presetManager;
rt300@24 14
rt300@24 15
rt300@24 16 @interface TopButtonViewController ()
rt300@24 17
rt300@24 18 @end
rt300@24 19
rt300@24 20 @implementation TopButtonViewController
rt300@24 21
rt300@24 22 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
rt300@24 23 {
rt300@24 24 self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
rt300@24 25 if (self) {
rt300@24 26 // Custom initialization
rt300@24 27 }
rt300@24 28 return self;
rt300@24 29 }
rt300@24 30
rt300@24 31 - (void)viewDidLoad
rt300@24 32 {
rt300@24 33 [super viewDidLoad];
rt300@24 34 // Do any additional setup after loading the view from its nib.
rt300@24 35 self.playButton.enabled = true;
rt300@24 36 self.pauseButton.enabled = false;
rt300@24 37 }
rt300@24 38
rt300@24 39 - (void)didReceiveMemoryWarning
rt300@24 40 {
rt300@24 41 [super didReceiveMemoryWarning];
rt300@24 42 // Dispose of any resources that can be recreated.
rt300@24 43 }
rt300@24 44
rt300@24 45 - (void)setAppRef:(id)theOFApp{
rt300@24 46 self.theOFAppRef = theOFApp;
rt300@24 47
rt300@24 48 }
rt300@24 49
rt300@24 50 - (IBAction)playPressed:(id)sender {
rt300@24 51 ((testApp *)self.theOFAppRef)->seqStartStop(true);
rt300@24 52 self.playButton.enabled = false;
rt300@24 53 self.pauseButton.enabled = true;
rt300@24 54 }
rt300@24 55
rt300@24 56 - (IBAction)pausePressed:(id)sender {
rt300@24 57 ((testApp *)self.theOFAppRef)->seqStartStop(false);
rt300@24 58 self.pauseButton.enabled = false;
rt300@24 59 self.playButton.enabled = true;
rt300@24 60 }
rt300@24 61
rt300@24 62 - (IBAction)savePressed:(id)sender {
rt300@24 63 cout << "SAVE PRESET\n";
rt300@24 64 presetManager.showNameDialog();
rt300@24 65 }
rt300@24 66
rt300@24 67 - (IBAction)lockSequencePressed:(id)sender {
rt300@24 68 UIBarButtonItem *button = (UIBarButtonItem *)sender;
rt300@24 69 if([button.title isEqualToString:@"Lock Sequence (X)"]){
rt300@24 70 ((testApp *)self.theOFAppRef)->lockSequencerPressed(true);
rt300@24 71 button.title = @"Unlock Sequence (X)";
rt300@24 72 }else if([button.title isEqualToString:@"Unlock Sequence (X)"]){
rt300@24 73 ((testApp *)self.theOFAppRef)->lockSequencerPressed(false);
rt300@24 74 button.title = @"Lock Sequence (X)";
rt300@24 75 }else{
rt300@24 76 NSLog(@"button title error");
rt300@24 77 }
rt300@24 78 }
rt300@24 79
rt300@24 80 - (IBAction)lockSynthPressed:(id)sender {
rt300@24 81 UIBarButtonItem *button = (UIBarButtonItem *)sender;
rt300@24 82 if([button.title isEqualToString:@"Lock Synth (Y)"]){
rt300@24 83 ((testApp *)self.theOFAppRef)->lockSynthPressed(true);
rt300@24 84 button.title = @"Unlock Synth (Y)";
rt300@24 85 }else if([button.title isEqualToString:@"Unlock Synth (Y)"]){
rt300@24 86 ((testApp *)self.theOFAppRef)->lockSynthPressed(false);
rt300@24 87 button.title = @"Lock Synth (Y)";
rt300@24 88 }else{
rt300@24 89 NSLog(@"button title error");
rt300@24 90 }
rt300@24 91 }
rt300@24 92
rt300@24 93 - (IBAction)qPressed:(id)sender {
rt300@24 94 ((testApp *)self.theOFAppRef)->showQuestionnaire();
rt300@24 95 }
rt300@24 96
rt300@24 97 - (IBAction)show:(id)sender
rt300@24 98 {
rt300@24 99 self.theOFAppRef = sender;
rt300@24 100 self.view.hidden = NO;
rt300@24 101 }
rt300@24 102
rt300@24 103 - (void)dealloc {
rt300@24 104 [_playButton release];
rt300@24 105 [_pauseButton release];
rt300@24 106 [super dealloc];
rt300@24 107 }
rt300@24 108 - (void)viewDidUnload {
rt300@24 109 [self setPlayButton:nil];
rt300@24 110 [self setPauseButton:nil];
rt300@24 111 [super viewDidUnload];
rt300@24 112 }
rt300@24 113 @end