Skip to content

Commit afca714

Browse files
committed
FMODAudioEngine and other members
1 parent ba2b2ad commit afca714

File tree

6 files changed

+171
-158
lines changed

6 files changed

+171
-158
lines changed

bindings/2.2074/Extras.bro

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,12 @@ class SequenceTriggerState {
212212
}
213213

214214
class FMODSoundTween {
215-
double m_unkDouble1;
216-
double m_unkDouble2;
217-
double m_unkDouble3;
215+
float m_interval;
216+
float m_duration;
217+
float m_start;
218+
float m_end;
219+
float m_value;
220+
bool m_finished;
218221
}
219222

220223
class FMODQueuedMusic {
@@ -264,9 +267,9 @@ class FMODSoundState {
264267
float m_pitch;
265268
bool m_fastFourierTransform;
266269
bool m_reverb;
267-
int m_unkInt1;
268-
bool m_unkBool1;
269-
int m_keyForFMODMusicMap;
270+
int m_effectID;
271+
bool m_isMusic;
272+
int m_musicID;
270273
bool m_unkBool2;
271274
}
272275

bindings/2.2074/GeometryDash.bro

Lines changed: 83 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,11 @@ class AdvancedFollowTriggerObject : EffectGameObject {
520520
[[link(android)]]
521521
class AdvFollowSetup {
522522
// ~AdvFollowSetup();
523+
524+
gd::unordered_set<int> m_centerIDs;
525+
gd::unordered_set<int> m_groupIDs;
526+
gd::unordered_set<int> m_controlIDs;
527+
int m_delay;
523528
}
524529

525530
[[link(android)]]
@@ -6064,13 +6069,13 @@ class FLAlertLayerProtocol {
60646069
class FMODAudioEngine : cocos2d::CCNode {
60656070
// virtual ~FMODAudioEngine();
60666071
FMODAudioEngine() = ios 0x142378, win 0x530d0, m1 inline, imac inline {
6067-
m_musicChannels = {};
6068-
m_unkMap180 = {};
6069-
m_unkMap1c0 = {};
6070-
m_musicVolume = .0f;
6071-
m_sfxVolume = .0f;
6072-
m_unusedInt164 = 0;
6073-
m_unusedInt168 = 0;
6072+
m_fmodMusic = {};
6073+
m_fmodSounds = {};
6074+
m_temporarySoundPaths = {};
6075+
m_musicVolume = 1.f;
6076+
m_sfxVolume = 1.f;
6077+
m_backgroundMusicFade = .0f;
6078+
m_musicFadeStart = .0f;
60746079
m_pulse1 = .0f;
60756080
m_pulse2 = .0f;
60766081
m_pulse3 = .0f;
@@ -6081,35 +6086,33 @@ class FMODAudioEngine : cocos2d::CCNode {
60816086
m_mainDSP = nullptr;
60826087
m_globalChannelDSP = nullptr;
60836088
m_globalChannel = nullptr;
6084-
m_channelGroup2 = nullptr;
6089+
m_reverbChannel = nullptr;
60856090
m_lastResult = FMOD_RESULT::FMOD_OK;
60866091
m_sampleRate = 0;
60876092
m_reducedQuality = false;
60886093
m_allAudioPaused = false;
60896094
m_musicOffset = 0;
6090-
m_unkBool1a8 = false;
6091-
m_unkInt1ac = 0;
6095+
m_stopped = false;
60926096
m_audioState = {};
6093-
m_unkSoundVector = {};
6094-
m_unkDSPMap384 = {};
6097+
m_removedSounds = {};
6098+
m_channelIDToDSP = {};
60956099
m_channelIDToChannel = {};
6096-
m_unkIntSet3bc = {};
6100+
m_stoppedChannels = {};
60976101
m_reverbPreset = FMODReverbPreset::Generic;
6098-
m_unkMapIntInt3dc = {};
6099-
m_unkMapIntInt3f8 = {};
6100-
m_unkMapIntString414 = {};
6102+
m_channelIDToEffectID = {};
6103+
m_effectIDToChannelID = {};
6104+
m_channelIDToSoundPath = {};
61016105
m_queuedEffects = {};
6102-
m_unkMapStringSound43c = {};
6103-
m_unkMapIntChannelGroup458 = {};
6104-
m_unkMapIntChannelGroup474 = {};
6105-
m_unkInt490 = 0;
6106-
m_unkInt494 = 0;
6107-
m_unkInt498 = 0;
6108-
m_unkInt49c = 0;
6109-
m_unkInt4a0 = 0;
6110-
m_unkInt4a4 = 0;
6111-
m_unkInt4a8 = 0;
6112-
m_unkInt4ac = 0;
6106+
m_soundPathToSound = {};
6107+
m_globalChannelGroups = {};
6108+
m_reverbChannelGroups = {};
6109+
m_showAudioVisualizer = false;
6110+
m_musicVisualizerTime = .0f;
6111+
m_musicVisualizerPeak = .0f;
6112+
m_musicVisualizerVolume = .0f;
6113+
m_sfxVisualizerTime = .0f;
6114+
m_sfxVisualizerPeak = .0f;
6115+
m_sfxVisualizerVolume = .0f;
61136116
}
61146117
static FMODAudioEngine* get() {
61156118
return FMODAudioEngine::sharedEngine();
@@ -6132,14 +6135,14 @@ class FMODAudioEngine : cocos2d::CCNode {
61326135
TodoReturn channelIDForUniqueID(int);
61336136
TodoReturn channelLinkSound(int, FMODSound*);
61346137
TodoReturn channelStopped(FMOD::Channel*, bool);
6135-
TodoReturn channelUnlinkSound(int);
6138+
void channelUnlinkSound(int) = win 0x57e20;
61366139
void clearAllAudio() = win 0x552e0, imac 0x3cb330, m1 0x353b90;
61376140
int countActiveEffects() {
61386141
return m_channelIDToChannel.size() - countActiveMusic();
61396142
}
61406143
int countActiveMusic() {
61416144
int count = 0;
6142-
for (auto& music : m_musicChannels) {
6145+
for (auto& music : m_fmodMusic) {
61436146
if (music.second.m_channelID > 0) {
61446147
++count;
61456148
}
@@ -6161,9 +6164,9 @@ class FMODAudioEngine : cocos2d::CCNode {
61616164
TodoReturn fadeMusic(float, int, float, float);
61626165
void fadeOutMusic(float, int) = ios 0x141e24, win 0x5c500, m1 0x35d940, imac 0x3d7e20;
61636166
gd::string getActiveMusic(int);
6164-
FMOD::Channel* getActiveMusicChannel(int musicChannel) = win inline, imac 0x3cf390, m1 0x356984, ios 0x13d850 {
6165-
// TODO: this might do other checks or whatever but i cant be bothered
6166-
return m_channelIDToChannel[m_musicChannels[musicChannel].m_channelID];
6167+
FMOD::Channel* getActiveMusicChannel(int musicID) = win inline, imac 0x3cf390, m1 0x356984, ios 0x13d850 {
6168+
if (m_fmodMusic.count(musicID) == 0) return nullptr;
6169+
return channelForChannelID(m_fmodMusic[musicID].m_channelID);
61676170
}
61686171
float getBackgroundMusicVolume() = ios 0x140278, win inline, imac 0x3d4880, m1 0x35ad68 {
61696172
return m_musicVolume;
@@ -6179,7 +6182,7 @@ class FMODAudioEngine : cocos2d::CCNode {
61796182
TodoReturn getMusicTime(int);
61806183
unsigned int getMusicTimeMS(int channel) = win 0x5c2d0, m1 0x35d310, imac 0x3d7660, ios 0x141ab4;
61816184
TodoReturn getNextChannelID();
6182-
TodoReturn getTweenContainer(AudioTargetType);
6185+
gd::map<std::pair<int, int>, FMODSoundTween>& getTweenContainer(AudioTargetType);
61836186
bool isAnyPersistentPlaying();
61846187
bool isChannelStopping(int);
61856188
bool isEffectLoaded(gd::string path);
@@ -6204,7 +6207,7 @@ class FMODAudioEngine : cocos2d::CCNode {
62046207
m_globalChannel->setPaused(true);
62056208
}
62066209
void pauseAllMusic(bool force) = ios 0x1402f0, win inline, imac 0x3d4930, m1 0x35ade0 {
6207-
for (auto& [id, channel] : m_musicChannels) {
6210+
for (auto& [id, channel] : m_fmodMusic) {
62086211
if (force || !channel.m_dontReset) {
62096212
if (auto ch = this->channelForChannelID(channel.m_channelID))
62106213
ch->setPaused(true);
@@ -6255,6 +6258,7 @@ class FMODAudioEngine : cocos2d::CCNode {
62556258
TodoReturn saveAudioState(FMODAudioState&) = win 0x558f0;
62566259
void setBackgroundMusicVolume(float volume) = win inline, imac 0x3d4890, m1 0x35ad70, ios 0x140280 {
62576260
m_musicVolume = volume;
6261+
m_musicFadeStart = 0.f;
62586262
if (m_backgroundMusicChannel) m_backgroundMusicChannel->setVolume(volume);
62596263
}
62606264
void setChannelPitch(int, AudioTargetType, float);
@@ -6277,8 +6281,8 @@ class FMODAudioEngine : cocos2d::CCNode {
62776281
void stopChannel(FMOD::Channel*, bool, float) = win 0x58810;
62786282
TodoReturn stopChannel(int, AudioTargetType, bool, float);
62796283
TodoReturn stopChannel(int);
6280-
TodoReturn stopChannelTween(int, AudioTargetType, AudioModType);
6281-
TodoReturn stopChannelTweens(int, AudioTargetType);
6284+
void stopChannelTween(int, AudioTargetType, AudioModType);
6285+
void stopChannelTweens(int, AudioTargetType);
62826286
TodoReturn stopMusic(int);
62836287
TodoReturn stopMusicNotInSet(gd::unordered_set<int>&);
62846288
TodoReturn storeEffect(FMOD::Sound* sound, gd::string path) = win 0x59510;
@@ -6289,23 +6293,22 @@ class FMODAudioEngine : cocos2d::CCNode {
62896293
TodoReturn unloadEffect(gd::string path);
62906294
TodoReturn unregisterChannel(int);
62916295
void updateBackgroundFade();
6292-
TodoReturn updateChannel(int, AudioTargetType, AudioModType, float, float);
6293-
TodoReturn updateChannelTweens(float) = imac 0x3cd220;
6296+
void updateChannel(int channel, AudioTargetType target, AudioModType mod, float duration, float value) = win 0x58b60;
6297+
void updateChannelTweens(float) = win 0x567c0, imac 0x3cd220;
62946298
void updateMetering();
62956299
void updateQueuedEffects() = win 0x5aec0;
62966300
void updateQueuedMusic();
62976301
void updateReverb(FMODReverbPreset, bool) = win 0x54400, imac 0x3cac50, m1 0x353444;
62986302
void updateTemporaryEffects() = win 0x5b410, imac 0x3cc820;
62996303
TodoReturn waitUntilSoundReady(FMOD::Sound*);
63006304

6301-
// not sure on the name, the system is quite confusing
6302-
gd::unordered_map<int, FMODMusic> m_musicChannels;
6303-
gd::unordered_map<gd::string, FMODSound> m_unkMap180;
6304-
gd::unordered_set<gd::string> m_unkMap1c0;
6305+
gd::unordered_map<int, FMODMusic> m_fmodMusic;
6306+
gd::unordered_map<gd::string, FMODSound> m_fmodSounds;
6307+
gd::unordered_set<gd::string> m_temporarySoundPaths;
63056308
float m_musicVolume;
63066309
float m_sfxVolume;
6307-
int m_unusedInt164;
6308-
int m_unusedInt168;
6310+
float m_backgroundMusicFade;
6311+
float m_musicFadeStart;
63096312
float m_pulse1;
63106313
float m_pulse2;
63116314
float m_pulse3;
@@ -6316,60 +6319,58 @@ class FMODAudioEngine : cocos2d::CCNode {
63166319
FMOD::DSP* m_mainDSP;
63176320
FMOD::DSP* m_globalChannelDSP;
63186321
FMOD::ChannelGroup* m_globalChannel;
6319-
FMOD::ChannelGroup* m_channelGroup2;
6322+
FMOD::ChannelGroup* m_reverbChannel;
63206323
FMOD_RESULT m_lastResult;
63216324
int m_sampleRate;
63226325
bool m_reducedQuality;
63236326
bool m_allAudioPaused;
63246327
int m_musicOffset;
6325-
bool m_unkBool1a8;
6326-
int m_unkInt1ac;
6328+
bool m_stopped;
63276329
FMODAudioState m_audioState;
6328-
gd::vector<FMOD::Sound*> m_unkSoundVector;
6329-
gd::unordered_map<int, FMOD::DSP*> m_unkDSPMap384;
6330+
gd::vector<FMOD::Sound*> m_removedSounds;
6331+
gd::unordered_map<int, FMOD::DSP*> m_channelIDToDSP;
63306332
gd::unordered_map<int, FMOD::Channel*> m_channelIDToChannel;
6331-
gd::unordered_set<int> m_unkIntSet3bc;
6333+
gd::unordered_set<int> m_stoppedChannels;
63326334
FMODReverbPreset m_reverbPreset;
6333-
gd::unordered_map<int, int> m_unkMapIntInt3dc;
6334-
gd::unordered_map<int, int> m_unkMapIntInt3f8;
6335-
gd::unordered_map<int, gd::string> m_unkMapIntString414;
6335+
gd::unordered_map<int, int> m_channelIDToEffectID;
6336+
gd::unordered_map<int, int> m_effectIDToChannelID;
6337+
gd::unordered_map<int, gd::string> m_channelIDToSoundPath;
63366338
gd::vector<FMODQueuedEffect> m_queuedEffects;
6337-
gd::unordered_map<gd::string, FMOD::Sound*> m_unkMapStringSound43c;
6338-
gd::unordered_map<int, FMOD::ChannelGroup*> m_unkMapIntChannelGroup458;
6339-
gd::unordered_map<int, FMOD::ChannelGroup*> m_unkMapIntChannelGroup474;
6340-
int m_unkInt490;
6341-
int m_unkInt494;
6342-
int m_unkInt498;
6343-
int m_unkInt49c;
6344-
int m_unkInt4a0;
6345-
int m_unkInt4a4;
6346-
int m_unkInt4a8;
6347-
int m_unkInt4ac;
6339+
gd::unordered_map<gd::string, FMOD::Sound*> m_soundPathToSound;
6340+
gd::unordered_map<int, FMOD::ChannelGroup*> m_globalChannelGroups;
6341+
gd::unordered_map<int, FMOD::ChannelGroup*> m_reverbChannelGroups;
6342+
bool m_showAudioVisualizer;
6343+
float m_musicVisualizerTime;
6344+
float m_musicVisualizerPeak;
6345+
float m_musicVisualizerVolume;
6346+
float m_sfxVisualizerTime;
6347+
float m_sfxVisualizerPeak;
6348+
float m_sfxVisualizerVolume;
63486349
}
63496350

63506351
[[link(android), depends(FMODSoundTween), depends(FMODQueuedMusic), depends(FMODSoundState)]]
63516352
class FMODAudioState {
63526353
// ~FMODAudioState();
63536354
// FMODAudioState() = win 0x52e40, ios 0x12ad78, m1 inline, imac inline {
6354-
// m_unkFloat1 = 0.f;
6355-
// m_unkFloat2 = 0.f;
6355+
// m_interval = 0.f;
6356+
// m_elapsed = 0.f;
63566357
// }
63576358

6358-
float m_unkFloat1;
6359-
float m_unkFloat2;
6360-
gd::map<std::pair<int,int>,FMODSoundTween> m_unkMapPairIntIntFMODSoundTween1;
6361-
gd::map<std::pair<int,int>,FMODSoundTween> m_unkMapPairIntIntFMODSoundTween2;
6362-
gd::map<std::pair<int,int>,FMODSoundTween> m_unkMapPairIntIntFMODSoundTween3;
6363-
gd::unordered_map<int,float> m_volumeForChannels1;
6364-
gd::unordered_map<int,float> m_volumeForChannels2;
6365-
gd::unordered_map<int,float> m_pitchForChannels1;
6366-
gd::unordered_map<int,float> m_volumeForChannels3;
6367-
gd::unordered_map<int,float> m_volumeForChannels4;
6368-
gd::unordered_map<int,float> m_pitchForChannels2;
6369-
gd::unordered_map<int,float> m_unkMapIntFloat1;
6370-
gd::unordered_map<int,float> m_unkMapIntFloat2;
6371-
gd::unordered_map<int,float> m_unkMapIntFloat3;
6372-
gd::unordered_map<int,float> m_unkMapIntFloat4;
6359+
float m_interval;
6360+
float m_elapsed;
6361+
gd::map<std::pair<int,int>,FMODSoundTween> m_tweensForEffectChannels;
6362+
gd::map<std::pair<int,int>,FMODSoundTween> m_tweensForEffectGroups;
6363+
gd::map<std::pair<int,int>,FMODSoundTween> m_tweensForMusicChannels;
6364+
gd::unordered_map<int,float> m_volumeForEffectChannels;
6365+
gd::unordered_map<int,float> m_volumeFactorForEffectChannels;
6366+
gd::unordered_map<int,float> m_pitchForEffectChannels;
6367+
gd::unordered_map<int,float> m_volumeForEffectGroups;
6368+
gd::unordered_map<int,float> m_volumeFactorForEffectGroups;
6369+
gd::unordered_map<int,float> m_pitchForEffectGroups;
6370+
gd::unordered_map<int,float> m_volumeForMusicChannels;
6371+
gd::unordered_map<int,float> m_volumeFactorForMusicChannels;
6372+
gd::unordered_map<int,float> m_pitchForMusicChannels;
6373+
gd::unordered_map<int,float> m_intervalForEffects;
63736374
gd::unordered_map<int,FMODQueuedMusic> m_queuedMusicForChannels1;
63746375
gd::unordered_map<int,FMODQueuedMusic> m_queuedMusicForChannels2;
63756376
gd::unordered_map<int,FMODSoundState> m_soundStateForChannels;
@@ -6384,7 +6385,7 @@ class FMODLevelVisualizer : cocos2d::CCNode {
63846385

63856386
virtual bool init() = win 0x2971d0, imac 0x29d020, m1 0x2447d0, ios 0x2e0c20;
63866387

6387-
void updateVisualizer(float, float, float) = ios 0x2e1008, win 0x297690, imac 0x29d460, m1 0x244c40;
6388+
void updateVisualizer(float volume, float peak, float time) = ios 0x2e1008, win 0x297690, imac 0x29d460, m1 0x244c40;
63886389

63896390
float m_width;
63906391
}

bindings/include/Geode/Enums.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ enum class FormatterType {
390390
Float = 1
391391
};
392392
enum class AudioModType {
393-
Speed = 0,
394-
Volume = 1
393+
Volume = 0,
394+
Pitch = 1
395395
};
396396
enum class GJAreaActionType {
397397
Move = 0,

0 commit comments

Comments
 (0)