Changeset ad40faa in orbit


Ignore:
Timestamp:
08/29/13 10:34:36 (7 years ago)
Author:
Steve Castellotti <sc@…>
Branches:
master, Servo, Tab_Interface, pyramid
Children:
e37a889
Parents:
c4c7004
Message:

Orbit:

  • reverted to WAV output
Location:
iOS/Orbit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • iOS/Orbit/Orbit/SignalConverter.h

    r359a504 rad40faa  
    1616 
    1717@interface SignalConverter : NSObject <TGAccessoryDelegate> { 
    18     AudioGenerator *audioPlayer; 
     18   // Generate Signal 
     19//   AudioGenerator *audioPlayer; 
     20   // Play WAV 
     21   AVAudioPlayer *audioPlayer; 
    1922} 
    2023 
     
    3639- (void) playTestSound; 
    3740- (void) stopTestSound; 
     41- (void) prepareAudio; 
    3842 
    3943@end 
  • iOS/Orbit/Orbit/SignalConverter.m

    r89934ea rad40faa  
    4040        [[TGAccessoryManager sharedTGAccessoryManager] setupManagerWithInterval:0.05]; 
    4141        [[TGAccessoryManager sharedTGAccessoryManager] setDelegate:self]; 
    42         audioPlayer = [[AudioGenerator alloc] init]; 
     42        // Generate Signal 
     43        //        audioPlayer = [[AudioGenerator alloc] init]; 
    4344         
    4445        // defaults 
     
    108109    if (value != nil) { 
    109110         
    110 //        NSLog(@"value: %i", [value intValue]); 
     111        //        NSLog(@"value: %i", [value intValue]); 
    111112         
    112113        if ([value intValue] == 0) { 
     
    122123        } 
    123124         
    124 //        NSLog(@"signalStrength: %i", signalStrength); 
     125        //        NSLog(@"signalStrength: %i", signalStrength); 
    125126         
    126127    } 
     
    227228- (void) playTestSound 
    228229{ 
     230     
     231    NSLog(@"playTestSound()"); 
     232    [self prepareAudio]; 
     233     
     234//    [self playAudio]; 
     235     
    229236    if (!running && !testing) { 
    230237        testing = YES; 
    231         [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 
     238        // Generate Sound 
     239        //        [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 
     240        [self playAudio]; 
    232241    } 
    233242} 
     
    273282} 
    274283 
     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 
    275296- (void) playAudio 
    276297{ 
     298     
     299    [audioPlayer play]; 
     300     
     301    return; 
     302     
     303    //   audioPlayer.volume = [self currentPowerLevel]; 
    277304    if ([self currentPowerLevel] > 0) { 
    278         [audioPlayer playWithThrottle:throttle yaw:yaw pitch:pitch]; 
     305        audioPlayer.volume = 1.0; 
     306        [audioPlayer play]; 
    279307    } else { 
    280308        [audioPlayer stop]; 
     309        [self prepareAudio]; 
    281310         
    282311    } 
     
    312341} 
    313342 
     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 
    314357@end 
  • iOS/Orbit/Orbit/controllers/FlightViewController.m

    r4a56cfb rad40faa  
    3939   self.meditationThreshold.value = 0; 
    4040    
     41   [signalConverter prepareAudio]; 
     42    
    4143   AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; 
    4244   signalConverter = appDelegate.signalConverter; 
     
    4648   [self.attentionThreshold addTarget:self action:@selector(setThresholds) forControlEvents:UIControlEventValueChanged]; 
    4749   [self.meditationThreshold addTarget:self action:@selector(setThresholds) forControlEvents:UIControlEventValueChanged]; 
     50    
    4851} 
    4952 
     
    173176- (IBAction) testButtonPressed:(id) sender { 
    174177    
    175     
    176    NSLog(@"Available fonts: %@", [UIFont familyNames]); 
    177 //   Droid Sans 
    178     
     178//   NSLog(@"Available fonts: %@", [UIFont familyNames]); 
    179179    
    180180   [signalConverter isAudioJackPlugged]; 
  • iOS/Orbit/orbit.xcodeproj/xcuserdata/sc.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist

    r9fa491d rad40faa  
    33   type = "1" 
    44   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> 
    520</Bucket> 
Note: See TracChangeset for help on using the changeset viewer.