20BEGIN_IGRAPHICS_NAMESPACE
25 pCaller->OnEndAnimation();
35 pCaller->OnEndAnimation();
39 pCaller->
As<
IVectorBase>()->SetSplashRadius((
float) progress);
59 assert(pParam &&
"ShowBubbleHorizontalActionFunc requires a parameter");
63 pGraphics->ShowBubbleControl(pCaller, bounds.R, bounds.
MH(), display.Get(), EDirection::Horizontal,
IRECT(0, 0, 50, 30));
70 assert(pParam &&
"ShowBubbleVerticalActionFunc requires a parameter");
74 pGraphics->ShowBubbleControl(pCaller, bounds.
MW(), bounds.T, display.Get(), EDirection::Vertical,
IRECT(0, 0, 50, 30));
77END_IGRAPHICS_NAMESPACE
81using namespace igraphics;
88 mVals[0].idx = paramIdx;
97 for (
auto& paramIdx : params) {
98 mVals.push_back({paramIdx, 0.});
111 assert(valIdx > kNoValIdx && valIdx <
NVals());
112 return mVals[valIdx].idx;
117 assert(valIdx > kNoValIdx && valIdx <
NVals());
118 mVals.at(valIdx).idx = paramIdx;
126 if(paramIdx > kNoParameter)
127 return mDelegate->
GetParam(paramIdx);
134 const int nVals =
NVals();
136 for (
int v = 0; v < nVals; v++)
138 if(mVals[v].idx == paramIdx)
149 assert(valIdx > kNoValIdx && valIdx <
NVals());
150 mVals[valIdx].value = value;
155 assert(valIdx > kNoValIdx && valIdx <
NVals());
156 return mVals[valIdx].value;
164 if (!
GetUI()->ControlIsCaptured(
this))
185 valIdx = (
NVals() == 1) ? 0 : valIdx;
187 auto paramDefault = [
this](
int v)
200 valIdx = (
NVals() == 1) ? 0 : valIdx;
209 auto paramUpdate = [
this](
int v)
225void IControl::Animate()
228 mAnimationFunc(
this);
247 mBlend.mWeight = (disable ? GRAYED_ALPHA : 1.0f);
285 if (pSelectedMenu && valIdx > kNoValIdx &&
GetParamIdx(valIdx) > kNoParameter && !mDisablePrompt)
293 if (x < 0.f) x = 0.f;
294 if (y < 0.f) y = 0.f;
296 float tX = x + (mTargetRECT.L - mRECT.L);
297 float tY = y + (mTargetRECT.T - mRECT.T);
299 SetRECT({x, y, x + mRECT.
W(), y + mRECT.
H()});
305 if (w < 0.f) w = 0.f;
306 if (h < 0.f) h = 0.f;
313 mGestureFuncs.insert(std::make_pair(type, func));
322 auto itr = mGestureFuncs.find(info.type);
324 if(itr != mGestureFuncs.end())
326 mLastGesture = info.type;
327 itr->second(
this, info);
336 if (valIdx > kNoValIdx &&
GetParamIdx(valIdx) > kNoParameter && !mDisablePrompt)
338 if (
GetParam(valIdx)->NDisplayTexts())
344 float cX = mRECT.
MW();
345 float cY = mRECT.
MH();
346 float halfW = PARAM_EDIT_W/2.f;
347 float halfH = PARAM_EDIT_H/2.f;
349 IRECT txtRECT =
IRECT(cX - halfW, cY - halfH, cX + halfW,cY + halfH);
359 if (valIdx > kNoValIdx &&
GetParamIdx(valIdx) > kNoParameter && !mDisablePrompt)
370 mPTHighlightColor = COLOR_RED;
373 mPTHighlightColor = COLOR_BLUE;
376 mPTHighlightColor = COLOR_GREEN;
379 mPTHighlightColor = COLOR_YELLOW;
385 mPTisHighlighted = isHighlighted;
391 if (mPTisHighlighted)
393 g.
FillCircle(mPTHighlightColor, mTargetRECT.R-5, mTargetRECT.T+5, 2);
403 if(direction == EDirection::Vertical)
404 val = 1.f - (y-bounds.T) / bounds.
H();
406 val = (x-bounds.L) / bounds.
W();
408 auto valFunc = [&](
int valIdx) {
409 SetValue(
Clip(std::round(val / 0.001 ) * 0.001, minClip, maxClip), valIdx);
416void IControl::OnEndAnimation()
418 mAnimationFunc =
nullptr;
421 if(mAnimationEndActionFunc)
422 mAnimationEndActionFunc(
this);
427 mAnimationStartTime = std::chrono::high_resolution_clock::now();
428 mAnimationDuration = Milliseconds(duration);
436 auto elapsed = Milliseconds(std::chrono::high_resolution_clock::now() - mAnimationStartTime);
437 return elapsed.count() / mAnimationDuration.count();
440ITextControl::ITextControl(
const IRECT& bounds,
const char* str,
const IText& text,
const IColor& BGColor,
bool setBoundsBasedOnStr)
444, mSetBoundsBasedOnStr(setBoundsBasedOnStr)
452 if(mSetBoundsBasedOnStr)
458 if (strcmp(mStr.Get(), str))
462 if(mSetBoundsBasedOnStr)
472 va_start(arglist, fmt);
473 mStr.SetAppendFormattedArgs(
false, maxlen, fmt, arglist);
481 g.
FillRect(mBGColor, mRECT, &mBlend);
484 g.
DrawText(mText, mStr.Get(), mRECT, &mBlend);
494IURLControl::IURLControl(
const IRECT& bounds,
const char* str,
const char* urlStr,
const IText& text,
const IColor& BGColor,
const IColor& MOColor,
const IColor& CLColor)
497, mOriginalColor(text.mFGColor)
501 mIgnoreMouse =
false;
506 g.
FillRect(mBGColor, mRECT, &mBlend);
509 mText.mFGColor = mMOColor;
511 mText.mFGColor = mClicked ? mCLColor : mOriginalColor;
513 if (mStr.GetLength())
518 float linePosY = 0.f;
519 float linePosL = 0.f;
520 float linePosR = 0.f;
522 if(mText.mVAlign == EVAlign::Middle)
523 linePosY = mRECT.
MH() + textDims.B;
524 else if(mText.mVAlign == EVAlign::Bottom)
526 else if(mText.mVAlign == EVAlign::Top)
527 linePosY = mRECT.T - textDims.
H();
529 if(mText.mAlign == EAlign::Center)
531 linePosL = mRECT.
MW() + textDims.L;
532 linePosR = mRECT.
MW() + textDims.R;
534 else if(mText.mAlign == EAlign::Near)
537 linePosR = mRECT.L + textDims.
W();
539 else if(mText.mAlign == EAlign::Far)
541 linePosL = mRECT.R - textDims.
W();
545 g.
DrawLine(mText.mFGColor, linePosL, linePosY, linePosR, linePosY, &mBlend);
546 g.
DrawText(mText, mStr.Get(), mRECT, &mBlend);
560 mOriginalColor = txt.mFGColor;
563ITextToggleControl::ITextToggleControl(
const IRECT& bounds,
int paramIdx,
const char* offText,
const char* onText,
const IText& text,
const IColor& bgColor)
570 mIgnoreMouse =
false;
571 mDblAsSingleClick =
true;
574ITextToggleControl::ITextToggleControl(
const IRECT& bounds, IActionFunction aF,
const char* offText,
const char* onText,
const IText& text,
const IColor& bgColor)
580 mDblAsSingleClick =
true;
581 mIgnoreMouse =
false;
607, mShowParamLabel(showParamLabel)
610 mDblAsSingleClick =
true;
611 mDisablePrompt =
false;
612 mIgnoreMouse =
false;
640 if (mTriangleRect.
W() > 0.f)
643 mTriangleRect.L, mTriangleRect.T, mTriangleRect.R, mTriangleRect.T, mTriangleRect.
MW(), mTriangleRect.B,
652 if (pParam && pParam->
Type() == IParam::kTypeEnum)
654 const auto textHeight = mText.mSize;
655 const auto dropDownAreaWidth = textHeight;
656 const auto triangleWidth = dropDownAreaWidth * 0.5f;
657 const auto triangleHeight = dropDownAreaWidth * 0.33f;
659 auto dropDownAreaRect = mText.mAlign == EAlign::Far ? mRECT.
GetFromLeft(dropDownAreaWidth)
666PlaceHolder::PlaceHolder(
const IRECT& bounds,
const char* str)
669 mBGColor = COLOR_WHITE;
670 mDisablePrompt =
false;
671 mDblAsSingleClick =
false;
672 mIgnoreMouse =
false;
678 g.
DrawLine(COLOR_RED, mRECT.L, mRECT.T, mRECT.R, mRECT.B, &BLEND_50, 2.f);
679 g.
DrawLine(COLOR_RED, mRECT.L, mRECT.B, mRECT.R, mRECT.T, &BLEND_50, 2.f);
684 g.
DrawText(mHeightText, mHeightStr.Get(), mRECT.L + mInset, mRECT.
MH());
689 g.
DrawText(mWidthText, mWidthStr.Get(), mRECT.
MW(), mRECT.T + mInset);
694 g.
DrawText(mTLGCText, mTLHCStr.Get(), mRECT.L + mInset, mRECT.T + mInset);
696 if (mStr.GetLength())
703 mCentreLabelBounds = r;
709 mTLHCStr.SetFormatted(32,
"%0.1f, %0.1f", mRECT.L, mRECT.T);
710 mWidthStr.SetFormatted(32,
"%0.1f", mRECT.
W());
711 mHeightStr.SetFormatted(32,
"%0.1f", mRECT.
H());
714IButtonControlBase::IButtonControlBase(
const IRECT& bounds, IActionFunction aF)
717 mDblAsSingleClick =
true;
726void IButtonControlBase::OnEndAnimation()
729 IControl::OnEndAnimation();
732ISwitchControlBase::ISwitchControlBase(
const IRECT& bounds,
int paramIdx, IActionFunction aF,
int numStates)
734, mNumStates(numStates)
736 mDisabledState.Resize(numStates);
737 SetAllStatesDisabled(
false);
738 mDblAsSingleClick =
true;
741void ISwitchControlBase::SetAllStatesDisabled(
bool disabled)
743 for(
int i=0; i<mNumStates; i++)
745 SetStateDisabled(i, disabled);
750void ISwitchControlBase::SetStateDisabled(
int stateIdx,
bool disabled)
752 if(stateIdx >= 0 && stateIdx < mNumStates && mDisabledState.GetSize())
753 mDisabledState.Get()[stateIdx] = disabled;
758bool ISwitchControlBase::GetStateDisabled(
int stateIdx)
const
760 if(stateIdx >= 0 && stateIdx < mNumStates && mDisabledState.GetSize())
761 return mDisabledState.Get()[stateIdx];
770 assert(mNumStates > 1);
779 const double step = 1.0 / (double(mNumStates-1));
782 if (val > (1.0 + std::numeric_limits<double>::epsilon()))
797bool IKnobControlBase::IsFineControl(
const IMouseMod& mod,
bool wheel)
const
803 return wheel ? mod.C : mod.R;
806 return (mod.C || mod.S);
815 if (mHideCursorOnDrag)
823 if (mHideCursorOnDrag)
832 double gearing = IsFineControl(mod,
false) ? mGearing * 10.0 : mGearing;
836 if (mDirection == EDirection::Vertical)
837 mMouseDragValue +=
static_cast<double>(dY /
static_cast<double>(dragBounds.T - dragBounds.B) / gearing);
839 mMouseDragValue +=
static_cast<double>(dX /
static_cast<double>(dragBounds.R - dragBounds.L) / gearing);
841 mMouseDragValue =
Clip(mMouseDragValue, 0., 1.);
843 double v = mMouseDragValue;
855 const double gearing = IsFineControl(mod,
true) ? 0.001 : 0.01;
856 double newValue = 0.0;
864 const double step = pParam->
GetStep();
866 v += d > 0 ? step : -step;
876 newValue = oldValue + gearing * d;
883ISliderControlBase::ISliderControlBase(
const IRECT& bounds,
int paramIdx, EDirection dir,
double gearing,
float handleSize)
886, mHandleSize(handleSize)
891 ISliderControlBase::ISliderControlBase(
const IRECT& bounds, IActionFunction aF, EDirection dir,
double gearing,
float handleSize)
894, mHandleSize(handleSize)
902 mTrackBounds = mRECT;
920 if (mHideCursorOnDrag)
928 if (mHideCursorOnDrag)
939 if(mod.touchID || !mHideCursorOnDrag)
957 double gearing = IsFineControl(mod,
false) ? mGearing * 10.0 : mGearing;
959 if (mDirection == EDirection::Vertical)
960 mMouseDragValue +=
static_cast<double>(dY /
static_cast<double>(mTrackBounds.T - mTrackBounds.B) / gearing);
962 mMouseDragValue +=
static_cast<double>(dX /
static_cast<double>(mTrackBounds.R - mTrackBounds.L) / gearing);
964 mMouseDragValue =
Clip(mMouseDragValue, 0., 1.);
966 double v = mMouseDragValue;
977 const double gearing = IsFineControl(mod,
true) ? 0.001 : 0.01;
978 double newValue = 0.0;
986 const double step = pParam->
GetStep();
988 v += d > 0 ? step : -step;
998 newValue = oldValue + gearing * d;
1005bool ISliderControlBase::IsFineControl(
const IMouseMod& mod,
bool wheel)
const
1011 return wheel ? mod.C : mod.R;
1014 return (mod.C || mod.S);
1019IDirBrowseControlBase::~IDirBrowseControlBase()
1024int IDirBrowseControlBase::NItems()
const
1026 return mItems.GetSize();
1031 assert(strlen(path));
1033 mPaths.Add(
new WDL_String(path));
1034 mPathLabels.Add(
new WDL_String(label));
1037void IDirBrowseControlBase::CollectSortedItems(
IPopupMenu* pMenu)
1039 int nItems = pMenu->NItems();
1041 for (
int i = 0; i < nItems; i++)
1045 if (pItem->GetSubmenu())
1046 CollectSortedItems(pItem->GetSubmenu());
1055 mItems.Empty(
false);
1058 mSelectedItemIndex = -1;
1062 if (mPaths.GetSize() == 1)
1064 ScanDirectory(mPaths.Get(0)->Get(), mMainMenu);
1068 for (
int p = 0; p<mPaths.GetSize(); p++)
1071 mMainMenu.AddItem(mPathLabels.Get(p)->Get(), idx++, pNewMenu);
1072 ScanDirectory(mPaths.Get(p)->Get(), *pNewMenu);
1076 CollectSortedItems(&mMainMenu);
1082 mPathLabels.Empty(
true);
1084 mItems.Empty(
false);
1089 for (
auto fileIdx = 0; fileIdx < mFiles.GetSize(); fileIdx ++)
1091 if (strcmp(mFiles.Get(fileIdx)->Get(), filePath) == 0)
1093 for (
auto itemIdx = 0; itemIdx < mItems.GetSize(); itemIdx++)
1097 if (pItem->GetTag() == fileIdx)
1099 mSelectedItemIndex = itemIdx;
1106 mSelectedItemIndex = -1;
1111 if (mSelectedItemIndex > -1)
1114 path.Set(mFiles.Get(pItem->GetTag()));
1124 if (mSelectedItemIndex > -1)
1127 mMainMenu.CheckItemAlone(pItem);
1131void IDirBrowseControlBase::ScanDirectory(
const char* path,
IPopupMenu& menuToAddTo)
1139 const char* f = d.GetCurrentFN();
1140 if (f && f[0] !=
'.')
1142 if (mScanRecursively && d.GetCurrentIsDirectory())
1145 d.GetCurrentFullFN(&subdir);
1147 menuToAddTo.AddItem(d.GetCurrentFN(), pNewMenu, -2);
1148 ScanDirectory(subdir.Get(), *pNewMenu);
1156 auto strrstr = [](
const char* str1,
const char* str2) ->
const char* {
1160 const char* result =
nullptr;
1162 while (*str1 !=
'\0') {
1163 if (std::strncmp(str1, str2, std::strlen(str2)) == 0)
1172 const char* a = strrstr(f, mExtension.Get());
1173 if (a && a > f && strlen(a) == strlen(mExtension.Get()))
1175 WDL_String menuEntry {f};
1177 if (!mShowFileExtensions)
1178 menuEntry.Set(f, (
int) (a - f) - 1);
1181 menuToAddTo.AddItem(pItem, -2 );
1182 WDL_String* pFullPath =
new WDL_String(
"");
1183 d.GetCurrentFullFN(pFullPath);
1184 mFiles.Add(pFullPath);
1188 }
while (!d.Next());
1191 if (!mShowEmptySubmenus)
1192 menuToAddTo.RemoveEmptySubmenus();
This file contains the base IControl implementation, along with some base classes for specific types ...
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
ICaptionControl(const IRECT &bounds, int paramIdx, const IText &text=DEFAULT_TEXT, const IColor &BGColor=DEFAULT_BGCOLOR, bool showParamLabel=true)
Creates an ICaptionControl.
void OnResize() override
Called when IControl is constructed or resized using SetRect().
void Draw(IGraphics &g) override
Draw the control to the graphics context.
The lowest level base class of an IGraphics control.
bool GetMouseIsOver() const
This can be used in IControl::Draw() to check if the mouse is over the control, without implementing ...
IControl(const IRECT &bounds, int paramIdx=kNoParameter, IActionFunction actionFunc=nullptr)
Constructor.
virtual void OnMouseOut()
Implement this method to respond to a mouseout event on this control.
bool mMouseIsOver
if mGraphics::mHandleMouseOver = true, this will be true when the mouse is over control.
virtual void OnMouseOver(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouseover event on this control.
virtual void SetPosition(float x, float y)
Set the position of the control, preserving the width and height.
virtual void SetValueFromDelegate(double value, int valIdx=0)
Set the control's value from the delegate This method is called from the class implementing the IEdit...
virtual void OnPopupMenuSelection(IPopupMenu *pSelectedMenu, int valIdx)
Implement this method to handle popup menu selection after IGraphics::CreatePopupMenu/IControlPromptU...
virtual void OnMouseDown(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouse down event on this control.
virtual void SetValueFromUserInput(double value, int valIdx=0)
Set the control's value after user input.
virtual bool IsDirty()
Called at each display refresh by the IGraphics draw loop, after IControl::Animate(),...
virtual void Hide(bool hide)
Shows or hides the IControl.
IControl * AttachGestureRecognizer(EGestureType type, IGestureFunc func)
Add a IGestureFunc that should be triggered in response to a certain type of gesture.
int GetParamIdx(int valIdx=0) const
Get the index of a parameter that the control is linked to Normaly controls are either linked to a si...
const IRECT & GetRECT() const
Get the rectangular draw area for this control, within the graphics context.
int LinkedToParam(int paramIdx) const
Check if the control is linked to a particular parameter.
void SetTargetRECT(const IRECT &bounds)
Set the rectangular mouse tracking target area, within the graphics context for this control.
IGEditorDelegate * GetDelegate()
Gets a pointer to the class implementing the IEditorDelegate interface that handles parameter changes...
virtual void OnMouseDblClick(float x, float y, const IMouseMod &mod)
Implement this method to respond to a mouse double click event on this control.
double GetAnimationProgress() const
Get the progress in a control's animation, in the range 0-1.
void PromptUserInput(int valIdx=0)
Call this method in response to a mouse event to create an edit box so the user can enter a value,...
virtual void SnapToMouse(float x, float y, EDirection direction, const IRECT &bounds, int valIdx=-1, double minClip=0., double maxClip=1.)
Set control value based on x, y position within a rectangle.
virtual void DrawPTHighlight(IGraphics &g)
Implement this to customise how a colored highlight is drawn on the control in ProTools (AAX format o...
virtual void SetValueToDefault(int valIdx=kNoValIdx)
Set one or all of the control's values to the default value of the associated parameter.
virtual void SetParamIdx(int paramIdx, int valIdx=0)
Set the index of a parameter that the control is linked to If you are calling this "manually" to reus...
virtual bool OnGesture(const IGestureInfo &info)
const IParam * GetParam(int valIdx=0) const
Get a const pointer to the IParam object (owned by the editor delegate class), associated with this c...
void ForValIdx(int valIdx, T func, Args... args)
A helper template function to call a method for an individual value, or for all values.
T * As()
Helper function to dynamic cast an IControl to a subclass.
virtual void SetSize(float w, float h)
Set the size of the control, preserving the current position.
void SetPTParameterHighlight(bool isHighlighted, int color)
Used internally by the AAX wrapper view interface to set the control parmeter highlight.
void SetRECT(const IRECT &bounds)
Set the rectangular draw area for this control, within the graphics context.
void StartAnimation(int duration)
virtual void SetDisabled(bool disable)
Sets disabled mode for the control, the default implementation modifies the mBlend member.
virtual void SetValue(double value, int valIdx=0)
Set one of the control's values.
double GetValue(int valIdx=0) const
Get the control's value.
void SetTargetAndDrawRECTs(const IRECT &bounds)
Set BOTH the draw rect and the target area, within the graphics context for this control.
virtual int GetValIdxForPos(float x, float y) const
Check to see which of the control's values relates to this x and y coordinate.
IAnimationFunction GetAnimationFunction()
Get the control's animation function, if it exists.
virtual void SetDirty(bool triggerAction=true, int valIdx=kNoValIdx)
Mark the control as dirty, i.e.
IControl * SetActionFunction(IActionFunction actionFunc)
Set an Action Function for this control.
void SetAnimation(IAnimationFunction func)
Set the animation function.
void ClearPathList()
Clear the menu.
void CheckSelectedItem()
Check the currently selected menu item.
void SetupMenu()
Call after adding one or more paths, to populate the menu.
void GetSelectedFile(WDL_String &path) const
Get the full path to the file if something has been selected in the menu.
void SetSelectedFile(const char *filePath)
Set the selected file based on a file path.
void AddPath(const char *path, const char *displayText)
Used to add a path to scan for files.
IParam * GetParam(int paramIdx)
Get a pointer to one of the delegate's IParam objects.
virtual void SendParameterValueFromUI(int paramIdx, double normalizedValue)
SPVFUI Called by the UI during a parameter change gesture, in order to notify the host of the new val...
The lowest level base class of an IGraphics context.
virtual bool OpenURL(const char *url, const char *msgWindowTitle=0, const char *confirmMsg=0, const char *errMsgOnFailure=0)=0
Open a URL in the platform’s default browser.
void DrawText(const IText &text, const char *str, const IRECT &bounds, const IBlend *pBlend=0)
Draw some text to the graphics context in a specific rectangle.
void UpdatePeers(IControl *pCaller, int callerValIdx)
This method is called after interacting with a control, so that any other controls linked to the same...
virtual void AttachGestureRecognizer(EGestureType type)
Registers a gesture recognizer with the graphics context.
void ReleaseMouseCapture()
Used to tell the graphics context to stop tracking mouse interaction with a control.
virtual void FillRect(const IColor &color, const IRECT &bounds, const IBlend *pBlend=0)
Fill a rectangular region of the graphics context with a color.
virtual void DrawLine(const IColor &color, float x1, float y1, float x2, float y2, const IBlend *pBlend=0, float thickness=1.f)
Draw a line to the graphics context.
void GetMouseDownPoint(float &x, float &y) const
Get the x, y position of the last mouse down message.
virtual void FillTriangle(const IColor &color, float x1, float y1, float x2, float y2, float x3, float y3, const IBlend *pBlend=0)
Fill a triangle with a color.
IControl * GetControlInTextEntry()
void PromptUserInput(IControl &control, const IRECT &bounds, int valIdx=0)
Prompt for user input either using a text entry or pop up menu.
virtual void HideMouseCursor(bool hide=true, bool lock=true)=0
Call to hide/show the mouse cursor.
virtual void FillCircle(const IColor &color, float cx, float cy, float r, const IBlend *pBlend=0)
Fill a circle with a color.
virtual float MeasureText(const IText &text, const char *str, IRECT &bounds) const
Measure the rectangular region that some text will occupy.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod &mod) override
Implement this method to respond to a mouse drag event on this control.
void OnMouseWheel(float x, float y, const IMouseMod &mod, float d) override
Implement this method to respond to a mouse wheel event on this control.
void OnMouseUp(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse up event on this control.
virtual IRECT GetKnobDragBounds()
Get the area for which mouse deltas will be used to calculate the amount dragging changes the control...
double GetStep() const
Returns the parameter's step size.
double GetDefault(bool normalized=false) const
Returns the parameter's default value.
EParamType Type() const
Get the parameter's type.
double ToNormalized(double nonNormalizedValue) const
Convert a real value to normalized value for this parameter.
double ConstrainNormalized(double normalizedValue) const
Constrains a normalised input value similarly to Constrain()
void GetDisplay(WDL_String &display, bool withDisplayText=true) const
Get the current textual display for the current parameter value.
const char * GetLabel() const
Returns the parameter's label.
double FromNormalized(double normalizedValue) const
Convert a normalized value to real value for this parameter.
void GetDisplayWithLabel(WDL_String &display, bool withDisplayText=true) const
Fills the WDL_String the value of the parameter along with the label, e.g.
double GetRange() const
Returns the parameter's range.
void OnMouseWheel(float x, float y, const IMouseMod &mod, float d) override
Implement this method to respond to a mouse wheel event on this control.
void OnMouseDrag(float x, float y, float dX, float dY, const IMouseMod &mod) override
Implement this method to respond to a mouse drag event on this control.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void OnResize() override
Called when IControl is constructed or resized using SetRect().
void OnMouseUp(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse up event on this control.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void OnInit() override
Called just prior to when the control is attached, after its delegate and graphics member variable se...
void OnMouseUp(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse up event on this control.
A basic control to display some text.
virtual void SetStrFmt(int maxlen, const char *fmt,...)
Set the text to display, using a printf-like format string.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnInit() override
Called just prior to when the control is attached, after its delegate and graphics member variable se...
void SetBoundsBasedOnStr()
Measures the bounds of the text that the control displays and compacts/expands the control's bounds t...
virtual void SetStr(const char *str)
Set the text to display.
void SetDirty(bool push, int valIdx=0) override
Mark the control as dirty, i.e.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void SetText(const IText &) override
Set the Text object typically used to determine font/layout/size etc of the main text in a control.
void OnMouseDown(float x, float y, const IMouseMod &mod) override
Implement this method to respond to a mouse down event on this control.
void Draw(IGraphics &g) override
Draw the control to the graphics context.
A base interface to be combined with IControl for vectorial controls "IVControls",...
void Draw(IGraphics &g) override
Draw the control to the graphics context.
void OnResize() override
Called when IControl is constructed or resized using SetRect().
BEGIN_IPLUG_NAMESPACE BEGIN_IGRAPHICS_NAMESPACE void DefaultAnimationFunc(IControl *pCaller)
An animation function that just calls the caller control's OnEndAnimation() method at the end of the ...
void EmptyClickActionFunc(IControl *pCaller)
A click action function that does nothing.
void DefaultClickActionFunc(IControl *pCaller)
A click action function that triggers the default animation function for DEFAULT_ANIMATION_DURATION.
void SplashClickActionFunc(IControl *pCaller)
The splash click action function is used by IVControls to start SplashAnimationFunc.
void SplashAnimationFunc(IControl *pCaller)
The splash animation function is used by IVControls to animate the splash.
void ShowBubbleVerticalActionFunc(IControl *pCaller)
Use with a param-linked control to popup the bubble control vertically.
void ShowBubbleHorizontalActionFunc(IControl *pCaller)
Use with a param-linked control to popup the bubble control horizontally.
Used to describe a particular gesture.
BEGIN_IPLUG_NAMESPACE T Clip(T x, T lo, T hi)
Clips the value x between lo and hi.
Used to manage color data, independent of draw class/platform.
Used to manage mouse modifiers i.e.
Used to manage a rectangular area, independent of draw class/platform.
IRECT GetFromRight(float amount) const
Get a subrect of this IRECT bounded in X by 'amount' and the right edge.
IRECT GetCentredInside(const IRECT &sr) const
Get a rectangle the size of sr but with the same center point as this rectangle.
IRECT GetTranslated(float x, float y) const
Get a translated copy of this rectangle.
void Constrain(float &x, float &y) const
Ensure the point (x,y) is inside this IRECT.
IRECT GetFromLeft(float amount) const
Get a subrect of this IRECT bounded in X by the left edge and 'amount'.
IText is used to manage font and text/text entry style for a piece of text on the UI,...