mirror of
https://github.com/love2d/love.git
synced 2026-08-17 02:58:31 +02:00
Minor code style tweaks
This commit is contained in:
+11
-8
@@ -220,26 +220,29 @@ static int dropFileEventFilter(void *userdata, SDL_Event *event)
|
||||
|
||||
- (void)audioSessionInterruption:(NSNotification *)note
|
||||
{
|
||||
@synchronized (self) {
|
||||
@synchronized (self)
|
||||
{
|
||||
auto audio = love::Module::getInstance<love::audio::Audio>(love::Module::M_AUDIO);
|
||||
if (!audio) {
|
||||
if (!audio)
|
||||
{
|
||||
NSLog(@"LoveAudioInterruptionListener could not get love audio module");
|
||||
return;
|
||||
}
|
||||
NSNumber *type = note.userInfo[AVAudioSessionInterruptionTypeKey];
|
||||
if (type.unsignedIntegerValue == AVAudioSessionInterruptionTypeBegan) {
|
||||
if (type.unsignedIntegerValue == AVAudioSessionInterruptionTypeBegan)
|
||||
audio->pauseContext();
|
||||
} else {
|
||||
else
|
||||
audio->resumeContext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applicationBecameActive:(NSNotification *)note
|
||||
{
|
||||
@synchronized (self) {
|
||||
@synchronized (self)
|
||||
{
|
||||
auto audio = love::Module::getInstance<love::audio::Audio>(love::Module::M_AUDIO);
|
||||
if (!audio) {
|
||||
if (!audio)
|
||||
{
|
||||
NSLog(@"ERROR:could not get love audio module");
|
||||
return;
|
||||
}
|
||||
@@ -247,7 +250,7 @@ static int dropFileEventFilter(void *userdata, SDL_Event *event)
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@end // LoveAudioInterruptionListener
|
||||
|
||||
namespace love
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user