re3/src/audio/MusicManager.h

113 lines
2.6 KiB
C
Raw Normal View History

#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-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;
class CPed;
2020-02-06 17:35:24 +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;
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;
uint8 m_nRadioStation;
uint32 m_nRadioPosition;
2020-05-27 00:29:54 +00:00
uint32 m_nRadioInCar;
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;
int8 field_3998;
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; }
uint32 GetMusicMode() { return m_nMusicMode; }
uint8 GetCurrentTrack() { return m_nPlayingTrack; }
2019-08-02 20:20:12 +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);
uint32 GetRadioInCar(void);
void SetRadioInCar(uint32);
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();
void ServiceTrack(CVehicle *veh, CPed *ped);
2020-02-06 17:35:24 +00:00
bool UsesPoliceRadio(CVehicle *veh);
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();
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-06-15 22:20:55 +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;
extern bool g_bAnnouncementReadPosAlready; // we have a symbol of this so it was declared in .h
float GetHeightScale();