iOS: Refactoring support for background Music.app.

This commit is contained in:
Phillip Ponson 2016-01-17 19:51:28 -06:00
parent 4de1726bf6
commit 6ca58a4d6e
2 changed files with 4 additions and 12 deletions

View File

@ -124,9 +124,7 @@ void cocoagl_bind_game_view_fbo(void)
{ {
#ifdef HAVE_AVFOUNDATION #ifdef HAVE_AVFOUNDATION
/* Implicitly initializes your audio session */ /* Implicitly initializes your audio session */
AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [[RetroArch_iOS get] supportOtherAudioSessions];
[audioSession setCategory: AVAudioSessionCategoryAmbient error: nil];
[audioSession setActive:YES error:nil];
#endif #endif
if (g_context) if (g_context)
[g_view bindDrawable]; [g_view bindDrawable];

View File

@ -47,9 +47,7 @@ void apple_rarch_exited(void);
static void rarch_enable_ui(void) static void rarch_enable_ui(void)
{ {
#ifdef HAVE_AVFOUNDATION #ifdef HAVE_AVFOUNDATION
AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [[RetroArch_iOS get] supportOtherAudioSessions];
[audioSession setCategory: AVAudioSessionCategoryAmbient error: nil];
[audioSession setActive:YES error:nil];
#endif #endif
bool boolean = true; bool boolean = true;
@ -71,9 +69,7 @@ static void rarch_disable_ui(void)
runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean);
rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
#ifdef HAVE_AVFOUNDATION #ifdef HAVE_AVFOUNDATION
AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [[RetroArch_iOS get] supportOtherAudioSessions];
[audioSession setCategory: AVAudioSessionCategoryAmbient error: nil];
[audioSession setActive:YES error:nil];
#endif #endif
} }
@ -329,9 +325,7 @@ enum
{ {
#ifdef HAVE_AVFOUNDATION #ifdef HAVE_AVFOUNDATION
/* Implicitly initializes your audio session. */ /* Implicitly initializes your audio session. */
AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [(RetroArch_iOS*)[[UIApplication sharedApplication] delegate] supportOtherAudioSessions];
[audioSession setCategory: AVAudioSessionCategoryAmbient error: nil];
[audioSession setActive:YES error:nil];
#endif #endif
return (RetroArch_iOS*)[[UIApplication sharedApplication] delegate]; return (RetroArch_iOS*)[[UIApplication sharedApplication] delegate];
} }