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.

75 lines
1.7KB

  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 <audio.hpp>
  7. namespace rack {
  8. namespace app {
  9. struct AudioDriverChoice : LedDisplayChoice {
  10. audio::Port* port;
  11. void onAction(const ActionEvent& e) override;
  12. void step() override;
  13. };
  14. struct AudioDeviceChoice : LedDisplayChoice {
  15. audio::Port* port;
  16. void onAction(const ActionEvent& e) override;
  17. void step() override;
  18. };
  19. struct AudioSampleRateChoice : LedDisplayChoice {
  20. audio::Port* port;
  21. void onAction(const ActionEvent& e) override;
  22. void step() override;
  23. };
  24. struct AudioBlockSizeChoice : LedDisplayChoice {
  25. audio::Port* port;
  26. void onAction(const ActionEvent& e) override;
  27. void step() override;
  28. };
  29. struct AudioDeviceMenuChoice : AudioDeviceChoice {
  30. void onAction(const ActionEvent& e) override;
  31. };
  32. /** Designed for Audio-8 and Audio-16 module. */
  33. struct AudioDisplay : LedDisplay {
  34. AudioDriverChoice* driverChoice;
  35. LedDisplaySeparator* driverSeparator;
  36. AudioDeviceChoice* deviceChoice;
  37. LedDisplaySeparator* deviceSeparator;
  38. AudioSampleRateChoice* sampleRateChoice;
  39. LedDisplaySeparator* sampleRateSeparator;
  40. AudioBlockSizeChoice* bufferSizeChoice;
  41. void setAudioPort(audio::Port* port);
  42. };
  43. /** A virtual audio port graphic that displays an audio menu when clicked. */
  44. struct AudioButton : SvgButton {
  45. audio::Port* port;
  46. void setAudioPort(audio::Port* port);
  47. void onAction(const ActionEvent& e) override;
  48. };
  49. /** Appends menu items to the given menu with driver, device, etc.
  50. Useful alternative to putting an AudioDisplay on your module's panel.
  51. */
  52. void appendAudioMenu(ui::Menu* menu, audio::Port* port);
  53. } // namespace app
  54. } // namespace rack