| 334 | } |
| 335 | |
| 336 | void 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 | |
| 368 | std::string CSequenceParser::PrintSequence() const |
| 369 | { |