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.

49 lines
1.2KB

  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. /** Designed for Audio-8 and Audio-16 module. */
  10. struct AudioWidget : LedDisplay {
  11. LedDisplayChoice* driverChoice;
  12. LedDisplaySeparator* driverSeparator;
  13. LedDisplayChoice* deviceChoice;
  14. LedDisplaySeparator* deviceSeparator;
  15. LedDisplayChoice* sampleRateChoice;
  16. LedDisplaySeparator* sampleRateSeparator;
  17. LedDisplayChoice* bufferSizeChoice;
  18. void setAudioPort(audio::Port* port);
  19. };
  20. /** Designed for Audio-2 module. */
  21. struct AudioDeviceWidget : LedDisplay {
  22. LedDisplayChoice* deviceChoice;
  23. void setAudioPort(audio::Port* port);
  24. };
  25. /** A virtual audio port graphic that displays an audio menu when clicked. */
  26. struct AudioButton : SvgButton {
  27. audio::Port* port;
  28. void setAudioPort(audio::Port* port);
  29. void onAction(const ActionEvent& e) override;
  30. };
  31. /** Appends menu items to the given menu with driver, device, etc.
  32. Useful alternative to putting an AudioWidget on your module's panel.
  33. */
  34. void appendAudioMenu(ui::Menu* menu, audio::Port* port);
  35. } // namespace app
  36. } // namespace rack