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.

70 lines
2.1KB

  1. /*
  2. * DISTRHO Cardinal Plugin
  3. * Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 3 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the LICENSE file.
  16. */
  17. #pragma once
  18. #include "DistrhoUtils.hpp"
  19. namespace rack {
  20. namespace window {
  21. struct Window;
  22. }
  23. }
  24. START_NAMESPACE_DISTRHO
  25. // -----------------------------------------------------------------------------------------------------------
  26. enum WindowParameterList {
  27. kWindowParameterShowTooltips,
  28. kWindowParameterCableOpacity,
  29. kWindowParameterCableTension,
  30. kWindowParameterRackBrightness,
  31. kWindowParameterHaloBrightness,
  32. kWindowParameterKnobMode,
  33. kWindowParameterWheelKnobControl,
  34. kWindowParameterWheelSensitivity,
  35. kWindowParameterLockModulePositions,
  36. kWindowParameterCount,
  37. };
  38. struct WindowParameters {
  39. float cableOpacity = 0.5f;
  40. float cableTension = 0.5f;
  41. float rackBrightness = 1.0f;
  42. float haloBrightness = 0.25f;
  43. float knobScrollSensitivity = 0.001f;
  44. int knobMode = 0;
  45. bool tooltips = true;
  46. bool knobScroll = false;
  47. bool lockModules = false;
  48. };
  49. struct WindowParametersCallback {
  50. virtual ~WindowParametersCallback() {}
  51. virtual void WindowParametersChanged(WindowParameterList param, float value) = 0;
  52. };
  53. void WindowParametersSave(rack::window::Window* window);
  54. void WindowParametersRestore(rack::window::Window* window);
  55. void WindowParametersSetCallback(rack::window::Window* window, WindowParametersCallback* callback);
  56. void WindowParametersSetValues(rack::window::Window* window, const WindowParameters& params);
  57. // -----------------------------------------------------------------------------------------------------------
  58. END_NAMESPACE_DISTRHO