summaryrefslogtreecommitdiffstats
path: root/src/audio/AudioManager.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/audio/AudioManager.h167
1 files changed, 18 insertions, 149 deletions
diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h
index 9479d1cd..d8b6c4d7 100644
--- a/src/audio/AudioManager.h
+++ b/src/audio/AudioManager.h
@@ -1,164 +1,33 @@
#pragma once
-#include "common.h"
-#include "config.h"
-
-#include "DMAudio.h"
-
+#include "audio_enums.h"
#include "AudioCollision.h"
#include "PoliceRadio.h"
-enum eScriptSounds : int16 {
- SCRIPT_SOUND_0 = 0,
- SCRIPT_SOUND_1 = 1,
- SCRIPT_SOUND_2 = 2,
- SCRIPT_SOUND_3 = 3,
- SCRIPT_SOUND_PARTY_1_LOOP_S = 4,
- SCRIPT_SOUND_PARTY_1_LOOP_L = 5,
- SCRIPT_SOUND_PARTY_2_LOOP_S = 6,
- SCRIPT_SOUND_PARTY_2_LOOP_L = 7,
- SCRIPT_SOUND_PARTY_3_LOOP_S = 8,
- SCRIPT_SOUND_PARTY_3_LOOP_L = 9,
- SCRIPT_SOUND_PARTY_4_LOOP_S = 10,
- SCRIPT_SOUND_PARTY_4_LOOP_L = 11,
- SCRIPT_SOUND_PARTY_5_LOOP_S = 12,
- SCRIPT_SOUND_PARTY_5_LOOP_L = 13,
- SCRIPT_SOUND_PARTY_6_LOOP_S = 14,
- SCRIPT_SOUND_PARTY_6_LOOP_L = 15,
- SCRIPT_SOUND_PARTY_7_LOOP_S = 16,
- SCRIPT_SOUND_PARTY_7_LOOP_L = 17,
- SCRIPT_SOUND_PARTY_8_LOOP_S = 18,
- SCRIPT_SOUND_PARTY_8_LOOP_L = 19,
- SCRIPT_SOUND_PARTY_9_LOOP_S = 20,
- SCRIPT_SOUND_PARTY_9_LOOP_L = 21,
- SCRIPT_SOUND_PARTY_10_LOOP_S = 22,
- SCRIPT_SOUND_PARTY_10_LOOP_L = 23,
- SCRIPT_SOUND_PARTY_11_LOOP_S = 24,
- SCRIPT_SOUND_PARTY_11_LOOP_L = 25,
- SCRIPT_SOUND_PARTY_12_LOOP_S = 26,
- SCRIPT_SOUND_PARTY_12_LOOP_L = 27,
- SCRIPT_SOUND_PARTY_13_LOOP_S = 28,
- SCRIPT_SOUND_PARTY_13_LOOP_L = 29,
- SCRIPT_SOUND_STRIP_CLUB_LOOP_1_S = 30,
- SCRIPT_SOUND_STRIP_CLUB_LOOP_1_L = 31,
- SCRIPT_SOUND_STRIP_CLUB_LOOP_2_S = 32,
- SCRIPT_SOUND_STRIP_CLUB_LOOP_2_L = 33,
- SCRIPT_SOUND_WORK_SHOP_LOOP_S = 34,
- SCRIPT_SOUND_WORK_SHOP_LOOP_L = 35,
- SCRIPT_SOUND_SAWMILL_LOOP_S = 36,
- SCRIPT_SOUND_SAWMILL_LOOP_L = 37,
- SCRIPT_SOUND_38 = 38,
- SCRIPT_SOUND_39 = 39,
- SCRIPT_SOUND_LAUNDERETTE_LOOP_S = 40,
- SCRIPT_SOUND_LAUNDERETTE_LOOP_L = 41,
- SCRIPT_SOUND_CHINATOWN_RESTAURANT_S = 42,
- SCRIPT_SOUND_CHINATOWN_RESTAURANT_L = 43,
- SCRIPT_SOUND_CIPRIANI_RESAURANT_S = 44,
- SCRIPT_SOUND_CIPRIANI_RESAURANT_L = 45,
- SCRIPT_SOUND_46_S = 46,
- SCRIPT_SOUND_47_L = 47,
- SCRIPT_SOUND_MARCO_BISTRO_S = 48,
- SCRIPT_SOUND_MARCO_BISTRO_L = 49,
- SCRIPT_SOUND_AIRPORT_LOOP_S = 50,
- SCRIPT_SOUND_AIRPORT_LOOP_L = 51,
- SCRIPT_SOUND_SHOP_LOOP_S = 52,
- SCRIPT_SOUND_SHOP_LOOP_L = 53,
- SCRIPT_SOUND_CINEMA_LOOP_S = 54,
- SCRIPT_SOUND_CINEMA_LOOP_L = 55,
- SCRIPT_SOUND_DOCKS_LOOP_S = 56,
- SCRIPT_SOUND_DOCKS_LOOP_L = 57,
- SCRIPT_SOUND_HOME_LOOP_S = 58,
- SCRIPT_SOUND_HOME_LOOP_L = 59,
- SCRIPT_SOUND_FRANKIE_PIANO = 60,
- SCRIPT_SOUND_PARTY_1_LOOP = 61,
- SCRIPT_SOUND_PORN_CINEMA_1_S = 62,
- SCRIPT_SOUND_PORN_CINEMA_1_L = 63,
- SCRIPT_SOUND_PORN_CINEMA_2_S = 64,
- SCRIPT_SOUND_PORN_CINEMA_2_L = 65,
- SCRIPT_SOUND_PORN_CINEMA_3_S = 66,
- SCRIPT_SOUND_PORN_CINEMA_3_L = 67,
- SCRIPT_SOUND_BANK_ALARM_LOOP_S = 68,
- SCRIPT_SOUND_BANK_ALARM_LOOP_L = 69,
- SCRIPT_SOUND_POLICE_BALL_LOOP_S = 70,
- SCRIPT_SOUND_POLICE_BALL_LOOP_L = 71,
- SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_S = 72,
- SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_L = 73,
- SCRIPT_SOUND_74 = 74,
- SCRIPT_SOUND_75 = 75,
- SCRIPT_SOUND_POLICE_CELL_BEATING_LOOP_S = 76,
- SCRIPT_SOUND_POLICE_CELL_BEATING_LOOP_L = 77,
- SCRIPT_SOUND_INJURED_PED_MALE_OUCH_S = 78,
- SCRIPT_SOUND_INJURED_PED_MALE_OUCH_L = 79,
- SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_S = 80,
- SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_L = 81,
- SCRIPT_SOUND_EVIDENCE_PICKUP = 82,
- SCRIPT_SOUND_UNLOAD_GOLD = 83,
- SCRIPT_SOUND_RAVE_1_LOOP_S = 84,
- SCRIPT_SOUND_RAVE_1_LOOP_L = 85,
- SCRIPT_SOUND_RAVE_2_LOOP_S = 86,
- SCRIPT_SOUND_RAVE_2_LOOP_L = 87,
- SCRIPT_SOUND_RAVE_3_LOOP_S = 88,
- SCRIPT_SOUND_RAVE_3_LOOP_L = 89,
- SCRIPT_SOUND_MISTY_SEX_S = 90,
- SCRIPT_SOUND_MISTY_SEX_L = 91,
- SCRIPT_SOUND_GATE_START_CLUNK = 92,
- SCRIPT_SOUND_GATE_STOP_CLUNK = 93,
- SCRIPT_SOUND_PART_MISSION_COMPLETE = 94,
- SCRIPT_SOUND_CHUNKY_RUN_SHOUT = 95,
- SCRIPT_SOUND_SECURITY_GUARD_AWAY_SHOUT = 96,
- SCRIPT_SOUND_RACE_START_3 = 97,
- SCRIPT_SOUND_RACE_START_2 = 98,
- SCRIPT_SOUND_RACE_START_1 = 99,
- SCRIPT_SOUND_RACE_START_GO = 100,
- SCRIPT_SOUND_SWAT_PED_SHOUT = 101,
- SCRIPT_SOUND_PRETEND_FIRE_LOOP = 102,
- SCRIPT_SOUND_AMMUNATION_CHAT_1 = 103,
- SCRIPT_SOUND_AMMUNATION_CHAT_2 = 104,
- SCRIPT_SOUND_AMMUNATION_CHAT_3 = 105,
- SCRIPT_SOUND_BULLET_HIT_GROUND_1 = 106,
- SCRIPT_SOUND_BULLET_HIT_GROUND_2 = 107,
- SCRIPT_SOUND_BULLET_HIT_GROUND_3 = 108,
- SCRIPT_SOUND_BULLET_HIT_WATER = 109, //no sound
- SCRIPT_SOUND_110 = 110,
- SCRIPT_SOUND_111 = 111,
- SCRIPT_SOUND_PAYPHONE_RINGING = 112,
- SCRIPT_SOUND_113 = 113,
- SCRIPT_SOUND_GLASS_BREAK_L = 114,
- SCRIPT_SOUND_GLASS_BREAK_S = 115,
- SCRIPT_SOUND_GLASS_CRACK = 116,
- SCRIPT_SOUND_GLASS_LIGHT_BREAK = 117,
- SCRIPT_SOUND_BOX_DESTROYED_1 = 118,
- SCRIPT_SOUND_BOX_DESTROYED_2 = 119,
- SCRIPT_SOUND_METAL_COLLISION = 120,
- SCRIPT_SOUND_TIRE_COLLISION = 121,
- SCRIPT_SOUND_GUNSHELL_DROP = 122,
- SCRIPT_SOUND_GUNSHELL_DROP_SOFT = 123,
-};
-
class tSound
{
public:
int32 m_nEntityIndex;
int32 m_nCounter;
int32 m_nSampleIndex;
- uint8 m_bBankIndex;
+ uint8 m_nBankIndex;
bool m_bIs2D;
int32 m_nReleasingVolumeModificator;
- int32 m_nFrequency;
- uint8 m_bVolume;
+ uint32 m_nFrequency;
+ uint8 m_nVolume;
float m_fDistance;
int32 m_nLoopCount;
int32 m_nLoopStart;
int32 m_nLoopEnd;
- uint8 m_bEmittingVolume;
+ uint8 m_nEmittingVolume;
float m_fSpeedMultiplier;
float m_fSoundIntensity;
bool m_bReleasingSoundFlag;
CVector m_vecPos;
bool m_bReverbFlag;
- uint8 m_bLoopsRemaining;
+ uint8 m_nLoopsRemaining;
bool m_bRequireReflection; // Used for oneshots
- uint8 m_bOffset;
+ uint8 m_nOffset;
int32 m_nReleasingVolumeDivider;
bool m_bIsProcessed;
bool m_bLoopEnded;
@@ -177,7 +46,7 @@ public:
eAudioType m_nType;
void *m_pEntity;
bool m_bIsUsed;
- uint8 m_bStatus;
+ uint8 m_nStatus;
int16 m_awAudioEvent[NUM_AUDIOENTITY_EVENTS];
float m_afVolume[NUM_AUDIOENTITY_EVENTS];
uint8 m_AudioEvents;
@@ -220,9 +89,9 @@ class cMissionAudio
public:
CVector m_vecPos;
bool m_bPredefinedProperties;
- int m_nSampleIndex;
- uint8 m_bLoadingStatus;
- uint8 m_bPlayStatus;
+ int32 m_nSampleIndex;
+ uint8 m_nLoadingStatus;
+ uint8 m_nPlayStatus;
uint8 field_22; // todo find a name
int32 m_nMissionAudioCounter;
bool m_bIsPlayed;
@@ -262,7 +131,7 @@ public:
float m_fDistance;
CVehicle *m_pVehicle;
cTransmission *m_pTransmission;
- int m_nIndex;
+ int32 m_nIndex;
float m_fVelocityChange;
};
@@ -291,7 +160,7 @@ public:
bool m_bIsInitialised;
uint8 field_1; // unused
bool m_bFifthFrameFlag;
- uint8 m_bActiveSamples;
+ uint8 m_nActiveSamples;
uint8 field_4; // unused
bool m_bDynamicAcousticModelingStatus;
float m_fSpeedOfSound;
@@ -301,7 +170,7 @@ public:
bool m_bActiveSampleQueue;
tSound m_asSamples[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS];
uint8 m_abSampleQueueIndexTable[NUM_SOUNDS_SAMPLES_BANKS][NUM_SOUNDS_SAMPLES_SLOTS];
- uint8 m_bSampleRequestQueuesStatus[NUM_SOUNDS_SAMPLES_BANKS];
+ uint8 m_SampleRequestQueuesStatus[NUM_SOUNDS_SAMPLES_BANKS];
tSound m_asActiveSamples[NUM_SOUNDS_SAMPLES_SLOTS];
tAudioEntity m_asAudioEntities[NUM_AUDIOENTITIES];
int32 m_anAudioEntityIndices[NUM_AUDIOENTITIES];
@@ -321,9 +190,9 @@ public:
int32 m_nBridgeEntity;
cMissionAudio m_sMissionAudio;
int32 m_anRandomTable[5];
- uint8 m_bTimeSpent;
- uint8 m_bUserPause;
- uint8 m_bPreviousUserPause;
+ uint8 m_nTimeSpent;
+ uint8 m_nUserPause;
+ uint8 m_nPreviousUserPause;
uint32 m_FrameCounter;
cAudioManager();
@@ -333,7 +202,7 @@ public:
uint32 GetFrameCounter() const { return m_FrameCounter; }
float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; }
int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; }
- bool IsMissionAudioPlaying() const { return m_sMissionAudio.m_bPlayStatus == 1; }
+ bool IsMissionAudioPlaying() const { return m_sMissionAudio.m_nPlayStatus == 1; }
// "Should" be in alphabetic order, except "getXTalkSfx"
void AddDetailsToRequestedOrderList(uint8 sample);