Changeset 7945ecb in orbit


Ignore:
Timestamp:
08/07/13 13:56:01 (7 years ago)
Author:
Jonathon Horsman <jonathon@…>
Branches:
master, Servo, Tab_Interface, pyramid
Children:
1472980
Parents:
359a504
Message:

CHange volume detection method

Location:
iOS/Orbit
Files:
2 edited

Legend:

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

    r359a504 r7945ecb  
    4949        // initialise the audio session - this should only be done once 
    5050        AudioSessionInitialize(NULL, NULL, NULL, NULL); 
     51        AudioSessionSetActive(YES); 
    5152    } 
    5253    return self; 
     
    7071        [_delegate appStopped]; 
    7172    } 
     73    AudioSessionSetActive(NO); 
    7274} 
    7375 
     
    142144- (BOOL) isVolumeMax 
    143145{ 
    144     AudioSessionSetActive(YES); 
    145     float volume = [[AVAudioSession sharedInstance] outputVolume]; 
     146    Float32 volume; 
     147    UInt32 dataSize; 
     148    AudioSessionGetPropertySize(kAudioSessionProperty_CurrentHardwareOutputVolume, &dataSize); 
     149    AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareOutputVolume, &dataSize, &volume); 
    146150    NSLog(@"Volume is %f", volume); 
    147151    return 1.0 == volume; 
     
    157161     
    158162    // make the call to get the audio description and populate the desc dictionary 
    159     AudioSessionGetProperty (kAudioSessionProperty_AudioRouteDescription, &routeSize, &desc); 
     163    AudioSessionGetProperty(kAudioSessionProperty_AudioRouteDescription, &routeSize, &desc); 
    160164 
    161165    // the dictionary contains 2 keys, for input and output. Get output array 
Note: See TracChangeset for help on using the changeset viewer.