summaryrefslogtreecommitdiff
path: root/macosx/plugins/DFSound/macsrc/NamedSlider.m
blob: 55322742b4f5593040ee373266eda32e3965e905 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#import "NamedSlider.h"

@implementation NamedSlider
@synthesize pluginClass;

#if !__has_feature(objc_arc)
- (void)dealloc
{
	self.strings = nil;
	
	[super dealloc];
}
#endif

@synthesize strings;

- (NSString *)stringValue
{
	NSInteger index = [self integerValue];

	if (index >= 0 && index < [strings count])
		return [strings objectAtIndex:index];

	if (!pluginClass) {
		return @"(Unknown)";
	} else {
		return [[NSBundle bundleForClass:pluginClass] localizedStringForKey:@"(Unknown)" value:@"" table:nil];
	}
}

- (void)setIntValue:(int)value
{
	[super setIntValue:value];
	[self sendAction:[self action] to:[self target]];
}

@end