//
// FindBPMLayer::init from 0x309a60 to 0x309b44 (228 bytes)
//
// 1 xrefs:
// > FindBPMLayer::create @ 0x309c2a
//
// 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
//
bool FindBPMLayer::init(FindBPMLayer *a1, int a2)
{
_BOOL4 v4; // r7
cocos2d::CCDirector *v5; // r0
cocos2d::CCLabelBMFont *v6; // r0
cocos2d::CCLabelBMFont *m_bpmLabel; // r8
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
MusicDownloadManager *v9; // r0
SongInfoObject *SongInfoObject; // r0
const char *m_BPM; // r1
cocos2d::CCLabelBMFont *m_infoLabel; // r5
void (__fastcall *setString)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // r8
cocos2d::CCString *v15; // r0
const char *CString; // r0
cocos2d::CCSize v17; // [sp+4h] [bp-18h] BYREF
cocos2d::CCPoint v18; // [sp+Ch] [bp-10h] BYREF
v4 = CreateGuidelinesLayer::init(a1, nullptr, BPMFinder);
if ( v4 )
{
a1->m_songID = a2;
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v17, v5);
v6 = cocos2d::CCLabelBMFont::create();
a1->m_bpmLabel = v6;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v6, 1);
m_bpmLabel = a1->m_bpmLabel;
setPosition = m_bpmLabel->setPosition;
cocos2d::CCPoint::CCPoint(&v18, v17.width * 0.5, v17.height * 0.5);
setPosition(m_bpmLabel, &v18);
cocos2d::CCArray::addObject(a1->m_recordingObjects, a1->m_bpmLabel);
v9 = MusicDownloadManager::sharedState();
SongInfoObject = MusicDownloadManager::getSongInfoObject(v9, a1->m_songID);
if ( SongInfoObject )
{
m_BPM = (const char *)SongInfoObject->m_BPM;
if ( (int)m_BPM > 0 )
{
m_infoLabel = a1->m_infoLabel;
setString = m_infoLabel->setString;
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"BPM: %i", m_BPM);
CString = cocos2d::CCString::getCString(v15);
setString(m_infoLabel, (const unsigned __int8 *)CString);
}
}
CreateGuidelinesLayer::toggleItems(a1, 0);
}
return v4;
}