iPlug2 - C++ Audio Plug-in Framework
|
Utility functions and macros. More...
Classes | |
class | IMidiQueue |
A class to help with queuing timestamped MIDI messages. More... | |
Macros | |
#define | MAKE_QUOTE(str) #str |
#define | MAKE_STR(str) MAKE_QUOTE(str) |
#define | GET_PARAM_FROM_VARARG(paramType, vp, v) |
Functions | |
template<typename T > | |
BEGIN_IPLUG_NAMESPACE T | Clip (T x, T lo, T hi) |
Clips the value x between lo and hi . More... | |
template<typename T > | |
T | Lerp (T a, T b, T f) |
Linear interpolate between values a and b . More... | |
static bool | CStringHasContents (const char *str) |
static double | DBToAmp (double dB) |
Calculates gain from a given dB value. More... | |
static double | AmpToDB (double amp) |
static void | GetVersionParts (int versionInteger, int &maj, int &min, int &pat) |
Helper function to unpack the version number parts as individual integers. More... | |
static int | GetDecimalVersion (int versionInteger) |
Helper function to get the version number as a decimal integer. More... | |
static void | GetVersionStr (int versionInteger, WDL_String &str) |
Helper function to get the semantic version number as a string from an integer. More... | |
template<class SRC , class DEST > | |
void | CastCopy (DEST *pDest, SRC *pSrc, int n) |
Helper function to loop through a buffer of samples copying and casting from e.g float to double. More... | |
static void | ToLower (char *cDest, const char *cSrc) |
static EHost | LookUpHost (const char *inHost) |
Gets the host ID from a human-readable name. More... | |
static void | GetHostNameStr (EHost host, WDL_String &str) |
Gets a human-readable name from host identifier. More... | |
static void | MidiNoteName (double midiPitch, WDL_String ¬eName, bool cents=false, bool middleCisC4=false) |
Utility functions and macros.
|
inlinestatic |
Definition at line 103 of file IPlugUtilities.h.
References AMP_DB.
Referenced by IVMeterControl< MAXNC >::OnMsgFromDelegate().
void CastCopy | ( | DEST * | pDest, |
SRC * | pSrc, | ||
int | n | ||
) |
Helper function to loop through a buffer of samples copying and casting from e.g float to double.
SRC | The source type |
DEST | The destination type |
pDest | Ptr to the destination buffer |
pSrc | Ptr to the source buffer |
n | The number of or elements in the buffer |
Definition at line 147 of file IPlugUtilities.h.
Referenced by IPlugProcessor::GetAUPluginType().
BEGIN_IPLUG_NAMESPACE T Clip | ( | T | x, |
T | lo, | ||
T | hi | ||
) |
Clips the value x
between lo
and hi
.
x | Input value |
lo | Minimum value to be allowed |
hi | Maximum value to be allowed If x is outside given range, it will be set to one of the boundaries |
Definition at line 47 of file IPlugUtilities.h.
Referenced by IColor::Clamp(), IParam::Constrain(), IEditorDelegate::ConstrainEditorResize(), IColor::Contrast(), IVKeyboardControl::Draw(), IGraphicsSkia::DrawBitmap(), IGraphics::DrawBitmap(), IBitmapBase::DrawBitmap(), IGraphicsNanoVG::DrawDottedRect(), IGraphics::DrawHorizontalLine(), IGraphics::DrawVerticalLine(), IVScopeControl< MAXNC, MAXBUF >::DrawWidget(), IColor::FromHSLA(), IVectorBase::GetColor(), IVStyle::IVStyle(), IShaderControl::OnMouseDown(), IShaderControl::OnMouseDrag(), IKnobControlBase::OnMouseDrag(), ISliderControlBase::OnMouseDrag(), IShaderControl::OnMouseUp(), IWheelControl::OnMouseUp(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), IGraphics::Resize(), IControl::SetDirty(), IPopupMenuControl::SetMaxBounds(), IColor::SetOpacity(), IGraphics::SetQwertyMidiKeyHandlerFunc(), IVNumberBoxControl::SetStyle(), IVMultiSliderControl< MAXNC >::SnapToMouse(), IControl::SnapToMouse(), and IParam::ToNormalized().
|
inlinestatic |
Calculates gain from a given dB value.
dB | Value in dB |
Definition at line 95 of file IPlugUtilities.h.
References IAMP_DB.
Referenced by IParam::DBToAmp().
|
inlinestatic |
Helper function to get the version number as a decimal integer.
versionInteger | The version number packed into an integer |
Definition at line 123 of file IPlugUtilities.h.
References GetVersionParts().
Referenced by IPluginBase::GetHostVersion(), and IPluginBase::GetPluginVersion().
|
static |
Gets a human-readable name from host identifier.
host | Host identifier (see EHost) |
str | WDL_String to set |
Definition at line 235 of file IPlugUtilities.h.
Referenced by IPluginBase::GetHostStr().
|
inlinestatic |
Helper function to unpack the version number parts as individual integers.
versionInteger | The version number packed into an integer |
maj | The major version |
min | The minor version |
pat | The patch version |
Definition at line 113 of file IPlugUtilities.h.
Referenced by GetDecimalVersion(), and GetVersionStr().
|
inlinestatic |
Helper function to get the semantic version number as a string from an integer.
versionInteger | The version number packed into an integer |
str | WDL_String to be populated with the version number in MAJOR.MINOR.PATCH format as a string |
Definition at line 133 of file IPlugUtilities.h.
References GetVersionParts().
Referenced by IPluginBase::GetHostVersionStr(), IPluginBase::GetPluginVersionStr(), and IPlugAPIBase::SetHost().
|
inline |
Linear interpolate between values a
and b
.
a | Low value |
b | High value |
f | Value betweeen 0-1 for interpolation |
Definition at line 54 of file IPlugUtilities.h.
Referenced by IWheelControl::Draw(), IWheelControl::OnMouseUp(), and IVMultiSliderControl< MAXNC >::SnapToMouse().
|
static |
Gets the host ID from a human-readable name.
inHost | Host name to search for |
Definition at line 171 of file IPlugUtilities.h.
References ToLower().
Referenced by IPlugAPIBase::SetHost().
|
static |
midiPitch |
Definition at line 294 of file IPlugUtilities.h.
Referenced by IParam::InitPitch().
|
static |
cDest |
Definition at line 158 of file IPlugUtilities.h.
Referenced by IGraphicsCanvas::BitmapExtSupported(), IGraphicsSkia::BitmapExtSupported(), IGraphicsNanoVG::BitmapExtSupported(), and LookUpHost().