From 733acea8dfbc2146eff33b0359e880bf8d2fd19c Mon Sep 17 00:00:00 2001 From: hemmer <915048+hemmer@users.noreply.github.com> Date: Tue, 23 Apr 2024 20:34:15 +0100 Subject: [PATCH] Better display for MidiThing for module browser --- .github/workflows/build-plugin.yml | 2 +- src/MidiThing.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-plugin.yml b/.github/workflows/build-plugin.yml index ec63601..961853e 100644 --- a/.github/workflows/build-plugin.yml +++ b/.github/workflows/build-plugin.yml @@ -2,7 +2,7 @@ name: Build VCV Rack Plugin on: [push, pull_request] env: - rack-sdk-version: 2.4.1 + rack-sdk-version: 2.5.1 rack-plugin-toolchain-dir: /home/build/rack-plugin-toolchain defaults: diff --git a/src/MidiThing.cpp b/src/MidiThing.cpp index 18340b5..c7a5b6e 100644 --- a/src/MidiThing.cpp +++ b/src/MidiThing.cpp @@ -485,10 +485,16 @@ struct LEDDisplay : LightWidget { if (font && font->handle >= 0) { - std::string text = "?-?v"; // fallback if module not yet defined + std::string text; if (module) { text = module->cfgPortModeNames[module->getVoltageMode(row, col) + 1]; } + else { + // fallback if module not yet defined + const char* cfgPortModeNames[5] = {"0/10v", "-5/5v", "-10/0v", "0/8v", "0/5v"}; + const int randomModeForDisplay = rack::random::u32() % 5; + text = cfgPortModeNames[randomModeForDisplay]; + } char buffer[numChars + 1]; int l = text.size(); if (l > numChars)