29 using Integer::Integer;
31 [[nodiscard]] int32_t getMaxValue()
const override {
return 128; }
33 void drawInteger(int32_t textWidth, int32_t textHeight, int32_t yPixel)
override {
37 if (this->getValue() == 128) {
38 text = l10n::get(l10n::String::STRING_FOR_NONE);
41 intToString(this->getValue(), buffer, 1);
44 canvas.
drawStringCentred(text, yPixel + OLED_MAIN_TOPMOST_PIXEL, textWidth, textHeight);
47 void drawValue()
override {
48 if (this->getValue() == 128) {
49 display->setText(l10n::get(l10n::String::STRING_FOR_NONE));
52 display->setTextAsNumber(this->getValue());
57 return getCurrentOutputType() == OutputType::MIDI_OUT;
61 this->setValue(this->getValue() + offset);
62 if (this->getValue() >= 129) {
63 this->setValue(this->getValue() - 129);
65 else if (this->getValue() < 0) {
66 this->setValue(this->getValue() + 129);
71 void renderInHorizontalMenu(
const SlotPosition& slot)
override {
74 DEF_STACK_STRING_BUF(paramValue, 5);
75 int32_t size_x, size_y;
76 if (this->getValue() == 128) {
77 paramValue.append(l10n::get(l10n::String::STRING_FOR_NONE));
78 size_x = kTextSpacingX;
79 size_y = kTextSpacingY;
82 paramValue.appendInt(getValue());
83 size_x = kTextTitleSpacingX;
84 size_y = kTextTitleSizeY;
86 image.drawStringCentered(paramValue, slot.start_x, slot.start_y + kHorizontalMenuSlotYOffset, size_x, size_y,
void drawStringCentred(char const *string, int32_t pixelY, int32_t textWidth, int32_t textHeight, int32_t centrePos=OLED_MAIN_WIDTH_PIXELS/2)
Definition canvas.cpp:311