DISTRHO Juice Plugins
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.

104 lines
2.9KB

  1. /*
  2. * Trigger Juice Plugin
  3. * Copyright (C) 2014 Andre Sklenar <andre.sklenar@gmail.com>, www.juicelab.cz
  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 TRIGGERJUICEUI_HPP_INCLUDED
  18. #define TRIGGERJUICEUI_HPP_INCLUDED
  19. #include "DistrhoUI.hpp"
  20. #include "Geometry.hpp"
  21. #include "ImageAboutWindow.hpp"
  22. #include "ImageButton.hpp"
  23. #include "ImageKnob.hpp"
  24. #include "ImageSlider.hpp"
  25. #include "TriggerJuiceArtwork.hpp"
  26. #include "TriggerJuicePlugin.hpp"
  27. using DGL::Image;
  28. using DGL::ImageAboutWindow;
  29. using DGL::ImageButton;
  30. using DGL::ImageKnob;
  31. using DGL::ImageSlider;
  32. using DGL::Rectangle;
  33. START_NAMESPACE_DISTRHO
  34. // -----------------------------------------------------------------------
  35. class TriggerJuiceUI : public UI,
  36. public ImageButton::Callback,
  37. public ImageKnob::Callback,
  38. public ImageSlider::Callback
  39. {
  40. public:
  41. TriggerJuiceUI();
  42. protected:
  43. // -------------------------------------------------------------------
  44. // Information
  45. uint d_getWidth() const noexcept override
  46. {
  47. return TriggerJuiceArtwork::backgroundWidth;
  48. }
  49. uint d_getHeight() const noexcept override
  50. {
  51. return TriggerJuiceArtwork::backgroundHeight;
  52. }
  53. // -------------------------------------------------------------------
  54. // DSP Callbacks
  55. void d_parameterChanged(uint32_t index, float value) override;
  56. void d_programChanged(uint32_t index) override;
  57. // -------------------------------------------------------------------
  58. // Widget Callbacks
  59. void imageButtonClicked(ImageButton* button, int) override;
  60. void imageKnobDragStarted(ImageKnob* knob) override;
  61. void imageKnobDragFinished(ImageKnob* knob) override;
  62. void imageKnobValueChanged(ImageKnob* knob, float value) override;
  63. void imageSliderDragStarted(ImageSlider* slider) override;
  64. void imageSliderDragFinished(ImageSlider* slider) override;
  65. void imageSliderValueChanged(ImageSlider* slider, float value) override;
  66. void onDisplay() override;
  67. private:
  68. float paramX, paramY;
  69. Image fImgBackground;
  70. ImageAboutWindow fAboutWindow;
  71. ScopedPointer<ImageButton> fButtonAbout;
  72. //knobs
  73. ScopedPointer<ImageKnob> fKnobAttack, fKnobRelease;
  74. //sliders
  75. ScopedPointer<ImageSlider> fSliderRev, fSliderSplit, fSliderMS;
  76. };
  77. // -----------------------------------------------------------------------
  78. END_NAMESPACE_DISTRHO
  79. #endif // TRIGGERJUICEUI_HPP_INCLUDED