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.

39 lines
882B

  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <app/LedDisplay.hpp>
  4. #include <ui/Menu.hpp>
  5. #include <app/SvgButton.hpp>
  6. #include <midi.hpp>
  7. namespace rack {
  8. namespace app {
  9. struct MidiWidget : LedDisplay {
  10. LedDisplayChoice* driverChoice;
  11. LedDisplaySeparator* driverSeparator;
  12. LedDisplayChoice* deviceChoice;
  13. LedDisplaySeparator* deviceSeparator;
  14. LedDisplayChoice* channelChoice;
  15. void setMidiPort(midi::Port* port);
  16. };
  17. /** A virtual MIDI port graphic that displays an MIDI menu when clicked. */
  18. struct MidiButton : SvgButton {
  19. midi::Port* port;
  20. void setMidiPort(midi::Port* port);
  21. void onAction(const event::Action& e) override;
  22. };
  23. /** Appends menu items to the given menu with driver, device, etc.
  24. Useful alternative to putting a MidiWidget on your module's panel.
  25. */
  26. void appendMidiMenu(ui::Menu* menu, midi::Port* port);
  27. } // namespace app
  28. } // namespace rack