ASPiK SDK
plugingui.h
1  // -----------------------------------------------------------------------------
2 // ASPiK Plugin Kernel File: plugingui.h
3 //
12 // -----------------------------------------------------------------------------
13 #pragma once
14 #ifndef __PluginGUI__
15 #define __PluginGUI__
16 
17 #define DOXYDOC 1
18 
19 #ifdef DOXYDOC
20 
21 #define AUPLUGIN 1
22 #define AAXPLUGIN 1
23 #define VSTPLUGIN 1
24 #define RAFXPLUGIN 1
25 
26 #endif
27 
28 // --- custom VSTGUI4 derived classes
29 #include "customcontrols.h"
30 
31 // --- VSTGUI
32 #include "vstgui/vstgui.h"
33 #include "vstgui/uidescription/uiviewswitchcontainer.h"
34 #include "vstgui/vstgui_uidescription.h"
35 #include "vstgui/lib/crect.h"
36 // 4.9
37 #include "vstgui/uidescription/cstream.h"
38 
39 #if VSTGUI_LIVE_EDITING
40 #include "vstgui/uidescription/editing/uieditcontroller.h"
41 #include "vstgui/uidescription/editing/uieditmenucontroller.h"
42 #endif
43 
44 #ifdef AUPLUGIN
45 #import <CoreFoundation/CoreFoundation.h>
46 #import <AudioUnit/AudioUnit.h>
47 #import <AudioToolbox/AudioToolbox.h>
48 #endif
49 
50 #ifdef AAXPLUGIN
51 #include "AAX_IEffectParameters.h"
52 #include "AAXtoVSTGUIButtonState.h"
53 #endif
54 
55 // --- plugin stuff
56 #include "pluginparameter.h"
57 
58 // --- std::
59 #include <sstream>
60 #include <algorithm>
61 #include <functional>
62 #include <cctype>
63 #include <locale>
64 #include <map>
65 
66 // --- const for host choice knob mode
67 const uint32_t kHostChoice = 3;
68 
69 namespace VSTGUI {
70 
86 {
87 public:
89  ControlUpdateReceiver(CControl* control, PluginParameter* pluginParameterPtr, bool _isControlListener)
90  {
91  hasRefGuiControl = pluginParameterPtr ? true : false;
92 
94  refGuiControl = *pluginParameterPtr;
95 
96  addControl(control);
97  isControlListener = _isControlListener;
98  }
99 
102  {
103  for(std::vector<CControl*>::iterator it = guiControls.begin(); it != guiControls.end(); ++it)
104  {
105  CControl* ctrl = *it;
106  ctrl->forget();
107  }
108  }
109 
114  bool hasControl(CControl* control)
115  {
116  return std::find(guiControls.begin (), guiControls.end (), control) != guiControls.end ();
117  }
118 
122  void addControl(CControl* control)
123  {
124  if(hasControl(control))
125  return;
126 
127  control->remember();
128  guiControls.push_back(control);
129 
130  // --- set default value (rather than from XML, which is a pain because it must be normalized)
131  if(hasRefGuiControl)
132  {
133  float normalizedValue = (float)refGuiControl.getDefaultValueNormalized();
134  control->setDefaultValue(normalizedValue);
135  }
136  }
137 
141  void removeControl(CControl* control)
142  {
143  for(std::vector<CControl*>::iterator it = guiControls.begin(); it != guiControls.end(); ++it)
144  {
145  CControl* ctrl = *it;
146  if(ctrl == control)
147  {
148  ctrl->forget();
149  guiControls.erase(it);
150  return;
151  }
152  }
153  }
154 
160  {
161  for(std::vector<CControl*>::iterator it = guiControls.begin(); it != guiControls.end(); ++it)
162  {
163  CControl* ctrl = *it;
164  if(ctrl && ctrl->isEditing())
165  return true;
166  }
167  return false;
168  }
169 
174  float getActualValueWithNormalizedValue(float normalizedValue)
175  {
176  return (float)refGuiControl.getControlValueWithNormalizedValue(normalizedValue);
177  }
178 
183  float getNormalizedValueWithActualValue(float actualValue)
184  {
185  return (float)refGuiControl.getNormalizedControlValueWithActualValue(actualValue);
186  }
187 
191  void updateControlsWithControl(CControl* control)
192  {
193  updateControlsWithActualValue(getActualValueWithNormalizedValue(control->getValueNormalized()), control);
194  }
195 
200  void updateControlsWithNormalizedValue(float normalizedValue, CControl* control = nullptr)
201  {
203  }
204 
208  void initControl(CControl* control)
209  {
210  float actualValue = (float)refGuiControl.getControlValue();
211  updateControlsWithActualValue(actualValue, control);
212  }
213 
218  void updateControlsWithActualValue(float actualValue, CControl* control = nullptr)
219  {
220  // --- eliminiate glitching from AAX parameter loop
221  if(!control && controlInRxGroupIsEditing())
222  return;
223 
224  // --- store on our reference control
225  refGuiControl.setControlValue(actualValue);
226 
227  // --- synchoronize all controls that share this controlID
228  for(std::vector<CControl*>::iterator it = guiControls.begin(); it != guiControls.end(); ++it)
229  {
230  CControl* guiCtrl = *it;
231  if(guiCtrl && control != guiCtrl) // nned the check for XY pads
232  {
233  // --- need to take care of multiple control types, slight differences in setup
234  CTextLabel* label = dynamic_cast<CTextLabel*>(guiCtrl);
235  COptionMenu* oMenu = dynamic_cast<COptionMenu*>(guiCtrl);
236  CXYPadEx* xyPad = dynamic_cast<CXYPadEx*>(guiCtrl);
237  CVuMeter* meter = dynamic_cast<CVuMeter*>(guiCtrl);
238 
239  if(meter)
240  {
241  continue;
242  }
243  else if(label)
244  {
245  label->setText(refGuiControl.getControlValueAsString().c_str());
246  label->invalid();
247  }
248  else if(oMenu)
249  {
250  // --- current rafx GUI Designer does not set max to anything
251  guiCtrl->setMin((float)refGuiControl.getGUIMin());
252  guiCtrl->setMax((float)refGuiControl.getGUIMin());
253 
254  // --- load for first time, NOT dynamic loading here
255  oMenu->removeAllEntry();
256 
257  for (uint32_t i = 0; i < refGuiControl.getStringCount(); i++)
258  {
259  oMenu->addEntry(refGuiControl.getStringByIndex(i).c_str(), i);
260  }
261 
262  oMenu->setValue((float)refGuiControl.getControlValue());
263  }
264  else if(xyPad)
265  {
266  float x = 0.f;
267  float y = 0.f;
268  xyPad->calculateXY(xyPad->getValue(), x, y);
269 
270  // --- retrieve the X and Y tags on the CXYPadEx
271  int32_t tagX = xyPad->getTagX();
272  int32_t tagY = xyPad->getTagY();
273 
274  if(tagX == refGuiControl.getControlID())
276  if(tagY == refGuiControl.getControlID())
278 
279  if(tagX >= 0 && tagY >= 0 && !guiCtrl->isEditing())
280  xyPad->setValue(xyPad->calculateValue(x, y));
281  }
282  else if(!guiCtrl->isEditing())
283  guiCtrl->setValueNormalized((float)refGuiControl.getControlValueNormalized());
284 
285  guiCtrl->invalid();
286  }
287  }
288  }
289 
295 
299  int32_t getControlID(){ return refGuiControl.getControlID(); }
300 
305  inline bool controlAndContainerVisible(CControl* ctrl)
306  {
307  if(!ctrl) return false;
308 
309  bool stickyVisible = ctrl->isVisible();
310 
311  if(!stickyVisible)
312  return false;
313 
314  // --- check parents
315  CView* parent = ctrl->getParentView();
316  while(parent)
317  {
318  stickyVisible = parent->isVisible();
319  if(!stickyVisible)
320  return false;
321 
322  parent = parent->getParentView();
323  }
324  return stickyVisible;
325  }
326 
332  int getControlID_WithMouseCoords(const CPoint& where)
333  {
334  CPoint mousePoint = where;
335 
336  for(std::vector<CControl*>::iterator it = guiControls.begin(); it != guiControls.end(); ++it)
337  {
338  CControl* ctrl = *it;
339  if(ctrl && controlAndContainerVisible(ctrl))
340  {
341  CPoint point = ctrl->frameToLocal(mousePoint);
342  CRect rect = ctrl->getViewSize();
343  if(rect.pointInside(point))
344  {
345  int tag = ctrl->getTag();
346  if(isReservedTag(tag))
347  return -1;
348  else
349  return tag;
350  }
351  }
352  }
353  return -1;
354  }
355 
361  CControl* getControl_WithMouseCoords(const CPoint& where)
362  {
363  CPoint mousePoint = where;
364 
365  for(std::vector<CControl*>::iterator it = guiControls.begin(); it != guiControls.end(); ++it)
366  {
367  CControl* ctrl = *it;
368  if(ctrl && controlAndContainerVisible(ctrl))
369  {
370  CPoint point = ctrl->frameToLocal(mousePoint);
371  CRect rect = ctrl->getViewSize();
372  if(rect.pointInside(point))
373  return ctrl;
374  }
375  }
376  return nullptr;
377  }
378 
379 protected:
381  std::vector<CControl*> guiControls;
382  bool hasRefGuiControl = false;
383  bool isControlListener = false;
384 };
385 
386 
412 class PluginGUI : public IController,
413  public IViewAddedRemovedObserver,
414  public IMouseObserver,
415  public IKeyboardHook,
416  public VSTGUIEditorInterface,
417  public CBaseObject,
418  public ICommandMenuItemTarget,
419  public IGUIView
420 {
421 
422 public:
424  PluginGUI(UTF8StringPtr _xmlFile);
425 
427  virtual ~PluginGUI();
428 
430  bool open(UTF8StringPtr _viewName,
431  void* parent,
432  const std::vector<PluginParameter*>* pluginParameterPtr,
433  const PlatformType& platformType = kDefaultNative,
434  IGUIPluginConnector* _guiPluginConnector = nullptr,
435  void* data = nullptr);
436 
438  void close();
439 
441  void syncGUIControl(uint32_t controlID);
442 
444  void getSize(float& width, float& height);
445 
447  void scaleGUISize(uint32_t controlValue);
448 
450  void writeToPresetFile();
451 
452 protected:
454  virtual void idle();
455 
457  void preCreateGUI();
458 
460  bool createGUI(bool bShowGUIEditor);
461 
463  void save(bool saveAs = false);
464 
466  virtual int32_t getKnobMode() const override;
467 
470  {
471  for(std::vector<PluginParameter*>::iterator it = pluginParameters.begin(); it != pluginParameters.end(); ++it) {
472  delete *it;
473  }
474  pluginParameters.clear();
475  }
476 
485  {
486  for(std::vector<PluginParameter*>::iterator it = pluginParameters.begin(); it != pluginParameters.end(); ++it) {
487  PluginParameter* ctrl = *it;
488  if(ctrl->getControlID() == tag)
489  return ctrl;
490  }
491  return nullptr;
492  }
493 
494  // --- protected variables
496  UIDescription* description = nullptr;
497  std::string viewName;
498  std::string xmlFile;
499 
500  uint32_t numUIControls = 0;
501  double zoomFactor = 1.0;
502  CVSTGUITimer* timer;
503 
504  CPoint minSize;
505  CPoint maxSize;
506  CRect nonEditRect;
507 
508  // --- flags for showing view
509  bool showGUIEditor = false;
510  bool createNewView = true;
511 
514  float guiWidth;
515  float guiHeight;
516 
518  CFrame* guiEditorFrame = nullptr;
519  uint32_t knobAction = kLinearMode;
520 
522  std::string getGUIDesignerSize();
523 
525  int getControlID_WithMouseCoords(const CPoint& where);
526 
528  CControl* getControl_WithMouseCoords(const CPoint& where);
529 
531  CMouseEventResult sendAAXMouseDown(int controlID, const CButtonState& buttons);
532 
534  CMouseEventResult sendAAXMouseMoved(int controlID, const CButtonState& buttons, const CPoint& where);
535 
537  CMouseEventResult sendAUMouseDown(CControl* control, const CButtonState& buttons);
538 
540  CMouseEventResult sendAUMouseMoved(CControl* control, const CButtonState& buttons, const CPoint& where) { return kMouseEventNotImplemented; }
541 
553  void setPluginParameterFromGUIControl(CControl* control, int tag, float actualValue, float normalizedValue)
554  {
555 #ifdef AUPLUGIN
556  setAUEventFromGUIControl(control, tag, actualValue);
557 #endif
558 
559 #ifdef AAXPLUGIN
560  setAAXParameterFromGUIControl(control, tag, actualValue, normalizedValue);
561 #endif
562 
563 #ifdef VSTPLUGIN
564  setVSTParameterFromGUIControl(control, tag, actualValue, normalizedValue);
565 #endif
566 
567 #ifdef RAFXPLUGIN
568  setRAFXParameterFromGUIControl(control, tag, actualValue, normalizedValue);
569 #endif
570 }
571 
575 #ifdef AAXPLUGIN
576 public:
581  void setAAXViewContainer(AAX_IViewContainer* _aaxViewContainer){ aaxViewContainer = _aaxViewContainer;}
582 
584  void setAAXParameterFromGUIControl(CControl* control, int tag, float actualValue, float normalizedValue);
585 
587  void updateGUIControlAAX(int tag, float actualPluginValue, float normalizedValue = 0.f, bool useNormalized = false);
588 protected:
589 #endif
590 
591 
592 #ifdef AUPLUGIN
593  AudioUnit m_AU;
594  AUEventListenerRef AUEventListener;
595 
596 public:
598  void dispatchAUControlChange(int tag, float actualPluginValue, int message = -1, bool fromEventListener = false);
599 
603  void setAU(AudioUnit inAU){m_AU = inAU;}
604 
605 protected:
607  void setAUEventFromGUIControl(CControl* control, int tag, float normalizedValue);
608 #endif
609 
610 #ifdef VSTPLUGIN
611 
612  void setVSTParameterFromGUIControl(CControl* control, int tag, float actualValue, float normalizedValue);
613 
615  void updateGUIControlVST(int tag, float normalizedValue);
616 #endif
617 
618 #ifdef RAFXPLUGIN
619 
620  void setRAFXParameterFromGUIControl(CControl* control, int tag, float actualValue, float normalizedValue);
621 
623  void updateGUIControlRAFX(int tag, float normalizedValue);
624 #endif
625 
626 
627 public:
629  CMessageResult notify(CBaseObject* sender, IdStringPtr message) override;
630 
632  virtual void valueChanged(VSTGUI::CControl* pControl) override;
633 
635  virtual int32_t controlModifierClicked(VSTGUI::CControl* pControl, VSTGUI::CButtonState button) override { return 0; }
636 
638  virtual void controlBeginEdit(VSTGUI::CControl* pControl) override;
639 
641  virtual void controlEndEdit(VSTGUI::CControl* pControl) override;
642 
644  virtual void controlTagWillChange(VSTGUI::CControl* pControl) override;
645 
647  virtual void controlTagDidChange(VSTGUI::CControl* pControl) override;
648 #if DEBUG
649 
650  virtual char controlModifierClicked(VSTGUI::CControl* pControl, long button) { return 0; }
651 #endif
652 
654  CView* createUserCustomView(std::string viewname, const CRect rect, IControlListener* listener, int32_t tag);
655 
657  CView* createView(const UIAttributes& attributes, const IUIDescription* description) override;
658 
660  IController* createSubController(UTF8StringPtr name, const IUIDescription* description) override;
661 
663  ControlUpdateReceiver* getControlUpdateReceiver(int32_t tag) const;
664 
666  void onViewAdded(CFrame* frame, CView* view) override {}
667 
669  void onViewRemoved(CFrame* frame, CView* view) override;
670 
672  void onMouseEntered(CView* view, CFrame* frame) override {}
673 
675  void onMouseExited(CView* view, CFrame* frame) override {}
676 
678  CMouseEventResult onMouseDown(CFrame* frame, const CPoint& where, const CButtonState& buttons) override;
679 
681  CMouseEventResult onMouseMoved(CFrame* frame, const CPoint& where, const CButtonState& buttons) override;
682 
684  int32_t onKeyDown(const VstKeyCode& code, CFrame* frame) override { return -1; }
685 
687  int32_t onKeyUp(const VstKeyCode& code, CFrame* frame) override { return -1; }
688 
690  virtual bool validateCommandMenuItem(CCommandMenuItem* item);
691 
693  virtual bool onCommandMenuItemSelected(CCommandMenuItem* item);
694 
701  virtual void setGUIWindowFrame(IGUIWindowFrame* frame) override
702  {
703  // --- we keep for resiging here
704  guiWindowFrame = frame;
705  }
706 
712  inline static bool parseSize (const std::string& str, CPoint& point)
713  {
714  size_t sep = str.find (',', 0);
715  if (sep != std::string::npos)
716  {
717  point.x = strtol (str.c_str (), 0, 10);
718  point.y = strtol (str.c_str () + sep+1, 0, 10);
719  return true;
720  }
721  return false;
722  }
723 
724  // --- for Meters only right now, but could be used to mark any control as writeable
732  bool hasWriteableControl(CControl* control)
733  {
734  return std::find (writeableControls.begin (), writeableControls.end (), control) != writeableControls.end ();
735  }
736 
743  void checkAddWriteableControl(PluginParameter* piParam, CControl* control)
744  {
745  if(!piParam)
746  return;
747  if(!control)
748  return;
749  if(!piParam->getIsWritable())
750  return;
751  if(!hasWriteableControl(control))
752  {
753  writeableControls.push_back(control);
754  control->remember();
755  }
756  }
757 
763  void checkRemoveWriteableControl(CControl* control)
764  {
765  if(!hasWriteableControl(control)) return;
766 
767  for(std::vector<CControl*>::iterator it = writeableControls.begin(); it != writeableControls.end(); ++it)
768  {
769  CControl* ctrl = *it;
770  if(ctrl == control)
771  {
772  ctrl->forget();
773  writeableControls.erase(it);
774  return;
775  }
776  }
777  }
778 
779 
784  {
785  for (ControlUpdateReceiverMap::const_iterator it = controlUpdateReceivers.begin(), end = controlUpdateReceivers.end(); it != end; ++it)
786  {
787  delete it->second;
788  }
789  controlUpdateReceivers.clear();
790  }
791 
796  {
797  for (std::vector<CControl*>::iterator it = writeableControls.begin(); it != writeableControls.end(); ++it)
798  {
799  CControl* ctrl = *it;
800  ctrl->forget();
801  }
802  writeableControls.clear();
803  }
804 
812  bool hasICustomView(CView* view)
813  {
814  ICustomView* customView = dynamic_cast<ICustomView*>(view);
815  if (customView)
816  return true;
817  return false;
818  }
819 
827  bool hasICustomView(IController* subController)
828  {
829  ICustomView* customView = dynamic_cast<ICustomView*>(subController);
830  if (customView)
831  return true;
832  return false;
833  }
834 
835 private:
836  typedef std::map<int32_t, ControlUpdateReceiver*> ControlUpdateReceiverMap;
837  ControlUpdateReceiverMap controlUpdateReceivers;
838  std::vector<CControl*> writeableControls;
839  std::vector<PluginParameter*> pluginParameters;
840 
841 #ifdef AAXPLUGIN
842  AAX_IViewContainer* aaxViewContainer = nullptr;
843 #endif
844 };
845 
846 }
847 
848 #endif
IGUIWindowFrame * guiWindowFrame
interface to allow plugin shell to resize our window
Definition: plugingui.h:517
double getControlValue()
the main function to access the underlying atomic double value
Definition: pluginparameter.h:167
AudioUnit m_AU
AU ONLY: the AU plugin reference.
Definition: plugingui.h:593
CView * createView(const UIAttributes &attributes, const IUIDescription *description) override
virtual void controlTagWillChange(VSTGUI::CControl *pControl) override
void checkAddWriteableControl(PluginParameter *piParam, CControl *control)
check to see if we already store this meter control and add it if we don&#39;t
Definition: plugingui.h:743
bool hasICustomView(IController *subController)
simple helper function to test sub-controller for ICustomView
Definition: plugingui.h:827
CControl * getControl_WithMouseCoords(const CPoint &where)
Definition: plugingui.h:361
virtual void setValue(float val) override
Definition: customcontrols.cpp:831
const PluginParameter getGuiControl()
Definition: plugingui.h:294
The PluginGUI object that maintains the entire GUI operation and has #defines to use with AAX...
Definition: plugingui.h:412
void save(bool saveAs=false)
void updateControlsWithControl(CControl *control)
Definition: plugingui.h:191
~ControlUpdateReceiver()
Definition: plugingui.h:101
void setAU(AudioUnit inAU)
Definition: plugingui.h:603
uint32_t numUIControls
control counter
Definition: plugingui.h:500
virtual void controlBeginEdit(VSTGUI::CControl *pControl) override
void dispatchAUControlChange(int tag, float actualPluginValue, int message=-1, bool fromEventListener=false)
set the GUI control from the AU event generator; this is part of the thread-safe event system...
Definition: plugingui.cpp:1349
void getSize(float &width, float &height)
std::string getGUIDesignerSize()
float getActualValueWithNormalizedValue(float normalizedValue)
Definition: plugingui.h:174
void setRAFXParameterFromGUIControl(CControl *control, int tag, float actualValue, float normalizedValue)
set the RAFX2 parameter from the GUI control
Definition: plugingui.cpp:1424
void setAAXViewContainer(AAX_IViewContainer *_aaxViewContainer)
AAX ONLY: plugin shell GUI object sets this after creation.
Definition: plugingui.h:581
void setAUEventFromGUIControl(CControl *control, int tag, float normalizedValue)
set the AU event from the GUI congrol; this is part of the thread-safe event system. This is called to safely set the GUI control value on the plugin shell&#39;s parameter list.
Definition: plugingui.cpp:1364
CMessageResult notify(CBaseObject *sender, IdStringPtr message) override
void removeControl(CControl *control)
Definition: plugingui.h:141
virtual void valueChanged(VSTGUI::CControl *pControl) override
bool getIsWritable()
query writable control (meter)
Definition: pluginparameter.h:152
IGUIPluginConnector * guiPluginConnector
the plugin shell interface that arrives with the open( ) function; OK if NULL for standalone GUIs ...
Definition: plugingui.h:495
CMouseEventResult sendAAXMouseMoved(int controlID, const CButtonState &buttons, const CPoint &where)
bool open(UTF8StringPtr _viewName, void *parent, const std::vector< PluginParameter *> *pluginParameterPtr, const PlatformType &platformType=kDefaultNative, IGUIPluginConnector *_guiPluginConnector=nullptr, void *data=nullptr)
double getControlValueNormalized(bool applyTaper=true)
get control value as normalied value
Definition: pluginparameter.h:279
uint32_t getControlID()
get ID value
Definition: pluginparameter.h:81
std::string getControlValueAsString()
the main function to access the underlying atomic double value as a string
Definition: pluginparameter.cpp:227
double getGUIMin()
Definition: pluginparameter.h:349
void deleteGUIControlList()
Definition: plugingui.h:469
IController * createSubController(UTF8StringPtr name, const IUIDescription *description) override
bool showGUIEditor
show the GUI designer
Definition: plugingui.h:509
double guiDesignerWidth
GUI Designer&#39;s frame size.
Definition: plugingui.h:512
std::vector< CControl * > guiControls
list of controls that share the control tag with this one
Definition: plugingui.h:381
double zoomFactor
scaling factor for built-in scaling
Definition: plugingui.h:501
CView * createUserCustomView(std::string viewname, const CRect rect, IControlListener *listener, int32_t tag)
void addControl(CControl *control)
Definition: plugingui.h:122
bool hasWriteableControl(CControl *control)
check to see if we already store this meter control
Definition: plugingui.h:732
PluginGUI(UTF8StringPtr _xmlFile)
virtual void idle()
bool controlAndContainerVisible(CControl *ctrl)
Definition: plugingui.h:305
CRect nonEditRect
non-edit area for GUI designer
Definition: plugingui.h:506
void updateControlsWithNormalizedValue(float normalizedValue, CControl *control=nullptr)
Definition: plugingui.h:200
virtual void controlTagDidChange(VSTGUI::CControl *pControl) override
void updateGUIControlAAX(int tag, float actualPluginValue, float normalizedValue=0.f, bool useNormalized=false)
set the GUI control from the plugin shell GUI object (thread-safe)
Definition: plugingui.cpp:1322
virtual void controlEndEdit(VSTGUI::CControl *pControl) override
CVSTGUITimer * timer
timer object (this is platform dependent)
Definition: plugingui.h:502
bool controlInRxGroupIsEditing()
Definition: plugingui.h:159
void writeToPresetFile()
std::string getStringByIndex(uint32_t index)
get string-list string by index
Definition: pluginparameter.cpp:281
float getNormalizedValueWithActualValue(float actualValue)
Definition: plugingui.h:183
CMouseEventResult sendAUMouseMoved(CControl *control, const CButtonState &buttons, const CPoint &where)
Definition: plugingui.h:540
float guiWidth
embedded GUI size
Definition: plugingui.h:514
int32_t onKeyDown(const VstKeyCode &code, CFrame *frame) override
Definition: plugingui.h:684
CPoint minSize
the min size of the GUI window
Definition: plugingui.h:504
Custom interface so that GUI can pass information to plugin shell in a thread-safe manner...
Definition: pluginstructures.h:1474
float guiHeight
embedded GUI size
Definition: plugingui.h:515
void setVSTParameterFromGUIControl(CControl *control, int tag, float actualValue, float normalizedValue)
set the VST parameter from the GUI control
Definition: plugingui.cpp:1391
double getControlValueWithNormalizedValue(double normalizedValue, bool applyTaper=true)
get the new control value as if it were set with a normalized value
Definition: pluginparameter.h:309
Custom View interface to allow plugin core to create safe communication channels with GUI custom view...
Definition: pluginstructures.h:1396
bool hasRefGuiControl
internal flag
Definition: plugingui.h:382
void onViewRemoved(CFrame *frame, CView *view) override
bool isReservedTag(int tag)
check to see if a tag is reserved: ASPiK defines several reserved control ID values.
Definition: guiconstants.h:49
Definition: customcontrols.cpp:20
std::string viewName
name
Definition: plugingui.h:497
size_t getStringCount()
get the number of individual strings in a string-list control
Definition: pluginparameter.h:227
void setControlValue(double actualParamValue, bool ignoreSmoothing=false)
the main function to set the underlying atomic double value
Definition: pluginparameter.h:175
void syncGUIControl(uint32_t controlID)
int getControlID_WithMouseCoords(const CPoint &where)
Definition: plugingui.h:332
uint32_t knobAction
knob mode
Definition: plugingui.h:519
CMouseEventResult onMouseMoved(CFrame *frame, const CPoint &where, const CButtonState &buttons) override
double getDefaultValueNormalized()
get default value as normalied value
Definition: pluginparameter.h:253
void onMouseEntered(CView *view, CFrame *frame) override
Definition: plugingui.h:672
void onMouseExited(CView *view, CFrame *frame) override
Definition: plugingui.h:675
ControlUpdateReceiver(CControl *control, PluginParameter *pluginParameterPtr, bool _isControlListener)
Definition: plugingui.h:89
void updateGUIControlRAFX(int tag, float normalizedValue)
set the GUI control from the RAFX2 parameter
Definition: plugingui.cpp:1437
The ControlUpdateReceiver object is the connection mechanism between PluginParameter objects and thei...
Definition: plugingui.h:85
bool hasICustomView(CView *view)
simple helper function to test view for ICustomView
Definition: plugingui.h:812
int32_t onKeyUp(const VstKeyCode &code, CFrame *frame) override
Definition: plugingui.h:687
bool hasControl(CControl *control)
Definition: plugingui.h:114
virtual bool validateCommandMenuItem(CCommandMenuItem *item)
ControlUpdateReceiver * getControlUpdateReceiver(int32_t tag) const
void scaleGUISize(uint32_t controlValue)
void setAAXParameterFromGUIControl(CControl *control, int tag, float actualValue, float normalizedValue)
set the plugin shelll parameter from GUI control using thread-safe mechanism
Definition: plugingui.cpp:1304
The PluginParameter object stores all of the data needed for any type of plugin parameter. It is a large object, but it is not complex as it really just stores LOTS of information about plugin parameters.
Definition: pluginparameter.h:51
CMouseEventResult sendAAXMouseDown(int controlID, const CButtonState &buttons)
CMouseEventResult onMouseDown(CFrame *frame, const CPoint &where, const CButtonState &buttons) override
virtual void setGUIWindowFrame(IGUIWindowFrame *frame) override
set the interface pointer for resizing from the GUI
Definition: plugingui.h:701
Custom interface to allow resizing of GUI window; this is mainly used for the GUI designer...
Definition: pluginstructures.h:1455
void initControl(CControl *control)
Definition: plugingui.h:208
bool createNewView
show the normal GUI
Definition: plugingui.h:510
Custom interface to allow resizing of GUI window; this is mainly used for the GUI designer...
Definition: pluginstructures.h:1431
double guiDesignerHeight
GUI Designer&#39;s frame size.
Definition: plugingui.h:513
The CXYPadEx object extends the CXYPad CVuMeter object with extra functionality. It is used in the Pl...
Definition: customcontrols.h:539
CFrame * guiEditorFrame
pointer to our frame
Definition: plugingui.h:518
void onViewAdded(CFrame *frame, CView *view) override
Definition: plugingui.h:666
static bool parseSize(const std::string &str, CPoint &point)
simple helper function to get size from string
Definition: plugingui.h:712
PluginParameter * getGuiControlWithTag(int tag)
find the local PluginParameter that is connected to the same control ID
Definition: plugingui.h:484
double getNormalizedControlValueWithActualValue(double actualValue)
get the new normalized control value as if it were set with an actual value
Definition: pluginparameter.h:346
void deleteControlUpdateReceivers()
delete all reciever objects
Definition: plugingui.h:783
UIDescription * description
the description version of the XML file
Definition: plugingui.h:496
virtual int32_t getKnobMode() const override
CMouseEventResult sendAUMouseDown(CControl *control, const CButtonState &buttons)
virtual bool onCommandMenuItemSelected(CCommandMenuItem *item)
void checkRemoveWriteableControl(CControl *control)
check to see if we already store this meter control and remove it if we do
Definition: plugingui.h:763
CControl * getControl_WithMouseCoords(const CPoint &where)
PluginParameter refGuiControl
single parameter with this control tag
Definition: plugingui.h:380
int getControlID_WithMouseCoords(const CPoint &where)
void setPluginParameterFromGUIControl(CControl *control, int tag, float actualValue, float normalizedValue)
safely set a plugin shell parameter with a GUI control
Definition: plugingui.h:553
bool isControlListener
internal flag
Definition: plugingui.h:383
void forgetWriteableControls()
forget all writeable (neter) controls
Definition: plugingui.h:795
virtual ~PluginGUI()
int32_t getControlID()
Definition: plugingui.h:299
bool createGUI(bool bShowGUIEditor)
CPoint maxSize
the max size of the GUI window
Definition: plugingui.h:505
std::string xmlFile
the XML file name
Definition: plugingui.h:498
void updateControlsWithActualValue(float actualValue, CControl *control=nullptr)
Definition: plugingui.h:218
AUEventListenerRef AUEventListener
AU ONLY: the event listener token.
Definition: plugingui.h:594
virtual int32_t controlModifierClicked(VSTGUI::CControl *pControl, VSTGUI::CButtonState button) override
return 1 if you want the control to not handle it, otherwise 0
Definition: plugingui.h:635
void updateGUIControlVST(int tag, float normalizedValue)
set the GUI control from the VST parameter
Definition: plugingui.cpp:1404