CaptuvoOptionsController.m 2.84 KB
Newer Older
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//
//  CaptuvoOptionsController.m
//  CaptuvoSDKDemo
//
//  Created by PLUC SeniorDesign on 2/24/15.
//  Copyright (c) 2015 Anthony J. Carno. All rights reserved.
//

#import "CaptuvoOptionsController.h"

@interface CaptuvoOptionsController ()

@end

@implementation CaptuvoOptionsController

int sled_volume;

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [[Captuvo sharedCaptuvoDevice] requestDecoderGoodReadBeeperVolumeStatus];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/**
 @brief This method identifies the current sled volume and then sets the label and the stepper to the correct values.
 */
- (void)decoderGoodReadBeeperVolumeStatus:(BeeperVolume)volume
{
    switch (volume) {
        case BeeperVolumeHigh:
            sled_volume = 3;
            self.sledSoundLabel.text = @"High";
            break;
        case BeeperVolumeMedium:
            sled_volume = 2;
            self.sledSoundLabel.text = @"Medium";
            break;
        case BeeperVolumeLow:
            sled_volume = 1;
            self.sledSoundLabel.text = @"Low";
            break;
        case BeeperVolumeOff:
            sled_volume = 0;
            self.sledSoundLabel.text = @"Silent";
            break;
        default:
            break;
    }
    self.sledSoundStepper.value = (double)sled_volume;
}

/**
 @brief This method changes the sled volume between high, medium, low, and silent.
 
 @param (id)sender - tied to button
 @return IBAction - tied to button
 */
- (IBAction)changeSledVolume:(id)sender {
    sled_volume = (int)self.sledSoundStepper.value;
    switch (sled_volume) {
        case 0:
            [[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeOff persistSetting:NO];
            self.sledSoundLabel.text = @"Silent";
            break;
        case 1:
            [[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeLow persistSetting:NO];
            self.sledSoundLabel.text = @"Low";
            break;
        case 2:
            [[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeMedium persistSetting:NO];
            self.sledSoundLabel.text = @"Medium";
            break;
        case 3:
            [[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeHigh persistSetting:NO];
            self.sledSoundLabel.text = @"High";
            break;
        default:
            break;
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end