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.

VectorJuiceUI.hpp 3.1KB

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