//
// CustomSongWidget::deleteSong from 0x1000fcdb4 to 0x1000fced0 (284 bytes)
//
// 1 xrefs:
// > CustomSongWidget::FLAlert_Clicked @ 0x1000fe724
//
// 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 CustomSongWidget::deleteSong(CustomSongWidget *a1)
{
FMODAudioEngine *v2; // x20
MusicDownloadManager *v3; // x0
int isMusicPlaying; // w0
int v5; // w20
FMODAudioEngine *v6; // x0
MusicDownloadManager *v7; // x0
cocos2d::CCLabelBMFont *m_errorLabel; // x0
float v9; // s0
float v10; // s1
__int16 v11; // [xsp+4h] [xbp-2Ch] BYREF
char v12; // [xsp+6h] [xbp-2Ah]
void *__p[2]; // [xsp+8h] [xbp-28h] BYREF
char v14; // [xsp+1Fh] [xbp-11h]
if ( !a1->m_songInfoObject )
return;
v2 = FMODAudioEngine::sharedEngine();
v3 = MusicDownloadManager::sharedState();
MusicDownloadManager::pathForSong(__p, v3, (unsigned int)a1->m_songInfoObject->m_songID);
isMusicPlaying = FMODAudioEngine::isMusicPlaying(v2, __p, 0);
v5 = isMusicPlaying;
if ( v14 < 0 )
{
operator delete(__p[0]);
if ( !v5 )
goto LABEL_5;
goto LABEL_4;
}
if ( isMusicPlaying )
{
LABEL_4:
v6 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v6, 1);
}
LABEL_5:
v7 = MusicDownloadManager::sharedState();
MusicDownloadManager::deleteSong(v7, a1->m_songInfoObject->m_songID);
CustomSongWidget::updateSongInfo(a1);
m_errorLabel = a1->m_errorLabel;
v12 = 0;
v11 = 25855;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int16 *))m_errorLabel->setColor)(m_errorLabel, &v11);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_errorLabel->setString)(
a1->m_errorLabel,
"Song Deleted");
if ( a1->m_isMusicLibrary )
{
v9 = 140.0;
v10 = 0.35;
}
else
{
v9 = 230.0;
v10 = 0.4;
}
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_errorLabel, v9, v10, 0.0);
CustomSongWidget::showError(a1, 1);
}