summaryrefslogtreecommitdiffstats
path: root/src/audio/MusicManager.h
blob: 7753d638e54acc7f75aad6dbb03f719a80ef906e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#pragma once

#include "audio.h"

class tMP3Sample
{
public:
	uint32 m_nLength;
	uint32 m_nPosition;
	uint32 m_nLastPosCheckTimer;
};

class cMusicManager
{
public:
	bool m_bIsInitialised;
	uint8 field_1;
	uint8 m_nMusicMode;
	uint8 m_nCurrentStreamedSound;
	uint8 m_nPreviousStreamedSound;
	uint8 field_5;
	uint8 field_6;
	uint8 field_7;
	bool m_bAnnouncement;
	bool m_bPreviousPlayerInCar;
	bool m_bPlayerInCar;
	bool m_bAnnouncementInProgress;
	tMP3Sample m_asMP3Samples[TOTAL_STREAMED_SOUNDS];
	uint8 field_2364;
	uint8 field_2365;
	uint8 field_2366;
	uint8 field_2367;
	uint32 field_2368;
	uint32 field_2372;
	uint32 field_2376;
	uint8 field_2380;
	uint8 field_2381;
	uint8 field_2382;
	bool m_bRadioSetByScript;
	uint8 m_nRadioStation;
	uint8 field_2385;
	uint8 field_2386;
	uint8 field_2387;
	uint32 m_nRadioPosition;
	bool m_bRadioInCar;
	uint8 field_2393;
	uint8 field_2394;
	uint8 field_2395;

public:
	bool IsInitialised() { return m_bIsInitialised; }
	uint32 GetMusicMode() { return m_nMusicMode; }
	uint8 GetCurrentTrack() { return m_nCurrentStreamedSound; }

	void Initialise();
	void Terminate();

	void ChangeMusicMode(int32 mode);
	void StopFrontEndTrack();

	bool PlayerInCar();
	void DisplayRadioStationName();

	void PlayAnnouncement(uint8);
	void PlayFrontEndTrack(uint8, uint8);
	void PreloadCutSceneMusic(uint8);
	void PlayPreloadedCutSceneMusic(void);
	void StopCutSceneMusic(void);
	int32 GetRadioInCar(void);
	void SetRadioInCar(uint32);
	void SetRadioChannelByScript(uint8, int32);

	void ResetMusicAfterReload();

	void ResetTimers(int32);
	void Service();
};

static_assert(sizeof(cMusicManager) == 0x95C, "cMusicManager: error");

extern cMusicManager &MusicManager;