AAX SDK  2.4.1
Avid Audio Extensions Development Kit
AAX_SliderConversions.h
Go to the documentation of this file.
1 /*================================================================================================*/
2 /*
3  *
4  * Copyright 2013-2015 by Avid Technology, Inc.
5  * All rights reserved.
6  *
7  * CONFIDENTIAL: This document contains confidential information. Do not
8  * read or examine this document unless you are an Avid Technology employee
9  * or have signed a non-disclosure agreement with Avid Technology which protects
10  * the confidentiality of this document. DO NOT DISCLOSE ANY INFORMATION
11  * CONTAINED IN THIS DOCUMENT TO ANY THIRD-PARTY WITHOUT THE PRIOR WRITTEN CONSENT
12  * OF Avid Technology, INC.
13  *
14  */
15 
31 /*================================================================================================*/
32 
33 
34 #pragma once
35 
36 #ifndef AAX_SLIDERCONVERSIONS_H
37 #define AAX_SLIDERCONVERSIONS_H
38 
39 #include "AAX.h"
40 #include <algorithm>
41 #include <stdint.h>
42 
43 
44 #define AAX_LIMIT(v1,firstVal,secondVal) ( (secondVal > firstVal) ? (std::max)((std::min)(v1,secondVal),firstVal) : (std::min)((std::max)(v1,secondVal),firstVal) )
45 
46 int32_t LongControlToNewRange (int32_t aValue, int32_t rangeMin, int32_t rangeMax);
47 
51 int32_t LongToLongControl (int32_t aValue, int32_t rangeMin, int32_t rangeMax);
52 
56 double LongControlToDouble(int32_t aValue, double firstVal, double secondVal);
57 
61 int32_t DoubleToLongControl (double aValue, double firstVal, double secondVal);
62 
63 int32_t DoubleToLongControlNonlinear(double aValue, double* minVal, double* rangePercent, int32_t numRanges);
64 double LongControlToDoubleNonlinear(int32_t aValue, double* minVal, double* rangePercent, int32_t numRanges);
65 
72 double LongControlToLogDouble(int32_t aValue, double minVal, double maxVal);
73 
80 int32_t LogDoubleToLongControl(double aValue, double minVal, double maxVal);
81 
82 #endif // AAX_SLIDERCONVERSIONS_H
83 
Various utility definitions for AAX.
int32_t DoubleToLongControl(double aValue, double firstVal, double secondVal)
Convert from an double ranging from firstVal to secondVal (linear) to int32_t control value 0x8000000...
int32_t LongControlToNewRange(int32_t aValue, int32_t rangeMin, int32_t rangeMax)
int32_t DoubleToLongControlNonlinear(double aValue, double *minVal, double *rangePercent, int32_t numRanges)
double LongControlToDoubleNonlinear(int32_t aValue, double *minVal, double *rangePercent, int32_t numRanges)
double LongControlToDouble(int32_t aValue, double firstVal, double secondVal)
Convert from int32_t control value 0x80000000...0x7FFFFFFF to an double ranging from firstVal to seco...
int32_t LongToLongControl(int32_t aValue, int32_t rangeMin, int32_t rangeMax)
Convert from int32_t control value 0x80000000...0x7FFFFFFF to a int32_t ranging from rangeMin to rang...
int32_t LogDoubleToLongControl(double aValue, double minVal, double maxVal)
Convert from an double ranging from minVal to maxVal (logarithmic) to int32_t control value 0x8000000...
double LongControlToLogDouble(int32_t aValue, double minVal, double maxVal)
Convert from int32_t control value 0x80000000...0x7FFFFFFF to an double ranging from minVal to maxVal...