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.

109 lines
2.9KB

  1. /*
  2. * Power 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 POWERJUICEUI_HPP_INCLUDED
  18. #define POWERJUICEUI_HPP_INCLUDED
  19. #include "DistrhoUI.hpp"
  20. #include "ImageAboutWindow.hpp"
  21. #include "ImageButton.hpp"
  22. #include "ImageKnob.hpp"
  23. #include "ImageSlider.hpp"
  24. #include "PowerJuiceArtwork.hpp"
  25. #include "PowerJuicePlugin.hpp"
  26. using DGL::Image;
  27. using DGL::ImageAboutWindow;
  28. using DGL::ImageButton;
  29. using DGL::ImageKnob;
  30. START_NAMESPACE_DISTRHO
  31. // -----------------------------------------------------------------------
  32. class PowerJuiceUI : public UI,
  33. public ImageButton::Callback,
  34. public ImageKnob::Callback
  35. {
  36. public:
  37. PowerJuiceUI();
  38. ~PowerJuiceUI() override;
  39. protected:
  40. // -------------------------------------------------------------------
  41. // Information
  42. unsigned int d_getWidth() const noexcept override
  43. {
  44. return PowerJuiceArtwork::backgroundWidth;
  45. }
  46. unsigned int d_getHeight() const noexcept override
  47. {
  48. return PowerJuiceArtwork::backgroundHeight;
  49. }
  50. // -------------------------------------------------------------------
  51. // DSP Callbacks
  52. void d_parameterChanged(uint32_t index, float value) override;
  53. void d_programChanged(uint32_t index) override;
  54. void d_stateChanged(const char*, const char*) override;
  55. // -------------------------------------------------------------------
  56. // UI Callbacks
  57. void d_uiIdle() override;
  58. // -------------------------------------------------------------------
  59. // Widget Callbacks
  60. void imageButtonClicked(ImageButton* button, int) override;
  61. void imageKnobDragStarted(ImageKnob* knob) override;
  62. void imageKnobDragFinished(ImageKnob* knob) override;
  63. void imageKnobValueChanged(ImageKnob* knob, float value) override;
  64. void onDisplay() override;
  65. void onClose() override;
  66. private:
  67. Image fImgBackground;
  68. ImageAboutWindow fAboutWindow;
  69. ImageKnob* fKnobAttack;
  70. ImageKnob* fKnobRelease;
  71. ImageKnob* fKnobThreshold;
  72. ImageKnob* fKnobRatio;
  73. ImageKnob* fKnobMakeup;
  74. ImageKnob* fKnobMix;
  75. ImageButton* fButtonAbout;
  76. shm_t shm;
  77. SharedMemData* shmData;
  78. bool fFirstDisplay;
  79. void initShm();
  80. void closeShm();
  81. };
  82. // -----------------------------------------------------------------------
  83. END_NAMESPACE_DISTRHO
  84. #endif // POWERJUICEUI_HPP_INCLUDED