summaryrefslogtreecommitdiffstats
path: root/src/audio/MusicManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio/MusicManager.cpp')
-rw-r--r--src/audio/MusicManager.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp
index 9f648d07..ae2e97ac 100644
--- a/src/audio/MusicManager.cpp
+++ b/src/audio/MusicManager.cpp
@@ -64,7 +64,8 @@ cMusicManager::PlayerInCar()
case MI_TRAIN:
case MI_SPEEDER:
case MI_REEFER:
- case MI_GHOST: return false;
+// case MI_GHOST:
+ return false;
default: return true;
}
}
@@ -116,7 +117,7 @@ cMusicManager::DisplayRadioStationName()
while(gRetuneCounter) {
if(pRetune == RADIO_OFF) {
- pRetune = HEAD_RADIO;
+ pRetune = WILDSTYLE;
} else if(pRetune < USERTRACK) {
pRetune = pRetune + 1;
}
@@ -130,20 +131,20 @@ cMusicManager::DisplayRadioStationName()
wchar *string = nil;
switch(pRetune) {
- case HEAD_RADIO: string = TheText.Get("FEA_FM0"); break;
- case DOUBLE_CLEF: string = TheText.Get("FEA_FM1"); break;
- case JAH_RADIO: string = TheText.Get("FEA_FM2"); break;
- case RISE_FM: string = TheText.Get("FEA_FM3"); break;
- case LIPS_106: string = TheText.Get("FEA_FM4"); break;
- case GAME_FM: string = TheText.Get("FEA_FM5"); break;
- case MSX_FM: string = TheText.Get("FEA_FM6"); break;
- case FLASHBACK: string = TheText.Get("FEA_FM7"); break;
- case CHATTERBOX: string = TheText.Get("FEA_FM8"); break;
+ case WILDSTYLE: string = TheText.Get("FEA_FM0"); break;
+ case FLASH_FM: string = TheText.Get("FEA_FM1"); break;
+ case KCHAT: string = TheText.Get("FEA_FM2"); break;
+ case FEVER: string = TheText.Get("FEA_FM3"); break;
+ case V_ROCK: string = TheText.Get("FEA_FM4"); break;
+ case VCPR: string = TheText.Get("FEA_FM5"); break;
+ case RADIO_ESPANTOSO: string = TheText.Get("FEA_FM6"); break;
+ case EMOTION: string = TheText.Get("FEA_FM7"); break;
+ case WAVE: string = TheText.Get("FEA_FM8"); break;
case USERTRACK: string = TheText.Get("FEA_FM9"); break;
default: return;
};
- if(pRetune > CHATTERBOX && !SampleManager.IsMP3RadioChannelAvailable()) { return; }
+ if(pRetune > WAVE && !SampleManager.IsMP3RadioChannelAvailable()) { return; }
if(string && pCurrentStation != string ||
m_nCurrentStreamedSound == STREAMED_SOUND_RADIO_MP3_PLAYER &&
@@ -159,7 +160,7 @@ cMusicManager::DisplayRadioStationName()
CFont::SetBackgroundOff();
CFont::SetScale(SCREEN_SCALE_X(0.8f), SCREEN_SCALE_Y(1.35f));
CFont::SetPropOn();
- CFont::SetFontStyle(FONT_HEADING);
+ CFont::SetFontStyle(FONT_STANDARD);
CFont::SetCentreOn();
CFont::SetCentreSize(SCREEN_SCALE_X(640.0f));
CFont::SetColor(CRGBA(0, 0, 0, 255));
@@ -222,7 +223,7 @@ cMusicManager::Initialise()
m_bDoTrackService = false;
m_bIgnoreTimeDelay = false;
m_bRadioSetByScript = false;
- m_nRadioStation = HEAD_RADIO;
+ m_nRadioStation = WILDSTYLE;
m_nRadioPosition = -1;
m_nRadioInCar = NO_STREAMED_SOUND;
gNumRetunePresses = 0;
@@ -296,7 +297,7 @@ cMusicManager::ChangeMusicMode(uint8 mode)
uint8
cMusicManager::GetRadioInCar(void)
{
- if (!m_bIsInitialised) return HEAD_RADIO;
+ if (!m_bIsInitialised) return WILDSTYLE;
if (PlayerInCar()) {
CVehicle *veh = FindPlayerVehicle();
if (veh != nil){
@@ -404,9 +405,6 @@ cMusicManager::ServiceFrontEndMode()
if (!AudioManager.m_nUserPause)
ChangeMusicMode(MUSICMODE_GAME);
break;
- case STREAMED_SOUND_GAME_COMPLETED:
- ChangeMusicMode(MUSICMODE_GAME);
- break;
default:
break;
}
@@ -526,7 +524,7 @@ cMusicManager::ServiceGameMode()
} else if (dist >= 100.0f) {
int8 volume = ((45.0f - (Sqrt(dist) - 10.0f)) / 45.0f * 100.0f);
int8 pan;
- if (AudioManager.IsMissionAudioSamplePlaying())
+ if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1))
volume /= 4;
if (volume != 0) {
CVector trVec;
@@ -538,7 +536,7 @@ cMusicManager::ServiceGameMode()
if (gRetuneCounter)
volume /= 4;
SampleManager.SetStreamedVolumeAndPan(volume, pan, 0, 0);
- } else if (AudioManager.IsMissionAudioSamplePlaying()) {
+ } else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1)) {
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
} else if (gRetuneCounter) {
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
@@ -546,7 +544,7 @@ cMusicManager::ServiceGameMode()
SampleManager.SetStreamedVolumeAndPan(100, 63, 0, 0);
}
}
- } else if (AudioManager.IsMissionAudioSamplePlaying()) {
+ } else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1)) {
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
nFramesSinceCutsceneEnded = 0;
} else {
@@ -625,14 +623,14 @@ cMusicManager::StopFrontEndTrack()
}
void
-cMusicManager::PlayAnnouncement(uint8 announcement)
+cMusicManager::PlayAnnouncement(uint32 announcement)
{
if (IsInitialised() && !m_bDisabled && !m_bAnnouncementInProgress)
m_nAnnouncement = announcement;
}
void
-cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend)
+cMusicManager::PlayFrontEndTrack(uint32 track, uint8 bPlayInFrontend)
{
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS) {
if (m_nMusicMode == MUSICMODE_GAME) {
@@ -667,7 +665,7 @@ cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend)
}
void
-cMusicManager::PreloadCutSceneMusic(uint8 track)
+cMusicManager::PreloadCutSceneMusic(uint32 track)
{
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS && m_nMusicMode == MUSICMODE_CUTSCENE) {
AudioManager.ResetPoliceRadio();
@@ -716,15 +714,17 @@ cMusicManager::UsesPoliceRadio(CVehicle *veh)
{
switch (veh->GetModelIndex())
{
- case MI_FBICAR:
- case MI_POLICE:
- case MI_ENFORCER:
- case MI_PREDATOR:
+ case MI_VCNMAV:
+ case MI_POLMAV:
+ case MI_COASTG:
case MI_RHINO:
case MI_BARRACKS:
return true;
+ case MI_MRWHOOP:
+ case MI_HUNTER:
+ return false;
}
- return false;
+ return veh->UsesSiren();
}
void
@@ -832,7 +832,7 @@ cMusicManager::ServiceAnnouncement()
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
if (SampleManager.StartStreamedFile(m_nAnnouncement, 0, 0)) {
- SampleManager.SetStreamedVolumeAndPan(AudioManager.IsMissionAudioSamplePlaying() ? 25 : 100, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan((AudioManager.IsMissionAudioSamplePlaying(0) || AudioManager.IsMissionAudioSamplePlaying(1)) ? 25 : 100, 63, 0, 0);
m_bAnnouncementInProgress = true;
m_nPreviousStreamedSound = m_nCurrentStreamedSound;
m_nCurrentStreamedSound = m_nAnnouncement;
@@ -847,7 +847,7 @@ cMusicManager::ServiceAnnouncement()
return false;
}
-uint8
+uint32
cMusicManager::GetCarTuning()
{
CVehicle *veh = FindPlayerVehicle();
@@ -858,12 +858,12 @@ cMusicManager::GetCarTuning()
return veh->m_nRadioStation;
}
-uint8
+uint32
cMusicManager::GetNextCarTuning()
{
CVehicle *veh = FindPlayerVehicle();
if (veh == nil) return RADIO_OFF;
- if (UsesPoliceRadio(veh)) return POLICE_RADIO;
+ if (UsesPoliceRadio(veh)) return STREAMED_SOUND_RADIO_POLICE;
if (gNumRetunePresses != 0) {
if (SampleManager.IsMP3RadioChannelAvailable()) {
if (veh->m_nRadioStation == RADIO_OFF)
@@ -876,7 +876,7 @@ cMusicManager::GetNextCarTuning()
} else if (gNumRetunePresses + veh->m_nRadioStation >= USERTRACK) {
while (gNumRetunePresses) {
if (veh->m_nRadioStation == RADIO_OFF)
- veh->m_nRadioStation = HEAD_RADIO;
+ veh->m_nRadioStation = WILDSTYLE;
else if (veh->m_nRadioStation < USERTRACK)
++veh->m_nRadioStation;
@@ -905,7 +905,7 @@ cMusicManager::ChangeRadioChannel()
return false;
if (!SampleManager.StartStreamedFile(m_nCurrentStreamedSound, GetTrackStartPos(m_nCurrentStreamedSound), 0))
return false;
- SampleManager.SetStreamedVolumeAndPan(AudioManager.IsMissionAudioSamplePlaying() ? 25 : 100, 63, 0, 0);
+ SampleManager.SetStreamedVolumeAndPan((AudioManager.IsMissionAudioSamplePlaying(0) || AudioManager.IsMissionAudioSamplePlaying(1)) ? 25 : 100, 63, 0, 0);
}
return true;
}