//
// GJBaseGameLayer::applySFXEditTrigger from 0x10015e5c0 to 0x10015e6d9 (281 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::activateSongEditTrigger @ 0x10015a61e
// > GJBaseGameLayer::activateSFXEditTrigger @ 0x10015adb6
// > GJBaseGameLayer::activateSFXEditTrigger @ 0x10015ae11
// > GJBaseGameLayer::activateSFXEditTrigger @ 0x10015ae45
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GJBaseGameLayer::applySFXEditTrigger(GJBaseGameLayer *a1, int a2, int a3, SFXTriggerGameObject *a4)
{
FMODAudioEngine *v6; // rax
FMODAudioEngine *v7; // rax
float m_pitch; // xmm0_4
FMODAudioEngine *v9; // rax
if ( *(_WORD *)&a1->m_isPracticeMode != 1 || a1->m_isPlatformer )
{
if ( a4->m_stop || a4->m_stopLoop )
{
v7 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopChannel(v7, a2, (AudioTargetType)a3, a4->m_stopLoop, 0.0);
if ( !a4->m_changeVolume )
{
LABEL_6:
if ( !a4->m_changeSpeed )
return;
goto LABEL_7;
}
}
else if ( !a4->m_changeVolume )
{
goto LABEL_6;
}
m_pitch = a4->m_pitch;
if ( m_pitch <= 0.0 )
{
FMODAudioEngine::sharedEngine();
m_pitch = FMODAudioEngine::pitchForIdx(a4->m_speed);
}
v9 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::updateChannel(v9, a2, (AudioTargetType)a3, Pitch, a4->m_duration, m_pitch);
if ( a4->m_changeSpeed )
{
LABEL_7:
v6 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::updateChannel(v6, a2, (AudioTargetType)a3, Volume, a4->m_duration, a4->m_volume);
}
}
}