|
iPlug2 - C++ Audio Plug-in Framework
|
Utility functions and macros. More...
Classes | |
| class | IMidiQueueBase< T > |
| 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) |
| static FILE * | fopenUTF8 (const char *path, const char *mode) |
| int | DOMKeyToVirtualKey (uint32_t domKeyCode) |
| Converts a DOM virtual key code to an iPlug2 virtual key code. More... | |
Utility functions and macros.
| #define GET_PARAM_FROM_VARARG | ( | paramType, | |
| vp, | |||
| v | |||
| ) |
Definition at line 64 of file IPlugUtilities.h.
| #define MAKE_QUOTE | ( | str | ) | #str |
Definition at line 60 of file IPlugUtilities.h.
| #define MAKE_STR | ( | str | ) | MAKE_QUOTE(str) |
Definition at line 61 of file IPlugUtilities.h.
| enum EDOMVirtualKey |
Definition at line 429 of file IPlugUtilities.h.
|
inlinestatic |
Definition at line 105 of file IPlugUtilities.h.
References AMP_DB.
Referenced by IBMeterControl::OnMsgFromDelegate(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), and IVPeakAvgMeterControl< 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 149 of file IPlugUtilities.h.
| 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 49 of file IPlugUtilities.h.
Referenced by IColor::Clamp(), IParam::Constrain(), IEditorDelegate::ConstrainEditorResize(), IColor::Contrast(), IGraphics::DrawBitmap(), IGraphicsSkia::DrawBitmap(), IBitmapBase::DrawBitmap(), IGraphicsNanoVG::DrawDottedRect(), IGraphics::DrawHorizontalLine(), IGraphics::DrawVerticalLine(), IColor::FromHSLA(), IShaderControl::OnMouseDrag(), IKnobControlBase::OnMouseDrag(), ISliderControlBase::OnMouseDrag(), IShaderControl::OnMouseUp(), IWheelControl::OnMouseUp(), IBMeterControl::OnMsgFromDelegate(), IVMeterControl< MAXNC >::OnMsgFromDelegate(), IVPeakAvgMeterControl< MAXNC >::OnMsgFromDelegate(), IGraphics::Resize(), IControl::SetDirty(), IColor::SetOpacity(), IGraphics::SetQwertyMidiKeyHandlerFunc(), ADSREnvelope< T >::SetStageTime(), IControl::SnapToMouse(), IVMultiSliderControl< MAXNC >::SnapToMouse(), and IParam::ToNormalized().
|
inlinestatic |
Definition at line 58 of file IPlugUtilities.h.
|
inlinestatic |
Calculates gain from a given dB value.
| dB | Value in dB |
Definition at line 97 of file IPlugUtilities.h.
References IAMP_DB.
|
inline |
Converts a DOM virtual key code to an iPlug2 virtual key code.
| domKeyCode | The DOM virtual key code to convert |
Definition at line 479 of file IPlugUtilities.h.
|
static |
Definition at line 412 of file IPlugUtilities.h.
|
inlinestatic |
Helper function to get the version number as a decimal integer.
| versionInteger | The version number packed into an integer |
Definition at line 125 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 int hostID = EHost::kHostAbletonLive;
WDL_String hostName;
GetHostNameStr(hostID, hostName);
static void GetHostNameStr(EHost host, WDL_String &str) Gets a human-readable name from host identifier. Definition: IPlugUtilities.h:238 |
Definition at line 238 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 115 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 135 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 56 of file IPlugUtilities.h.
|
static |
Gets the host ID from a human-readable name.
| inHost | Host name to search for |
Definition at line 173 of file IPlugUtilities.h.
References ToLower().
Referenced by IPlugAPIBase::SetHost().
|
static |
| midiPitch |
| noteName |
| cents |
| middleCisC4 |
Definition at line 298 of file IPlugUtilities.h.
Referenced by IParam::InitPitch().
|
static |
| cDest |
| cSrc |
Definition at line 160 of file IPlugUtilities.h.
Referenced by IGraphicsNanoVG::BitmapExtSupported(), IGraphicsSkia::BitmapExtSupported(), and LookUpHost().