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(int32_t startX, int32_t width, int32_t startY, int32_t height) {
73 renderColumnLabel(startX, width, startY);
75 DEF_STACK_STRING_BUF(paramValue, 5);
77 if (this->getValue() == 128) {
78 paramValue.append(l10n::get(l10n::String::STRING_FOR_NONE));
79 sizeX = kTextSpacingX;
80 sizeY = kTextSpacingY;
83 paramValue.appendInt(getValue());
84 sizeX = kTextTitleSpacingX;
85 sizeY = kTextTitleSizeY;
87 image.drawStringCentered(paramValue, startX, startY + sizeY + 2, sizeX, sizeY, width);
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:190