From a73a2c91793c329a1039032871a1cbf7bda61bd9 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Wed, 30 Jun 2021 21:21:45 +0300 Subject: Pause radio when game is paused --- src/audio/MusicManager.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/audio/MusicManager.cpp') diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index 5a176005..13fba08c 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -310,7 +310,16 @@ cMusicManager::ChangeMusicMode(uint8 mode) switch (mode) { - case MUSICMODE_FRONTEND: m_nUpcomingMusicMode = MUSICMODE_FRONTEND; break; + case MUSICMODE_FRONTEND: + m_nUpcomingMusicMode = MUSICMODE_FRONTEND; + +#ifdef PAUSE_RADIO_IN_FRONTEND + // rewind those streams we weren't listening right now + for( uint32 i = STREAMED_SOUND_RADIO_WILD; i < STREAMED_SOUND_CUTSCENE_ASS_1; i++ ) + m_aTracks[i].m_nPosition = GetTrackStartPos(i); +#endif + + break; case MUSICMODE_GAME: m_nUpcomingMusicMode = MUSICMODE_GAME; break; case MUSICMODE_CUTSCENE: m_nUpcomingMusicMode = MUSICMODE_CUTSCENE; @@ -414,6 +423,12 @@ cMusicManager::ServiceFrontEndMode() { static bool8 bRadioStatsRecorded = FALSE; +#ifdef PAUSE_RADIO_IN_FRONTEND + // pause radio + for (uint32 i = STREAMED_SOUND_RADIO_WILD; i < STREAMED_SOUND_CUTSCENE_ASS_1; i++) + m_aTracks[i].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); +#endif + if (m_bAnnouncementInProgress) { SampleManager.StopStreamedFile(); if (SampleManager.IsStreamPlaying()) -- cgit v1.2.3