annotate TopButtonViewController.mm @ 25:f42a00e3f22d

Logs condensed slightly. Questionnaire button enable. double precision location!!!
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 01 Feb 2013 17:39:19 +0000
parents a4908ad8c78e
children 2e1fdac115af
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@25 37 self.qButton.enabled = false;
rt300@25 38
rt300@24 39 }
rt300@24 40
rt300@25 41 - (void)enableQuestionButton{
rt300@25 42 self.qButton.enabled = true;
rt300@25 43 }
rt300@24 44 - (void)didReceiveMemoryWarning
rt300@24 45 {
rt300@24 46 [super didReceiveMemoryWarning];
rt300@24 47 // Dispose of any resources that can be recreated.
rt300@24 48 }
rt300@24 49
rt300@24 50 - (void)setAppRef:(id)theOFApp{
rt300@24 51 self.theOFAppRef = theOFApp;
rt300@24 52
rt300@24 53 }
rt300@24 54
rt300@24 55 - (IBAction)playPressed:(id)sender {
rt300@24 56 ((testApp *)self.theOFAppRef)->seqStartStop(true);
rt300@24 57 self.playButton.enabled = false;
rt300@24 58 self.pauseButton.enabled = true;
rt300@24 59 }
rt300@24 60
rt300@24 61 - (IBAction)pausePressed:(id)sender {
rt300@24 62 ((testApp *)self.theOFAppRef)->seqStartStop(false);
rt300@24 63 self.pauseButton.enabled = false;
rt300@24 64 self.playButton.enabled = true;
rt300@24 65 }
rt300@24 66
rt300@24 67 - (IBAction)savePressed:(id)sender {
rt300@24 68 cout << "SAVE PRESET\n";
rt300@24 69 presetManager.showNameDialog();
rt300@24 70 }
rt300@24 71
rt300@24 72 - (IBAction)lockSequencePressed:(id)sender {
rt300@24 73 UIBarButtonItem *button = (UIBarButtonItem *)sender;
rt300@24 74 if([button.title isEqualToString:@"Lock Sequence (X)"]){
rt300@24 75 ((testApp *)self.theOFAppRef)->lockSequencerPressed(true);
rt300@24 76 button.title = @"Unlock Sequence (X)";
rt300@24 77 }else if([button.title isEqualToString:@"Unlock Sequence (X)"]){
rt300@24 78 ((testApp *)self.theOFAppRef)->lockSequencerPressed(false);
rt300@24 79 button.title = @"Lock Sequence (X)";
rt300@24 80 }else{
rt300@24 81 NSLog(@"button title error");
rt300@24 82 }
rt300@24 83 }
rt300@24 84
rt300@24 85 - (IBAction)lockSynthPressed:(id)sender {
rt300@24 86 UIBarButtonItem *button = (UIBarButtonItem *)sender;
rt300@24 87 if([button.title isEqualToString:@"Lock Synth (Y)"]){
rt300@24 88 ((testApp *)self.theOFAppRef)->lockSynthPressed(true);
rt300@24 89 button.title = @"Unlock Synth (Y)";
rt300@24 90 }else if([button.title isEqualToString:@"Unlock Synth (Y)"]){
rt300@24 91 ((testApp *)self.theOFAppRef)->lockSynthPressed(false);
rt300@24 92 button.title = @"Lock Synth (Y)";
rt300@24 93 }else{
rt300@24 94 NSLog(@"button title error");
rt300@24 95 }
rt300@24 96 }
rt300@24 97
rt300@24 98 - (IBAction)qPressed:(id)sender {
rt300@24 99 ((testApp *)self.theOFAppRef)->showQuestionnaire();
rt300@24 100 }
rt300@24 101
rt300@25 102 - (IBAction)randomise:(id)sender {
rt300@25 103 ((testApp *)self.theOFAppRef)->randomise();
rt300@25 104 }
rt300@25 105
rt300@24 106 - (IBAction)show:(id)sender
rt300@24 107 {
rt300@24 108 self.theOFAppRef = sender;
rt300@24 109 self.view.hidden = NO;
rt300@24 110 }
rt300@24 111
rt300@24 112 - (void)dealloc {
rt300@24 113 [_playButton release];
rt300@24 114 [_pauseButton release];
rt300@25 115 [_qButton release];
rt300@24 116 [super dealloc];
rt300@24 117 }
rt300@24 118 - (void)viewDidUnload {
rt300@24 119 [self setPlayButton:nil];
rt300@24 120 [self setPauseButton:nil];
rt300@25 121 [self setQButton:nil];
rt300@24 122 [super viewDidUnload];
rt300@24 123 }
rt300@24 124 @end