2019-05-30 15:24:47 -04:00
|
|
|
#pragma once
|
|
|
|
|
2019-10-26 08:39:10 -04:00
|
|
|
#include "audio_enums.h"
|
2019-06-15 18:20:55 -04:00
|
|
|
|
2020-02-06 12:35:24 -05:00
|
|
|
class tStreamedSample
|
2019-06-16 20:10:55 -04:00
|
|
|
{
|
2019-06-15 18:20:55 -04:00
|
|
|
public:
|
|
|
|
uint32 m_nLength;
|
|
|
|
uint32 m_nPosition;
|
|
|
|
uint32 m_nLastPosCheckTimer;
|
|
|
|
};
|
|
|
|
|
2020-02-06 12:35:24 -05:00
|
|
|
class CVehicle;
|
|
|
|
|
2019-05-30 15:24:47 -04:00
|
|
|
class cMusicManager
|
|
|
|
{
|
|
|
|
public:
|
2019-06-16 18:16:38 -04:00
|
|
|
bool m_bIsInitialised;
|
2020-02-06 12:35:24 -05:00
|
|
|
bool m_bDisabled;
|
2019-06-15 18:20:55 -04:00
|
|
|
uint8 m_nMusicMode;
|
|
|
|
uint8 m_nCurrentStreamedSound;
|
|
|
|
uint8 m_nPreviousStreamedSound;
|
2020-02-06 12:35:24 -05:00
|
|
|
bool m_bFrontendTrackFinished;
|
|
|
|
bool m_bPlayInFrontend;
|
|
|
|
bool m_bSetNextStation;
|
|
|
|
uint8 m_nAnnouncement;
|
2019-06-16 18:16:38 -04:00
|
|
|
bool m_bPreviousPlayerInCar;
|
|
|
|
bool m_bPlayerInCar;
|
|
|
|
bool m_bAnnouncementInProgress;
|
2020-02-06 12:35:24 -05:00
|
|
|
tStreamedSample m_aTracks[TOTAL_STREAMED_SOUNDS];
|
|
|
|
bool m_bResetTimers;
|
|
|
|
uint32 m_nResetTime;
|
|
|
|
uint32 m_nLastTrackServiceTime;
|
|
|
|
uint32 m_nTimer;
|
|
|
|
bool m_bDoTrackService;
|
|
|
|
bool m_bIgnoreTimeDelay;
|
|
|
|
bool m_bDontServiceAmbienceTrack;
|
2019-06-16 18:16:38 -04:00
|
|
|
bool m_bRadioSetByScript;
|
2019-06-15 18:20:55 -04:00
|
|
|
uint8 m_nRadioStation;
|
2020-02-06 12:35:24 -05:00
|
|
|
int32 m_nRadioPosition;
|
|
|
|
uint8 m_nRadioInCar;
|
2019-06-15 18:20:55 -04:00
|
|
|
|
|
|
|
public:
|
2020-02-06 12:35:24 -05:00
|
|
|
cMusicManager();
|
2019-08-02 16:20:12 -04:00
|
|
|
bool IsInitialised() { return m_bIsInitialised; }
|
|
|
|
uint32 GetMusicMode() { return m_nMusicMode; }
|
|
|
|
uint8 GetCurrentTrack() { return m_nCurrentStreamedSound; }
|
|
|
|
|
2020-02-06 12:35:24 -05:00
|
|
|
bool Initialise();
|
2019-07-05 15:15:32 -04:00
|
|
|
void Terminate();
|
|
|
|
|
2020-02-06 12:35:24 -05:00
|
|
|
void ChangeMusicMode(uint8 mode);
|
2019-07-16 11:03:37 -04:00
|
|
|
void StopFrontEndTrack();
|
|
|
|
|
2019-06-15 18:20:55 -04:00
|
|
|
bool PlayerInCar();
|
|
|
|
void DisplayRadioStationName();
|
2019-08-29 18:44:57 -04:00
|
|
|
|
2019-10-26 08:20:12 -04:00
|
|
|
void PlayAnnouncement(uint8);
|
|
|
|
void PlayFrontEndTrack(uint8, uint8);
|
|
|
|
void PreloadCutSceneMusic(uint8);
|
2019-08-14 21:43:00 -04:00
|
|
|
void PlayPreloadedCutSceneMusic(void);
|
|
|
|
void StopCutSceneMusic(void);
|
2020-02-06 12:35:24 -05:00
|
|
|
uint8 GetRadioInCar(void);
|
2019-10-26 08:20:12 -04:00
|
|
|
void SetRadioInCar(uint32);
|
|
|
|
void SetRadioChannelByScript(uint8, int32);
|
2019-08-29 18:44:57 -04:00
|
|
|
|
|
|
|
void ResetMusicAfterReload();
|
2019-09-21 16:10:35 -04:00
|
|
|
|
|
|
|
void ResetTimers(int32);
|
|
|
|
void Service();
|
2020-02-06 12:35:24 -05:00
|
|
|
void ServiceFrontEndMode();
|
|
|
|
void ServiceGameMode();
|
|
|
|
void ServiceAmbience();
|
|
|
|
void ServiceTrack();
|
|
|
|
|
|
|
|
bool UsesPoliceRadio(CVehicle *veh);
|
|
|
|
uint32 GetTrackStartPos(uint8);
|
|
|
|
|
|
|
|
void ComputeAmbienceVol(uint8 reset, uint8& outVolume);
|
|
|
|
bool ServiceAnnouncement();
|
|
|
|
|
|
|
|
uint8 GetCarTuning();
|
|
|
|
uint8 GetNextCarTuning();
|
|
|
|
bool ChangeRadioChannel();
|
2019-05-30 15:24:47 -04:00
|
|
|
};
|
2019-06-15 18:20:55 -04:00
|
|
|
|
|
|
|
static_assert(sizeof(cMusicManager) == 0x95C, "cMusicManager: error");
|
|
|
|
|
2019-05-30 15:24:47 -04:00
|
|
|
extern cMusicManager &MusicManager;
|