summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLAudioPassThruCapabilities.m
blob: fbb02be84a1aa078cdd19eb305b4d836439a6b70 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//  SDLAudioPassThruCapabilities.m
//


#import "SDLAudioPassThruCapabilities.h"

#import "SDLAudioType.h"
#import "SDLBitsPerSample.h"
#import "SDLNames.h"
#import "SDLSamplingRate.h"


@implementation SDLAudioPassThruCapabilities

- (instancetype)init {
    if (self = [super init]) {
    }
    return self;
}

- (instancetype)initWithDictionary:(NSMutableDictionary *)dict {
    if (self = [super initWithDictionary:dict]) {
    }
    return self;
}

- (void)setSamplingRate:(SDLSamplingRate *)samplingRate {
    if (samplingRate != nil) {
        [store setObject:samplingRate forKey:NAMES_samplingRate];
    } else {
        [store removeObjectForKey:NAMES_samplingRate];
    }
}

- (SDLSamplingRate *)samplingRate {
    NSObject *obj = [store objectForKey:NAMES_samplingRate];
    if (obj == nil || [obj isKindOfClass:SDLSamplingRate.class]) {
        return (SDLSamplingRate *)obj;
    } else {
        return [SDLSamplingRate valueOf:(NSString *)obj];
    }
}

- (void)setBitsPerSample:(SDLBitsPerSample *)bitsPerSample {
    if (bitsPerSample != nil) {
        [store setObject:bitsPerSample forKey:NAMES_bitsPerSample];
    } else {
        [store removeObjectForKey:NAMES_bitsPerSample];
    }
}

- (SDLBitsPerSample *)bitsPerSample {
    NSObject *obj = [store objectForKey:NAMES_bitsPerSample];
    if (obj == nil || [obj isKindOfClass:SDLBitsPerSample.class]) {
        return (SDLBitsPerSample *)obj;
    } else {
        return [SDLBitsPerSample valueOf:(NSString *)obj];
    }
}

- (void)setAudioType:(SDLAudioType *)audioType {
    if (audioType != nil) {
        [store setObject:audioType forKey:NAMES_audioType];
    } else {
        [store removeObjectForKey:NAMES_audioType];
    }
}

- (SDLAudioType *)audioType {
    NSObject *obj = [store objectForKey:NAMES_audioType];
    if (obj == nil || [obj isKindOfClass:SDLAudioType.class]) {
        return (SDLAudioType *)obj;
    } else {
        return [SDLAudioType valueOf:(NSString *)obj];
    }
}

@end