summaryrefslogtreecommitdiffstats
path: root/src/audio/MusicManager.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-05-22 12:08:26 +0200
committerSergeanur <s.anureev@yandex.ua>2021-06-24 20:34:32 +0200
commit5bcdb933a78abb2b9b8d6648d17502240bd9fd29 (patch)
treedf31ee5fefd2ee7716b9ba01cc0062361520a655 /src/audio/MusicManager.cpp
parentFix C3dMarkers::PlaceMarker calls in Radar (diff)
downloadre3-5bcdb933a78abb2b9b8d6648d17502240bd9fd29.tar
re3-5bcdb933a78abb2b9b8d6648d17502240bd9fd29.tar.gz
re3-5bcdb933a78abb2b9b8d6648d17502240bd9fd29.tar.bz2
re3-5bcdb933a78abb2b9b8d6648d17502240bd9fd29.tar.lz
re3-5bcdb933a78abb2b9b8d6648d17502240bd9fd29.tar.xz
re3-5bcdb933a78abb2b9b8d6648d17502240bd9fd29.tar.zst
re3-5bcdb933a78abb2b9b8d6648d17502240bd9fd29.zip
Diffstat (limited to 'src/audio/MusicManager.cpp')
-rw-r--r--src/audio/MusicManager.cpp274
1 files changed, 137 insertions, 137 deletions
diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp
index 1a727b4f..e56bc013 100644
--- a/src/audio/MusicManager.cpp
+++ b/src/audio/MusicManager.cpp
@@ -28,7 +28,7 @@ static_assert(false, "R*'s radio implementation is quite buggy, RADIO_SCROLL_TO_
cMusicManager MusicManager;
int32 gNumRetunePresses;
int32 gRetuneCounter;
-bool g_bAnnouncementReadPosAlready;
+bool8 g_bAnnouncementReadPosAlready;
uint8 RadioStaticCounter = 5;
uint32 RadioStaticTimer;
@@ -50,13 +50,13 @@ uint32 NewGameRadioTimers[10] =
cMusicManager::cMusicManager()
{
- m_bIsInitialised = false;
- m_bDisabled = false;
+ m_bIsInitialised = FALSE;
+ m_bDisabled = FALSE;
m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK;
m_nUpcomingMusicMode = MUSICMODE_DISABLED;
m_nMusicMode = MUSICMODE_DISABLED;
- m_bSetNextStation = false;
+ m_bSetNextStation = FALSE;
for (int i = 0; i < NUM_RADIOS; i++)
aListenTimeArray[i] = 0.0f;
@@ -66,7 +66,7 @@ cMusicManager::cMusicManager()
m_nCurrentVolume = 0;
m_nMaxVolume = 0;
m_nAnnouncement = NO_TRACK;
- m_bAnnouncementInProgress = false;
+ m_bAnnouncementInProgress = FALSE;
}
void
@@ -74,38 +74,38 @@ cMusicManager::ResetMusicAfterReload()
{
float afRadioTime[NUM_RADIOS];
- m_bRadioSetByScript = false;
+ m_bRadioSetByScript = FALSE;
m_nRadioStationScript = WILDSTYLE;
m_nRadioPosition = -1;
m_nAnnouncement = NO_TRACK;
- m_bAnnouncementInProgress = false;
- m_bSetNextStation = false;
+ m_bAnnouncementInProgress = FALSE;
+ m_bSetNextStation = FALSE;
RadioStaticTimer = 0;
gNumRetunePresses = 0;
gRetuneCounter = 0;
m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK;
- m_FrontendLoopFlag = false;
- m_bTrackChangeStarted = false;
+ m_FrontendLoopFlag = FALSE;
+ m_bTrackChangeStarted = FALSE;
m_nNextTrack = NO_TRACK;
- m_nNextLoopFlag = false;
- m_bVerifyNextTrackStartedToPlay = false;
- m_bGameplayAllowsRadio = false;
- m_bRadioStreamReady = false;
+ m_nNextLoopFlag = FALSE;
+ m_bVerifyNextTrackStartedToPlay = FALSE;
+ m_bGameplayAllowsRadio = FALSE;
+ m_bRadioStreamReady = FALSE;
nFramesSinceCutsceneEnded = -1;
- m_bUserResumedGame = false;
- m_bMusicModeChangeStarted = false;
- m_bEarlyFrontendTrack = false;
+ m_bUserResumedGame = FALSE;
+ m_bMusicModeChangeStarted = FALSE;
+ m_bEarlyFrontendTrack = FALSE;
m_nVolumeLatency = 0;
m_nCurrentVolume = 0;
m_nMaxVolume = 0;
- bool bRadioWasEverListened = false;
+ bool8 bRadioWasEverListened = FALSE;
for (int i = 0; i < NUM_RADIOS; i++) {
afRadioTime[i] = CStats::GetFavoriteRadioStationList(i);
if (!bRadioWasEverListened && afRadioTime[i] != 0.0f)
- bRadioWasEverListened = true;
+ bRadioWasEverListened = TRUE;
}
if (!bRadioWasEverListened) return;
@@ -125,7 +125,7 @@ cMusicManager::ResetMusicAfterReload()
}
void
-cMusicManager::SetStartingTrackPositions(uint8 isNewGameTimer)
+cMusicManager::SetStartingTrackPositions(bool8 isNewGameTimer)
{
int pos;
@@ -174,15 +174,15 @@ cMusicManager::SetStartingTrackPositions(uint8 isNewGameTimer)
}
}
-bool
+bool8
cMusicManager::Initialise()
{
if (!IsInitialised()) {
- m_bIsInitialised = true;
- SetStartingTrackPositions(false);
- m_bResetTimers = false;
+ m_bIsInitialised = TRUE;
+ SetStartingTrackPositions(FALSE);
+ m_bResetTimers = FALSE;
m_nResetTime = 0;
- m_bRadioSetByScript = false;
+ m_bRadioSetByScript = FALSE;
m_nRadioStationScript = WILDSTYLE;
m_nRadioPosition = -1;
m_nRadioInCar = NO_TRACK;
@@ -192,18 +192,18 @@ cMusicManager::Initialise()
m_nPlayingTrack = NO_TRACK;
m_nUpcomingMusicMode = MUSICMODE_DISABLED;
m_nMusicMode = MUSICMODE_DISABLED;
- m_FrontendLoopFlag = false;
- m_bTrackChangeStarted = false;
+ m_FrontendLoopFlag = FALSE;
+ m_bTrackChangeStarted = FALSE;
m_nNextTrack = NO_TRACK;
- m_nNextLoopFlag = false;
- m_bVerifyNextTrackStartedToPlay = false;
- m_bGameplayAllowsRadio = false;
- m_bRadioStreamReady = false;
+ m_nNextLoopFlag = FALSE;
+ m_bVerifyNextTrackStartedToPlay = FALSE;
+ m_bGameplayAllowsRadio = FALSE;
+ m_bRadioStreamReady = FALSE;
nFramesSinceCutsceneEnded = -1;
- m_bUserResumedGame = false;
- m_bMusicModeChangeStarted = false;
+ m_bUserResumedGame = FALSE;
+ m_bMusicModeChangeStarted = FALSE;
m_nMusicModeToBeSet = MUSICMODE_DISABLED;
- m_bEarlyFrontendTrack = false;
+ m_bEarlyFrontendTrack = FALSE;
m_nVolumeLatency = 0;
m_nCurrentVolume = 0;
m_nMaxVolume = 0;
@@ -220,7 +220,7 @@ cMusicManager::Terminate()
SampleManager.StopStreamedFile(0);
m_nPlayingTrack = NO_TRACK;
}
- m_bIsInitialised = false;
+ m_bIsInitialised = FALSE;
}
void
@@ -230,29 +230,29 @@ cMusicManager::SetRadioChannelByScript(uint32 station, int32 pos)
if (station == STREAMED_SOUND_RADIO_MP3_PLAYER)
station = STREAMED_SOUND_CITY_AMBIENT;
if (station <= STREAMED_SOUND_RADIO_POLICE) {
- m_bRadioSetByScript = true;
+ m_bRadioSetByScript = TRUE;
m_nRadioStationScript = station;
m_nRadioPosition = pos == -1 ? -1 : pos % m_aTracks[station].m_nLength;
}
}
}
-bool
+bool8
cMusicManager::PlayerInCar()
{
CVehicle *vehicle = AudioManager.FindVehicleOfPlayer();
if(!vehicle)
- return false;
+ return FALSE;
int32 State = FindPlayerPed()->m_nPedState;
if(State == PED_DRAG_FROM_CAR || State == PED_EXIT_CAR || State == PED_ARRESTED)
- return false;
+ return FALSE;
if (vehicle->GetStatus() == STATUS_WRECKED)
- return false;
+ return FALSE;
- return true;
+ return TRUE;
}
uint32
@@ -325,16 +325,16 @@ cMusicManager::ChangeMusicMode(uint8 mode)
while (SampleManager.IsStreamPlaying(0))
SampleManager.StopStreamedFile(0);
m_nMusicMode = m_nUpcomingMusicMode;
- m_bMusicModeChangeStarted = false;
- m_bTrackChangeStarted = false;
+ m_bMusicModeChangeStarted = FALSE;
+ m_bTrackChangeStarted = FALSE;
m_nNextTrack = NO_TRACK;
- m_nNextLoopFlag = false;
- m_bVerifyNextTrackStartedToPlay = false;
+ m_nNextLoopFlag = FALSE;
+ m_bVerifyNextTrackStartedToPlay = FALSE;
m_nPlayingTrack = NO_TRACK;
m_nFrontendTrack = NO_TRACK;
- m_bAnnouncementInProgress = false;
+ m_bAnnouncementInProgress = FALSE;
m_nAnnouncement = NO_TRACK;
- g_bAnnouncementReadPosAlready = false;
+ g_bAnnouncementReadPosAlready = FALSE;
break;
case MUSICMODE_DISABLE: m_nUpcomingMusicMode = MUSICMODE_DISABLED; break;
default: return;
@@ -344,7 +344,7 @@ cMusicManager::ChangeMusicMode(uint8 mode)
void
cMusicManager::ResetTimers(int32 time)
{
- m_bResetTimers = true;
+ m_bResetTimers = TRUE;
m_nResetTime = time;
}
@@ -352,11 +352,11 @@ void
cMusicManager::Service()
{
if (m_bResetTimers) {
- m_bResetTimers = false;
+ m_bResetTimers = FALSE;
m_nLastTrackServiceTime = m_nResetTime;
}
- static bool bRadioStatsRecorded = false;
+ static bool8 bRadioStatsRecorded = FALSE;
if (!m_bIsInitialised || m_bDisabled) return;
@@ -369,39 +369,39 @@ cMusicManager::Service()
{
case MUSICMODE_FRONTEND: ServiceFrontEndMode(); break;
case MUSICMODE_GAME: ServiceGameMode(); break;
- case MUSICMODE_CUTSCENE: SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 1, 0); break;
+ case MUSICMODE_CUTSCENE: SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, TRUE, 0); break;
}
}
else
m_nMusicMode = MUSICMODE_DISABLED;
} else {
- m_bMusicModeChangeStarted = true;
+ m_bMusicModeChangeStarted = TRUE;
if (!m_bUserResumedGame && !AudioManager.m_nUserPause && AudioManager.m_nPreviousUserPause)
- m_bUserResumedGame = true;
+ m_bUserResumedGame = TRUE;
if (AudioManager.m_FrameCounter % 4 == 0) {
gNumRetunePresses = 0;
gRetuneCounter = 0;
- m_bSetNextStation = false;
+ m_bSetNextStation = FALSE;
if (SampleManager.IsStreamPlaying(0)) {
if (m_nPlayingTrack != NO_TRACK && !bRadioStatsRecorded)
{
RecordRadioStats();
m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
- bRadioStatsRecorded = true;
+ bRadioStatsRecorded = TRUE;
}
SampleManager.StopStreamedFile(0);
} else {
- bRadioStatsRecorded = false;
+ bRadioStatsRecorded = FALSE;
m_nMusicMode = m_nMusicModeToBeSet;
- m_bMusicModeChangeStarted = false;
- m_bTrackChangeStarted = false;
+ m_bMusicModeChangeStarted = FALSE;
+ m_bTrackChangeStarted = FALSE;
m_nNextTrack = NO_TRACK;
- m_nNextLoopFlag = false;
- m_bVerifyNextTrackStartedToPlay = false;
+ m_nNextLoopFlag = FALSE;
+ m_bVerifyNextTrackStartedToPlay = FALSE;
m_nPlayingTrack = NO_TRACK;
if (m_bEarlyFrontendTrack)
- m_bEarlyFrontendTrack = false;
+ m_bEarlyFrontendTrack = FALSE;
else
m_nFrontendTrack = NO_TRACK;
}
@@ -412,15 +412,15 @@ cMusicManager::Service()
void
cMusicManager::ServiceFrontEndMode()
{
- static bool bRadioStatsRecorded = false;
+ static bool8 bRadioStatsRecorded = FALSE;
if (m_bAnnouncementInProgress) {
SampleManager.StopStreamedFile(0);
if (SampleManager.IsStreamPlaying(0))
return;
- g_bAnnouncementReadPosAlready = false;
+ g_bAnnouncementReadPosAlready = FALSE;
m_nAnnouncement = NO_TRACK;
- m_bAnnouncementInProgress = false;
+ m_bAnnouncementInProgress = FALSE;
m_nNextTrack = NO_TRACK;
m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK;
@@ -439,7 +439,7 @@ cMusicManager::ServiceFrontEndMode()
else {
if (m_nCurrentVolume < m_nMaxVolume)
m_nCurrentVolume = Min(m_nMaxVolume, m_nCurrentVolume + 6);
- SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, FALSE, 0);
}
} else {
if (m_nPlayingTrack == STREAMED_SOUND_RADIO_MP3_PLAYER)
@@ -448,13 +448,13 @@ cMusicManager::ServiceFrontEndMode()
ChangeMusicMode(MUSICMODE_GAME);
}
} else {
- m_bTrackChangeStarted = true;
+ m_bTrackChangeStarted = TRUE;
if (m_bVerifyNextTrackStartedToPlay || !SampleManager.IsStreamPlaying(0)) {
- bRadioStatsRecorded = false;
+ bRadioStatsRecorded = FALSE;
if (SampleManager.IsStreamPlaying(0) || m_nNextTrack == NO_TRACK) {
m_nPlayingTrack = m_nNextTrack;
- m_bVerifyNextTrackStartedToPlay = false;
- m_bTrackChangeStarted = false;
+ m_bVerifyNextTrackStartedToPlay = FALSE;
+ m_bTrackChangeStarted = FALSE;
} else {
uint32 trackStartPos = (m_nNextTrack > STREAMED_SOUND_RADIO_POLICE) ? 0 : GetTrackStartPos(m_nNextTrack);
if (m_nNextTrack != NO_TRACK) {
@@ -463,10 +463,10 @@ cMusicManager::ServiceFrontEndMode()
m_nVolumeLatency = 3;
m_nCurrentVolume = 0;
m_nMaxVolume = 100;
- SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, FALSE, 0);
if (m_nNextTrack < STREAMED_SOUND_CITY_AMBIENT)
m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode();
- m_bVerifyNextTrackStartedToPlay = true;
+ m_bVerifyNextTrackStartedToPlay = TRUE;
}
}
} else {
@@ -474,9 +474,9 @@ cMusicManager::ServiceFrontEndMode()
m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
RecordRadioStats();
- bRadioStatsRecorded = true;
+ bRadioStatsRecorded = TRUE;
}
- SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
SampleManager.StopStreamedFile(0);
}
}
@@ -488,7 +488,7 @@ cMusicManager::ServiceGameMode()
CPed *ped = FindPlayerPed();
CVehicle *vehicle = AudioManager.FindVehicleOfPlayer();
m_bRadioStreamReady = m_bGameplayAllowsRadio;
- m_bGameplayAllowsRadio = false;
+ m_bGameplayAllowsRadio = FALSE;
switch (CGame::currArea)
{
@@ -499,14 +499,14 @@ cMusicManager::ServiceGameMode()
case AREA_BLOOD:
case AREA_OVALRING:
case AREA_MALIBU_CLUB:
- m_bGameplayAllowsRadio = false;
+ m_bGameplayAllowsRadio = FALSE;
break;
default:
if (SampleManager.GetMusicVolume()) {
if (PlayerInCar())
- m_bGameplayAllowsRadio = true;
+ m_bGameplayAllowsRadio = TRUE;
} else
- m_bGameplayAllowsRadio = false;
+ m_bGameplayAllowsRadio = FALSE;
break;
}
@@ -514,7 +514,7 @@ cMusicManager::ServiceGameMode()
nFramesSinceCutsceneEnded = -1;
gNumRetunePresses = 0;
gRetuneCounter = 0;
- m_bSetNextStation = false;
+ m_bSetNextStation = FALSE;
} else if (ped) {
if(!ped->DyingOrDead() && vehicle) {
#ifdef GTA_PC
@@ -567,11 +567,11 @@ cMusicManager::ServiceGameMode()
if (m_bUserResumedGame)
{
- m_bRadioStreamReady = false;
- m_bUserResumedGame = false;
+ m_bRadioStreamReady = FALSE;
+ m_bUserResumedGame = FALSE;
}
if (m_nPlayingTrack == NO_TRACK && m_nFrontendTrack == NO_TRACK)
- m_bRadioStreamReady = false;
+ m_bRadioStreamReady = FALSE;
if (m_bGameplayAllowsRadio)
{
@@ -594,7 +594,7 @@ cMusicManager::ServiceGameMode()
m_aTracks[m_nFrontendTrack].m_nPosition = m_nRadioPosition;
m_aTracks[m_nFrontendTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
}
- m_bRadioSetByScript = false;
+ m_bRadioSetByScript = FALSE;
return;
}
@@ -605,7 +605,7 @@ cMusicManager::ServiceGameMode()
if (m_nAnnouncement < NO_TRACK) {
if ((m_bAnnouncementInProgress || m_nFrontendTrack == m_nPlayingTrack) && ServiceAnnouncement()) {
if (m_bAnnouncementInProgress) {
- m_bSetNextStation = false;
+ m_bSetNextStation = FALSE;
gNumRetunePresses = 0;
gRetuneCounter = 0;
return;
@@ -613,7 +613,7 @@ cMusicManager::ServiceGameMode()
if(m_nAnnouncement == NO_TRACK) {
m_nNextTrack = NO_TRACK;
m_nFrontendTrack = GetCarTuning();
- m_bSetNextStation = false;
+ m_bSetNextStation = FALSE;
gRetuneCounter = 0;
gNumRetunePresses = 0;
}
@@ -635,7 +635,7 @@ cMusicManager::ServiceGameMode()
if(gRetuneCounter > 1)
gRetuneCounter--;
else if(gRetuneCounter == 1) {
- m_bSetNextStation = true;
+ m_bSetNextStation = TRUE;
gRetuneCounter = 0;
}
}
@@ -644,7 +644,7 @@ cMusicManager::ServiceGameMode()
{
if (--gRetuneCounter == 0)
{
- m_bSetNextStation = true;
+ m_bSetNextStation = TRUE;
gRetuneCounter = 0;
}
}
@@ -694,7 +694,7 @@ cMusicManager::ServiceGameMode()
SetUpCorrectAmbienceTrack();
ServiceTrack(vehicle, ped);
if (m_bSetNextStation)
- m_bSetNextStation = false;
+ m_bSetNextStation = FALSE;
return;
}
if (UsesPoliceRadio(vehicle))
@@ -713,13 +713,13 @@ cMusicManager::ServiceGameMode()
gRetuneCounter = 0;
gNumRetunePresses = 0;
- m_bSetNextStation = false;
- m_bRadioSetByScript = false;
+ m_bSetNextStation = FALSE;
+ m_bRadioSetByScript = FALSE;
if (m_nFrontendTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nFrontendTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
SetUpCorrectAmbienceTrack();
ServiceTrack(vehicle, ped);
if (m_bSetNextStation)
- m_bSetNextStation = false;
+ m_bSetNextStation = FALSE;
return;
}
@@ -728,9 +728,9 @@ cMusicManager::ServiceGameMode()
SampleManager.StopStreamedFile(0);
if (SampleManager.IsStreamPlaying(0))
return;
- g_bAnnouncementReadPosAlready = false;
+ g_bAnnouncementReadPosAlready = FALSE;
m_nAnnouncement = NO_TRACK;
- m_bAnnouncementInProgress = false;
+ m_bAnnouncementInProgress = FALSE;
m_nNextTrack = NO_TRACK;
m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK;
@@ -808,7 +808,7 @@ GetHeightScale()
}
void
-cMusicManager::ComputeAmbienceVol(uint8 reset, uint8& outVolume)
+cMusicManager::ComputeAmbienceVol(bool8 reset, uint8& outVolume)
{
static float fVol = 0.0f;
@@ -868,7 +868,7 @@ cMusicManager::ComputeAmbienceVol(uint8 reset, uint8& outVolume)
outVolume = (90.0f - fHeightScale) / 50.0f * fVol;
}
-bool
+bool8
cMusicManager::ServiceAnnouncement()
{
if (m_bAnnouncementInProgress) {
@@ -876,36 +876,36 @@ cMusicManager::ServiceAnnouncement()
m_nPlayingTrack = m_nNextTrack;
else if (m_nPlayingTrack != NO_TRACK) {
m_nAnnouncement = NO_TRACK;
- m_bAnnouncementInProgress = false;
+ m_bAnnouncementInProgress = FALSE;
m_nPlayingTrack = NO_TRACK;
}
- return true;
+ return TRUE;
} else if (SampleManager.IsStreamPlaying(0)) {
if (m_nPlayingTrack != NO_TRACK && !g_bAnnouncementReadPosAlready) {
RecordRadioStats();
m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0);
- g_bAnnouncementReadPosAlready = true;
+ g_bAnnouncementReadPosAlready = TRUE;
m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
}
SampleManager.StopStreamedFile(0);
} else {
- g_bAnnouncementReadPosAlready = false;
+ g_bAnnouncementReadPosAlready = FALSE;
m_nPlayingTrack = NO_TRACK;
m_nNextTrack = m_nAnnouncement;
SampleManager.SetStreamedFileLoopFlag(0, 0);
SampleManager.StartStreamedFile(m_nNextTrack, 0, 0);
- SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 0, 0);
- m_bAnnouncementInProgress = true;
+ SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, FALSE, 0);
+ m_bAnnouncementInProgress = TRUE;
}
- return true;
+ return TRUE;
}
void
cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
{
- static bool bRadioStatsRecorded = false;
- static bool bRadioStatsRecorded2 = false;
+ static bool8 bRadioStatsRecorded = FALSE;
+ static bool8 bRadioStatsRecorded2 = FALSE;
uint8 volume;
if (!m_bTrackChangeStarted)
m_nNextTrack = m_nFrontendTrack;
@@ -915,30 +915,30 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
RecordRadioStats();
- bRadioStatsRecorded = true;
+ bRadioStatsRecorded = TRUE;
}
- SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
SampleManager.StopStreamedFile(0);
}
return;
}
if (bRadioStatsRecorded) {
- bRadioStatsRecorded = false;
+ bRadioStatsRecorded = FALSE;
m_nPlayingTrack = NO_TRACK;
}
if (m_nNextTrack != m_nPlayingTrack)
{
- m_bTrackChangeStarted = true;
- SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
+ m_bTrackChangeStarted = TRUE;
+ SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
if (!(AudioManager.m_FrameCounter & 1)) {
if (m_bVerifyNextTrackStartedToPlay || !SampleManager.IsStreamPlaying(0)) {
- bRadioStatsRecorded2 = false;
+ bRadioStatsRecorded2 = FALSE;
if (SampleManager.IsStreamPlaying(0)) {
m_nPlayingTrack = m_nNextTrack;
- m_bVerifyNextTrackStartedToPlay = false;
- m_bTrackChangeStarted = false;
+ m_bVerifyNextTrackStartedToPlay = FALSE;
+ m_bTrackChangeStarted = FALSE;
if (veh) {
#ifdef FIX_BUGS
if (m_nPlayingTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
@@ -962,16 +962,16 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
m_nVolumeLatency = 10;
m_nCurrentVolume = 0;
m_nMaxVolume = 100;
- SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, FALSE, 0);
}
else
{
- ComputeAmbienceVol(true, volume);
- SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
+ ComputeAmbienceVol(TRUE, volume);
+ SampleManager.SetStreamedVolumeAndPan(volume, 63, TRUE, 0);
}
if (m_nNextTrack < STREAMED_SOUND_CITY_AMBIENT)
m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode();
- m_bVerifyNextTrackStartedToPlay = true;
+ m_bVerifyNextTrackStartedToPlay = TRUE;
}
}
} else {
@@ -981,7 +981,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
{
m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
- bRadioStatsRecorded2 = true;
+ bRadioStatsRecorded2 = TRUE;
RecordRadioStats();
if (m_nPlayingTrack >= STREAMED_SOUND_HAVANA_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_HAVANA_BEACH_AMBIENT)
{
@@ -989,7 +989,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_HURRICANE, 0.0);
}
}
- SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
SampleManager.StopStreamedFile(0);
}
}
@@ -998,8 +998,8 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
if (m_nPlayingTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
{
- ComputeAmbienceVol(false, volume);
- SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
+ ComputeAmbienceVol(FALSE, volume);
+ SampleManager.SetStreamedVolumeAndPan(volume, 63, TRUE, 0);
return;
}
if (CTimer::GetIsSlowMotionActive())
@@ -1009,7 +1009,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
float DistToTargetSq = (TheCamera.pTargetEntity->GetPosition() - TheCamera.GetPosition()).MagnitudeSqr();
if (DistToTargetSq >= SQR(55.0f))
{
- SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
}
else if (DistToTargetSq >= SQR(10.0f))
{
@@ -1026,17 +1026,17 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
}
if (gRetuneCounter != 0)
volume = 0;
- SampleManager.SetStreamedVolumeAndPan(volume, pan, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(volume, pan, FALSE, 0);
}
else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1))
- SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, FALSE, 0);
else if (gRetuneCounter != 0)
- SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
else
- SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, FALSE, 0);
}
} else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1)) {
- SampleManager.SetStreamedVolumeAndPan(Min(m_nCurrentVolume, 25), 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(Min(m_nCurrentVolume, 25), 63, FALSE, 0);
nFramesSinceCutsceneEnded = 0;
} else {
if (nFramesSinceCutsceneEnded == -1)
@@ -1058,7 +1058,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
}
if (gRetuneCounter != 0)
volume = 0;
- SampleManager.SetStreamedVolumeAndPan(volume, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan(volume, 63, FALSE, 0);
}
if (m_nVolumeLatency > 0)
m_nVolumeLatency--;
@@ -1074,7 +1074,7 @@ cMusicManager::PreloadCutSceneMusic(uint32 track)
while (SampleManager.IsStreamPlaying(0))
SampleManager.StopStreamedFile(0);
SampleManager.PreloadStreamedFile(track, 0);
- SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 1, 0);
+ SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, TRUE, 0);
m_nPlayingTrack = track;
}
}
@@ -1096,14 +1096,14 @@ cMusicManager::StopCutSceneMusic(void)
}
void
-cMusicManager::PlayFrontEndTrack(uint32 track, uint8 loopFlag)
+cMusicManager::PlayFrontEndTrack(uint32 track, bool8 loopFlag)
{
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS && (m_nUpcomingMusicMode == MUSICMODE_FRONTEND || m_nMusicMode == MUSICMODE_FRONTEND))
{
m_nFrontendTrack = track;
m_FrontendLoopFlag = loopFlag;
if (m_nMusicMode != MUSICMODE_FRONTEND)
- m_bEarlyFrontendTrack = true;
+ m_bEarlyFrontendTrack = TRUE;
}
}
@@ -1201,7 +1201,7 @@ cMusicManager::GetFavouriteRadioStation()
return favstation;
}
-bool
+bool8
cMusicManager::CheckForMusicInterruptions()
{
return (m_nPlayingTrack == STREAMED_SOUND_MISSION_COMPLETED) || (m_nPlayingTrack == STREAMED_SOUND_CUTSCENE_FINALE);
@@ -1361,7 +1361,7 @@ cMusicManager::DisplayRadioStationName()
#endif
}
-bool
+bool8
cMusicManager::UsesPoliceRadio(CVehicle *veh)
{
switch (veh->GetModelIndex())
@@ -1371,18 +1371,18 @@ cMusicManager::UsesPoliceRadio(CVehicle *veh)
case MI_COASTG:
case MI_RHINO:
case MI_BARRACKS:
- return true;
+ return TRUE;
case MI_MRWHOOP:
case MI_HUNTER:
- return false;
+ return FALSE;
}
return veh->UsesSiren();
}
-bool
+bool8
cMusicManager::UsesTaxiRadio(CVehicle *veh)
{
- if (veh->GetModelIndex() != MI_KAUFMAN) return false;
+ if (veh->GetModelIndex() != MI_KAUFMAN) return FALSE;
return CTheScripts::bPlayerHasMetDebbieHarry;
}
@@ -1391,10 +1391,10 @@ cMusicManager::ServiceAmbience()
{
}
-bool
+bool8
cMusicManager::ChangeRadioChannel()
{
- return true;
+ return TRUE;
}
// these two are empty