//
// FindBPMLayer::init from 0x10007e0f8 to 0x10007e210 (280 bytes)
//
// 1 xrefs:
// > FindBPMLayer::create @ 0x10007e0ac
//
// 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 __fastcall FindBPMLayer::init(FindBPMLayer *a1, int a2)
{
_BOOL4 v4; // w20
cocos2d::CCDirector *v5; // x0
cocos2d::CCLabelBMFont *v6; // x0
__n128 v7; // q0
cocos2d::CCLabelBMFont *m_bpmLabel; // x21
__n128 v9; // q1
MusicDownloadManager *v10; // x0
SongInfoObject *SongInfoObject; // x0
cocos2d::CCLabelBMFont *m_infoLabel; // x21
cocos2d::CCString *v13; // x0
const char *CString; // x0
_DWORD v16[4]; // [xsp+10h] [xbp-30h] BYREF
v4 = CreateGuidelinesLayer::init(a1, nullptr, BPMFinder);
if ( v4 )
{
a1->m_songID = a2;
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
v6 = cocos2d::CCLabelBMFont::create_1("BPM", "bigFont.fnt");
a1->m_bpmLabel = v6;
v7 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v6,
1);
m_bpmLabel = a1->m_bpmLabel;
v7.n128_f32[0] = *(float *)&v16[2] * 0.5;
v9.n128_f32[0] = *(float *)&v16[3] * 0.5;
sub_100022980(v7, v9, v16);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD *))m_bpmLabel->setPosition)(m_bpmLabel, v16);
sub_10024A2D0(a1->m_recordingObjects, a1->m_bpmLabel);
v10 = MusicDownloadManager::sharedState();
SongInfoObject = MusicDownloadManager::getSongInfoObject(v10, a1->m_songID);
if ( SongInfoObject && SongInfoObject->m_BPM >= 1 )
{
m_infoLabel = a1->m_infoLabel;
v13 = (cocos2d::CCString *)sub_100268F4C("BPM: %i", SongInfoObject->m_BPM);
CString = cocos2d::CCString::getCString(v13);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))m_infoLabel->setString)(m_infoLabel, CString);
}
CreateGuidelinesLayer::toggleItems(a1, 0);
}
return v4;
}