mirror of
https://github.com/mrxenginner/reVC.git
synced 2026-10-10 11:53:03 +08:00
Music: more PS2 changes
This commit is contained in:
+25
-17
@@ -204,7 +204,7 @@ cMusicManager::SetStartingTrackPositions(bool8 isNewGameTimer)
|
||||
}
|
||||
#endif
|
||||
|
||||
for (uint32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++) {
|
||||
for (tTrack i = 0; i < TOTAL_STREAMED_SOUNDS; i++) {
|
||||
m_aTracks[i].m_nLength = SampleManager.GetStreamedFileLength(i);
|
||||
|
||||
if (i < STREAMED_SOUND_CITY_AMBIENT && isNewGameTimer)
|
||||
@@ -269,7 +269,7 @@ cMusicManager::Terminate()
|
||||
}
|
||||
|
||||
void
|
||||
cMusicManager::SetRadioChannelByScript(uint32 station, int32 pos)
|
||||
cMusicManager::SetRadioChannelByScript(tTrack station, int32 pos)
|
||||
{
|
||||
if (m_bIsInitialised) {
|
||||
#ifdef GTA_PC
|
||||
@@ -284,7 +284,7 @@ cMusicManager::SetRadioChannelByScript(uint32 station, int32 pos)
|
||||
}
|
||||
}
|
||||
|
||||
uint32
|
||||
tTrack
|
||||
cMusicManager::GetRadioInCar(void)
|
||||
{
|
||||
#define RET_RADIO(radio) if (m_nRadioInCar != NO_TRACK) { \
|
||||
@@ -314,7 +314,7 @@ cMusicManager::GetRadioInCar(void)
|
||||
}
|
||||
|
||||
void
|
||||
cMusicManager::SetRadioInCar(uint32 station)
|
||||
cMusicManager::SetRadioInCar(tTrack station)
|
||||
{
|
||||
if (m_bIsInitialised) {
|
||||
if (!PlayerInCar()) {
|
||||
@@ -341,7 +341,7 @@ cMusicManager::ChangeMusicMode(uint8 mode)
|
||||
|
||||
#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++ ) {
|
||||
for( tTrack i = STREAMED_SOUND_RADIO_WILD; i < STREAMED_SOUND_CUTSCENE_ASS_1; i++ ) {
|
||||
m_aTracks[i].m_nPosition = GetTrackStartPos(i);
|
||||
m_aTracks[i].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
||||
}
|
||||
@@ -455,7 +455,7 @@ cMusicManager::ServiceFrontEndMode()
|
||||
|
||||
#ifdef PAUSE_RADIO_IN_FRONTEND
|
||||
// pause radio
|
||||
for (uint32 i = STREAMED_SOUND_RADIO_WILD; i < STREAMED_SOUND_CUTSCENE_ASS_1; i++)
|
||||
for (tTrack i = STREAMED_SOUND_RADIO_WILD; i < STREAMED_SOUND_CUTSCENE_ASS_1; i++)
|
||||
m_aTracks[i].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
|
||||
#endif
|
||||
|
||||
@@ -1103,7 +1103,7 @@ cMusicManager::ChangeRadioChannel()
|
||||
}
|
||||
|
||||
void
|
||||
cMusicManager::PreloadCutSceneMusic(uint32 track)
|
||||
cMusicManager::PreloadCutSceneMusic(tTrack track)
|
||||
{
|
||||
if (m_bIsInitialised && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS && m_nMusicMode == MUSICMODE_CUTSCENE) {
|
||||
AudioManager.ResetPoliceRadio();
|
||||
@@ -1123,7 +1123,15 @@ void
|
||||
cMusicManager::PlayPreloadedCutSceneMusic(void)
|
||||
{
|
||||
if (m_bIsInitialised && !m_bDisabled && m_nMusicMode == MUSICMODE_CUTSCENE) {
|
||||
// TODO: PS2 code
|
||||
#ifdef GTA_PS2
|
||||
if (m_bAnnouncementInProgress) {
|
||||
m_nAnnouncement = NO_TRACK;
|
||||
m_bAnnouncementInProgress = FALSE;
|
||||
m_nNextTrack = NO_TRACK;
|
||||
m_nFrontendTrack = NO_TRACK;
|
||||
m_nPlayingTrack = NO_TRACK;
|
||||
}
|
||||
#endif
|
||||
SampleManager.StartPreloadedStreamedFile();
|
||||
}
|
||||
}
|
||||
@@ -1145,7 +1153,7 @@ cMusicManager::StopCutSceneMusic(void)
|
||||
}
|
||||
|
||||
void
|
||||
cMusicManager::PlayFrontEndTrack(uint32 track, bool8 loopFlag)
|
||||
cMusicManager::PlayFrontEndTrack(tTrack track, bool8 loopFlag)
|
||||
{
|
||||
if (m_bIsInitialised && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS && (m_nUpcomingMusicMode == MUSICMODE_FRONTEND || m_nMusicMode == MUSICMODE_FRONTEND)) {
|
||||
m_nFrontendTrack = track;
|
||||
@@ -1167,14 +1175,14 @@ void cMusicManager::Disable() {}
|
||||
void cMusicManager::Enable() {}
|
||||
|
||||
void
|
||||
cMusicManager::PlayAnnouncement(uint32 announcement)
|
||||
cMusicManager::PlayAnnouncement(tTrack announcement)
|
||||
{
|
||||
if (m_bIsInitialised && !m_bDisabled && !m_bAnnouncementInProgress)
|
||||
m_nAnnouncement = announcement;
|
||||
}
|
||||
|
||||
uint32
|
||||
cMusicManager::GetTrackStartPos(uint32 track)
|
||||
cMusicManager::GetTrackStartPos(tTrack track)
|
||||
{
|
||||
if (!m_bIsInitialised) return 0;
|
||||
|
||||
@@ -1207,7 +1215,7 @@ cMusicManager::PlayerInCar()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
uint32
|
||||
tTrack
|
||||
cMusicManager::GetCarTuning()
|
||||
{
|
||||
CVehicle *veh = AudioManager.FindVehicleOfPlayer();
|
||||
@@ -1223,7 +1231,7 @@ cMusicManager::GetCarTuning()
|
||||
return RADIO_OFF;
|
||||
}
|
||||
|
||||
uint32
|
||||
tTrack
|
||||
cMusicManager::GetNextCarTuning()
|
||||
{
|
||||
CVehicle *veh = AudioManager.FindVehicleOfPlayer();
|
||||
@@ -1298,19 +1306,19 @@ cMusicManager::GetListenTimeArray()
|
||||
}
|
||||
|
||||
uint32
|
||||
cMusicManager::GetRadioPosition(uint32 station)
|
||||
cMusicManager::GetRadioPosition(tTrack station)
|
||||
{
|
||||
if (station < NUM_RADIOS)
|
||||
return GetTrackStartPos(station);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32
|
||||
tTrack
|
||||
cMusicManager::GetFavouriteRadioStation()
|
||||
{
|
||||
uint32 favstation = 0;
|
||||
tTrack favstation = 0;
|
||||
|
||||
for (int i = 1; i < NUM_RADIOS; i++) {
|
||||
for (tTrack i = 1; i < NUM_RADIOS; i++) {
|
||||
if (aListenTimeArray[i] > aListenTimeArray[favstation])
|
||||
favstation = i;
|
||||
}
|
||||
|
||||
+23
-17
@@ -14,6 +14,12 @@ public:
|
||||
class CVehicle;
|
||||
class CPed;
|
||||
|
||||
#ifdef GTA_PS2
|
||||
typedef uint8 tTrack;
|
||||
#else
|
||||
typedef uint32 tTrack;
|
||||
#endif
|
||||
|
||||
class cMusicManager
|
||||
{
|
||||
public:
|
||||
@@ -23,7 +29,7 @@ public:
|
||||
uint8 m_nVolumeLatency;
|
||||
uint8 m_nCurrentVolume;
|
||||
uint8 m_nMaxVolume;
|
||||
uint32 m_nAnnouncement;
|
||||
tTrack m_nAnnouncement;
|
||||
bool8 m_bAnnouncementInProgress;
|
||||
tStreamedSample m_aTracks[TOTAL_STREAMED_SOUNDS];
|
||||
bool8 m_bResetTimers;
|
||||
@@ -31,14 +37,14 @@ public:
|
||||
bool8 m_bRadioSetByScript;
|
||||
uint8 m_nRadioStationScript;
|
||||
int32 m_nRadioPosition;
|
||||
uint32 m_nRadioInCar;
|
||||
uint32 m_nFrontendTrack;
|
||||
uint32 m_nPlayingTrack;
|
||||
tTrack m_nRadioInCar;
|
||||
tTrack m_nFrontendTrack;
|
||||
tTrack m_nPlayingTrack;
|
||||
uint8 m_nUpcomingMusicMode;
|
||||
uint8 m_nMusicMode;
|
||||
bool8 m_FrontendLoopFlag;
|
||||
bool8 m_bTrackChangeStarted;
|
||||
uint32 m_nNextTrack;
|
||||
tTrack m_nNextTrack;
|
||||
bool8 m_nNextLoopFlag;
|
||||
bool8 m_bVerifyNextTrackStartedToPlay;
|
||||
bool8 m_bGameplayAllowsRadio;
|
||||
@@ -56,7 +62,7 @@ public:
|
||||
~cMusicManager();
|
||||
bool8 IsInitialised() { return m_bIsInitialised; }
|
||||
uint8 GetMusicMode() { return m_nMusicMode; }
|
||||
uint32 GetCurrentTrack() { return m_nPlayingTrack; }
|
||||
tTrack GetCurrentTrack() { return m_nPlayingTrack; }
|
||||
|
||||
void ResetMusicAfterReload();
|
||||
void SetStartingTrackPositions(bool8 isNewGameTimer);
|
||||
@@ -69,14 +75,14 @@ public:
|
||||
bool8 PlayerInCar();
|
||||
void DisplayRadioStationName();
|
||||
|
||||
void PlayAnnouncement(uint32);
|
||||
void PlayFrontEndTrack(uint32, bool8);
|
||||
void PreloadCutSceneMusic(uint32);
|
||||
void PlayAnnouncement(tTrack);
|
||||
void PlayFrontEndTrack(tTrack, bool8);
|
||||
void PreloadCutSceneMusic(tTrack);
|
||||
void PlayPreloadedCutSceneMusic(void);
|
||||
void StopCutSceneMusic(void);
|
||||
uint32 GetRadioInCar(void);
|
||||
void SetRadioInCar(uint32);
|
||||
void SetRadioChannelByScript(uint32, int32);
|
||||
tTrack GetRadioInCar(void);
|
||||
void SetRadioInCar(tTrack);
|
||||
void SetRadioChannelByScript(tTrack, int32);
|
||||
|
||||
void ResetTimers(uint32);
|
||||
void Service();
|
||||
@@ -87,19 +93,19 @@ public:
|
||||
|
||||
bool8 UsesPoliceRadio(CVehicle *veh);
|
||||
bool8 UsesTaxiRadio(CVehicle *veh);
|
||||
uint32 GetTrackStartPos(uint32 track);
|
||||
uint32 GetTrackStartPos(tTrack track);
|
||||
|
||||
void ComputeAmbienceVol(bool8 reset, uint8& outVolume);
|
||||
bool8 ServiceAnnouncement();
|
||||
|
||||
uint32 GetCarTuning();
|
||||
uint32 GetNextCarTuning();
|
||||
tTrack GetCarTuning();
|
||||
tTrack GetNextCarTuning();
|
||||
bool8 ChangeRadioChannel();
|
||||
void RecordRadioStats();
|
||||
void SetUpCorrectAmbienceTrack();
|
||||
float *GetListenTimeArray();
|
||||
uint32 GetRadioPosition(uint32 station);
|
||||
uint32 GetFavouriteRadioStation();
|
||||
uint32 GetRadioPosition(tTrack station);
|
||||
tTrack GetFavouriteRadioStation();
|
||||
void SetMalibuClubTrackPos(uint8 pos);
|
||||
void SetStripClubTrackPos(uint8 pos);
|
||||
bool8 CheckForMusicInterruptions();
|
||||
|
||||
@@ -49,7 +49,9 @@ enum eStreamedSounds
|
||||
STREAMED_SOUND_RADIO_ESPANTOSO,
|
||||
STREAMED_SOUND_RADIO_EMOTION,
|
||||
STREAMED_SOUND_RADIO_WAVE,
|
||||
#ifndef GTA_PS2
|
||||
STREAMED_SOUND_RADIO_MP3_PLAYER,
|
||||
#endif
|
||||
STREAMED_SOUND_CITY_AMBIENT,
|
||||
STREAMED_SOUND_WATER_AMBIENT,
|
||||
STREAMED_SOUND_BEACH_AMBIENT,
|
||||
|
||||
Reference in New Issue
Block a user