//
// CustomSongWidget::updatePlaybackBtn from 0x14016c160 to 0x14016c27a (282 bytes)
//
// 3 xrefs:
// > CustomSongWidget::init @ 0x14016a686
// > CustomSongWidget::songStateChanged @ 0x14016c36d
// > ??> @ 0x140918158
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:27:29 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall CustomSongWidget::updatePlaybackBtn(__int64 a1)
{
__int64 *v2; // rdi
__int64 v3; // rcx
_QWORD *v4; // rbx
_QWORD *v5; // rcx
bool isMusicPlaying; // al
__int64 v7; // rbx
cocos2d::CCSpriteFrameCache *v8; // rax
const char *v9; // rdx
struct cocos2d::CCSpriteFrame *v10; // rax
_BYTE v11[40]; // [rsp+20h] [rbp-28h] BYREF
void *v12; // [rsp+58h] [rbp+10h]
void *v13; // [rsp+58h] [rbp+10h]
if ( *(_QWORD *)(a1 + 336) )
{
v2 = (__int64 *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 416) + 952LL))(*(_QWORD *)(a1 + 416));
v3 = qword_14090C070;
if ( !qword_14090C070 )
{
v12 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v12);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v3 = qword_14090C070;
}
v4 = (_QWORD *)MusicDownloadManager::pathForSong(v3, v11, *(unsigned int *)(*(_QWORD *)(a1 + 336) + 320LL));
v5 = (_QWORD *)qword_14090BF60;
if ( !qword_14090BF60 )
{
v13 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v5 = (_QWORD *)qword_14090BF60;
}
isMusicPlaying = FMODAudioEngine::isMusicPlaying(v5, v4);
v7 = *v2;
if ( isMusicPlaying )
{
v8 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v9 = "GJ_stopMusicBtn_001.png";
}
else
{
v8 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v9 = "GJ_playMusicBtn_001.png";
}
v10 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v8, v9);
(*(void (__fastcall **)(__int64 *, struct cocos2d::CCSpriteFrame *))(v7 + 1008))(v2, v10);
}
}