// // 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:YES]; self.sledSoundLabel.text = @"Silent"; break; case 1: [[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeLow persistSetting:YES]; self.sledSoundLabel.text = @"Low"; break; case 2: [[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeMedium persistSetting:YES]; self.sledSoundLabel.text = @"Medium"; break; case 3: [[Captuvo sharedCaptuvoDevice] setDecoderGoodReadBeeperVolume:BeeperVolumeHigh persistSetting:YES]; 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