//
// MusicDownloadManager::addMusicDownloadDelegate from 0x56bbc0 to 0x56bc00 (64 bytes)
//
// 11 xrefs:
// > MenuLayer::init @ 0x3fadce
// > EditorUI::init @ 0x48bf72
// > CustomSongWidget::init @ 0x4e4c9a
// > SetupSongTriggerPopup::init @ 0x658d32
// > CustomSFXWidget::init @ 0x6a7c76
// > sub_6BEA10 @ 0x6bf83a
// > NewsPopup::init @ 0x6c30ec
// > sub_6C6B24 @ 0x6c810a
// > AudioAssetsBrowser::init @ 0x6e2454
// > AudioAssetsPopup::init @ 0x7611d6
// > EditorSoundConfigInfoLayer::startSFXDownload @ 0x7887ce
//
// 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:52:33 +0000
//
int __fastcall MusicDownloadManager::addMusicDownloadDelegate(cocos2d::CCArray **this, MusicDownloadDelegate *a2)
{
unsigned int i; // r4
MusicDownloadDelegate *v5; // r1
int result; // r0
cocos2d::CCObject *v7; // r1
for ( i = 0; i < cocos2d::CCArray::count(*(this + 68)); ++i )
{
result = cocos2d::CCArray::objectAtIndex(*(this + 68), i);
if ( *(MusicDownloadDelegate **)(result + 264) == a2 )
return result;
}
v7 = MusicDelegateHandler::create(a2, v5);
return cocos2d::CCArray::addObject(*(this + 68), v7);
}