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.

77 lines
2.3KB

  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. #ifdef HEADLESS
  18. # error wrong include
  19. #endif
  20. #pragma once
  21. #include "DistrhoUtils.hpp"
  22. namespace rack {
  23. namespace window {
  24. struct Window;
  25. }
  26. }
  27. START_NAMESPACE_DISTRHO
  28. // -----------------------------------------------------------------------------------------------------------
  29. enum WindowParameterList {
  30. kWindowParameterShowTooltips,
  31. kWindowParameterCableOpacity,
  32. kWindowParameterCableTension,
  33. kWindowParameterRackBrightness,
  34. kWindowParameterHaloBrightness,
  35. kWindowParameterKnobMode,
  36. kWindowParameterWheelKnobControl,
  37. kWindowParameterWheelSensitivity,
  38. kWindowParameterLockModulePositions,
  39. kWindowParameterUpdateRateLimit,
  40. kWindowParameterCount,
  41. };
  42. struct WindowParameters {
  43. float cableOpacity = 0.5f;
  44. float cableTension = 0.75f;
  45. float rackBrightness = 1.0f;
  46. float haloBrightness = 0.25f;
  47. float knobScrollSensitivity = 0.001f;
  48. int knobMode = 0;
  49. bool tooltips = true;
  50. bool knobScroll = false;
  51. bool lockModules = false;
  52. // cardinal specific
  53. int rateLimit = 0;
  54. };
  55. struct WindowParametersCallback {
  56. virtual ~WindowParametersCallback() {}
  57. virtual void WindowParametersChanged(WindowParameterList param, float value) = 0;
  58. };
  59. void WindowParametersSave(rack::window::Window* window);
  60. void WindowParametersRestore(rack::window::Window* window);
  61. void WindowParametersSetCallback(rack::window::Window* window, WindowParametersCallback* callback);
  62. void WindowParametersSetValues(rack::window::Window* window, const WindowParameters& params);
  63. // -----------------------------------------------------------------------------------------------------------
  64. END_NAMESPACE_DISTRHO