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.

ZamCompX2UI.hpp 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. using DGL::Image;
  24. using DGL::ImageKnob;
  25. using DGL::ImageToggle;
  26. START_NAMESPACE_DISTRHO
  27. // -----------------------------------------------------------------------
  28. class ZamCompX2UI : public UI,
  29. public ImageKnob::Callback,
  30. public ImageToggle::Callback
  31. {
  32. public:
  33. ZamCompX2UI();
  34. protected:
  35. // -------------------------------------------------------------------
  36. // Information
  37. uint d_getWidth() const noexcept override
  38. {
  39. return ZamCompX2Artwork::zamcompx2Width;
  40. }
  41. uint d_getHeight() const noexcept override
  42. {
  43. return ZamCompX2Artwork::zamcompx2Height;
  44. }
  45. // -------------------------------------------------------------------
  46. // DSP Callbacks
  47. void d_parameterChanged(uint32_t index, float value) override;
  48. void d_programChanged(uint32_t index) override;
  49. // -------------------------------------------------------------------
  50. // Widget Callbacks
  51. void imageKnobDragStarted(ImageKnob* knob) override;
  52. void imageKnobDragFinished(ImageKnob* knob) override;
  53. void imageKnobValueChanged(ImageKnob* knob, float value) override;
  54. void imageToggleClicked(ImageToggle* imageToggle, int button) override;
  55. void onDisplay() override;
  56. private:
  57. Image fImgBackground;
  58. ScopedPointer<ImageKnob> fKnobAttack, fKnobRelease, fKnobThresh;
  59. ScopedPointer<ImageKnob> fKnobRatio, fKnobKnee, fKnobMakeup;
  60. Image fImgSwitchSlider;
  61. ScopedPointer<ImageToggle> fToggleStereo;
  62. Image fLedRedImg;
  63. float fLedRedValue;
  64. Image fLedYellowImg;
  65. float fLedYellowValue;
  66. };
  67. // -----------------------------------------------------------------------
  68. END_NAMESPACE_DISTRHO
  69. #endif // ZAMCOMPX2UI_HPP_INCLUDED