Audio plugin host https://kx.studio/carla
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.

98 lines
2.6KB

  1. /*
  2. * ZamCompX2 stereo compressor
  3. * Copyright (C) 2014 Damien Zammit <damien@zamaudio.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 2 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 doc/GPL.txt file.
  16. */
  17. #ifndef ZAMCOMPX2UI_HPP_INCLUDED
  18. #define ZAMCOMPX2UI_HPP_INCLUDED
  19. #include "DistrhoUI.hpp"
  20. #include "ImageKnob.hpp"
  21. #include "ImageToggle.hpp"
  22. #include "ZamCompX2Artwork.hpp"
  23. #include "ZamCompX2Plugin.hpp"
  24. using DGL::Image;
  25. using DGL::ImageKnob;
  26. using DGL::ImageToggle;
  27. START_NAMESPACE_DISTRHO
  28. // -----------------------------------------------------------------------
  29. class ZamCompX2UI : public UI,
  30. public ImageKnob::Callback,
  31. public ImageToggle::Callback
  32. {
  33. public:
  34. ZamCompX2UI();
  35. ~ZamCompX2UI() override;
  36. protected:
  37. // -------------------------------------------------------------------
  38. // Information
  39. unsigned int d_getWidth() const noexcept override
  40. {
  41. return ZamCompX2Artwork::zamcompx2Width;
  42. }
  43. unsigned int d_getHeight() const noexcept override
  44. {
  45. return ZamCompX2Artwork::zamcompx2Height;
  46. }
  47. // -------------------------------------------------------------------
  48. // DSP Callbacks
  49. void d_parameterChanged(uint32_t index, float value) override;
  50. void d_programChanged(uint32_t index) override;
  51. // -------------------------------------------------------------------
  52. // Widget Callbacks
  53. void imageKnobDragStarted(ImageKnob* knob) override;
  54. void imageKnobDragFinished(ImageKnob* knob) override;
  55. void imageKnobValueChanged(ImageKnob* knob, float value) override;
  56. void imageToggleClicked(ImageToggle *toggle, int button) override;
  57. void onDisplay() override;
  58. private:
  59. Image fImgBackground;
  60. ImageKnob* fKnobAttack;
  61. ImageKnob* fKnobRelease;
  62. ImageKnob* fKnobThresh;
  63. ImageKnob* fKnobRatio;
  64. ImageKnob* fKnobKnee;
  65. ImageKnob* fKnobMakeup;
  66. Image fImgToggleSlider;
  67. ImageToggle* fToggleStereo;
  68. Image fLedRedImg;
  69. float fLedRedValue;
  70. Image fLedYellowImg;
  71. float fLedYellowValue;
  72. };
  73. // -----------------------------------------------------------------------
  74. END_NAMESPACE_DISTRHO
  75. #endif // ZAMCOMPX2UI_HPP_INCLUDED