2019-05-30 19:24:47 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-10-26 12:39:10 +00:00
|
|
|
#include "audio_enums.h"
|
2019-06-15 22:20:55 +00:00
|
|
|
|
2020-02-06 17:35:24 +00:00
|
|
|
class tStreamedSample
|
2019-06-17 00:10:55 +00:00
|
|
|
{
|
2019-06-15 22:20:55 +00:00
|
|
|
public:
|
|
|
|
uint32 m_nLength;
|
|
|
|
uint32 m_nPosition;
|
|
|
|
uint32 m_nLastPosCheckTimer;
|
|
|
|
};
|
|
|
|
|
2020-02-06 17:35:24 +00:00
|
|
|
class CVehicle;
|
2020-09-09 16:37:44 +00:00
|
|
|
class CPed;
|
2020-02-06 17:35:24 +00:00
|
|
|
|
2019-05-30 19:24:47 +00:00
|
|
|
class cMusicManager
|
|
|
|
{
|
|
|
|
public:
|
2019-06-16 22:16:38 +00:00
|
|
|
bool m_bIsInitialised;
|
2020-02-06 17:35:24 +00:00
|
|
|
bool m_bDisabled;
|
2020-09-09 16:37:44 +00:00
|
|
|
bool field_2;
|
|
|
|
uint8 m_nVolumeLatency;
|
|
|
|
uint8 m_nCurrentVolume;
|
|
|
|
uint8 m_nMaxVolume;
|
2020-05-27 00:29:54 +00:00
|
|
|
uint32 m_nAnnouncement;
|
2019-06-16 22:16:38 +00:00
|
|
|
bool m_bAnnouncementInProgress;
|
2020-02-06 17:35:24 +00:00
|
|
|
tStreamedSample m_aTracks[TOTAL_STREAMED_SOUNDS];
|
|
|
|
bool m_bResetTimers;
|
|
|
|
uint32 m_nResetTime;
|
2019-06-16 22:16:38 +00:00
|
|
|
bool m_bRadioSetByScript;
|
2020-09-09 16:37:44 +00:00
|
|
|
uint8 m_nRadioStation;
|
|
|
|
uint32 m_nRadioPosition;
|
2020-05-27 00:29:54 +00:00
|
|
|
uint32 m_nRadioInCar;
|
2020-09-09 16:37:44 +00:00
|
|
|
uint32 m_nFrontendTrack;
|
|
|
|
uint32 m_nPlayingTrack;
|
|
|
|
uint8 m_nUpcomingMusicMode;
|
|
|
|
uint8 m_nMusicMode;
|
|
|
|
bool field_398E;
|
|
|
|
bool field_398F;
|
|
|
|
uint32 m_nStreamedTrack;
|
|
|
|
bool field_3994;
|
|
|
|
bool field_3995;
|
|
|
|
bool field_3996;
|
|
|
|
bool field_3997;
|
2020-09-19 18:45:57 +00:00
|
|
|
int8 nFramesSinceCutsceneEnded;
|
2020-09-09 16:37:44 +00:00
|
|
|
bool field_3999;
|
|
|
|
bool field_399A;
|
|
|
|
uint8 m_nMusicModeToBeSet;
|
|
|
|
bool field_399C;
|
|
|
|
float aListenTimeArray[NUM_RADIOS];
|
|
|
|
float m_nLastTrackServiceTime;
|
2019-06-15 22:20:55 +00:00
|
|
|
|
|
|
|
public:
|
2020-02-06 17:35:24 +00:00
|
|
|
cMusicManager();
|
2019-08-02 20:20:12 +00:00
|
|
|
bool IsInitialised() { return m_bIsInitialised; }
|
2020-09-09 21:57:14 +00:00
|
|
|
uint8 GetMusicMode() { return m_nMusicMode; }
|
|
|
|
uint32 GetCurrentTrack() { return m_nPlayingTrack; }
|
2019-08-02 20:20:12 +00:00
|
|
|
|
2020-09-09 16:37:44 +00:00
|
|
|
void ResetMusicAfterReload();
|
|
|
|
void SetStartingTrackPositions(uint8 isNewGameTimer);
|
2020-02-06 17:35:24 +00:00
|
|
|
bool Initialise();
|
2019-07-05 19:15:32 +00:00
|
|
|
void Terminate();
|
|
|
|
|
2020-02-06 17:35:24 +00:00
|
|
|
void ChangeMusicMode(uint8 mode);
|
2019-07-16 15:03:37 +00:00
|
|
|
void StopFrontEndTrack();
|
|
|
|
|
2019-06-15 22:20:55 +00:00
|
|
|
bool PlayerInCar();
|
|
|
|
void DisplayRadioStationName();
|
2019-08-29 22:44:57 +00:00
|
|
|
|
2020-05-27 00:29:54 +00:00
|
|
|
void PlayAnnouncement(uint32);
|
|
|
|
void PlayFrontEndTrack(uint32, uint8);
|
|
|
|
void PreloadCutSceneMusic(uint32);
|
2019-08-15 01:43:00 +00:00
|
|
|
void PlayPreloadedCutSceneMusic(void);
|
|
|
|
void StopCutSceneMusic(void);
|
2020-09-09 16:37:44 +00:00
|
|
|
uint32 GetRadioInCar(void);
|
2019-10-26 12:20:12 +00:00
|
|
|
void SetRadioInCar(uint32);
|
2020-09-09 16:37:44 +00:00
|
|
|
void SetRadioChannelByScript(uint32, int32);
|
2019-09-21 20:10:35 +00:00
|
|
|
|
|
|
|
void ResetTimers(int32);
|
|
|
|
void Service();
|
2020-02-06 17:35:24 +00:00
|
|
|
void ServiceFrontEndMode();
|
|
|
|
void ServiceGameMode();
|
|
|
|
void ServiceAmbience();
|
2020-09-09 16:37:44 +00:00
|
|
|
void ServiceTrack(CVehicle *veh, CPed *ped);
|
2020-02-06 17:35:24 +00:00
|
|
|
|
|
|
|
bool UsesPoliceRadio(CVehicle *veh);
|
2020-09-09 16:37:44 +00:00
|
|
|
bool UsesTaxiRadio(CVehicle *veh);
|
|
|
|
uint32 GetTrackStartPos(uint32 track);
|
2020-02-06 17:35:24 +00:00
|
|
|
|
|
|
|
void ComputeAmbienceVol(uint8 reset, uint8& outVolume);
|
|
|
|
bool ServiceAnnouncement();
|
|
|
|
|
2020-05-27 00:29:54 +00:00
|
|
|
uint32 GetCarTuning();
|
|
|
|
uint32 GetNextCarTuning();
|
2020-02-06 17:35:24 +00:00
|
|
|
bool ChangeRadioChannel();
|
2020-09-09 16:37:44 +00:00
|
|
|
void RecordRadioStats();
|
|
|
|
void SetUpCorrectAmbienceTrack();
|
|
|
|
float *GetListenTimeArray();
|
|
|
|
uint32 GetRadioPosition(uint32 station);
|
|
|
|
uint32 GetFavouriteRadioStation();
|
|
|
|
void SetMalibuClubTrackPos(uint8 pos);
|
|
|
|
void SetStripClubTrackPos(uint8 pos);
|
|
|
|
bool CheckForMusicInterruptions();
|
|
|
|
|
|
|
|
void Enable();
|
|
|
|
void Disable();
|
2019-05-30 19:24:47 +00:00
|
|
|
};
|
2019-06-15 22:20:55 +00:00
|
|
|
|
2020-05-10 15:49:33 +00:00
|
|
|
VALIDATE_SIZE(cMusicManager, 0x95C);
|
2019-06-15 22:20:55 +00:00
|
|
|
|
2020-04-16 08:50:45 +00:00
|
|
|
extern cMusicManager MusicManager;
|
2020-09-09 16:37:44 +00:00
|
|
|
extern bool g_bAnnouncementReadPosAlready; // we have a symbol of this so it was declared in .h
|
2020-09-19 18:45:57 +00:00
|
|
|
float GetHeightScale();
|