AAX SDK  2.4.1
Avid Audio Extensions Development Kit
AAX_CBinaryTaperDelegate.h
Go to the documentation of this file.
1 /*================================================================================================*/
2 /*
3  *
4  * Copyright 2014-2017, 2019 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 
22 /*================================================================================================*/
23 
24 
25 #ifndef AAX_CBINARYTAPERDELEGATE_H
26 #define AAX_CBINARYTAPERDELEGATE_H
27 
28 #include "AAX_ITaperDelegate.h"
29 
30 
43 template <typename T>
45 {
46 public:
47 
52 
53  //Virtual Overrides
55  T GetMaximumValue() const AAX_OVERRIDE;
56  T GetMinimumValue() const AAX_OVERRIDE;
57  T ConstrainRealValue(T value) const AAX_OVERRIDE;
58  T NormalizedToReal(double normalizedValue) const AAX_OVERRIDE;
59  double RealToNormalized(T realValue) const AAX_OVERRIDE;
60 };
61 
62 
63 
64 
65 
66 
67 template <typename T>
70 {
71 }
72 
73 template <typename T>
75 {
76  return new AAX_CBinaryTaperDelegate(*this);
77 }
78 
79 template <typename T>
81 {
82  return false;
83 }
84 
85 template <typename T>
87 {
88  return true;
89 }
90 
91 template <typename T>
93 {
94  return value;
95 }
96 
97 template <typename T>
98 T AAX_CBinaryTaperDelegate<T>::NormalizedToReal(double normalizedValue) const
99 {
100  if (normalizedValue > 0.0f)
101  return (T)(1); //should construct true for bool
102  return (T)(0); //should construct false for bool
103 }
104 
105 template <typename T>
107 {
108  if (realValue > (T)(0))
109  return 1.0f;
110  return 0.0f;
111 }
112 
113 
114 
115 
116 #endif //AAX_CBINARYTAPERDELEGATE_H
117 
118 
#define AAX_OVERRIDE
override keyword macro
Definition: AAX.h:141
Defines the taper conversion behavior for a parameter.
A binary taper conforming to AAX_ITaperDelegate.
Definition: AAX_CBinaryTaperDelegate.h:45
T GetMaximumValue() const AAX_OVERRIDE
Returns the taper's maximum real value.
Definition: AAX_CBinaryTaperDelegate.h:86
AAX_ITaperDelegate< T > * Clone() const AAX_OVERRIDE
Constructs and returns a copy of the taper delegate.
Definition: AAX_CBinaryTaperDelegate.h:74
T ConstrainRealValue(T value) const AAX_OVERRIDE
Applies a contraint to the value and returns the constrained value.
Definition: AAX_CBinaryTaperDelegate.h:92
double RealToNormalized(T realValue) const AAX_OVERRIDE
Normalizes a real parameter value.
Definition: AAX_CBinaryTaperDelegate.h:106
AAX_CBinaryTaperDelegate()
Constructs a Binary Taper.
Definition: AAX_CBinaryTaperDelegate.h:68
T NormalizedToReal(double normalizedValue) const AAX_OVERRIDE
Converts a normalized value to a real value.
Definition: AAX_CBinaryTaperDelegate.h:98
T GetMinimumValue() const AAX_OVERRIDE
Returns the taper's minimum real value.
Definition: AAX_CBinaryTaperDelegate.h:80
Classes for conversion to and from normalized parameter values.
Definition: AAX_ITaperDelegate.h:89