mirror of
https://github.com/love2d/love.git
synced 2026-08-19 04:06:17 +02:00
Merge default into minor
--HG-- branch : minor
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user