32 using SelectedNoteRow::SelectedNoteRow;
34 [[nodiscard]] int32_t getMaxValue()
const override {
return (kNumProbabilityValues | 127); }
35 [[nodiscard]] int32_t getMinValue()
const override {
return 1; }
43 char modelStackMemory[MODEL_STACK_MAX_SIZE];
47 if (modelStackWithNoteRow->getNoteRowAllowNull() !=
nullptr) {
48 NoteRow* noteRow = modelStackWithNoteRow->getNoteRowAllowNull();
49 this->setValue(noteRow->probabilityValue);
55 int32_t newValue = instrumentClipView.setNoteRowProbabilityWithOffset(offset);
57 this->setValue(newValue);
64 bool latching =
false;
66 intToString(getProbabilityValue(latching), buffer);
69 strcat(buffer,
" (L)");
72 OLED::main.drawStringCentred(buffer, 18 + OLED_MAIN_TOPMOST_PIXEL, kTextHugeSpacingX, kTextHugeSizeY);
75 void renderInHorizontalMenu(
const SlotPosition& slot)
override {
77 bool latching =
false;
79 intToString(getProbabilityValue(latching), buffer);
80 strcat(buffer, latching ?
"L" :
"%");
82 OLED::main.drawStringCentered(buffer, slot.start_x, slot.start_y + kHorizontalMenuSlotYOffset, kTextSpacingX,
83 kTextSpacingY, slot.width);
86 void drawValue()
override {
88 bool latching =
false;
90 intToString(getProbabilityValue(latching), buffer);
92 display->setText(buffer,
true, latching ? 3 : 255);
96 bool latching =
false;
97 valueBuf.appendInt(getProbabilityValue(latching));
101 valueBuf.append(
" ltch");
105 void writeCurrentValue()
override { ; }
108 int32_t getProbabilityValue(
bool& latching) {
109 int32_t probability = this->getValue();
112 if (probability > kNumProbabilityValues) {
117 return probability * 5;