//
// SFXBrowser::setupSFXBrowser from 0x10043fa10 to 0x10043fb3e (302 bytes)
//
// 3 xrefs:
// > SFXBrowser::init @ 0x10043f498
// > SFXBrowser::trySetupSFXBrowser @ 0x10043f9c1
// > SFXBrowser::musicActionFinished @ 0x1004404c0
//
// 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::setupSFXBrowser(SFXBrowser *a1)
{
MusicDownloadManager *v1; // rax
unsigned int sizex2; // ecx
MusicDownloadManager *v3; // rax
SFXSearchResult *v4; // r14
MusicDownloadManager *v5; // rax
SFXFolderObject *SFXFolderObjectForID; // rax
MusicDownloadManager *v7; // rax
MusicDownloadManager *v8; // rax
unsigned int v9; // ecx
MusicDownloadManager *v10; // rax
MusicDownloadManager *v11; // rax
v1 = MusicDownloadManager::sharedState();
sizex2 = v1->m_customContentURL.m_data.m_short.sizex2;
if ( (sizex2 & 1) != 0 )
{
if ( v1->m_customContentURL.m_data.m_long.size )
goto LABEL_6;
}
else if ( sizex2 >> 1 )
{
goto LABEL_6;
}
v3 = MusicDownloadManager::sharedState();
MusicDownloadManager::getCustomContentURL(v3);
LABEL_6:
v4 = SFXSearchResult::create(a1->m_sfxID);
v5 = MusicDownloadManager::sharedState();
SFXFolderObjectForID = MusicDownloadManager::getSFXFolderObjectForID(v5, a1->m_sfxID);
if ( !SFXFolderObjectForID )
{
v7 = MusicDownloadManager::sharedState();
SFXFolderObjectForID = MusicDownloadManager::getSFXFolderObjectForID(v7, 1);
}
SFXSearchResult::setActiveFolder(v4, SFXFolderObjectForID);
((void (__fastcall *)(SFXSearchResult *, _QWORD))v4->updateObjects)(v4, (unsigned int)a1->m_sortType);
v4->m_startIndex = SFXSearchResult::getSelectedPage(v4, a1->m_sfxID, a1->m_cellAmount);
a1->m_snapToSelected = 1;
SFXBrowser::setupList(a1, v4);
a1->m_snapToSelected = 0;
if ( !MusicDownloadManager::sharedState()->m_requestedSfxLibraryDownloaded )
{
a1->m_autoUpdating = 1;
v8 = MusicDownloadManager::sharedState();
v9 = v8->m_customContentURL.m_data.m_short.sizex2;
if ( (v9 & 1) != 0 )
{
if ( v8->m_customContentURL.m_data.m_long.size )
goto LABEL_11;
}
else if ( v9 >> 1 )
{
LABEL_11:
a1->m_gettingURL = 0;
v10 = MusicDownloadManager::sharedState();
MusicDownloadManager::tryUpdateSFXLibrary(v10);
return;
}
a1->m_gettingURL = 1;
v11 = MusicDownloadManager::sharedState();
MusicDownloadManager::getCustomContentURL(v11);
}
}