| AAX SDK 2.8.0 Avid Audio Extensions Development Kit

- Welcome
- Manual
- Classes
- Files
- Lists
- Support

- File List
- File Members

Loading...
Searching...
No Matches
AAX_CBinaryTaperDelegate.h
Go to the documentation of this file.
1/*================================================================================================*/
2/*
3 *
4 * Copyright 2014-2017, 2019, 2023-2024 Avid Technology, Inc.
5 * All rights reserved.
6 *
7 * This file is part of the Avid AAX SDK.
8 *
9 * The AAX SDK is subject to commercial or open-source licensing.
10 *
11 * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License
12 * Agreement and Avid Privacy Policy.
13 *
14 * AAX SDK License: https://developer.avid.com/aax
15 * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement
16 *
17 * Or: You may also use this code under the terms of the GPL v3 (see
18 * www.gnu.org/licenses).
19 *
20 * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
21 * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
22 * DISCLAIMED.
23 *
24 */
25
32/*================================================================================================*/
33
34
35#ifndef AAX_CBINARYTAPERDELEGATE_H
36#define AAX_CBINARYTAPERDELEGATE_H
37
38#include "AAX_ITaperDelegate.h"
39
40
53 template <typename T>
54 class AAX_CBinaryTaperDelegate : public AAX_ITaperDelegate<T>
55{
56 public:
57
61 AAX_CBinaryTaperDelegate( );
62
63 //Virtual Overrides
64 AAX_ITaperDelegate<T>* Clone() const AAX_OVERRIDE;
65 T GetMaximumValue() const AAX_OVERRIDE;
66 T GetMinimumValue() const AAX_OVERRIDE;
67 T ConstrainRealValue(T value) const AAX_OVERRIDE;
68 T NormalizedToReal(double normalizedValue) const AAX_OVERRIDE;
69 double RealToNormalized(T realValue) const AAX_OVERRIDE;
70};
71
72
73
74
75
76
77 template <typename T>
78 AAX_CBinaryTaperDelegate<T>::AAX_CBinaryTaperDelegate( ) :
79 AAX_ITaperDelegate<T>()
80{
81}
82
83 template <typename T>
84 AAX_ITaperDelegate<T>* AAX_CBinaryTaperDelegate<T>::Clone() const
85{
86 return new AAX_CBinaryTaperDelegate(*this);
87}
88
89 template <typename T>
90T AAX_CBinaryTaperDelegate<T>::GetMinimumValue() const
91{
92 return false;
93}
94
95 template <typename T>
96T AAX_CBinaryTaperDelegate<T>::GetMaximumValue() const
97{
98 return true;
99}
100
101 template <typename T>
102T AAX_CBinaryTaperDelegate<T>::ConstrainRealValue(T value) const
103{
104 return value;
105}
106
107 template <typename T>
108T AAX_CBinaryTaperDelegate<T>::NormalizedToReal(double normalizedValue) const
109{
110 if (normalizedValue > 0.0f)
111 return (T)(1); //should construct true for bool
112 return (T)(0); //should construct false for bool
113}
114
115 template <typename T>
116 double AAX_CBinaryTaperDelegate<T>::RealToNormalized(T realValue) const
117{
118 if (realValue > (T)(0))
119 return 1.0f;
120 return 0.0f;
121}
122
123
124
125
126#endif //AAX_CBINARYTAPERDELEGATE_H
127
128
AAX_ITaperDelegate.h
Defines the taper conversion behavior for a parameter.
AAX_OVERRIDE
#define AAX_OVERRIDE
override keyword macro
Definition: AAX.h:164
AAX_CBinaryTaperDelegate
A binary taper conforming to AAX_ITaperDelegate.
Definition: AAX_CBinaryTaperDelegate.h:55
AAX_CBinaryTaperDelegate::GetMaximumValue
T GetMaximumValue() const AAX_OVERRIDE
Returns the taper's maximum real value.
Definition: AAX_CBinaryTaperDelegate.h:96
AAX_CBinaryTaperDelegate::Clone
AAX_ITaperDelegate< T > * Clone() const AAX_OVERRIDE
Constructs and returns a copy of the taper delegate.
Definition: AAX_CBinaryTaperDelegate.h:84
AAX_CBinaryTaperDelegate::ConstrainRealValue
T ConstrainRealValue(T value) const AAX_OVERRIDE
Applies a contraint to the value and returns the constrained value.
Definition: AAX_CBinaryTaperDelegate.h:102
AAX_CBinaryTaperDelegate::RealToNormalized
double RealToNormalized(T realValue) const AAX_OVERRIDE
Normalizes a real parameter value.
Definition: AAX_CBinaryTaperDelegate.h:116
AAX_CBinaryTaperDelegate::AAX_CBinaryTaperDelegate
AAX_CBinaryTaperDelegate()
Constructs a Binary Taper.
Definition: AAX_CBinaryTaperDelegate.h:78
AAX_CBinaryTaperDelegate::NormalizedToReal
T NormalizedToReal(double normalizedValue) const AAX_OVERRIDE
Converts a normalized value to a real value.
Definition: AAX_CBinaryTaperDelegate.h:108
AAX_CBinaryTaperDelegate::GetMinimumValue
T GetMinimumValue() const AAX_OVERRIDE
Returns the taper's minimum real value.
Definition: AAX_CBinaryTaperDelegate.h:90
AAX_ITaperDelegate
Definition: AAX_ITaperDelegate.h:99