Repository navigation
Naming unknown audio engine fields #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /* | ||
| Plugin-SDK (Grand Theft Auto San Andreas) header file | ||
| Authors: GTA Community. See more here | ||
| https://github.com/DK22Pac/plugin-sdk | ||
| Do not delete this comment block. Respect others' work! | ||
| */ | ||
| #pragma once | ||
| #include "PluginBase.h" | ||
|
|
||
| struct tBeat { | ||
| UInt32 time; | ||
| UInt32 key; | ||
| }; | ||
| VALIDATE_OFFSET(tBeat, time, 0x0); | ||
| VALIDATE_OFFSET(tBeat, key, 0x4); | ||
| VALIDATE_SIZE(tBeat, 0x8); | ||
|
|
||
| struct tBeatInfo { | ||
| tBeat beatWindow[20]; | ||
| Int32 isBeatInfoPresent; | ||
| Int32 beatTypeThisFrame; | ||
| Int32 beatNumber; | ||
| }; | ||
| VALIDATE_OFFSET(tBeatInfo, beatWindow, 0x0); | ||
| VALIDATE_OFFSET(tBeatInfo, isBeatInfoPresent, 0xA0); | ||
| VALIDATE_OFFSET(tBeatInfo, beatTypeThisFrame, 0xA4); | ||
| VALIDATE_OFFSET(tBeatInfo, beatNumber, 0xA8); | ||
| VALIDATE_SIZE(tBeatInfo, 0xAC); | ||
|
|
||
| struct tTrackInfo { | ||
| tBeat beats[1000]; | ||
| UInt32 field_1F40[16]; | ||
| UInt16 field_1F80; | ||
| }; | ||
| VALIDATE_OFFSET(tTrackInfo, beats, 0x0); | ||
| VALIDATE_OFFSET(tTrackInfo, field_1F40, 0x1F40); | ||
| VALIDATE_OFFSET(tTrackInfo, field_1F80, 0x1F80); | ||
| VALIDATE_SIZE(tTrackInfo, 0x1F84); |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,11 +13,11 @@ | |||||||||||||||
|
|
||||||||||||||||
| class PLUGIN_API CAEAudioHardware { | ||||||||||||||||
| public: | ||||||||||||||||
| unsigned char field_0; | ||||||||||||||||
| char m_bDisableEffectsLoading; | ||||||||||||||||
| char field_2; | ||||||||||||||||
| char field_3; | ||||||||||||||||
| char field_4; | ||||||||||||||||
| bool m_bInitialised; | ||||||||||||||||
| bool m_bDisableEffectsLoading; | ||||||||||||||||
| bool m_bPrevMaxSecondarySlowFadeout; | ||||||||||||||||
| bool m_bPrevMaxGlobalSlowFadeout; | ||||||||||||||||
| bool m_bHardwareMixAvailable; | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set when |
||||||||||||||||
| char m_nReverbEnvironment; | ||||||||||||||||
| short m_awChannelFlags[64]; | ||||||||||||||||
| short field_86; | ||||||||||||||||
|
|
@@ -26,16 +26,16 @@ class PLUGIN_API CAEAudioHardware { | |||||||||||||||
| unsigned short m_nNumChannels; | ||||||||||||||||
| short m_anNumSoundsInSlot[64]; | ||||||||||||||||
| float m_afChannelVolumes[64]; | ||||||||||||||||
| int field_210[64]; | ||||||||||||||||
| float m_afChannelGains[64]; // linear volume gain (10 ^ (dB / 20)) | ||||||||||||||||
| float m_afChannelsFrqScalingFactor[64]; | ||||||||||||||||
| float m_fMusicMasterScalingFactor; | ||||||||||||||||
| float m_fEffectMasterScalingFactor; | ||||||||||||||||
| float m_fMusicFaderScalingFactor; | ||||||||||||||||
| float m_fEffectsFaderScalingFactor; | ||||||||||||||||
| float m_fStreamFaderScalingFactor; | ||||||||||||||||
| float m_fNonStreamFaderScalingFactor; | ||||||||||||||||
| float field_428; | ||||||||||||||||
| float field_42C; | ||||||||||||||||
| float m_fNonStreamFaderScalingFactor; // order swapped with m_fStreamFaderScalingFactor? | ||||||||||||||||
|
Comment on lines
35
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Swapped:
Suggested change
|
||||||||||||||||
| float m_fPrevMaxVolumeSecondary; | ||||||||||||||||
| float m_fPrevMaxVolumeGlobal; | ||||||||||||||||
|
Comment on lines
+37
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| short m_aBankSlotIds[300]; | ||||||||||||||||
| short m_aSoundTypes[300]; | ||||||||||||||||
| short m_anVirtualChannelSoundLoopStartTimes[300]; | ||||||||||||||||
|
|
@@ -64,11 +64,11 @@ class PLUGIN_API CAEAudioHardware { | |||||||||||||||
| public: | ||||||||||||||||
| int GetActiveTrackID(); | ||||||||||||||||
| }; | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, field_0, 0x0); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_bInitialised, 0x0); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_bDisableEffectsLoading, 0x1); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, field_2, 0x2); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, field_3, 0x3); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, field_4, 0x4); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_bPrevMaxSecondarySlowFadeout, 0x2); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_bPrevMaxGlobalSlowFadeout, 0x3); | ||||||||||||||||
|
Comment on lines
+69
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_bHardwareMixAvailable, 0x4); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_nReverbEnvironment, 0x5); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_awChannelFlags, 0x6); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, field_86, 0x86); | ||||||||||||||||
|
|
@@ -77,16 +77,16 @@ VALIDATE_OFFSET(CAEAudioHardware, m_wNumAvailableChannels, 0x8C); | |||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_nNumChannels, 0x8E); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_anNumSoundsInSlot, 0x90); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_afChannelVolumes, 0x110); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, field_210, 0x210); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_afChannelGains, 0x210); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_afChannelsFrqScalingFactor, 0x310); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_fMusicMasterScalingFactor, 0x410); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_fEffectMasterScalingFactor, 0x414); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_fMusicFaderScalingFactor, 0x418); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_fEffectsFaderScalingFactor, 0x41C); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_fStreamFaderScalingFactor, 0x420); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_fNonStreamFaderScalingFactor, 0x424); | ||||||||||||||||
|
Comment on lines
86
to
87
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, field_428, 0x428); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, field_42C, 0x42C); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_fPrevMaxVolumeSecondary, 0x428); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_fPrevMaxVolumeGlobal, 0x42C); | ||||||||||||||||
|
Comment on lines
+88
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_aBankSlotIds, 0x430); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_aSoundTypes, 0x688); | ||||||||||||||||
| VALIDATE_OFFSET(CAEAudioHardware, m_anVirtualChannelSoundLoopStartTimes, 0x8E0); | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,8 +18,8 @@ char *CAERadioTrackManager::GetRadioStationName(signed char id) | |||||||||
| return ((char *(__thiscall *)(CAERadioTrackManager *, signed char))0x4E9E10)(this, id); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void CAERadioTrackManager::StartRadio(int stationId, float bass, int arg, char unused) { | ||||||||||
| plugin::CallMethod<0x4EB3C0, CAERadioTrackManager*, int, float, int, char>(this, stationId, bass, arg, unused); | ||||||||||
| void CAERadioTrackManager::StartRadio(eRadioID stationId, float bass, int arg, char unused) { | ||||||||||
| plugin::CallMethod<0x4EB3C0, CAERadioTrackManager*, eRadioID, float, int, char>(this, stationId, bass, arg, unused); | ||||||||||
|
Comment on lines
+21
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| } | ||||||||||
|
|
||||||||||
| void CAERadioTrackManager::StopRadio(tVehicleAudioSettings* settings, char arg) { | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||
|
|
||||||
| #include "PluginBase.h" | ||||||
| #include "CAEVehicleAudioEntity.h" | ||||||
| #include "eRadioID.h" | ||||||
|
|
||||||
| struct PLUGIN_API tRadioSettings { | ||||||
| Int32 TrackIDs[5]; | ||||||
|
|
@@ -16,7 +17,7 @@ struct PLUGIN_API tRadioSettings { | |||||
| Int32 PlayTime; | ||||||
| Int32 TrackLengthMs; | ||||||
| UInt8 TrackFlags; | ||||||
| Int8 StationID; // eRadioID | ||||||
| eRadioID StationID; | ||||||
| Int8 BassSetting; | ||||||
| Int8 _pad27; | ||||||
| float BassFactor; | ||||||
|
|
@@ -110,7 +111,7 @@ class PLUGIN_API CAERadioTrackManager { | |||||
| public: | ||||||
| bool IsVehicleRadioActive(); | ||||||
| char* GetRadioStationName(signed char id); | ||||||
| void StartRadio(int stationId, float bass, int arg, char unused); | ||||||
| void StartRadio(eRadioID stationId, float bass, int arg, char unused); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Real signature:
Suggested change
|
||||||
| void StopRadio(tVehicleAudioSettings* settings, char arg); | ||||||
|
|
||||||
| static void Load(); | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -37,8 +37,8 @@ void CAudioEngine::SetRadioAutoRetuneOnOff(bool on) { | |||||||||
| plugin::CallMethod<0x506F80, CAudioEngine*, bool>(this, on); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void CAudioEngine::RetuneRadio(char stationId) { | ||||||||||
| plugin::CallMethod<0x507E10, CAudioEngine*, char>(this, stationId); | ||||||||||
| void CAudioEngine::RetuneRadio(eRadioID stationId) { | ||||||||||
| plugin::CallMethod<0x507E10, CAudioEngine*, eRadioID>(this, stationId); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| CReference* CAudioEngine::ReportFrontendAudioEvent(int id, float volume, float speed) { | ||||||||||
|
|
@@ -58,8 +58,8 @@ void CAudioEngine::ServiceLoadingTune(float fade) { | |||||||||
| plugin::CallMethod<0x5078A0, CAudioEngine*, float>(this, fade); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void CAudioEngine::StartRadio(int radioStation, char arg) { | ||||||||||
| plugin::CallMethod<0x507DC0, CAudioEngine*, int, char>(this, radioStation, arg); | ||||||||||
| void CAudioEngine::StartRadio(eRadioID radioStation, char arg) { | ||||||||||
| plugin::CallMethod<0x507DC0, CAudioEngine*, eRadioID, char>(this, radioStation, arg); | ||||||||||
|
Comment on lines
+61
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| } | ||||||||||
|
|
||||||||||
| void CAudioEngine::StopRadio(tVehicleAudioSettings* settings, bool arg) { | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -6,26 +6,24 @@ | |||||
| */ | ||||||
| #pragma once | ||||||
| #include "PluginBase.h" | ||||||
| #include "AudioTypes.h" | ||||||
| #include "CAEFrontendAudioEntity.h" | ||||||
| #include "CAEPedlessSpeechAudioEntity.h" | ||||||
| #include "CAETwinLoopSoundEntity.h" | ||||||
| #include "CAEScriptAudioEntity.h" | ||||||
| #include "CAECollisionAudioEntity.h" | ||||||
| #include "CAEVehicleAudioEntity.h" | ||||||
| #include "eAudioEvents.h" | ||||||
| #include "eRadioID.h" | ||||||
|
|
||||||
| class PLUGIN_API CAudioEngine { | ||||||
| public: | ||||||
| char field_0; | ||||||
| char field_1; | ||||||
| char m_nCurrentRadiostationId; | ||||||
| char field_3; | ||||||
| int field_4; | ||||||
| char field_8[152]; | ||||||
| char field_A0; | ||||||
| char field_A1[15]; | ||||||
| char field_B0; | ||||||
| char field_B1[3]; | ||||||
| bool m_bPlayingMissionCompleteTrack; | ||||||
| bool m_bStoppingMissionCompleteTrack; | ||||||
| eRadioID m_nCurrentRadiostationId; | ||||||
| eRadioID m_nSavedRadioStationId; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 0x3 is never accessed (the mobile layout has nothing there either). The saved station is 0x2:
Suggested change
|
||||||
| int m_nBackgroundAudioChannel; | ||||||
| tBeatInfo m_beatInfo; | ||||||
| CAEFrontendAudioEntity m_FrontendAudio; | ||||||
| CAETwinLoopSoundEntity field_150; | ||||||
| CAETwinLoopSoundEntity field_1F8; | ||||||
|
|
@@ -44,12 +42,12 @@ class PLUGIN_API CAudioEngine { | |||||
| void SetMusicMasterVolume(char volume); | ||||||
| void SetBassEnhanceOnOff(bool on); | ||||||
| void SetRadioAutoRetuneOnOff(bool on); | ||||||
| void RetuneRadio(char stationId); | ||||||
| void RetuneRadio(eRadioID stationId); | ||||||
| CReference* ReportFrontendAudioEvent(int id, float volume, float speed); | ||||||
| void ReportMissionAudioEvent(eAudioEvents audioEvent, CVector const* coords); | ||||||
| void Service(); | ||||||
| void ServiceLoadingTune(float fade); | ||||||
| void StartRadio(int radioStation, char arg); | ||||||
| void StartRadio(eRadioID radioStation, char arg); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| void StopRadio(tVehicleAudioSettings* settings, bool arg); | ||||||
| bool IsRadioRetuneInProgress(); | ||||||
| bool IsLoadingTuneActive(); | ||||||
|
|
@@ -62,16 +60,12 @@ class PLUGIN_API CAudioEngine { | |||||
| void SetMusicFaderScalingFactor(float value); | ||||||
| void SetEffectsFaderScalingFactor(float value); | ||||||
| }; | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_0, 0x0); | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_1, 0x1); | ||||||
| VALIDATE_OFFSET(CAudioEngine, m_bPlayingMissionCompleteTrack, 0x0); | ||||||
| VALIDATE_OFFSET(CAudioEngine, m_bStoppingMissionCompleteTrack, 0x1); | ||||||
| VALIDATE_OFFSET(CAudioEngine, m_nCurrentRadiostationId, 0x2); | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_3, 0x3); | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_4, 0x4); | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_8, 0x8); | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_A0, 0xA0); | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_A1, 0xA1); | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_B0, 0xB0); | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_B1, 0xB1); | ||||||
| VALIDATE_OFFSET(CAudioEngine, m_nSavedRadioStationId, 0x3); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| VALIDATE_OFFSET(CAudioEngine, m_nBackgroundAudioChannel, 0x4); | ||||||
| VALIDATE_OFFSET(CAudioEngine, m_beatInfo, 0x8); | ||||||
| VALIDATE_OFFSET(CAudioEngine, m_FrontendAudio, 0xB4); | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_150, 0x150); | ||||||
| VALIDATE_OFFSET(CAudioEngine, field_1F8, 0x1F8); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: "Secondary" is the loudest frontend sound (channel flag 0x1), "Global" the loudest overall; the bools are its smooth ducking flag (0x80). Mobile SDK names: