istereo

diff 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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/ui.m	Fri Sep 09 10:03:42 2011 +0300
     1.3 @@ -0,0 +1,83 @@
     1.4 +#import "ui.h"
     1.5 +
     1.6 +extern int stereo;
     1.7 +extern int use_bump;
     1.8 +extern float split;
     1.9 +
    1.10 +
    1.11 +@implementation UI
    1.12 +
    1.13 +@synthesize bn_done;
    1.14 +@synthesize slider_split;
    1.15 +@synthesize grp_mode;
    1.16 +@synthesize sw_stereo;
    1.17 +
    1.18 +// The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
    1.19 +/*
    1.20 +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    1.21 +{
    1.22 +	self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    1.23 +	if(self) {
    1.24 +	}
    1.25 +	return self;
    1.26 +}*/
    1.27 +
    1.28 +
    1.29 +// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    1.30 +- (void)viewDidLoad
    1.31 +{
    1.32 +	[super viewDidLoad];
    1.33 +	
    1.34 +	[slider_split setValue: 1.0 - split];
    1.35 +	sw_stereo.on = stereo ? YES : NO;
    1.36 +	grp_mode.selectedSegmentIndex = use_bump ? 1 : 0;	
    1.37 +}
    1.38 +
    1.39 +
    1.40 +// Override to allow orientations other than the default portrait orientation.
    1.41 +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    1.42 +    // Return YES for supported orientations.
    1.43 +    return interfaceOrientation == UIInterfaceOrientationLandscapeRight;
    1.44 +}
    1.45 +
    1.46 +
    1.47 +- (void)didReceiveMemoryWarning {
    1.48 +    // Releases the view if it doesn't have a superview.
    1.49 +    [super didReceiveMemoryWarning];
    1.50 +    
    1.51 +    // Release any cached data, images, etc. that aren't in use.
    1.52 +}
    1.53 +
    1.54 +- (void)viewDidUnload {
    1.55 +    [super viewDidUnload];
    1.56 +    // Release any retained subviews of the main view.
    1.57 +    // e.g. self.myOutlet = nil;
    1.58 +}
    1.59 +
    1.60 +
    1.61 +- (void)dealloc {
    1.62 +    [super dealloc];
    1.63 +}
    1.64 +
    1.65 +-(IBAction) done_clicked: (id) sender
    1.66 +{
    1.67 +	self.view.hidden = YES;
    1.68 +}
    1.69 +
    1.70 +-(IBAction) split_changed: (id) sender
    1.71 +{
    1.72 +	split = 1.0 - slider_split.value;
    1.73 +}
    1.74 +
    1.75 +-(IBAction) stereo_changed: (id) sender
    1.76 +{
    1.77 +	stereo = sw_stereo.on;
    1.78 +}
    1.79 +
    1.80 +-(IBAction) mode_changed: (id) sender
    1.81 +{
    1.82 +	use_bump = grp_mode.selectedSegmentIndex;
    1.83 +}
    1.84 +
    1.85 +
    1.86 +@end