iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
IPlugUtilities.h File Reference

Utility functions and macros. More...

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include "heapbuf.h"
#include "wdlstring.h"
#include "IPlugConstants.h"
#include "IPlugPlatform.h"

Go to the source code of this file.

Macros

#define MAKE_QUOTE(str)   #str
 
#define MAKE_STR(str)   MAKE_QUOTE(str)
 
#define GET_PARAM_FROM_VARARG(paramType, vp, v)
 

Enumerations

enum  EDOMVirtualKey {
  DOM_VK_BACK_SPACE = 0x08 , DOM_VK_TAB = 0x09 , DOM_VK_RETURN = 0x0D , DOM_VK_SHIFT = 0x10 ,
  DOM_VK_CONTROL = 0x11 , DOM_VK_ALT = 0x12 , DOM_VK_PAUSE = 0x13 , DOM_VK_CAPS_LOCK = 0x14 ,
  DOM_VK_ESCAPE = 0x1B , DOM_VK_SPACE = 0x20 , DOM_VK_PAGE_UP = 0x21 , DOM_VK_PAGE_DOWN = 0x22 ,
  DOM_VK_END = 0x23 , DOM_VK_HOME = 0x24 , DOM_VK_LEFT = 0x25 , DOM_VK_UP = 0x26 ,
  DOM_VK_RIGHT = 0x27 , DOM_VK_DOWN = 0x28 , DOM_VK_INSERT = 0x2D , DOM_VK_DELETE = 0x2E ,
  DOM_VK_F1 = 0x70 , DOM_VK_F2 = 0x71 , DOM_VK_F3 = 0x72 , DOM_VK_F4 = 0x73 ,
  DOM_VK_F5 = 0x74 , DOM_VK_F6 = 0x75 , DOM_VK_F7 = 0x76 , DOM_VK_F8 = 0x77 ,
  DOM_VK_F9 = 0x78 , DOM_VK_F10 = 0x79 , DOM_VK_F11 = 0x7A , DOM_VK_F12 = 0x7B ,
  DOM_VK_NUMPAD0 = 0x60 , DOM_VK_NUMPAD1 = 0x61 , DOM_VK_NUMPAD2 = 0x62 , DOM_VK_NUMPAD3 = 0x63 ,
  DOM_VK_NUMPAD4 = 0x64 , DOM_VK_NUMPAD5 = 0x65 , DOM_VK_NUMPAD6 = 0x66 , DOM_VK_NUMPAD7 = 0x67 ,
  DOM_VK_NUMPAD8 = 0x68 , DOM_VK_NUMPAD9 = 0x69
}
 

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 >
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 &noteName, 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...
 

Detailed Description

Utility functions and macros.

Definition in file IPlugUtilities.h.