iPlug2 - C++ Audio Plug-in Framework
IControls.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the iPlug 2 library. Copyright (C) the iPlug 2 developers.
5 
6  See LICENSE.txt for more info.
7 
8  ==============================================================================
9 */
10 
11 #pragma once
12 
19 #include "IControl.h"
20 #include "IColorPickerControl.h"
21 #include "IVKeyboardControl.h"
22 #include "IVMeterControl.h"
23 #include "IVScopeControl.h"
24 #include "IVMultiSliderControl.h"
25 #include "IRTTextControl.h"
26 #include "IVDisplayControl.h"
27 #include "ILEDControl.h"
28 #include "IPopupMenuControl.h"
29 
30 BEGIN_IPLUG_NAMESPACE
31 BEGIN_IGRAPHICS_NAMESPACE
32 
38 #pragma mark - Vector Controls
39 
42  , public IVectorBase
43 {
44 public:
45  IVLabelControl(const IRECT& bounds, const char* label, const IVStyle& style = DEFAULT_STYLE.WithDrawFrame(false).WithColor(kSH, COLOR_BLACK).WithShadowOffset(1).WithValueText(DEFAULT_VALUE_TEXT.WithSize(20.f).WithFGColor(COLOR_WHITE)));
46  void Draw(IGraphics& g) override;
47 };
48 
51  , public IVectorBase
52 {
53 public:
62  IVButtonControl(const IRECT& bounds, IActionFunction aF = SplashClickActionFunc, const char* label = "", const IVStyle& style = DEFAULT_STYLE, bool labelInButton = true, bool valueInButton = true, EVShape shape = EVShape::Rectangle);
63 
64  void Draw(IGraphics& g) override;
65  virtual void DrawWidget(IGraphics& g) override;
66  bool IsHit(float x, float y) const override;
67  void OnResize() override;
68 };
69 
72  , public IVectorBase
73 {
74 public:
75  IVSwitchControl(const IRECT& bounds, int paramIdx = kNoParameter, const char* label = "", const IVStyle& style = DEFAULT_STYLE, bool valueInButton = true);
76 
77  IVSwitchControl(const IRECT& bounds, IActionFunction aF = SplashClickActionFunc, const char* label = "", const IVStyle& style = DEFAULT_STYLE, int numStates = 2, bool valueInButton = true);
78 
79  void Draw(IGraphics& g) override;
80  virtual void DrawWidget(IGraphics& g) override;
81  void OnMouseOut() override { ISwitchControlBase::OnMouseOut(); SetDirty(false); }
82  bool IsHit(float x, float y) const override;
83  void SetDirty(bool push, int valIdx = kNoValIdx) override;
84  void OnResize() override;
85  void OnInit() override;
86 };
87 
90 {
91 public:
92  IVToggleControl(const IRECT& bounds, int paramIdx = kNoParameter, const char* label = "", const IVStyle& style = DEFAULT_STYLE, const char* offText = "OFF", const char* onText = "ON");
93 
94  IVToggleControl(const IRECT& bounds, IActionFunction aF = SplashClickActionFunc, const char* label = "", const IVStyle& style = DEFAULT_STYLE, const char* offText = "OFF", const char* onText = "ON", bool initialState = false);
95 
96  void DrawValue(IGraphics& g, bool mouseOver) override;
97  void DrawWidget(IGraphics& g) override;
98 protected:
99  WDL_String mOffText;
100  WDL_String mOnText;
101 };
102 
105 {
106 public:
107  IVSlideSwitchControl(const IRECT& bounds, int paramIdx = kNoParameter, const char* label = "", const IVStyle& style = DEFAULT_STYLE, bool valueInButton = false, EDirection direction = EDirection::Horizontal);
108 
109  IVSlideSwitchControl(const IRECT& bounds, IActionFunction aF = EmptyClickActionFunc, const char* label = "", const IVStyle& style = DEFAULT_STYLE, bool valueInButton = false, EDirection direction = EDirection::Horizontal, int numStates = 2, int initialState = 0);
110 
111  void Draw(IGraphics& g) override;
112  void DrawWidget(IGraphics& g) override;
113  virtual void DrawTrack(IGraphics& g, const IRECT& filledArea);
114 
115  void OnResize() override;
116  void OnEndAnimation() override;
117  void SetDirty(bool push, int valIdx = kNoValIdx) override;
118 protected:
119  void UpdateRects();
120 
121  IRECT mStartRect, mEndRect;
122  IRECT mHandleBounds;
123  EDirection mDirection;
124 };
125 
128  , public IVectorBase
129 {
130 public:
131  enum class ETabSegment { Start, Mid, End };
132 
141  IVTabSwitchControl(const IRECT& bounds, int paramIdx = kNoParameter, const std::initializer_list<const char*>& options = {}, const char* label = "", const IVStyle & style = DEFAULT_STYLE, EVShape shape = EVShape::Rectangle, EDirection direction = EDirection::Horizontal);
142 
151  IVTabSwitchControl(const IRECT& bounds, IActionFunction aF, const std::initializer_list<const char*>& options, const char* label = "", const IVStyle& style = DEFAULT_STYLE, EVShape shape = EVShape::Rectangle, EDirection direction = EDirection::Horizontal);
152 
153  virtual ~IVTabSwitchControl() { mTabLabels.Empty(true); }
154  void Draw(IGraphics& g) override;
155  void OnInit() override;
156 
157  virtual void DrawWidget(IGraphics& g) override;
158  virtual void DrawButton(IGraphics& g, const IRECT& bounds, bool pressed, bool mouseOver, ETabSegment segment, bool disabled);
159  void OnMouseDown(float x, float y, const IMouseMod& mod) override;
160  void OnMouseOver(float x, float y, const IMouseMod& mod) override;
161  void OnMouseOut() override { mMouseOverButton = -1; ISwitchControlBase::OnMouseOut(); SetDirty(false); }
162  void OnResize() override;
163  virtual bool IsHit(float x, float y) const override;
164 
166  const char* GetSelectedLabelStr() const;
167 protected:
168 
170  virtual int GetButtonForPoint(float x, float y) const;
171 
172  int mMouseOverButton = -1;
173  WDL_TypedBuf<IRECT> mButtons;
174  WDL_PtrList<WDL_String> mTabLabels;
175  EDirection mDirection;
176 };
177 
180 {
181 public:
190  IVRadioButtonControl(const IRECT& bounds, int paramIdx = kNoParameter, const std::initializer_list<const char*>& options = {}, const char* label = "", const IVStyle& style = DEFAULT_STYLE, EVShape shape = EVShape::Ellipse, EDirection direction = EDirection::Vertical, float buttonSize = 10.f);
191 
201  IVRadioButtonControl(const IRECT& bounds, IActionFunction aF, const std::initializer_list<const char*>& options, const char* label = "", const IVStyle& style = DEFAULT_STYLE, EVShape shape = EVShape::Ellipse, EDirection direction = EDirection::Vertical, float buttonSize = 10.f);
202 
203  virtual void DrawWidget(IGraphics& g) override;
204 protected:
206  int GetButtonForPoint(float x, float y) const override;
207 
208  float mButtonSize;
209  float mButtonAreaWidth;
210  bool mOnlyButtonsRespondToMouse = false;
211 };
212 
215  , public IVectorBase
216 {
217 public:
218  IVKnobControl(const IRECT& bounds, int paramIdx,
219  const char* label = "",
220  const IVStyle& style = DEFAULT_STYLE,
221  bool valueIsEditable = false, bool valueInWidget = false,
222  float a1 = -135.f, float a2 = 135.f, float aAnchor = -135.f,
223  EDirection direction = EDirection::Vertical, double gearing = DEFAULT_GEARING, float trackSize = 2.f);
224 
225  IVKnobControl(const IRECT& bounds, IActionFunction aF,
226  const char* label = "",
227  const IVStyle& style = DEFAULT_STYLE,
228  bool valueIsEditable = false, bool valueInWidget = false,
229  float a1 = -135.f, float a2 = 135.f, float aAnchor = -135.f,
230  EDirection direction = EDirection::Vertical, double gearing = DEFAULT_GEARING, float trackSize = 2.f);
231 
232  virtual ~IVKnobControl() {}
233 
234  void Draw(IGraphics& g) override;
235  virtual void DrawWidget(IGraphics& g) override;
236  virtual void DrawIndicatorTrack(IGraphics& g, float angle, float cx, float cy, float radius);
237  virtual void DrawPointer(IGraphics& g, float angle, float cx, float cy, float radius);
238 
239  void OnMouseDown(float x, float y, const IMouseMod& mod) override;
240  void OnMouseDblClick(float x, float y, const IMouseMod& mod) override;
241  void OnMouseUp(float x, float y, const IMouseMod& mod) override;
242  void OnMouseOver(float x, float y, const IMouseMod& mod) override;
243  void OnMouseOut() override { mValueMouseOver = false; IKnobControlBase::OnMouseOut(); }
244 
245  void OnResize() override;
246  bool IsHit(float x, float y) const override;
247  void SetDirty(bool push, int valIdx = kNoValIdx) override;
248  void OnInit() override;
249 
250  void SetInnerPointerFrac(float frac) { mInnerPointerFrac = frac; }
251  void SetOuterPointerFrac(float frac) { mOuterPointerFrac = frac; }
252  void SetPointerThickness(float thickness) { mPointerThickness = thickness; }
253 
254 protected:
255  virtual IRECT GetKnobDragBounds() override;
256 
257  float mTrackToHandleDistance = 4.f;
258  float mInnerPointerFrac = 0.1f;
259  float mOuterPointerFrac = 1.f;
260  float mPointerThickness = 2.5f;
261  float mAngle1, mAngle2;
262  float mAnchorAngle; // for bipolar arc
263  bool mValueMouseOver = false;
264 };
265 
268  , public IVectorBase
269 {
270 public:
271  IVSliderControl(const IRECT& bounds, int paramIdx = kNoParameter, const char* label = "", const IVStyle& style = DEFAULT_STYLE, bool valueIsEditable = false, EDirection dir = EDirection::Vertical, double gearing = DEFAULT_GEARING, float handleSize = 8.f, float trackSize = 2.f, bool handleInsideTrack = false);
272 
273  IVSliderControl(const IRECT& bounds, IActionFunction aF, const char* label = "", const IVStyle& style = DEFAULT_STYLE, bool valueIsEditable = false, EDirection dir = EDirection::Vertical, double gearing = DEFAULT_GEARING, float handleSize = 8.f, float trackSize = 2.f, bool handleInsideTrack = false);
274 
275  virtual ~IVSliderControl() {}
276  void Draw(IGraphics& g) override;
277  virtual void DrawWidget(IGraphics& g) override;
278  virtual void DrawTrack(IGraphics& g, const IRECT& filledArea);
279  virtual void DrawHandle(IGraphics& g, const IRECT& bounds);
280 
281  void OnMouseDown(float x, float y, const IMouseMod& mod) override;
282  void OnMouseDblClick(float x, float y, const IMouseMod& mod) override;
283  void OnMouseUp(float x, float y, const IMouseMod& mod) override;
284  void OnMouseOver(float x, float y, const IMouseMod& mod) override;
285  void OnMouseOut() override { mValueMouseOver = false; ISliderControlBase::OnMouseOut(); }
286  bool IsHit(float x, float y) const override;
287  void OnResize() override;
288  void SetDirty(bool push, int valIdx = kNoValIdx) override;
289  void OnInit() override;
290 
291 protected:
292  bool mHandleInsideTrack = false;
293  bool mValueMouseOver = false;
294 };
295 
298 {
299 public:
300  IVRangeSliderControl(const IRECT& bounds, const std::initializer_list<int>& params, const char* label = "", const IVStyle& style = DEFAULT_STYLE, EDirection dir = EDirection::Vertical, bool onlyHandle = false, float handleSize = 8.f, float trackSize = 2.f);
301 
302  void Draw(IGraphics& g) override;
303  void DrawTrack(IGraphics& g, const IRECT& r, int chIdx) override;
304  void DrawWidget(IGraphics& g) override;
305  void OnMouseOver(float x, float y, const IMouseMod& mod) override;
306  void OnMouseOut() override { mMouseOverHandle = -1; IVTrackControlBase::OnMouseOut(); }
307  void OnMouseDown(float x, float y, const IMouseMod& mod) override;
308  void OnMouseUp(float x, float y, const IMouseMod& mod) override { mMouseIsDown = false; }
309  void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod& mod) override;
310 
311 protected:
312  void MakeTrackRects(const IRECT& bounds) override;
313  IRECT GetHandleBounds(int trackIdx);
314 
315  int mMouseOverHandle = -1;
316  float mHandleSize;
317  bool mMouseIsDown = false;
318 };
319 
321 class IVXYPadControl : public IControl
322  , public IVectorBase
323 {
324 public:
325  IVXYPadControl(const IRECT& bounds, const std::initializer_list<int>& params, const char* label = "", const IVStyle& style = DEFAULT_STYLE, float handleRadius = 10.f);
326 
327  void Draw(IGraphics& g) override;
328  void DrawWidget(IGraphics& g) override;
329  virtual void DrawHandle(IGraphics& g, const IRECT& trackBounds, const IRECT& handleBounds);
330  virtual void DrawTrack(IGraphics& g);
331  void OnMouseDown(float x, float y, const IMouseMod& mod) override;
332  void OnMouseUp(float x, float y, const IMouseMod& mod) override;
333  void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod& mod) override;
334  void OnResize() override;
335 protected:
336  float mHandleRadius;
337  bool mMouseDown = false;
338  bool mTrackClipsHandle = true;
339 };
340 
342 class IVPlotControl : public IControl
343  , public IVectorBase
344 {
345 public:
347  using IPlotFunc = std::function<double(double)>;
348 
352  struct Plot {
353  IColor color;
354  IPlotFunc func;
355  };
356 
367  IVPlotControl(const IRECT& bounds, const std::initializer_list<Plot>& funcs, int numPoints, const char* label = "", const IVStyle& style = DEFAULT_STYLE, float min = -1., float max = 1., bool useLayer = false);
368 
369  void Draw(IGraphics& g) override;
370  void OnResize() override;
371 
375  void AddPlotFunc(const IColor& color, const IPlotFunc& func);
376 
377 protected:
378  ILayerPtr mLayer;
379  std::vector<Plot> mPlots;
380  float mMin;
381  float mMax;
382  bool mUseLayer = true;
383  int mHorizontalDivisions = 10;
384  int mVerticalDivisions = 10; // always + 2 when drawing
385 
386  std::vector<float> mPoints;
387 };
388 
390 class IVGroupControl : public IControl
391  , public IVectorBase
392 {
393 public:
394  IVGroupControl(const IRECT& bounds, const char* label = "", float labelOffset = 10.f, const IVStyle& style = DEFAULT_STYLE);
395 
396  IVGroupControl(const char* label, const char* groupName, float padL = 0.f, float padT = 0.f, float padR = 0.f, float padB = 0.f, const IVStyle& style = DEFAULT_STYLE);
397 
398  void Draw(IGraphics& g) override;
399  void DrawWidget(IGraphics& g) override;
400  void OnResize() override;
401  void OnInit() override;
402 
403  void SetBoundsBasedOnGroup(const char* groupName, float padL, float padT, float padR, float padB);
404 protected:
405  WDL_String mGroupName;
406  float mPadL = 0.f;
407  float mPadT = 0.f;
408  float mPadR = 0.f;
409  float mPadB = 0.f;
410  float mLabelOffset = 10.f;
411  float mLabelPadding = 10.f;
412 };
413 
415 class IVPanelControl : public IControl
416  , public IVectorBase
417 {
418 public:
419  IVPanelControl(const IRECT& bounds, const char* label = "", const IVStyle& style = DEFAULT_STYLE.WithColor(kFG, COLOR_TRANSLUCENT).WithEmboss(true))
420  : IControl(bounds)
421  , IVectorBase(style)
422  {
423  mIgnoreMouse = true;
424  AttachIControl(this, label);
425  }
426 
427  void Draw(IGraphics& g) override
428  {
429  DrawBackground(g, mRECT);
430  DrawWidget(g);
431  DrawLabel(g);
433  }
434 
435  void DrawWidget(IGraphics& g) override
436  {
437  DrawPressableRectangle(g, mWidgetBounds, false, false, false);
438  }
439 
440  void OnResize() override
441  {
442  SetTargetRECT(MakeRects(mRECT));
443  }
444 };
445 
448  , public IVectorBase
449 {
450 public:
451  enum class ECellLayout { kGrid, kHorizontal, kVertical };
452 
453  using ColorChosenFunc = std::function<void(int, IColor)>;
454 
455  IVColorSwatchControl(const IRECT& bounds, const char* label = "", ColorChosenFunc func = nullptr, const IVStyle& spec = DEFAULT_STYLE, ECellLayout layout = ECellLayout::kGrid,
456  const std::initializer_list<EVColor>& colorIDs = { kBG, kFG, kPR, kFR, kHL, kSH, kX1, kX2, kX3 },
457  const std::initializer_list<const char*>& labelsForIDs = { kVColorStrs[kBG],kVColorStrs[kFG],kVColorStrs[kPR],kVColorStrs[kFR],kVColorStrs[kHL],kVColorStrs[kSH],kVColorStrs[kX1],kVColorStrs[kX2],kVColorStrs[kX3] });
458 
459  virtual ~IVColorSwatchControl() { mLabels.Empty(true); }
460 
461  void Draw(IGraphics& g) override;
462  void OnMouseOver(float x, float y, const IMouseMod& mod) override;
463  void OnMouseOut() override;
464  void OnMouseDown(float x, float y, const IMouseMod& mod) override;
465  void OnResize() override;
466 
467  void DrawWidget(IGraphics& g) override;
468 
469 private:
470  ColorChosenFunc mColorChosenFunc = nullptr;
471  int mCellOver = -1;
472  ECellLayout mLayout = ECellLayout::kVertical;
473  WDL_TypedBuf<IRECT> mCellRects;
474  WDL_PtrList<WDL_String> mLabels;
475  std::vector<EVColor> mColorIdForCells;
476 };
477 
478 #pragma mark - SVG Vector Controls
479 
482 {
483 public:
484  ISVGKnobControl(const IRECT& bounds, const ISVG& svg, int paramIdx = kNoParameter);
485 
486  void Draw(IGraphics& g) override;
487  void SetSVG(ISVG& svg);
488 
489 private:
490  ISVG mSVG;
491  float mStartAngle = -135.f;
492  float mEndAngle = 135.f;
493 };
494 
497 {
498 public:
502  ISVGButtonControl(const IRECT& bounds, IActionFunction aF, const ISVG& offImage, const ISVG& onImage);
503 
504  void Draw(IGraphics& g) override;
505  //void OnResize() override;
506 
507 protected:
508  ISVG mOffSVG;
509  ISVG mOnSVG;
510 };
511 
514 {
515 public:
521  ISVGSwitchControl(const IRECT& bounds, const std::initializer_list<ISVG>& svgs, int paramIdx = kNoParameter, IActionFunction aF = nullptr);
522 
523  void Draw(IGraphics& g) override;
524 
525 protected:
526  std::vector<ISVG> mSVGs;
527 };
528 
531 {
532 public:
540  ISVGSliderControl(const IRECT& bounds, const ISVG& handleSvg, const ISVG& trackSVG, int paramIdx = kNoParameter, EDirection dir = EDirection::Vertical, double gearing = DEFAULT_GEARING);
541 
542  void Draw(IGraphics& g) override;
543  void OnResize() override;
544 
545 protected:
546  IRECT GetHandleBounds(double value = -1.0) const;
547 
548  IRECT mTrackSVGBounds;
549  IRECT mHandleBoundsAtMax;
550  ISVG mHandleSVG;
551  ISVG mTrackSVG;
552 };
553 
554 #pragma mark - Bitmap Controls
555 
558  , public IBitmapBase
559 {
560 public:
561  IBButtonControl(float x, float y, const IBitmap& bitmap, IActionFunction aF = DefaultClickActionFunc);
562 
563  IBButtonControl(const IRECT& bounds, const IBitmap& bitmap, IActionFunction aF = DefaultClickActionFunc);
564 
565  void Draw(IGraphics& g) override { DrawBitmap(g); }
566  void OnRescale() override { mBitmap = GetUI()->GetScaledBitmap(mBitmap); }
567 };
568 
571  , public IBitmapBase
572 {
573 public:
579  IBSwitchControl(float x, float y, const IBitmap& bitmap, int paramIdx = kNoParameter);
580 
585  IBSwitchControl(const IRECT& bounds, const IBitmap& bitmap, int paramIdx = kNoParameter);
586 
587  virtual ~IBSwitchControl() {}
588  void Draw(IGraphics& g) override { DrawBitmap(g); }
589  void OnRescale() override { mBitmap = GetUI()->GetScaledBitmap(mBitmap); }
590  void OnMouseDown(float x, float y, const IMouseMod& mod) override;
591 };
592 
595  , public IBitmapBase
596 {
597 public:
598  IBKnobControl(float x, float y, const IBitmap& bitmap, int paramIdx, EDirection direction = EDirection::Vertical, double gearing = DEFAULT_GEARING)
599  : IKnobControlBase(IRECT(x, y, bitmap), paramIdx, direction, gearing)
600  , IBitmapBase(bitmap) { AttachIControl(this); }
601 
602  IBKnobControl(const IRECT& bounds, const IBitmap& bitmap, int paramIdx, EDirection direction = EDirection::Vertical, double gearing = DEFAULT_GEARING)
603  : IKnobControlBase(bounds.GetCentredInside(bitmap), paramIdx, direction, gearing)
604  , IBitmapBase(bitmap) { AttachIControl(this); }
605 
606  virtual ~IBKnobControl() {}
607  void Draw(IGraphics& g) override { DrawBitmap(g); }
608  void OnRescale() override { mBitmap = GetUI()->GetScaledBitmap(mBitmap); }
609 };
610 
613 {
614 public:
615  IBKnobRotaterControl(float x, float y, const IBitmap& bitmap, int paramIdx)
616  : IBKnobControl(IRECT(x, y, bitmap), bitmap, paramIdx) {}
617 
618  IBKnobRotaterControl(const IRECT& bounds, const IBitmap& bitmap, int paramIdx)
619  : IBKnobControl(bounds.GetCentredInside(bitmap), bitmap, paramIdx) {}
620 
621  virtual ~IBKnobRotaterControl() {}
622  void Draw(IGraphics& g) override;
623 };
624 
627  , public IBitmapBase
628 {
629 public:
630  IBSliderControl(float x, float y, float trackLength, const IBitmap& handleBitmap, const IBitmap& trackBitmap = IBitmap(), int paramIdx = kNoParameter, EDirection dir = EDirection::Vertical, double gearing = DEFAULT_GEARING);
631 
632  IBSliderControl(const IRECT& bounds, const IBitmap& handleBitmap, const IBitmap& trackBitmap = IBitmap(), int paramIdx = kNoParameter, EDirection dir = EDirection::Vertical, double gearing = DEFAULT_GEARING);
633 
634  virtual ~IBSliderControl() {}
635 
636  void Draw(IGraphics& g) override;
637  void OnRescale() override { mBitmap = GetUI()->GetScaledBitmap(mBitmap); }
638  void OnResize() override;
639 
640  IRECT GetHandleBounds(double value = -1.0) const;
641 
642 protected:
643  IBitmap mTrackBitmap;
644 };
645 
648  , public IBitmapBase
649 {
650 public:
651  IBTextControl(const IRECT& bounds, const IBitmap& bitmap, const IText& text = DEFAULT_TEXT, const char* str = "", int charWidth = 6, int charHeight = 12, int charOffset = 0, bool multiLine = false, bool vCenter = true, EBlend blend = EBlend::Default);
652  virtual ~IBTextControl() {}
653 
654  void Draw(IGraphics& g) override;
655  void OnRescale() override { mBitmap = GetUI()->GetScaledBitmap(mBitmap); }
656 
657 protected:
658  int mCharWidth, mCharHeight, mCharOffset;
659  bool mMultiLine;
660  bool mVCentre;
661 };
662 
663 END_IGRAPHICS_NAMESPACE
664 END_IPLUG_NAMESPACE
665 
666 #include "IVPresetManagerControl.h"
667 #include "IVNumberBoxControl.h"
668 
Glowing LED control.
std::function< double(double)> IPlotFunc
IVPlotControl passes values between 0 and 1 to this object, that are the plot normalized x values...
Definition: IControls.h:347
IRECT DrawPressableRectangle(IGraphics &g, const IRECT &bounds, bool pressed, bool mouseOver, bool disabled, bool rtl=true, bool rtr=true, bool rbl=true, bool rbr=true)
Draw a rectangle-shaped vector button.
Definition: IControl.h:876
A control to display some text in the UI, driven by values in the RT audio thread.
void OnMouseOut() override
Implement this method to respond to a mouseout event on this control.
Definition: IControls.h:285
Vectorial multi-channel capable oscilloscope control.
The lowest level base class of an IGraphics control.
Definition: IControl.h:42
Used to manage a rectangular area, independent of draw class/platform.
void OnMouseUp(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse up event on this control.
Definition: IControls.h:308
virtual void OnResize()
Called when IControl is constructed or resized using SetRect().
Definition: IControl.h:148
A "meta control" for a "preset manager" for disk-based preset files It adds several child buttons...
virtual void OnMouseDown(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouse down event on this control.
Definition: IControl.cpp:250
virtual void DrawValue(IGraphics &g, bool mouseOver)
Draw the IVControl value text.
Definition: IControl.h:756
A vector button/momentary switch control which shows two SVG states.
Definition: IControls.h:496
A "meta control" for a number box with an Inc/Dec button It adds several child buttons.
A control to show a color swatch of up to 9 colors.
Definition: IControls.h:447
A basic control to display some text.
Definition: IControl.h:1945
virtual void DrawBackground(IGraphics &g, const IRECT &rect)
Draw the IVControl background (usually transparent)
Definition: IControl.h:733
User-facing bitmap abstraction that you use to manage bitmap data, independant of draw class/platform...
void OnMouseOut() override
Implement this method to respond to a mouseout event on this control.
Definition: IControls.h:81
A vector toggle control.
Definition: IControls.h:89
A vector button/momentary switch control.
Definition: IControls.h:50
Used to manage mouse modifiers i.e.
A base class for switch controls.
Definition: IControl.h:1690
bool mMouseIsOver
if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control.
Definition: IControl.h:545
A vector slider control.
Definition: IControls.h:267
A panel control which can be styled with emboss etc.
Definition: IControls.h:415
void EmptyClickActionFunc(IControl *pCaller)
A click action function that does nothing.
Definition: IControl.cpp:43
A vector "tab" multi switch control.
Definition: IControls.h:127
A Slider control with and SVG for track and handle.
Definition: IControls.h:530
Used to manage color data, independent of draw class/platform.
A control for choosing a color.
A base interface to be combined with IControl for bitmap-based controls "IBControls", managing an IBitmap.
Definition: IControl.h:586
A vector XY Pad slider control.
Definition: IControls.h:321
void DefaultClickActionFunc(IControl *pCaller)
A click action function that triggers the default animation function for DEFAULT_ANIMATION_DURATION.
Definition: IControl.cpp:45
A base class for buttons/momentary switches - cannot be linked to parameters.
Definition: IControl.h:1679
virtual void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod &mod)
Implement this method to respond to a mouse drag event on this control.
Definition: IControl.h:99
A vector switch control which shows one of multiple SVG states.
Definition: IControls.h:513
A control to display text using a monospace bitmap font.
Definition: IControls.h:647
User-facing SVG abstraction that you use to manage SVG data ISVG doesn&#39;t actually own the image data...
void AttachIControl(IControl *pControl, const char *label)
Call in the constructor of your IVControl to link the IVectorBase and IControl.
Definition: IControl.h:641
void Draw(IGraphics &g) override
Draw the control to the graphics context.
Definition: IControls.h:588
This file contains the base IControl implementation, along with some base classes for specific types ...
virtual bool IsHit(float x, float y) const
Hit test the control.
Definition: IControl.h:385
virtual void OnMouseUp(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouse up event on this control.
Definition: IControl.h:91
Vectorial multi-channel capable meter control.
void OnResize() override
Called when IControl is constructed or resized using SetRect().
Definition: IControls.h:440
A base class for mult-strip/track controls, such as multi-sliders, meters Track refers to the channel...
Definition: IControl.h:1248
IRECT MakeRects(const IRECT &parent, bool hasHandle=false)
Calculate the rectangles for the various areas, depending on the style.
Definition: IControl.h:1014
A vector "radio buttons" switch control.
Definition: IControls.h:179
A bitmap switch control.
Definition: IControls.h:570
A vectorial multi-slider control.
void OnRescale() override
Implement to do something when graphics is scaled globally (e.g.
Definition: IControls.h:566
A control to display a rolling graphics of historical values.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
Definition: IControls.h:565
IText is used to manage font and text/text entry style for a piece of text on the UI...
A vector knob/dial control which rotates an SVG image.
Definition: IControls.h:481
A vector label control that can display text with a shadow.
Definition: IControls.h:41
void Draw(IGraphics &g) override
Draw the control to the graphics context.
Definition: IControls.h:607
IControl(const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
Constructor.
Definition: IControl.cpp:81
IBitmap GetScaledBitmap(IBitmap &inBitmap)
Get a version of the input bitmap from the cache that corresponds to the current screen scale For exa...
Definition: IGraphics.cpp:1493
void OnRescale() override
Implement to do something when graphics is scaled globally (e.g.
Definition: IControls.h:589
A switch with a slide animation when clicked.
Definition: IControls.h:104
void DrawWidget(IGraphics &g) override
Draw the IVControl main widget (override)
Definition: IControls.h:435
The lowest level base class of an IGraphics context.
Definition: IGraphics.h:86
IVectorBase(const IVStyle &style, bool labelInWidget=false, bool valueInWidget=false)
IVectorBase Constructor.
Definition: IControl.h:631
Groups a plot function and color.
Definition: IControls.h:352
virtual void OnMouseOver(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouseover event on this control.
Definition: IControl.cpp:265
virtual void DrawLabel(IGraphics &g)
Draw the IVControl label text.
Definition: IControl.h:746
A base control for a pop-up menu/drop-down list that stays within the bounds of the IGraphics context...
void OnInit() override
Called just prior to when the control is attached, after its delegate and graphics member variable se...
Definition: IControl.cpp:448
void OnMouseOut() override
Implement this method to respond to a mouseout event on this control.
Definition: IControls.h:243
A vector plot to display functions and waveforms.
Definition: IControls.h:342
A base class for knob/dial controls, to handle mouse action and Sender.
Definition: IControl.h:1191
A bitmap knob/dial control that rotates an image.
Definition: IControls.h:612
void SplashClickActionFunc(IControl *pCaller)
The splash click action function is used by IVControls to start SplashAnimationFunc.
Definition: IControl.cpp:47
A base class for slider/fader controls, to handle mouse action and Sender.
Definition: IControl.h:1221
void SetTargetRECT(const IRECT &bounds)
Set the rectangular mouse tracking target area, within the graphics context for this control...
Definition: IControl.h:317
IGraphics * GetUI()
Definition: IControl.h:452
void OnMouseOut() override
Implement this method to respond to a mouseout event on this control.
Definition: IControl.h:1346
A bitmap knob/dial control that draws a frame from a stacked bitmap.
Definition: IControls.h:594
virtual void DrawWidget(IGraphics &g)
Draw the IVControl main widget (override)
Definition: IControl.h:740
IRECT GetCentredInside(const IRECT &sr) const
Get a rectangle the size of sr but with the same center point as this rectangle.
virtual void OnMouseDblClick(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouse double click event on this control.
Definition: IControl.cpp:256
void Draw(IGraphics &g) override
Draw the control to the graphics context.
Definition: IControls.h:427
void OnMouseOut() override
Implement this method to respond to a mouseout event on this control.
Definition: IControls.h:161
A vector switch control.
Definition: IControls.h:71
A bitmap button/momentary switch control.
Definition: IControls.h:557
A base interface to be combined with IControl for vectorial controls "IVControls", in order for them to share a common style If you need more flexibility, you&#39;re on your own!
Definition: IControl.h:624
void OnRescale() override
Implement to do something when graphics is scaled globally (e.g.
Definition: IControls.h:637
void OnMouseOut() override
Implement this method to respond to a mouseout event on this control.
Definition: IControls.h:306
void OnRescale() override
Implement to do something when graphics is scaled globally (e.g.
Definition: IControls.h:655
A bitmap slider/fader control.
Definition: IControls.h:626
std::unique_ptr< ILayer > ILayerPtr
ILayerPtr is a managed pointer for transferring the ownership of layers.
Vectorial keyboard control.
void OnRescale() override
Implement to do something when graphics is scaled globally (e.g.
Definition: IControls.h:608
A vector range slider control, with two handles.
Definition: IControls.h:297
A control to draw a rectangle around a named IControl group.
Definition: IControls.h:390
A struct encapsulating a set of properties used to configure IVControls.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.
Definition: IControl.cpp:196
A vector knob control drawn using graphics primitives.
Definition: IControls.h:214
virtual void OnMouseOut()
Implement this method to respond to a mouseout event on this control.
Definition: IControl.cpp:273
void Draw(IGraphics &g) override
Draw the control to the graphics context.
Definition: IControls.cpp:38