33 using SelectedNote::SelectedNote;
35 [[nodiscard]] int32_t getMaxValue()
const override {
return (kNumProbabilityValues | 127); }
36 [[nodiscard]] int32_t getMinValue()
const override {
return 1; }
44 Note* leftMostNote = instrumentClipView.getLeftMostNotePressed();
47 this->setValue(leftMostNote->getProbability());
52 instrumentClipView.adjustNoteProbabilityWithOffset(offset);
58 bool latching =
false;
60 intToString(getProbabilityValue(latching), buffer);
63 strcat(buffer,
" (L)");
66 OLED::main.drawStringCentred(buffer, 18 + OLED_MAIN_TOPMOST_PIXEL, kTextHugeSpacingX, kTextHugeSizeY);
69 void renderInHorizontalMenu(
const SlotPosition& slot)
override {
71 bool latching =
false;
73 intToString(getProbabilityValue(latching), buffer);
74 strcat(buffer, latching ?
"L" :
"%");
76 OLED::main.drawStringCentered(buffer, slot.start_x, slot.start_y + kHorizontalMenuSlotYOffset, kTextSpacingX,
77 kTextSpacingY, slot.width);
80 void drawValue()
override {
82 bool latching =
false;
84 intToString(getProbabilityValue(latching), buffer);
86 display->setText(buffer,
true, latching ? 3 : 255);
90 bool latching =
false;
91 valueBuf.appendInt(getProbabilityValue(latching));
95 valueBuf.append(
" ltch");
99 void writeCurrentValue()
override { ; }
102 int32_t getProbabilityValue(
bool& latching) {
103 int32_t probability = this->getValue();
106 if (probability > kNumProbabilityValues) {
111 return probability * 5;