MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / GetSegmentIndexValue

Method GetSegmentIndexValue

lib/macro/macro-action-variable.cpp:687–716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

685}
686
687int MacroActionVariable::GetSegmentIndexValue() const
688{
689 auto m = GetMacro();
690 if (!m) {
691 return -1;
692 }
693
694 auto segment = _macroSegment.lock();
695 if (!segment) {
696 return -1;
697 }
698
699 if (_action == Action::SET_CONDITION_VALUE) {
700 auto it = std::find(m->Conditions().begin(),
701 m->Conditions().end(), segment);
702 if (it != m->Conditions().end()) {
703 return std::distance(m->Conditions().begin(), it);
704 }
705 return -1;
706 } else if (_action == Action::SET_ACTION_VALUE) {
707 auto it = std::find(m->Actions().begin(), m->Actions().end(),
708 segment);
709 if (it != m->Actions().end()) {
710 return std::distance(m->Actions().begin(), it);
711 }
712 return -1;
713 }
714
715 return -1;
716}
717
718void MacroActionVariable::ResolveVariablesToFixedValues()
719{

Callers 3

UpdateEntryDataMethod · 0.80

Calls 3

GetMacroFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected