//
// SFXBrowser::musicActionFinished from 0x100440450 to 0x10044052d (221 bytes)
//
// 2 xrefs:
// > sub_100440530 @ 0x10044053c
// > ??> @ 0x100938668
//
// 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 SFXBrowser::musicActionFinished(SFXBrowser *a1, GJMusicAction a2)
{
MusicDownloadManager *v2; // rax
unsigned int sizex2; // ecx
MusicDownloadManager *v4; // rax
MusicDownloadManager *v5; // rax
unsigned int v6; // ebx
MusicDownloadManager *v7; // rax
std::size_t size; // rbx
if ( a2 == DownloadOrUpdate && a1->m_gettingURL )
{
a1->m_autoUpdating = 1;
v2 = MusicDownloadManager::sharedState();
sizex2 = v2->m_customContentURL.m_data.m_short.sizex2;
if ( (sizex2 & 1) != 0 )
{
if ( v2->m_customContentURL.m_data.m_long.size )
goto LABEL_5;
}
else if ( sizex2 >> 1 )
{
LABEL_5:
a1->m_gettingURL = 0;
v4 = MusicDownloadManager::sharedState();
MusicDownloadManager::tryUpdateSFXLibrary(v4);
return;
}
a1->m_gettingURL = 1;
v7 = MusicDownloadManager::sharedState();
goto LABEL_15;
}
if ( MusicDownloadManager::sharedState()->m_sfxObjects )
{
SFXBrowser::setupSFXBrowser(a1);
return;
}
v5 = MusicDownloadManager::sharedState();
v6 = v5->m_customContentURL.m_data.m_short.sizex2;
if ( (v6 & 1) == 0 )
{
v7 = MusicDownloadManager::sharedState();
if ( !(v6 >> 1) )
goto LABEL_15;
LABEL_12:
MusicDownloadManager::downloadSFXLibrary(v7);
return;
}
size = v5->m_customContentURL.m_data.m_long.size;
v7 = MusicDownloadManager::sharedState();
if ( size )
goto LABEL_12;
LABEL_15:
MusicDownloadManager::getCustomContentURL(v7);
}