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

Method ModifyFlag

Source/GraphEditorComponentImpl.cpp:872–886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870}
871
872void CNoiseSelector::ModifyFlag(int idx, int flag) {
873 if (auto pSeq = parent_.GetSequence()) {
874 last_idx_ = idx;
875 last_flag_ = flag;
876 int8_t ItemValue = pSeq->GetItem(idx);
877 auto flagMode = flag == 0 ? s5b_mode_t::Envelope : flag == 1 ? s5b_mode_t::Square : s5b_mode_t::Noise;
878 if (enable_flag_)
879 ItemValue |= value_cast(flagMode);
880 else
881 ItemValue &= ~value_cast(flagMode);
882
883 pSeq->SetItem(idx, ItemValue);
884 parent_.ItemModified(); // // //
885 }
886}
887
888bool CNoiseSelector::CheckFlag(int8_t val, int flag) {
889 if (flag >= 0 && flag < (int)std::size(S5B_FLAGS))

Callers

nothing calls this directly

Calls 5

value_castFunction · 0.85
GetItemMethod · 0.80
SetItemMethod · 0.80
ItemModifiedMethod · 0.80
GetSequenceMethod · 0.45

Tested by

no test coverage detected