Advertisement
mayae

example gui

Sep 30th, 2015
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. #include "TestProcessor.h"
  2. #include "vstguiex.h"
  3. #include "plugin-bindings\aeffguieditor.h"
  4.  
  5. class GUI : public AEffGUIEditor, public CControlListener
  6. {
  7. public:
  8.  
  9.     GUI(Processor * effect)
  10.     :
  11.         AEffGUIEditor(effect), processor(effect),
  12.         cutoff({0, 0, 80, 80}, this, effect->kCutoff, nullptr, nullptr),
  13.         resonance({ 80, 0, 80, 80 }, this, effect->kResonance, nullptr, nullptr),
  14.         curve({ 160, 0, 80, 80 }, this, /* any non-used value goes here */ 3, nullptr, nullptr)
  15.     {
  16.         // set size, etc.
  17.     }
  18.  
  19.     void valueChanged(CControl * ctrl) override
  20.     {
  21.         // standard interface:
  22.         if (ctrl == &cutoff)
  23.         {
  24.             processor->setParameterAutomated(processor->kCutoff, ctrl->getValue());
  25.         }
  26.         else if (ctrl == &resonance)
  27.         {
  28.             processor->setParameterAutomated(processor->kResonance, ctrl->getValue());
  29.         }
  30.         // a control the host doesn't know about!
  31.         else if (ctrl == &curve)
  32.         {
  33.             processor->setCurve(ctrl->getValue());
  34.         }
  35.     }
  36.  
  37. private:
  38.     Processor * processor;
  39.     CKnob cutoff, resonance, curve;
  40. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement