MCPcopy Create free account
hub / github.com/VCVRack/Befaco / updateButtonDescriptions

Method updateButtonDescriptions

src/Random8.cpp:740–775  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

738 }
739
740 void updateButtonDescriptions() {
741 auto *random8 = dynamic_cast<Random8 *>(module);
742 if (!random8) {
743 return;
744 }
745
746 const std::string menuDesc =
747 "Press to exit menu.\nHold to select another menu page.\nVery long press to reset channel/all.";
748
749 for (int i = 0; i < Random8::NUM_CHANNELS; i++) {
750 auto *button = channelButtons[i];
751 if (!button || !button->getParamQuantity()) {
752 continue;
753 }
754 auto *pq = button->getParamQuantity();
755 if (random8->panelAppState == Random8Panel::IN_PRESETS) {
756 if (i == Random8::PAGE_PRESET) {
757 pq->description = "Press to exit preset mode.";
758 } else if (random8->presetSlots[i]) {
759 pq->description =
760 "Press to load preset from this slot.\nHold and release to overwrite this slot.\nReturns to "
761 "performance mode.";
762 } else {
763 pq->description =
764 "Press to save current state to this empty slot.\nHold and release to save as well.\nReturns to "
765 "performance mode.";
766 }
767 } else if (random8->inMenu) {
768 pq->description = menuDesc;
769 } else {
770 pq->description = string::f("Short press to change loop mode.\nLong press to enter %s menu.\nDouble tap to "
771 "exit loop mode.\nVery long press to reset channel.",
772 random8->pageNames[i]);
773 }
774 }
775 }
776
777 void setPage(int page) {
778 for (int p = 0; p < Random8::NUM_PAGES; p++) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected