MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / ParseSequence

Method ParseSequence

Source/SequenceParser.cpp:336–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

334}
335
336void CSequenceParser::ParseSequence(std::string_view sv)
337{
338 auto Setting = static_cast<seq_setting_t>(m_pSequence->GetSetting());
339 m_pSequence->Clear();
340 m_pSequence->SetSetting(Setting);
341 m_iPushedCount = 0;
342
343 const auto PushFunc = [&] {
344 while (m_pConversion->IsReady() && m_iPushedCount < MAX_SEQUENCE_ITEMS)
345 m_pSequence->SetItem(m_iPushedCount++, m_pConversion->GetValue());
346 };
347
348 int Loop = -1, Release = -1;
349
350 m_pConversion->OnStart();
351 PushFunc();
352 for (auto x : re::tokens(sv)) {
353 auto str = re::sv_from_submatch(x[0]);
354 if (str == "|")
355 Loop = m_iPushedCount;
356 else if (str == "/")
357 Release = m_iPushedCount;
358 else if (m_pConversion->ToValue(str))
359 PushFunc();
360 }
361 m_pConversion->OnFinish();
362 PushFunc();
363 m_pSequence->SetItemCount(m_iPushedCount);
364 m_pSequence->SetLoopPoint(Loop);
365 m_pSequence->SetReleasePoint(Release);
366}
367
368std::string CSequenceParser::PrintSequence() const
369{

Callers 2

TranslateMMLMethod · 0.80
mainFunction · 0.80

Calls 14

tokensFunction · 0.85
sv_from_submatchFunction · 0.85
GetSettingMethod · 0.80
SetSettingMethod · 0.80
SetItemMethod · 0.80
ToValueMethod · 0.80
SetItemCountMethod · 0.80
SetLoopPointMethod · 0.80
SetReleasePointMethod · 0.80
ClearMethod · 0.45
IsReadyMethod · 0.45
GetValueMethod · 0.45

Tested by 1

mainFunction · 0.64