//
// CustomSongWidget::updatePlaybackBtn from 0x4e29ac to 0x4e2a42 (150 bytes)
//
// 2 xrefs:
// > CustomSongWidget::init @ 0x4e4cb4
// > CustomSongWidget::songStateChanged @ 0x4e5002
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:51:02 +0000
//
int __fastcall CustomSongWidget::updatePlaybackBtn(int this, int a2, int a3, int a4)
{
FMODAudioEngine *v4; // r6
MusicDownloadManager *v5; // r8
int v6; // r0
int v7; // r3
_BOOL4 isMusicPlaying; // r7
cocos2d::CCSpriteFrameCache *v9; // r0
int (__fastcall *v10)(FMODAudioEngine *, int); // r4
cocos2d::CCSpriteFrameCache *v11; // r0
const char *v12; // r1
int v13; // r0
_DWORD v14[4]; // [sp+0h] [bp-10h] BYREF
v14[0] = this;
v14[1] = a2;
v14[2] = a3;
v14[3] = a4;
if ( *(_DWORD *)(this + 272) )
{
v4 = (FMODAudioEngine *)(*(int (__fastcall **)(_DWORD))(**(_DWORD **)(this + 312) + 536))(*(_DWORD *)(this + 312));
v5 = (MusicDownloadManager *)FMODAudioEngine::sharedEngine(v4);
v6 = MusicDownloadManager::sharedState(v5);
MusicDownloadManager::pathForSong((MusicDownloadManager *)v14, v6);
isMusicPlaying = FMODAudioEngine::isMusicPlaying(v5, (unsigned __int8 *)v14, 0, v7);
v9 = (cocos2d::CCSpriteFrameCache *)std::string::~string((int)v14);
v10 = *(int (__fastcall **)(FMODAudioEngine *, int))(*(_DWORD *)v4 + 580);
v11 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v9);
if ( isMusicPlaying )
v12 = "GJ_stopMusicBtn_001.png";
else
v12 = "GJ_playMusicBtn_001.png";
v13 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v11, v12);
return v10(v4, v13);
}
return this;
}