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.

100 lines
3.0KB

  1. /*
  2. * Vector 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 VECTORJUICEUI_HPP_INCLUDED
  18. #define VECTORJUICEUI_HPP_INCLUDED
  19. #include "DistrhoUI.hpp"
  20. #include "ImageWidgets.hpp"
  21. #include "VectorJuiceArtwork.hpp"
  22. using DGL::Image;
  23. using DGL::ImageAboutWindow;
  24. using DGL::ImageButton;
  25. using DGL::ImageKnob;
  26. using DGL::ImageSlider;
  27. START_NAMESPACE_DISTRHO
  28. // -----------------------------------------------------------------------
  29. class VectorJuiceUI : public UI,
  30. public ImageButton::Callback,
  31. public ImageKnob::Callback,
  32. public ImageSlider::Callback
  33. {
  34. public:
  35. VectorJuiceUI();
  36. protected:
  37. // -------------------------------------------------------------------
  38. // DSP Callbacks
  39. void parameterChanged(uint32_t index, float value) override;
  40. void programLoaded(uint32_t index) override;
  41. // -------------------------------------------------------------------
  42. // Widget Callbacks
  43. void imageButtonClicked(ImageButton* button, int) override;
  44. void imageKnobDragStarted(ImageKnob* knob) override;
  45. void imageKnobDragFinished(ImageKnob* knob) override;
  46. void imageKnobValueChanged(ImageKnob* knob, float value) override;
  47. void imageSliderDragStarted(ImageSlider* slider) override;
  48. void imageSliderDragFinished(ImageSlider* slider) override;
  49. void imageSliderValueChanged(ImageSlider* slider, float value) override;
  50. void onDisplay() override;
  51. bool onMouse(const MouseEvent&) override;
  52. bool onMotion(const MotionEvent&) override;
  53. private:
  54. float paramX, paramY;
  55. Image fImgBackground;
  56. Image fImgRoundlet;
  57. Image fImgOrbit;
  58. Image fImgSubOrbit;
  59. ImageAboutWindow fAboutWindow;
  60. ScopedPointer<ImageButton> fButtonAbout;
  61. //knobs
  62. ScopedPointer<ImageKnob> fKnobOrbitSpeedX, fKnobOrbitSpeedY, fKnobOrbitSizeX, fKnobOrbitSizeY;
  63. ScopedPointer<ImageKnob> fKnobSubOrbitSpeed, fKnobSubOrbitSize, fKnobSubOrbitSmooth;
  64. //sliders
  65. ScopedPointer<ImageSlider> fSliderOrbitWaveX, fSliderOrbitWaveY;
  66. ScopedPointer<ImageSlider> fSliderOrbitPhaseX, fSliderOrbitPhaseY;
  67. // needed for XY canvas handling
  68. bool fDragging;
  69. bool fDragValid;
  70. int fLastX;
  71. int fLastY;
  72. DGL::Rectangle<int> fCanvasArea;
  73. float orbitX, orbitY, subOrbitX, subOrbitY;
  74. };
  75. // -----------------------------------------------------------------------
  76. END_NAMESPACE_DISTRHO
  77. #endif // VECTORJUICEUI_HPP_INCLUDED