You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
618B

  1. #include "rack.hpp"
  2. using namespace rack;
  3. namespace rack_plugin_rcm {
  4. struct NotesToShowItem : MenuItem {
  5. char buffer[100];
  6. PianoRollWidget* module;
  7. int value;
  8. NotesToShowItem(PianoRollWidget* module, int value) {
  9. this->module = module;
  10. this->value = value;
  11. snprintf(buffer, 10, "%d", value);
  12. text = buffer;
  13. if (value == module->rollAreaWidget->state.notesToShow) {
  14. rightText = "✓";
  15. }
  16. }
  17. void onAction(EventAction &e) override {
  18. module->rollAreaWidget->state.notesToShow = value;
  19. module->rollAreaWidget->state.dirty = true;
  20. }
  21. };
  22. } // namespace rack_plugin_rcm