diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-09-02 08:31:22 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-09-02 08:31:22 +0300 |
commit | 9b511d28ec299705a6871ac4fbd53647e2808ea0 (patch) | |
tree | 05c0c1b592c9e1fd9257e5ac6ee32a73e55797a6 /src/audio/PolRadio.cpp | |
parent | c41239ed5e44cfd4f54d9478c1b08efd94e1338e (diff) |
Audio: PS2 cAudioManager::ServicePoliceRadioChannel
Diffstat (limited to 'src/audio/PolRadio.cpp')
-rw-r--r-- | src/audio/PolRadio.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/audio/PolRadio.cpp b/src/audio/PolRadio.cpp index 2dce3dae..f2c14ec4 100644 --- a/src/audio/PolRadio.cpp +++ b/src/audio/PolRadio.cpp @@ -189,16 +189,24 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel) if (!m_bIsInitialised) return; if (m_bIsPaused) { +#ifdef GTA_PS2 + if (SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO)) + SampleManager.SetChannelFrequency(CHANNEL_POLICE_RADIO, 0); +#else if (SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO)) SampleManager.StopChannel(CHANNEL_POLICE_RADIO); if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_PLAYING && - SampleManager.IsStreamPlaying(1)) { + SampleManager.IsStreamPlaying(1)) SampleManager.PauseStream(TRUE, 1); - } +#endif } else { +#ifdef GTA_PS2 + if (m_bWasPaused) + SampleManager.SetChannelFrequency(CHANNEL_POLICE_RADIO, PoliceChannelFreq); +#else if (m_bWasPaused && g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && - bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_PLAYING) { + bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_PLAYING) SampleManager.PauseStream(FALSE, 1); - } +#endif if (m_sPoliceRadioQueue.m_nSamplesInQueue == 0) bChannelOpen = FALSE; if (cWait) { #ifdef FIX_BUGS @@ -211,11 +219,19 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel) if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && !bChannelOpen) { if (g_nMissionAudioPlayingStatus != PLAY_STATUS_STOPPED) { if (g_nMissionAudioPlayingStatus == PLAY_STATUS_PLAYING && bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_STOPPED && +#ifdef GTA_PS2 + SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO)) { +#else SampleManager.IsStreamPlaying(1)) { +#endif bMissionAudioPhysicalPlayingStatus = PLAY_STATUS_PLAYING; } if (bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_PLAYING) { +#ifdef GTA_PS2 + if (SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO)) { +#else if (SampleManager.IsStreamPlaying(1)) { +#endif DoPoliceRadioCrackle(); } else { bMissionAudioPhysicalPlayingStatus = PLAY_STATUS_FINISHED; @@ -226,9 +242,18 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel) return; } } else if (!SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO)) { +#ifdef GTA_PS2 + SampleManager.InitialiseChannel(CHANNEL_POLICE_RADIO, g_nMissionAudioSfx, SFX_BANK_PED_COMMENTS); + PoliceChannelFreq = SampleManager.GetSampleBaseFrequency(g_nMissionAudioSfx); + SampleManager.SetChannelFrequency(CHANNEL_POLICE_RADIO, PoliceChannelFreq); + SampleManager.SetChannelVolume(CHANNEL_POLICE_RADIO, MAX_VOLUME); + SampleManager.SetChannelPan(CHANNEL_POLICE_RADIO, 63); + SampleManager.StartChannel(CHANNEL_POLICE_RADIO); +#else SampleManager.PreloadStreamedFile(g_nMissionAudioSfx, 1); SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, TRUE, 1); SampleManager.StartPreloadedStreamedFile(1); +#endif g_nMissionAudioPlayingStatus = PLAY_STATUS_PLAYING; bMissionAudioPhysicalPlayingStatus = PLAY_STATUS_STOPPED; return; |