mirror of https://github.com/axmolengine/axmol.git
Improve code style
This commit is contained in:
parent
2de66bbefa
commit
b534d9d1f4
|
@ -80,6 +80,12 @@ static void ccALResumeDevice()
|
||||||
|
|
||||||
#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS
|
#if AX_TARGET_PLATFORM == AX_PLATFORM_IOS
|
||||||
|
|
||||||
|
# if TARGET_OS_SIMULATOR
|
||||||
|
#define AVAUDIOSESSION_DEFAULT_CATEGORY AVAudioSessionCategoryPlayback // Fix can't hear sound in ios simulator 16.0
|
||||||
|
# else
|
||||||
|
#define AVAUDIOSESSION_DEFAULT_CATEGORY AVAudioSessionCategoryAmbient
|
||||||
|
# endif
|
||||||
|
|
||||||
@interface AudioEngineSessionHandler : NSObject {
|
@interface AudioEngineSessionHandler : NSObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,12 +120,7 @@ static void ccALResumeDevice()
|
||||||
name:UIApplicationWillResignActiveNotification
|
name:UIApplicationWillResignActiveNotification
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
# if TARGET_OS_SIMULATOR
|
BOOL success = [[AVAudioSession sharedInstance] setCategory:AVAUDIOSESSION_DEFAULT_CATEGORY error:nil];
|
||||||
const auto category = AVAudioSessionCategoryPlayback; // Fix can't hear sound in ios simulator 16.0
|
|
||||||
# else
|
|
||||||
const auto category = AVAudioSessionCategoryAmbient;
|
|
||||||
# endif
|
|
||||||
BOOL success = [[AVAudioSession sharedInstance] setCategory:category error:nil];
|
|
||||||
if (!success)
|
if (!success)
|
||||||
ALOGE("Fail to set audio session.");
|
ALOGE("Fail to set audio session.");
|
||||||
}
|
}
|
||||||
|
@ -200,7 +201,7 @@ static void ccALResumeDevice()
|
||||||
resumeOnBecomingActive = false;
|
resumeOnBecomingActive = false;
|
||||||
ALOGD("UIApplicationDidBecomeActiveNotification, alcMakeContextCurrent(s_ALContext)");
|
ALOGD("UIApplicationDidBecomeActiveNotification, alcMakeContextCurrent(s_ALContext)");
|
||||||
NSError* error = nil;
|
NSError* error = nil;
|
||||||
BOOL success = [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:&error];
|
BOOL success = [[AVAudioSession sharedInstance] setCategory:AVAUDIOSESSION_DEFAULT_CATEGORY error:&error];
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
ALOGE("Fail to set audio session.");
|
ALOGE("Fail to set audio session.");
|
||||||
|
|
Loading…
Reference in New Issue