| 870 | } |
| 871 | |
| 872 | void 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 | |
| 888 | bool CNoiseSelector::CheckFlag(int8_t val, int flag) { |
| 889 | if (flag >= 0 && flag < (int)std::size(S5B_FLAGS)) |
nothing calls this directly
no test coverage detected