istereo

annotate src/ui.m @ 35:23e5d274b2a2

added options panel, also added the xib files to the repository as they're needed
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 09 Sep 2011 10:03:42 +0300
parents
children 834503dcb486
rev   line source
nuclear@35 1 #import "ui.h"
nuclear@35 2
nuclear@35 3 extern int stereo;
nuclear@35 4 extern int use_bump;
nuclear@35 5 extern float split;
nuclear@35 6
nuclear@35 7
nuclear@35 8 @implementation UI
nuclear@35 9
nuclear@35 10 @synthesize bn_done;
nuclear@35 11 @synthesize slider_split;
nuclear@35 12 @synthesize grp_mode;
nuclear@35 13 @synthesize sw_stereo;
nuclear@35 14
nuclear@35 15 // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
nuclear@35 16 /*
nuclear@35 17 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
nuclear@35 18 {
nuclear@35 19 self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
nuclear@35 20 if(self) {
nuclear@35 21 }
nuclear@35 22 return self;
nuclear@35 23 }*/
nuclear@35 24
nuclear@35 25
nuclear@35 26 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
nuclear@35 27 - (void)viewDidLoad
nuclear@35 28 {
nuclear@35 29 [super viewDidLoad];
nuclear@35 30
nuclear@35 31 [slider_split setValue: 1.0 - split];
nuclear@35 32 sw_stereo.on = stereo ? YES : NO;
nuclear@35 33 grp_mode.selectedSegmentIndex = use_bump ? 1 : 0;
nuclear@35 34 }
nuclear@35 35
nuclear@35 36
nuclear@35 37 // Override to allow orientations other than the default portrait orientation.
nuclear@35 38 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
nuclear@35 39 // Return YES for supported orientations.
nuclear@35 40 return interfaceOrientation == UIInterfaceOrientationLandscapeRight;
nuclear@35 41 }
nuclear@35 42
nuclear@35 43
nuclear@35 44 - (void)didReceiveMemoryWarning {
nuclear@35 45 // Releases the view if it doesn't have a superview.
nuclear@35 46 [super didReceiveMemoryWarning];
nuclear@35 47
nuclear@35 48 // Release any cached data, images, etc. that aren't in use.
nuclear@35 49 }
nuclear@35 50
nuclear@35 51 - (void)viewDidUnload {
nuclear@35 52 [super viewDidUnload];
nuclear@35 53 // Release any retained subviews of the main view.
nuclear@35 54 // e.g. self.myOutlet = nil;
nuclear@35 55 }
nuclear@35 56
nuclear@35 57
nuclear@35 58 - (void)dealloc {
nuclear@35 59 [super dealloc];
nuclear@35 60 }
nuclear@35 61
nuclear@35 62 -(IBAction) done_clicked: (id) sender
nuclear@35 63 {
nuclear@35 64 self.view.hidden = YES;
nuclear@35 65 }
nuclear@35 66
nuclear@35 67 -(IBAction) split_changed: (id) sender
nuclear@35 68 {
nuclear@35 69 split = 1.0 - slider_split.value;
nuclear@35 70 }
nuclear@35 71
nuclear@35 72 -(IBAction) stereo_changed: (id) sender
nuclear@35 73 {
nuclear@35 74 stereo = sw_stereo.on;
nuclear@35 75 }
nuclear@35 76
nuclear@35 77 -(IBAction) mode_changed: (id) sender
nuclear@35 78 {
nuclear@35 79 use_bump = grp_mode.selectedSegmentIndex;
nuclear@35 80 }
nuclear@35 81
nuclear@35 82
nuclear@35 83 @end