//
//  MPT_MeterController.m
//  Enjoyment
//
//  Created by Andrew Salamon on 5/1/09.
//  Copyright 2009 Machine Perception Laboratory, University of California San Diego.. All rights reserved.
//

#import "MPT_MeterController.h"

#import "MPT_EnjoymentView.h"
#import "MPT_Speedometer.h"

@implementation MPT_MeterController
- (id)init
{
	if( self = [super init] )
	{
        if( ![NSBundle loadNibNamed:@"EnjoymentView" owner:self] )
			NSLog( @"Unable to load nib for MPT_MeterController framework." );
	}
	return self;
}

- (void)awakeFromNib
{
	[self setMin:-8.0];
	[self setMax:2.0];
	[self setCutoff:-3.0];
    [self setLabel:@""];
}

- (MPT_AUView *)auView {
    return [[auView retain] autorelease];
}

- (float)cutoff {
    return cutoff;
}

- (void)setCutoff:(float)value {
    if (cutoff != value) {
        cutoff = value;
        [[auView valueView] setCenter:value];
    }
}

- (float)min {
    return min;
}

- (void)setMin:(float)value {
    if (min != value) {
        min = value;
        [[auView valueView] setMin:value];
    }
}

- (float)max {
    return max;
}

- (void)setMax:(float)value {
    if (max != value) {
        max = value;
        [[auView valueView] setMax:value];
    }
}

- (NSString *)label {
    return [[label retain] autorelease];
}

- (void)setLabel:(NSString *)value {
    if (label != value) {
        [label release];
        label = [value copy];
    }
}

@end
