- Timestamp:
- 08/29/13 10:34:36 (9 years ago)
- Branches:
- master, Servo, Tab_Interface, pyramid
- Children:
- e37a889
- Parents:
- c4c7004
- Location:
- iOS/Orbit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
iOS/Orbit/Orbit/SignalConverter.h
r359a504 rad40faa 16 16 17 17 @interface SignalConverter : NSObject <TGAccessoryDelegate> { 18 AudioGenerator *audioPlayer; 18 // Generate Signal 19 // AudioGenerator *audioPlayer; 20 // Play WAV 21 AVAudioPlayer *audioPlayer; 19 22 } 20 23 … … 36 39 - (void) playTestSound; 37 40 - (void) stopTestSound; 41 - (void) prepareAudio; 38 42 39 43 @end -
iOS/Orbit/Orbit/SignalConverter.m
r89934ea rad40faa 40 40 [[TGAccessoryManager sharedTGAccessoryManager] setupManagerWithInterval:0.05]; 41 41 [[TGAccessoryManager sharedTGAccessoryManager] setDelegate:self]; 42 audioPlayer = [[AudioGenerator alloc] init]; 42 // Generate Signal 43 // audioPlayer = [[AudioGenerator alloc] init]; 43 44 44 45 // defaults … … 108 109 if (value != nil) { 109 110 110 // NSLog(@"value: %i", [value intValue]);111 // NSLog(@"value: %i", [value intValue]); 111 112 112 113 if ([value intValue] == 0) { … … 122 123 } 123 124 124 // NSLog(@"signalStrength: %i", signalStrength);125 // NSLog(@"signalStrength: %i", signalStrength); 125 126 126 127 } … … 227 228 - (void) playTestSound 228 229 { 230 231 NSLog(@"playTestSound()"); 232 [self prepareAudio]; 233 234 // [self playAudio]; 235 229 236 if (!running && !testing) { 230 237 testing = YES; 231 [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 238 // Generate Sound 239 // [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 240 [self playAudio]; 232 241 } 233 242 } … … 273 282 } 274 283 284 //- (void) playAudio 285 //{ 286 // if ([self currentPowerLevel] > 0) { 287 // // Generate Signal 288 // [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 289 // } else { 290 // [audioPlayer stop]; 291 // 292 // } 293 //} 294 295 275 296 - (void) playAudio 276 297 { 298 299 [audioPlayer play]; 300 301 return; 302 303 // audioPlayer.volume = [self currentPowerLevel]; 277 304 if ([self currentPowerLevel] > 0) { 278 [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 305 audioPlayer.volume = 1.0; 306 [audioPlayer play]; 279 307 } else { 280 308 [audioPlayer stop]; 309 [self prepareAudio]; 281 310 282 311 } … … 312 341 } 313 342 343 - (void) prepareAudio 344 { 345 NSURL *audioFilePath = [[NSBundle mainBundle] URLForResource:AUDIO_FILE_NAME withExtension:nil]; 346 347 NSError *error; 348 audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:audioFilePath error:&error]; 349 if (!audioPlayer) { 350 // [self logMessage:[NSString stringWithFormat:@"Failed to initialize audio player: %@", [error debugDescription]]]; 351 NSLog(@"Failed to initialize audio player: %@", [error debugDescription]); 352 } else { 353 [audioPlayer prepareToPlay]; 354 } 355 } 356 314 357 @end -
iOS/Orbit/Orbit/controllers/FlightViewController.m
r4a56cfb rad40faa 39 39 self.meditationThreshold.value = 0; 40 40 41 [signalConverter prepareAudio]; 42 41 43 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 42 44 signalConverter = appDelegate.signalConverter; … … 46 48 [self.attentionThreshold addTarget:self action:@selector(setThresholds) forControlEvents:UIControlEventValueChanged]; 47 49 [self.meditationThreshold addTarget:self action:@selector(setThresholds) forControlEvents:UIControlEventValueChanged]; 50 48 51 } 49 52 … … 173 176 - (IBAction) testButtonPressed:(id) sender { 174 177 175 176 NSLog(@"Available fonts: %@", [UIFont familyNames]); 177 // Droid Sans 178 178 // NSLog(@"Available fonts: %@", [UIFont familyNames]); 179 179 180 180 [signalConverter isAudioJackPlugged]; -
iOS/Orbit/orbit.xcodeproj/xcuserdata/sc.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
r9fa491d rad40faa 3 3 type = "1" 4 4 version = "1.0"> 5 <FileBreakpoints> 6 <FileBreakpoint 7 shouldBeEnabled = "Yes" 8 ignoreCount = "0" 9 continueAfterRunningActions = "No" 10 filePath = "Orbit/SignalConverter.m" 11 timestampString = "399450641.859267" 12 startingColumnNumber = "9223372036854775807" 13 endingColumnNumber = "9223372036854775807" 14 startingLineNumber = "189" 15 endingLineNumber = "189" 16 landmarkName = "-isAudioJackPlugged" 17 landmarkType = "5"> 18 </FileBreakpoint> 19 </FileBreakpoints> 5 20 </Bucket>
Note: See TracChangeset
for help on using the changeset viewer.