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 {
34 oled_canvas::Canvas& canvas = OLED::main;
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)
override {
72 oled_canvas::Canvas& image = OLED::main;
74 DEF_STACK_STRING_BUF(paramValue, 5);
76 if (this->getValue() == 128) {
77 paramValue.append(l10n::get(l10n::String::STRING_FOR_NONE));
78 sizeX = kTextSpacingX;
79 sizeY = kTextSpacingY;
82 paramValue.appendInt(getValue());
83 sizeX = kTextTitleSpacingX;
84 sizeY = kTextTitleSizeY;
86 image.drawStringCentered(paramValue, startX, startY + 2, sizeX, sizeY, width);
89 [[nodiscard]]
bool showPopup()
const override {
return false; }