Skip to content

Commit

Permalink
Better display for MidiThing for module browser
Browse files Browse the repository at this point in the history
  • Loading branch information
hemmer committed Apr 23, 2024
1 parent 1cb0e9f commit 733acea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 7 additions & 1 deletion src/MidiThing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 733acea

Please sign in to comment.