|
|
@@ -26,12 +26,12 @@ cMusicManager::cMusicManager() |
|
m_bIsInitialised = false;
|
|
m_bIsInitialised = false;
|
|
m_bDisabled = false;
|
|
m_bDisabled = false;
|
|
m_nMusicMode = MUSICMODE_DISABLED;
|
|
m_nMusicMode = MUSICMODE_DISABLED;
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
|
|
m_nPreviousStreamedSound = NO_TRACK;
|
|
m_bFrontendTrackFinished = false;
|
|
m_bFrontendTrackFinished = false;
|
|
m_bPlayInFrontend = false;
|
|
m_bPlayInFrontend = false;
|
|
m_bSetNextStation = false;
|
|
m_bSetNextStation = false;
|
|
m_nAnnouncement = NO_STREAMED_SOUND;
|
|
m_nAnnouncement = NO_TRACK;
|
|
m_bPreviousPlayerInCar = false;
|
|
m_bPreviousPlayerInCar = false;
|
|
m_bPlayerInCar = false;
|
|
m_bPlayerInCar = false;
|
|
m_bAnnouncementInProgress = false;
|
|
m_bAnnouncementInProgress = false;
|
|
|
@@ -224,7 +224,7 @@ cMusicManager::Initialise() |
|
m_bRadioSetByScript = false;
|
|
m_bRadioSetByScript = false;
|
|
m_nRadioStation = HEAD_RADIO;
|
|
m_nRadioStation = HEAD_RADIO;
|
|
m_nRadioPosition = -1;
|
|
m_nRadioPosition = -1;
|
|
m_nRadioInCar = NO_STREAMED_SOUND;
|
|
m_nRadioInCar = NO_TRACK;
|
|
gNumRetunePresses = 0;
|
|
gNumRetunePresses = 0;
|
|
gRetuneCounter = 0;
|
|
gRetuneCounter = 0;
|
|
m_bIsInitialised = true;
|
|
m_bIsInitialised = true;
|
|
|
@@ -239,8 +239,8 @@ cMusicManager::Terminate() |
|
|
|
|
|
if (SampleManager.IsStreamPlaying(0)) {
|
|
if (SampleManager.IsStreamPlaying(0)) {
|
|
SampleManager.StopStreamedFile(0);
|
|
SampleManager.StopStreamedFile(0);
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
|
|
m_nPreviousStreamedSound = NO_TRACK;
|
|
}
|
|
}
|
|
m_bIsInitialised = false;
|
|
m_bIsInitialised = false;
|
|
}
|
|
}
|
|
|
@@ -274,8 +274,8 @@ cMusicManager::ChangeMusicMode(uint8 mode) |
|
}
|
|
}
|
|
SampleManager.StopStreamedFile(0);
|
|
SampleManager.StopStreamedFile(0);
|
|
}
|
|
}
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
|
|
m_nPreviousStreamedSound = NO_TRACK;
|
|
m_bFrontendTrackFinished = false;
|
|
m_bFrontendTrackFinished = false;
|
|
m_bPlayInFrontend = false;
|
|
m_bPlayInFrontend = false;
|
|
m_bSetNextStation = false;
|
|
m_bSetNextStation = false;
|
|
|
@@ -301,14 +301,14 @@ cMusicManager::GetRadioInCar(void) |
|
CVehicle *veh = FindPlayerVehicle();
|
|
CVehicle *veh = FindPlayerVehicle();
|
|
if (veh != nil){
|
|
if (veh != nil){
|
|
if (UsesPoliceRadio(veh)) {
|
|
if (UsesPoliceRadio(veh)) {
|
|
if (m_nRadioInCar == NO_STREAMED_SOUND || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
|
|
if (m_nRadioInCar == NO_TRACK || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
|
|
return POLICE_RADIO;
|
|
return POLICE_RADIO;
|
|
return m_nRadioInCar;
|
|
return m_nRadioInCar;
|
|
} else return veh->m_nRadioStation;
|
|
} else return veh->m_nRadioStation;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (m_nRadioInCar == NO_STREAMED_SOUND || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
|
|
if (m_nRadioInCar == NO_TRACK || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
|
|
return RADIO_OFF;
|
|
return RADIO_OFF;
|
|
return m_nRadioInCar;
|
|
return m_nRadioInCar;
|
|
}
|
|
}
|
|
|
@@ -347,7 +347,7 @@ cMusicManager::ResetMusicAfterReload() |
|
m_bRadioSetByScript = false;
|
|
m_bRadioSetByScript = false;
|
|
m_nRadioStation = 0;
|
|
m_nRadioStation = 0;
|
|
m_nRadioPosition = -1;
|
|
m_nRadioPosition = -1;
|
|
m_nAnnouncement = NO_STREAMED_SOUND;
|
|
m_nAnnouncement = NO_TRACK;
|
|
m_bAnnouncementInProgress = false;
|
|
m_bAnnouncementInProgress = false;
|
|
m_bSetNextStation = false;
|
|
m_bSetNextStation = false;
|
|
gRetuneCounter = 0;
|
|
gRetuneCounter = 0;
|
|
|
@@ -384,7 +384,7 @@ cMusicManager::Service() |
|
m_nLastTrackServiceTime = m_nTimer;
|
|
m_nLastTrackServiceTime = m_nTimer;
|
|
} else m_bDoTrackService = false;
|
|
} else m_bDoTrackService = false;
|
|
|
|
|
|
if (m_nCurrentStreamedSound == NO_STREAMED_SOUND && SampleManager.IsStreamPlaying(0))
|
|
if (m_nCurrentStreamedSound == NO_TRACK && SampleManager.IsStreamPlaying(0))
|
|
SampleManager.StopStreamedFile(0);
|
|
SampleManager.StopStreamedFile(0);
|
|
else switch (m_nMusicMode) {
|
|
else switch (m_nMusicMode) {
|
|
case MUSICMODE_FRONTEND: ServiceFrontEndMode(); break;
|
|
case MUSICMODE_FRONTEND: ServiceFrontEndMode(); break;
|
|
|
@@ -410,8 +410,8 @@ cMusicManager::ServiceFrontEndMode() |
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
|
|
m_nPreviousStreamedSound = NO_TRACK;
|
|
}
|
|
}
|
|
} else if (bHasStarted) {
|
|
} else if (bHasStarted) {
|
|
if (!SampleManager.IsStreamPlaying(0))
|
|
if (!SampleManager.IsStreamPlaying(0))
|
|
|
@@ -434,6 +434,7 @@ cMusicManager::ServiceGameMode() |
|
{
|
|
{
|
|
bool bRadioOff = false;
|
|
bool bRadioOff = false;
|
|
static int8 nFramesSinceCutsceneEnded = -1;
|
|
static int8 nFramesSinceCutsceneEnded = -1;
|
|
|
|
uint8 volume;
|
|
|
|
|
|
m_bPreviousPlayerInCar = m_bPlayerInCar;
|
|
m_bPreviousPlayerInCar = m_bPlayerInCar;
|
|
m_bPlayerInCar = PlayerInCar();
|
|
m_bPlayerInCar = PlayerInCar();
|
|
|
@@ -516,56 +517,54 @@ cMusicManager::ServiceGameMode() |
|
m_bPlayerInCar = false;
|
|
m_bPlayerInCar = false;
|
|
if (FindPlayerVehicle())
|
|
if (FindPlayerVehicle())
|
|
FindPlayerVehicle()->m_nRadioStation = m_nCurrentStreamedSound;
|
|
FindPlayerVehicle()->m_nRadioStation = m_nCurrentStreamedSound;
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
}
|
|
}
|
|
if (CTimer::GetIsSlowMotionActive()) {
|
|
if (CTimer::GetIsSlowMotionActive()) {
|
|
if (TheCamera.pTargetEntity != nil) {
|
|
if (TheCamera.pTargetEntity != nil) {
|
|
float dist = (TheCamera.pTargetEntity->GetPosition() - TheCamera.GetPosition()).MagnitudeSqr();
|
|
float DistToTargetSq = (TheCamera.pTargetEntity->GetPosition() - TheCamera.GetPosition()).MagnitudeSqr();
|
|
if (dist >= 3025.0f) {
|
|
if (DistToTargetSq >= SQR(55.0f)) {
|
|
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
|
|
} else if (dist >= 100.0f) {
|
|
} else if (DistToTargetSq >= SQR(10.0f)) {
|
|
int8 volume = ((45.0f - (Sqrt(dist) - 10.0f)) / 45.0f * 100.0f);
|
|
volume = ((45.0f - (Sqrt(DistToTargetSq) - 10.0f)) / 45.0f * 100.0f);
|
|
int8 pan;
|
|
uint8 pan;
|
|
if (AudioManager.IsMissionAudioSamplePlaying())
|
|
if (AudioManager.ShouldDuckMissionAudio())
|
|
volume /= 4;
|
|
volume /= 4;
|
|
if (volume != 0) {
|
|
if (volume > 0) {
|
|
CVector trVec;
|
|
CVector panVec;
|
|
AudioManager.TranslateEntity(&TheCamera.pTargetEntity->GetPosition(), &trVec);
|
|
AudioManager.TranslateEntity(&TheCamera.pTargetEntity->GetPosition(), &panVec);
|
|
pan = AudioManager.ComputePan(55.0f, &trVec);
|
|
pan = AudioManager.ComputePan(55.0f, &panVec);
|
|
} else {
|
|
} else {
|
|
pan = 0;
|
|
pan = 0;
|
|
}
|
|
}
|
|
if (gRetuneCounter)
|
|
if (gRetuneCounter)
|
|
volume /= 4;
|
|
volume /= 4;
|
|
SampleManager.SetStreamedVolumeAndPan(volume, pan, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(volume, pan, 0, 0);
|
|
} else if (AudioManager.IsMissionAudioSamplePlaying()) {
|
|
} else if (AudioManager.ShouldDuckMissionAudio()) {
|
|
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
|
|
} else if (gRetuneCounter) {
|
|
} else if (gRetuneCounter) {
|
|
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
|
|
} else {
|
|
} else {
|
|
SampleManager.SetStreamedVolumeAndPan(100, 63, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(100, 63, 0, 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (AudioManager.IsMissionAudioSamplePlaying()) {
|
|
} else if (AudioManager.ShouldDuckMissionAudio()) {
|
|
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0);
|
|
nFramesSinceCutsceneEnded = 0;
|
|
nFramesSinceCutsceneEnded = 0;
|
|
} else {
|
|
} else {
|
|
int8 volume;
|
|
|
|
if (nFramesSinceCutsceneEnded == -1) {
|
|
if (nFramesSinceCutsceneEnded == -1) {
|
|
volume = 100;
|
|
volume = 100;
|
|
} else if (nFramesSinceCutsceneEnded >= 20) {
|
|
} else if (nFramesSinceCutsceneEnded < 20) {
|
|
if (nFramesSinceCutsceneEnded >= 40) {
|
|
|
|
nFramesSinceCutsceneEnded = -1;
|
|
|
|
volume = 100;
|
|
|
|
} else {
|
|
|
|
volume = 3 * (nFramesSinceCutsceneEnded - 20) + 25;
|
|
|
|
nFramesSinceCutsceneEnded++;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
nFramesSinceCutsceneEnded++;
|
|
nFramesSinceCutsceneEnded++;
|
|
volume = 25;
|
|
volume = 25;
|
|
|
|
} else if (nFramesSinceCutsceneEnded < 40) {
|
|
|
|
volume = 3 * (nFramesSinceCutsceneEnded - 20) + 25;
|
|
|
|
nFramesSinceCutsceneEnded++;
|
|
|
|
} else {
|
|
|
|
nFramesSinceCutsceneEnded = -1;
|
|
|
|
volume = 100;
|
|
}
|
|
}
|
|
if (gRetuneCounter) volume /= 4;
|
|
if (gRetuneCounter != 0)
|
|
|
|
volume /= 4;
|
|
SampleManager.SetStreamedVolumeAndPan(volume, 63, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(volume, 63, 0, 0);
|
|
}
|
|
}
|
|
return;
|
|
return;
|
|
|
@@ -585,7 +584,7 @@ cMusicManager::ServiceGameMode() |
|
} else {
|
|
} else {
|
|
m_nCurrentStreamedSound = m_nRadioStation;
|
|
m_nCurrentStreamedSound = m_nRadioStation;
|
|
if (FindPlayerVehicle()->m_nRadioStation == m_nCurrentStreamedSound) {
|
|
if (FindPlayerVehicle()->m_nRadioStation == m_nCurrentStreamedSound) {
|
|
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
|
|
m_nPreviousStreamedSound = NO_TRACK;
|
|
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
|
|
SampleManager.StopStreamedFile(0);
|
|
SampleManager.StopStreamedFile(0);
|
|
}
|
|
}
|
|
|
@@ -608,19 +607,19 @@ cMusicManager::ServiceGameMode() |
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
m_bPlayerInCar = false;
|
|
m_bPlayerInCar = false;
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
void
|
|
void
|
|
cMusicManager::StopFrontEndTrack()
|
|
cMusicManager::StopFrontEndTrack()
|
|
{
|
|
{
|
|
if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_FRONTEND && m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
|
|
if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_FRONTEND && m_nCurrentStreamedSound != NO_TRACK) {
|
|
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
|
|
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
|
|
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
SampleManager.StopStreamedFile(0);
|
|
SampleManager.StopStreamedFile(0);
|
|
m_nPreviousStreamedSound = NO_STREAMED_SOUND;
|
|
m_nPreviousStreamedSound = NO_TRACK;
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -636,17 +635,17 @@ cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend) |
|
{
|
|
{
|
|
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS) {
|
|
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS) {
|
|
if (m_nMusicMode == MUSICMODE_GAME) {
|
|
if (m_nMusicMode == MUSICMODE_GAME) {
|
|
if (m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
|
|
if (m_nCurrentStreamedSound != NO_TRACK) {
|
|
if (m_bAnnouncementInProgress) {
|
|
if (m_bAnnouncementInProgress) {
|
|
m_nAnnouncement = NO_STREAMED_SOUND;
|
|
m_nAnnouncement = NO_TRACK;
|
|
m_bAnnouncementInProgress = false;
|
|
m_bAnnouncementInProgress = false;
|
|
}
|
|
}
|
|
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
|
|
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
|
|
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
}
|
|
}
|
|
SampleManager.StopStreamedFile(0);
|
|
SampleManager.StopStreamedFile(0);
|
|
} else if (m_nMusicMode == MUSICMODE_FRONTEND) {
|
|
} else if (m_nMusicMode == MUSICMODE_FRONTEND) {
|
|
if (m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
|
|
if (m_nCurrentStreamedSound != NO_TRACK) {
|
|
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
|
|
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
|
|
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
}
|
|
}
|
|
|
@@ -691,23 +690,22 @@ cMusicManager::StopCutSceneMusic(void) |
|
{
|
|
{
|
|
if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_CUTSCENE) {
|
|
if (IsInitialised() && !m_bDisabled && m_nMusicMode == MUSICMODE_CUTSCENE) {
|
|
SampleManager.StopStreamedFile(0);
|
|
SampleManager.StopStreamedFile(0);
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
uint32
|
|
uint32
|
|
cMusicManager::GetTrackStartPos(uint8 track)
|
|
cMusicManager::GetTrackStartPos(uint8 track)
|
|
{
|
|
{
|
|
uint32 result;
|
|
uint32 pos = m_aTracks[track].m_nPosition;
|
|
uint32 timer = m_aTracks[track].m_nLastPosCheckTimer;
|
|
if (CTimer::GetTimeInMillisecondsPauseMode() > m_aTracks[track].m_nLastPosCheckTimer)
|
|
if (CTimer::GetTimeInMillisecondsPauseMode() <= timer) {
|
|
pos += Min(CTimer::GetTimeInMillisecondsPauseMode() - m_aTracks[track].m_nLastPosCheckTimer, 90000);
|
|
result = m_aTracks[track].m_nPosition;
|
|
else
|
|
m_aTracks[track].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
m_aTracks[track].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
} else
|
|
|
|
result = Min(CTimer::GetTimeInMillisecondsPauseMode() - timer, 90000) + m_aTracks[track].m_nPosition;
|
|
|
|
|
|
|
|
if (result > m_aTracks[track].m_nLength) result %= m_aTracks[track].m_nLength;
|
|
if (pos > m_aTracks[track].m_nLength)
|
|
return result;
|
|
pos %= m_aTracks[track].m_nLength;
|
|
|
|
return pos;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@@ -733,21 +731,21 @@ cMusicManager::ServiceAmbience() |
|
uint8 volume;
|
|
uint8 volume;
|
|
|
|
|
|
if (m_bAnnouncementInProgress) {
|
|
if (m_bAnnouncementInProgress) {
|
|
m_nAnnouncement = NO_STREAMED_SOUND;
|
|
m_nAnnouncement = NO_TRACK;
|
|
m_bAnnouncementInProgress = false;
|
|
m_bAnnouncementInProgress = false;
|
|
}
|
|
}
|
|
if (m_nCurrentStreamedSound < STREAMED_SOUND_CITY_AMBIENT) {
|
|
if (m_nCurrentStreamedSound < STREAMED_SOUND_CITY_AMBIENT) {
|
|
if (SampleManager.IsStreamPlaying(0)) {
|
|
if (SampleManager.IsStreamPlaying(0)) {
|
|
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
|
|
m_aTracks[m_nCurrentStreamedSound].m_nPosition = SampleManager.GetStreamedFilePosition(0);
|
|
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
SampleManager.StopStreamedFile(0);
|
|
SampleManager.StopStreamedFile(0);
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
m_nCurrentStreamedSound = STREAMED_SOUND_CITY_AMBIENT;
|
|
m_nCurrentStreamedSound = STREAMED_SOUND_CITY_AMBIENT;
|
|
}
|
|
}
|
|
if (CWorld::Players[CWorld::PlayerInFocus].m_WBState != WBSTATE_PLAYING && !SampleManager.IsStreamPlaying(0)) {
|
|
if (CWorld::Players[CWorld::PlayerInFocus].m_WBState != WBSTATE_PLAYING && !SampleManager.IsStreamPlaying(0)) {
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -774,7 +772,7 @@ cMusicManager::ServiceAmbience() |
|
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0);
|
|
m_bDontServiceAmbienceTrack = true;
|
|
m_bDontServiceAmbienceTrack = true;
|
|
} else
|
|
} else
|
|
m_nCurrentStreamedSound = NO_STREAMED_SOUND;
|
|
m_nCurrentStreamedSound = NO_TRACK;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -813,7 +811,7 @@ cMusicManager::ServiceAnnouncement() |
|
static int8 cCheck = 0;
|
|
static int8 cCheck = 0;
|
|
if (m_bAnnouncementInProgress) {
|
|
if (m_bAnnouncementInProgress) {
|
|
if (!SampleManager.IsStreamPlaying(0)) {
|
|
if (!SampleManager.IsStreamPlaying(0)) {
|
|
m_nAnnouncement = NO_STREAMED_SOUND;
|
|
m_nAnnouncement = NO_TRACK;
|
|
m_bAnnouncementInProgress = false;
|
|
m_bAnnouncementInProgress = false;
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
|
@@ -823,7 +821,7 @@ cMusicManager::ServiceAnnouncement() |
|
cCheck = 0;
|
|
cCheck = 0;
|
|
int pos = SampleManager.GetStreamedFilePosition(0);
|
|
int pos = SampleManager.GetStreamedFilePosition(0);
|
|
if (SampleManager.IsStreamPlaying(0)) {
|
|
if (SampleManager.IsStreamPlaying(0)) {
|
|
if (m_nCurrentStreamedSound != NO_STREAMED_SOUND) {
|
|
if (m_nCurrentStreamedSound != NO_TRACK) {
|
|
m_aTracks[m_nCurrentStreamedSound].m_nPosition = pos;
|
|
m_aTracks[m_nCurrentStreamedSound].m_nPosition = pos;
|
|
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
m_aTracks[m_nCurrentStreamedSound].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
|
SampleManager.StopStreamedFile(0);
|
|
SampleManager.StopStreamedFile(0);
|
|
|
@@ -832,7 +830,7 @@ cMusicManager::ServiceAnnouncement() |
|
|
|
|
|
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0);
|
|
if (SampleManager.StartStreamedFile(m_nAnnouncement, 0, 0)) {
|
|
if (SampleManager.StartStreamedFile(m_nAnnouncement, 0, 0)) {
|
|
SampleManager.SetStreamedVolumeAndPan(AudioManager.IsMissionAudioSamplePlaying() ? 25 : 100, 63, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(AudioManager.ShouldDuckMissionAudio() ? 25 : 100, 63, 0, 0);
|
|
m_bAnnouncementInProgress = true;
|
|
m_bAnnouncementInProgress = true;
|
|
m_nPreviousStreamedSound = m_nCurrentStreamedSound;
|
|
m_nPreviousStreamedSound = m_nCurrentStreamedSound;
|
|
m_nCurrentStreamedSound = m_nAnnouncement;
|
|
m_nCurrentStreamedSound = m_nAnnouncement;
|
|
|
@@ -905,7 +903,7 @@ cMusicManager::ChangeRadioChannel() |
|
return false;
|
|
return false;
|
|
if (!SampleManager.StartStreamedFile(m_nCurrentStreamedSound, GetTrackStartPos(m_nCurrentStreamedSound), 0))
|
|
if (!SampleManager.StartStreamedFile(m_nCurrentStreamedSound, GetTrackStartPos(m_nCurrentStreamedSound), 0))
|
|
return false;
|
|
return false;
|
|
SampleManager.SetStreamedVolumeAndPan(AudioManager.IsMissionAudioSamplePlaying() ? 25 : 100, 63, 0, 0);
|
|
SampleManager.SetStreamedVolumeAndPan(AudioManager.ShouldDuckMissionAudio() ? 25 : 100, 63, 0, 0);
|
|
}
|
|
}
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|