//
// CustomSongWidget::deleteSong from 0x3dfa60 to 0x3dfb36 (214 bytes)
//
// 1 xrefs:
// > CustomSongWidget::FLAlert_Clicked @ 0x3e032a
//
// 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 CustomSongWidget::deleteSong(CustomSongWidget *a1)
{
FMODAudioEngine *v2; // r7
MusicDownloadManager *v3; // r0
_BOOL4 isMusicPlaying; // r7
FMODAudioEngine *v5; // r0
MusicDownloadManager *v6; // r0
cocos2d::CCLabelBMFont *m_errorLabel; // r0
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r3
float v9; // r1
float v10; // r2
CustomSongWidget *v11; // [sp+0h] [bp-Ch] BYREF
v11 = a1;
if ( a1->m_songInfoObject )
{
v2 = FMODAudioEngine::sharedEngine();
v3 = MusicDownloadManager::sharedState();
MusicDownloadManager::pathForSong((MusicDownloadManager *)&v11, (int)v3);
isMusicPlaying = FMODAudioEngine::isMusicPlaying(v2, (int)&v11);
sub_774008(&v11);
if ( isMusicPlaying )
{
v5 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllMusic(v5, (bool)&dword_0 + 1);
}
v6 = MusicDownloadManager::sharedState();
MusicDownloadManager::deleteSong(v6, a1->m_songInfoObject->m_songID);
CustomSongWidget::updateSongInfo(a1);
m_errorLabel = a1->m_errorLabel;
setColor = m_errorLabel->setColor;
LOWORD(v11) = 25855;
BYTE2(v11) = 0;
setColor(m_errorLabel, (const cocos2d::ccColor3B *)&v11);
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);
}
}