26class Volts final :
public Decimal,
public FormattedTitle {
28 Volts(l10n::String name, l10n::String title_format_str) :
Decimal(name), FormattedTitle(title_format_str) {}
30 [[nodiscard]] std::string_view
getTitle()
const override {
return FormattedTitle::title(); }
32 [[nodiscard]] int32_t getMinValue()
const override {
return 0; }
33 [[nodiscard]] int32_t getMaxValue()
const override {
return 200; }
34 [[nodiscard]] int32_t getNumDecimalPlaces()
const override {
return 2; }
35 [[nodiscard]] int32_t getDefaultEditPos()
const override {
return 1; }
37 this->setValue(cvEngine.cvChannels[soundEditor.currentSourceIndex].voltsPerOctave);
39 void writeCurrentValue()
override {
40 cvEngine.setCVVoltsPerOctave(soundEditor.currentSourceIndex, this->getValue());
44 if (this->getValue() == 0) {
52 void drawValue()
override {
53 if (this->getValue() == 0) {
54 display->setText(
"HZPV",
false, 255,
true);
62 if (this->getValue() != 0) {
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:189