diff --git a/source/ps/Globals.cpp b/source/ps/Globals.cpp index 6622547f14..9174aab513 100644 --- a/source/ps/Globals.cpp +++ b/source/ps/Globals.cpp @@ -72,14 +72,18 @@ InReaction GlobalsInputHandler(const SDL_Event_* ev) if(ev->ev.active.state & SDL_APPACTIVE) { g_app_minimized = (ev->ev.active.gain == 0); // negated +#if CONFIG2_AUDIO if ( g_SoundManager ) g_SoundManager->Pause( g_app_minimized && g_PauseOnFocusLoss && !g_NetClient ); +#endif } if(ev->ev.active.state & SDL_APPINPUTFOCUS) { g_app_has_focus = (ev->ev.active.gain != 0); +#if CONFIG2_AUDIO if ( g_SoundManager ) g_SoundManager->Pause( !g_app_has_focus && g_PauseOnFocusLoss && !g_NetClient ); +#endif } if(ev->ev.active.state & SDL_APPMOUSEFOCUS) g_mouse_active = (ev->ev.active.gain != 0); diff --git a/source/scripting/ScriptGlue.cpp b/source/scripting/ScriptGlue.cpp index d17ae25013..61566a0846 100644 --- a/source/scripting/ScriptGlue.cpp +++ b/source/scripting/ScriptGlue.cpp @@ -341,8 +341,10 @@ JSBool SetPaused(JSContext* cx, uintN argc, jsval* vp) try { g_Game->m_Paused = ToPrimitive (JS_ARGV(cx, vp)[0]); +#if CONFIG2_AUDIO if ( g_SoundManager ) g_SoundManager->Pause(g_Game->m_Paused); +#endif } catch (PSERROR_Scripting_ConversionFailed) { diff --git a/source/soundmanager/js/MusicList.cpp b/source/soundmanager/js/MusicList.cpp index e6e2f036e3..04efe7c35a 100644 --- a/source/soundmanager/js/MusicList.cpp +++ b/source/soundmanager/js/MusicList.cpp @@ -33,7 +33,9 @@ JMusicList::JMusicList() { +#if CONFIG2_AUDIO g_SoundManager->ClearPlayListItems(); +#endif } bool JMusicList::AddItem(JSContext* cx, uintN UNUSED(argc), jsval* vp) @@ -42,7 +44,10 @@ bool JMusicList::AddItem(JSContext* cx, uintN UNUSED(argc), jsval* vp) if (! ToPrimitive(cx, vp[0], filename)) return false; +#if CONFIG2_AUDIO g_SoundManager->AddPlayListItem( new VfsPath( filename ) ); +#endif + return true; }