//
// AudioAssetsBrowser::setupList from 0x59b640 to 0x59b790 (336 bytes)
//
// 2 xrefs:
// > AudioAssetsBrowser::trySetupAudioBrowser @ 0x59b7ca
// > AudioAssetsBrowser::init @ 0x59bbac
//
// 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 AudioAssetsBrowser::setupList(AudioAssetsBrowser *a1)
{
cocos2d::CCArray *m_songInfoObjects; // r0
cocos2d::CCDirector *v3; // r0
cocos2d::CCTouchDispatcher *v4; // r0
cocos2d::CCArray *v5; // r0
int *m_finish; // r8
int *m_start; // r7
cocos2d::CCArray *v8; // r5
int v9; // t1
MusicDownloadManager *v10; // r0
SongInfoObject *SongInfoObject; // r1
cocos2d::CCDirector *v12; // r0
CustomListView *v13; // r0
GJCommentListLayer *v14; // r0
GJCommentListLayer *m_songList; // r7
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCSize v17; // [sp+14h] [bp-18h] BYREF
cocos2d::CCPoint v18; // [sp+1Ch] [bp-10h] BYREF
m_songInfoObjects = a1->m_songInfoObjects;
if ( m_songInfoObjects )
cocos2d::CCObject::release(m_songInfoObjects);
if ( a1->m_songList )
{
v3 = cocos2d::CCDirector::sharedDirector();
v4 = v3->getTouchDispatcher(v3);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v4, a1->m_songList);
m_songInfoObjects = (cocos2d::CCArray *)((int (__fastcall *)(GJCommentListLayer *))a1->m_songList->removeMeAndCleanup)(a1->m_songList);
a1->m_songList = nullptr;
}
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(m_songInfoObjects);
m_finish = a1->m_songsIds.m_finish;
m_start = a1->m_songsIds.m_start;
v8 = v5;
while ( m_start != m_finish )
{
v9 = *m_start++;
v10 = MusicDownloadManager::sharedState();
SongInfoObject = MusicDownloadManager::getSongInfoObject(v10, v9);
if ( SongInfoObject )
cocos2d::CCArray::addObject(v8, SongInfoObject);
}
a1->m_songInfoObjects = v8;
cocos2d::CCObject::retain(v8);
v12 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v17, v12);
v13 = CustomListView::create(v8, (BoomListType)&a1->TableViewCellDelegate, 220.0, 340.0);
v14 = GJCommentListLayer::create(v13, (const char *)&unk_939830, (cocos2d::ccColor4B)-13487566, 340.0, 220.0, 1);
a1->m_songList = v14;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v14, 10);
m_songList = a1->m_songList;
setPosition = m_songList->setPosition;
cocos2d::CCPoint::CCPoint(&v18, (float)(v17.width - 340.0) * 0.5, (float)((float)(v17.height - 220.0) * 0.5) - 10.0);
setPosition(m_songList, &v18);
AudioAssetsBrowser::updatePageLabel(a1);
}