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.

MidiDisplay.hpp 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 MidiDriverChoice : LedDisplayChoice {
  10. midi::Port* port;
  11. void onAction(const ActionEvent& e) override;
  12. void step() override;
  13. };
  14. struct MidiDeviceChoice : LedDisplayChoice {
  15. midi::Port* port;
  16. void onAction(const ActionEvent& e) override;
  17. void step() override;
  18. };
  19. struct MidiChannelChoice : LedDisplayChoice {
  20. midi::Port* port;
  21. void onAction(const ActionEvent& e) override;
  22. void step() override;
  23. };
  24. struct MidiDisplay : LedDisplay {
  25. MidiDriverChoice* driverChoice;
  26. LedDisplaySeparator* driverSeparator;
  27. MidiDeviceChoice* deviceChoice;
  28. LedDisplaySeparator* deviceSeparator;
  29. MidiChannelChoice* channelChoice;
  30. void setMidiPort(midi::Port* port);
  31. };
  32. /** A virtual MIDI port graphic that displays an MIDI menu when clicked. */
  33. struct MidiButton : SvgButton {
  34. midi::Port* port;
  35. void setMidiPort(midi::Port* port);
  36. void onAction(const ActionEvent& e) override;
  37. };
  38. /** Appends menu items to the given menu with driver, device, etc.
  39. Useful alternative to putting a MidiDisplay on your module's panel.
  40. */
  41. void appendMidiMenu(ui::Menu* menu, midi::Port* port);
  42. } // namespace app
  43. } // namespace rack