Merge default into minor

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-07-28 19:14:54 -03:00
12 changed files with 116 additions and 0 deletions
+23
View File
@@ -26,6 +26,7 @@
#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioServices.h>
#import <AVFoundation/AVFoundation.h>
#include <vector>
@@ -344,6 +345,28 @@ void vibrate()
}
}
void setAudioMixWithOthers(bool mixEnabled)
{
@autoreleasepool
{
NSString *category = AVAudioSessionCategorySoloAmbient;
NSError *err;
if (mixEnabled)
category = AVAudioSessionCategoryAmbient;
if (![[AVAudioSession sharedInstance] setCategory:category error:&err])
NSLog(@"Error in AVAudioSession setCategory: %@", [err localizedDescription]);
}
}
bool hasBackgroundMusic()
{
if ([[AVAudioSession sharedInstance] respondsToSelector:@selector(secondaryAudioShouldBeSilencedHint)])
return [[AVAudioSession sharedInstance] secondaryAudioShouldBeSilencedHint];
return false;
}
} // ios
} // love