//
// MusicDownloadManager::onDownloadMusicLibraryCompleted from 0x45d4e4 to 0x45d58a (166 bytes)
//
// 0 xrefs:
//
// 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 MusicDownloadManager::onDownloadMusicLibraryCompleted(
MusicDownloadManager *a1,
cocos2d::extension::CCHttpClient *a2,
cocos2d::extension::CCHttpResponse *a3)
{
FILE *v5; // r8
char *filename[2]; // [sp+0h] [bp-8h] BYREF
filename[0] = (char *)a1;
filename[1] = (char *)a2;
MusicDownloadManager::removeDLFromActive(a1, "dl_music_l");
if ( a3 && a3->_succeed )
{
MusicDownloadManager::pathForSongFolder((MusicDownloadManager *)filename, a1, 0, a3->_succeed);
sub_774544((int)filename, "musiclibrary.dat");
v5 = fopen(filename[0], "wb");
if ( v5
&& (fwrite(a3->_responseData.m_start, 1u, a3->_responseData.m_finish - a3->_responseData.m_start, v5),
fclose(v5),
MusicDownloadManager::parseMusicLibrary(a1),
MusicDownloadManager::isMusicLibraryLoaded(a1)) )
{
MusicDownloadManager::musicActionFinished(a1, UpdateMusicLibrary|0x1);
}
else
{
MusicDownloadManager::musicActionFailed(a1, UpdateMusicLibrary|0x1);
}
sub_774008(filename);
}
else
{
MusicDownloadManager::musicActionFailed(a1, UpdateMusicLibrary|0x1);
}
}