AAX SDK 2.8.0
Avid Audio Extensions Development Kit
Loading...
Searching...
No Matches
AAX_CParameter.h
Go to the documentation of this file.
1/*================================================================================================*/
2/*
3 *
4 * Copyright 2013-2017, 2019, 2021, 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_CPARAMETER_H
36#define AAX_CPARAMETER_H
37
38#include "AAX_Assert.h"
39#include "AAX_IParameter.h"
40#include "AAX_ITaperDelegate.h"
43#include "AAX_CString.h" //concrete class required for name.
44
45#include <cstring>
46#include <list>
47#include <map>
48
49
51#if 0
52#pragma mark -
53#endif
55
57
63template <typename T>
65{
66public:
67 enum Defaults {
70 };
71
72public:
74
77
79
87 explicit AAX_CParameterValue(AAX_CParamID identifier);
88
96 explicit AAX_CParameterValue(AAX_CParamID identifier, const T& value);
97
100 explicit AAX_CParameterValue(const AAX_CParameterValue<T>& other);
101
102public: // AAX_CParameterValue<T> implementation
105 const T& Get() const { return mValue; }
108 void Set(const T& inValue) { mValue = inValue; }
109
110public: // AAX_IParameterValue implementation
111
113 AAX_CParamID Identifier() const AAX_OVERRIDE { return mIdentifier; }
114
119 bool GetValueAsBool(bool* value) const AAX_OVERRIDE;
120 bool GetValueAsInt32(int32_t* value) const AAX_OVERRIDE;
121 bool GetValueAsFloat(float* value) const AAX_OVERRIDE;
122 bool GetValueAsDouble(double* value) const AAX_OVERRIDE;
123 bool GetValueAsString(AAX_IString* value) const AAX_OVERRIDE;
125
126private:
127 void InitIdentifier(const char* inIdentifier);
128
129private:
130 char mIdentifier[eParameterDefaultMaxIdentifierSize];
131 T mValue;
132};
133
134
136
137template <typename T>
139: mValue()
140{
141 InitIdentifier(identifier);
142}
143
144template <typename T>
146: mValue(value)
147{
148 InitIdentifier(identifier);
149}
150
151template <typename T>
153: mValue(other.mValue)
154{
155 InitIdentifier(other.mIdentifier);
156}
157
158template<typename T>
159bool AAX_CParameterValue<T>::GetValueAsBool(bool* /*value*/) const
160{
161 return false;
162}
163template <>
165
166
167template<typename T>
168bool AAX_CParameterValue<T>::GetValueAsInt32(int32_t* /*value*/) const
169{
170 return false;
171}
172template<>
174
175template<typename T>
176bool AAX_CParameterValue<T>::GetValueAsFloat(float* /*value*/) const
177{
178 return false;
179}
180template<>
182
183template<typename T>
184bool AAX_CParameterValue<T>::GetValueAsDouble(double* /*value*/) const
185{
186 return false;
187}
188template<>
190
191template<typename T>
193{
194 return false;
195}
196template<>
198
199template<typename T>
200void AAX_CParameterValue<T>::InitIdentifier(const char *inIdentifier)
201{
202
203 const size_t len = strlen(inIdentifier);
204 AAX_ASSERT(len < eParameterDefaultMaxIdentifierSize);
205 if (len < eParameterDefaultMaxIdentifierSize)
206 {
207 std::strncpy(mIdentifier, inIdentifier, 1+len);
208 mIdentifier[len] = 0;
209 }
210 else
211 {
212 std::strncpy(mIdentifier, inIdentifier, eParameterDefaultMaxIdentifierLength);
213 mIdentifier[eParameterDefaultMaxIdentifierLength] = 0;
214 }
215}
216
217
219#if 0
220#pragma mark -
221#endif
223
225
246template <typename T>
248{
249public:
250
251 enum Type {
257 };
258
259 enum Defaults {
262 };
263
294 AAX_CParameter(AAX_CParamID identifier, const AAX_IString& name, T defaultValue, const AAX_ITaperDelegate<T>& taperDelegate, const AAX_IDisplayDelegate<T>& displayDelegate, bool automatable=false);
295
302 AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, T defaultValue, const AAX_ITaperDelegate<T>& taperDelegate, const AAX_IDisplayDelegate<T>& displayDelegate, bool automatable=false);
303
313 AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, T defaultValue, bool automatable=false);
314
325 AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, bool automatable=false);
326
330
334 AAX_DELETE(AAX_CParameter& operator= (const AAX_CParameter& other));
335
341
343
349 void SetName(const AAX_CString& name) AAX_OVERRIDE;
350 const AAX_CString& Name() const AAX_OVERRIDE;
351 void AddShortenedName(const AAX_CString& name) AAX_OVERRIDE;
352 const AAX_CString& ShortenedName(int32_t iNumCharacters) const AAX_OVERRIDE;
355
360 void SetNormalizedDefaultValue(double normalizedDefault) AAX_OVERRIDE;
363 void SetNormalizedValue(double newNormalizedValue) AAX_OVERRIDE;
364 double GetNormalizedValue() const AAX_OVERRIDE;
365 void SetNumberOfSteps(uint32_t numSteps) AAX_OVERRIDE;
366 uint32_t GetNumberOfSteps() const AAX_OVERRIDE;
367 uint32_t GetStepValue() const AAX_OVERRIDE;
368 double GetNormalizedValueFromStep(uint32_t iStep) const AAX_OVERRIDE;
369 uint32_t GetStepValueFromNormalizedValue(double normalizedValue) const AAX_OVERRIDE;
370 void SetStepValue(uint32_t iStep) AAX_OVERRIDE;
371 void SetType(AAX_EParameterType iControlType) AAX_OVERRIDE;
375 void SetTaperDelegate(AAX_ITaperDelegateBase& inTaperDelegate,bool inPreserveValue=true) AAX_OVERRIDE;
377
383 bool GetValueString( AAX_CString* valueString) const AAX_OVERRIDE;
384 bool GetValueString(int32_t iMaxNumChars, AAX_CString* valueString) const AAX_OVERRIDE;
385 bool GetNormalizedValueFromBool(bool value, double *normalizedValue) const AAX_OVERRIDE;
386 bool GetNormalizedValueFromInt32(int32_t value, double *normalizedValue) const AAX_OVERRIDE;
387 bool GetNormalizedValueFromFloat(float value, double *normalizedValue) const AAX_OVERRIDE;
388 bool GetNormalizedValueFromDouble(double value, double *normalizedValue) const AAX_OVERRIDE;
389 bool GetNormalizedValueFromString(const AAX_CString& valueString, double *normalizedValue) const AAX_OVERRIDE;
390 bool GetBoolFromNormalizedValue(double normalizedValue, bool* value) const AAX_OVERRIDE;
391 bool GetInt32FromNormalizedValue(double normalizedValue, int32_t* value) const AAX_OVERRIDE;
392 bool GetFloatFromNormalizedValue(double normalizedValue, float* value) const AAX_OVERRIDE;
393 bool GetDoubleFromNormalizedValue(double normalizedValue, double* value) const AAX_OVERRIDE;
394 bool GetStringFromNormalizedValue(double normalizedValue, AAX_CString& valueString) const AAX_OVERRIDE;
395 bool GetStringFromNormalizedValue(double normalizedValue, int32_t iMaxNumChars, AAX_CString& valueString) const AAX_OVERRIDE;
396 bool SetValueFromString(const AAX_CString& newValueString) AAX_OVERRIDE;
398
403 void SetAutomationDelegate ( AAX_IAutomationDelegate * iAutomationDelegate ) AAX_OVERRIDE;
404 bool Automatable() const AAX_OVERRIDE;
405 void Touch() AAX_OVERRIDE;
406 void Release() AAX_OVERRIDE;
408
413 bool GetValueAsBool(bool* value) const AAX_OVERRIDE;
414 bool GetValueAsInt32(int32_t* value) const AAX_OVERRIDE;
415 bool GetValueAsFloat(float* value) const AAX_OVERRIDE;
416 bool GetValueAsDouble(double* value) const AAX_OVERRIDE;
417 bool GetValueAsString(AAX_IString* value) const AAX_OVERRIDE;
418 bool SetValueWithBool(bool value) AAX_OVERRIDE;
419 bool SetValueWithInt32(int32_t value) AAX_OVERRIDE;
420 bool SetValueWithFloat(float value) AAX_OVERRIDE;
421 bool SetValueWithDouble(double value) AAX_OVERRIDE;
422 bool SetValueWithString(const AAX_IString& value) AAX_OVERRIDE;
424
429 void UpdateNormalizedValue(double newNormalizedValue) AAX_OVERRIDE;
431
449 void SetValue(T newValue );
456 T GetValue() const;
465 void SetDefaultValue(T newDefaultValue);
472 T GetDefaultValue() const;
477 const AAX_ITaperDelegate<T>* TaperDelegate() const;
482 const AAX_IDisplayDelegate<T>* DisplayDelegate() const;
484
485protected:
488 uint32_t mNumSteps;
495
498
499private:
500 void InitializeNumberOfSteps();
501};
502
503
505
506template <typename T>
507AAX_CParameter<T>::AAX_CParameter(AAX_CParamID identifier, const AAX_IString& name, T defaultValue, const AAX_ITaperDelegate<T>& taperDelegate, const AAX_IDisplayDelegate<T>& displayDelegate, bool automatable)
508: mNames(name)
509, mAutomatable(automatable)
510, mNumSteps(0) // Default set below for discrete/continuous
513, mTaperDelegate(taperDelegate.Clone())
514, mDisplayDelegate(displayDelegate.Clone())
516, mNeedNotify(true)
517, mValue(identifier)
518, mDefaultValue(defaultValue)
519{
520 this->InitializeNumberOfSteps();
521 this->SetToDefaultValue();
522}
523
524template <typename T>
525AAX_CParameter<T>::AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, T defaultValue, const AAX_ITaperDelegate<T>& taperDelegate, const AAX_IDisplayDelegate<T>& displayDelegate, bool automatable)
526: mNames(name)
527, mAutomatable(automatable)
528, mNumSteps(0) // Default set below for discrete/continuous
531, mTaperDelegate(taperDelegate.Clone())
532, mDisplayDelegate(displayDelegate.Clone())
534, mNeedNotify(true)
535, mValue(identifier.Get())
536, mDefaultValue(defaultValue)
537{
538 this->InitializeNumberOfSteps();
539 this->SetToDefaultValue();
540}
541
542template <typename T>
543AAX_CParameter<T>::AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, T defaultValue, bool automatable)
544: mNames(name)
545, mAutomatable(automatable)
546, mNumSteps(0)
547, mControlType( AAX_eParameterType_Continuous )
548, mOrientation( AAX_eParameterOrientation_Default )
549, mTaperDelegate(NULL)
550, mDisplayDelegate(NULL)
551, mAutomationDelegate(NULL)
552, mNeedNotify(true)
553, mValue(identifier.Get())
554, mDefaultValue(defaultValue)
555{
556 this->InitializeNumberOfSteps();
557 this->SetToDefaultValue();
558}
559
560template <typename T>
561AAX_CParameter<T>::AAX_CParameter(const AAX_IString& identifier, const AAX_IString& name, bool automatable)
562: mNames(name)
563, mAutomatable(automatable)
564, mNumSteps(0)
565, mControlType( AAX_eParameterType_Continuous )
566, mOrientation( AAX_eParameterOrientation_Default )
567, mTaperDelegate(NULL)
568, mDisplayDelegate(NULL)
569, mAutomationDelegate(NULL)
570, mNeedNotify(true)
571, mValue(identifier.Get())
572, mDefaultValue()
573{
574 this->InitializeNumberOfSteps();
575 this->SetToDefaultValue(); // WARNING: uninitialized default value
576}
577
578template <typename T>
580{
581 //Make sure to remove any registration with the token system.
582 SetAutomationDelegate(0);
583
584 delete mTaperDelegate;
585 mTaperDelegate = 0;
586 delete mDisplayDelegate;
587 mDisplayDelegate = 0;
588}
589
590template <typename T>
592{
593 return new AAX_CParameterValue<T>(mValue);
594}
595
596template <typename T>
598{
599 return mValue.Identifier();
600}
601
602template <typename T>
604{
605 mNames.SetPrimary(name);
606 if (mAutomationDelegate) {
607 mAutomationDelegate->ParameterNameChanged(this->Identifier());
608 }
609}
610
611template <typename T>
613{
614 return mNames.Primary();
615}
616
617template <typename T>
619{
620 mNames.Add(name);
621}
622
623template <typename T>
624const AAX_CString& AAX_CParameter<T>::ShortenedName(int32_t iNumCharacters) const
625{
626 return mNames.Get(iNumCharacters);
627}
628
629template <typename T>
631{
632 mNames.Clear();
633}
634
635
636
637template<typename T>
639{
640 double newNormalizedValue = mTaperDelegate->RealToNormalized(newValue);
641
642 // <DMT> Always go through the automation delegate even if the control isn't automatable to prevent fighting with other GUIs.
643 // Somewhere back in the automation delegate, or elsewhere in the system, it will determine the differences in behavior surrounding
644 // automation. The only reason that there wouldn't be an automation delegate is if this parameter has yet to be added to a
645 // ParameterManager. Let's put the null value guards in place, just in case, and also for unit tests.
646 if ( mAutomationDelegate )
647 {
648 //TODO: Create RAII utility class for touch/release
649
650 //Touch the control
651 Touch();
652
653 //Send that token.
654 mAutomationDelegate->PostSetValueRequest(Identifier(), newNormalizedValue );
655
656 //Release the control
657 Release();
658 }
659 else
660 {
661 mNeedNotify = true;
662
663 // In the rare case that an automation delegate doesn't exist, lets still set the value. It's possible that someone is trying to
664 // set the new value before adding the parameter to a parametermanager.
665 UpdateNormalizedValue(newNormalizedValue);
666 }
667}
668
669template <typename T>
670void AAX_CParameter<T>::UpdateNormalizedValue(double newNormalizedValue)
671{
672 T newValue = mTaperDelegate->NormalizedToReal(newNormalizedValue);
673 if (mNeedNotify || (mValue.Get() != newValue))
674 {
675 //Set the new value
676 mValue.Set(newValue);
677
678 //<DMT> Always notify that the value has changed through the automation delegate to guarantee that all control surfaces and other
679 // GUIs get their values updated.
680 if (mAutomationDelegate)
681 mAutomationDelegate->PostCurrentValue(Identifier(), newNormalizedValue);
682
683 // clear flag
684 mNeedNotify = false;
685 }
686}
687
688template <typename T>
690{
691 if (mNumSteps == 0) // If no explicit number of steps has been set...
692 {
693 switch (mControlType)
694 {
696 {
697 // Discrete parameters default to binary unless
698 // otherwise specified
699 this->SetNumberOfSteps (eParameterDefaultNumStepsDiscrete);
700 break;
701 }
703 {
704 // Defaulting to 128 steps to match one full rotation of
705 // Command|8 and similar surfaces, which query the num
706 // steps to determine tick values for rotary encoders
707 this->SetNumberOfSteps (eParameterDefaultNumStepsContinuous);
708 break;
709 }
710 default:
711 {
712 AAX_ASSERT (0); // Invalid type
713 break;
714 }
715 }
716 }
717}
718
719template<typename T>
721{
722 return mValue.Get();
723}
724
725
726template<typename T>
728{
729 return mValue.GetValueAsBool(value);
730}
731
732template<typename T>
733bool AAX_CParameter<T>::GetValueAsInt32(int32_t* value) const
734{
735 return mValue.GetValueAsInt32(value);
736}
737
738template<typename T>
740{
741 return mValue.GetValueAsFloat(value);
742}
743
744template<typename T>
745bool AAX_CParameter<T>::GetValueAsDouble(double* value) const
746{
747 return mValue.GetValueAsDouble(value);
748}
749
750template<typename T>
752{
753 bool result = false;
754 if (value)
755 {
756 AAX_CString valueString;
757 result = this->GetValueString(&valueString);
758 if (true == result)
759 {
760 *value = valueString;
761 }
762 }
763 return result;
764}
765
766template<>
768
769
770template<typename T>
772{
773 return false;
774}
775template<>
777
778template<typename T>
780{
781 return false;
782}
783template<>
785
786template<typename T>
788{
789 return false;
790}
791template<>
793
794template<typename T>
796{
797 return false;
798}
799template<>
801
802template<typename T>
804{
805 const AAX_CString valueString(value);
806 return this->SetValueFromString(valueString);
807}
808template<>
810
811template<typename T>
812void AAX_CParameter<T>::SetNormalizedDefaultValue(double newNormalizedDefault)
813{
814 T newDefaultValue = mTaperDelegate->NormalizedToReal(newNormalizedDefault);
815 SetDefaultValue(newDefaultValue);
816}
817
818template<typename T>
820{
821 double normalizedDefault = mTaperDelegate->RealToNormalized(mDefaultValue);
822 return normalizedDefault;
823}
824
825template<typename T>
827{
828 newDefaultValue = mTaperDelegate->ConstrainRealValue(newDefaultValue);
829 mDefaultValue = newDefaultValue;
830}
831
832template<typename T>
834{
835 return mDefaultValue;
836}
837
838template<typename T>
840{
841 SetValue(mDefaultValue);
842}
843
844template<typename T>
846{
847 AAX_ASSERT(0 < numSteps);
848 if (0 < numSteps)
849 {
850 mNumSteps = numSteps;
851 }
852}
853
854template<typename T>
856{
857 return mNumSteps;
858}
859
860template<typename T>
862{
863 return GetStepValueFromNormalizedValue(this->GetNormalizedValue());
864}
865
866template<typename T>
868{
869 double numSteps = (double) this->GetNumberOfSteps ();
870 if ( numSteps < 2.0 )
871 return 0.0;
872
873 double valuePerStep = 1.0 / ( numSteps - 1.0 );
874 double value = valuePerStep * (double) iStep;
875 if ( value < 0.0 )
876 value = 0.0;
877 else if ( value > 1.0 )
878 value = 1.0;
879
880 return value;
881}
882
883template<typename T>
884uint32_t AAX_CParameter<T>::GetStepValueFromNormalizedValue(double normalizedValue) const
885{
886 double numSteps = (double) this->GetNumberOfSteps ();
887 if ( numSteps < 2.0 )
888 return 0;
889
890 double valuePerStep = 1.0 / ( numSteps - 1.0 );
891 double curStep = ( normalizedValue / valuePerStep ) + 0.5;
892 if ( curStep < 0.0 )
893 curStep = 0.0;
894 else if ( curStep > (double) ( numSteps - 1.0 ) )
895 curStep = (double) ( numSteps - 1.0 );
896
897 return (uint32_t) curStep;
898}
899
900template<typename T>
902{
903 double numSteps = (double) this->GetNumberOfSteps ();
904 if ( numSteps < 2.0 )
905 return;
906
907 this->SetNormalizedValue ( GetNormalizedValueFromStep(iStep) );
908}
909
910template<typename T>
912{
913 mControlType = iControlType;
914}
915
916template<typename T>
918{
919 return mControlType;
920}
921
922template<typename T>
924{
925 mOrientation = iOrientation;
926}
927
928template<typename T>
930{
931 return mOrientation;
932}
933
934template<typename T>
935void AAX_CParameter<T>::SetNormalizedValue(double normalizedNewValue)
936{
937 T newValue = mTaperDelegate->NormalizedToReal(normalizedNewValue);
938 this->SetValue(newValue);
939}
940
941template<typename T>
943{
944 T val = GetValue();
945 return mTaperDelegate->RealToNormalized(val);
946}
947
948
949template<typename T>
951{
952 return mDisplayDelegate->ValueToString(this->GetValue(), valueString);
953}
954
955template<typename T>
956bool AAX_CParameter<T>::GetValueString(int32_t /*iMaxNumChars*/, AAX_CString* valueString) const
957{
958 return mDisplayDelegate->ValueToString(this->GetValue(), valueString);
959}
960
961template <typename T>
962bool AAX_CParameter<T>::GetNormalizedValueFromBool(bool /*value*/, double * /*normalizedValue*/) const
963{
964 return false;
965}
966template <>
967bool AAX_CParameter<bool>::GetNormalizedValueFromBool(bool value, double *normalizedValue) const;
968
969template <typename T>
970bool AAX_CParameter<T>::GetNormalizedValueFromInt32(int32_t /*value*/, double * /*normalizedValue*/) const
971{
972 return false;
973}
974template <>
975bool AAX_CParameter<int32_t>::GetNormalizedValueFromInt32(int32_t value, double *normalizedValue) const;
976
977template <typename T>
978bool AAX_CParameter<T>::GetNormalizedValueFromFloat(float /*value*/, double * /*normalizedValue*/) const
979{
980 return false;
981}
982template <>
983bool AAX_CParameter<float>::GetNormalizedValueFromFloat(float value, double *normalizedValue) const;
984
985template <typename T>
986bool AAX_CParameter<T>::GetNormalizedValueFromDouble(double /*value*/, double * /*normalizedValue*/) const
987{
988 return false;
989}
990template <>
991bool AAX_CParameter<double>::GetNormalizedValueFromDouble(double value, double *normalizedValue) const;
992
993template <typename T>
994bool AAX_CParameter<T>::GetNormalizedValueFromString(const AAX_CString& valueString, double *normalizedValue) const
995{
996 //First, convert the string to a value using the wrapped parameter's display delegate.
997 T value;
998 if (!mDisplayDelegate->StringToValue(valueString, &value))
999 return false;
1000
1001 //Then use the wrapped parameter's taper delegate to convert to a normalized representation.
1002 //If the parameter is out of range, the normalizedValue will be clamped just to be safe.
1003 *normalizedValue = mTaperDelegate->RealToNormalized(value);
1004 return true;
1005}
1006
1007template<typename T>
1008bool AAX_CParameter<T>::GetBoolFromNormalizedValue(double /*inNormalizedValue*/, bool* /*value*/) const
1009{
1010 return false;
1011}
1012template <>
1013bool AAX_CParameter<bool>::GetBoolFromNormalizedValue(double inNormalizedValue, bool* value) const;
1014
1015
1016template<typename T>
1017bool AAX_CParameter<T>::GetInt32FromNormalizedValue(double /*inNormalizedValue*/, int32_t* /*value*/) const
1018{
1019 return false;
1020}
1021template<>
1022bool AAX_CParameter<int32_t>::GetInt32FromNormalizedValue(double inNormalizedValue, int32_t* value) const;
1023
1024template<typename T>
1025bool AAX_CParameter<T>::GetFloatFromNormalizedValue(double /*inNormalizedValue*/, float* /*value*/) const
1026{
1027 return false;
1028}
1029template<>
1030bool AAX_CParameter<float>::GetFloatFromNormalizedValue(double inNormalizedValue, float* value) const;
1031
1032template<typename T>
1033bool AAX_CParameter<T>::GetDoubleFromNormalizedValue(double /*inNormalizedValue*/, double* /*value*/) const
1034{
1035 return false;
1036}
1037template<>
1038bool AAX_CParameter<double>::GetDoubleFromNormalizedValue(double inNormalizedValue, double* value) const;
1039
1040template <typename T>
1041bool AAX_CParameter<T>::GetStringFromNormalizedValue(double normalizedValue, AAX_CString& valueString) const
1042{
1043 T value = mTaperDelegate->NormalizedToReal(normalizedValue);
1044 if (!mDisplayDelegate->ValueToString(value, &valueString))
1045 return false;
1046
1047 //If the parameter is out of range, we should probably return false, even though we clamped the normalizedValue already just to be safe.
1048 if ((value > mTaperDelegate->GetMaximumValue()) || (value < mTaperDelegate->GetMinimumValue()))
1049 return false;
1050 return true;
1051}
1052
1053template <typename T>
1054bool AAX_CParameter<T>::GetStringFromNormalizedValue(double normalizedValue, int32_t iMaxNumChars, AAX_CString& valueString) const
1055{
1056 T value = mTaperDelegate->NormalizedToReal(normalizedValue);
1057 if (!mDisplayDelegate->ValueToString(value, iMaxNumChars, &valueString))
1058 return false;
1059
1060 //If the parameter is out of range, we should probably return false, even though we clamped the normalizedValue already just to be safe.
1061 if ((value > mTaperDelegate->GetMaximumValue()) || (value < mTaperDelegate->GetMinimumValue()))
1062 return false;
1063 return true;
1064}
1065
1066template<typename T>
1068{
1069 T newValue;
1070 if (!mDisplayDelegate->StringToValue(newValueString, &newValue))
1071 return false;
1072 SetValue(newValue);
1073 return true;
1074}
1075
1076template<typename T>
1077void AAX_CParameter<T>::SetTaperDelegate(AAX_ITaperDelegateBase& inTaperDelegate,bool inPreserveValue)
1078{
1079 double normalizeValue = this->GetNormalizedValue ();
1080
1081 AAX_ITaperDelegate<T>* oldDelegate = mTaperDelegate;
1082 mTaperDelegate = ((AAX_ITaperDelegate<T> &) inTaperDelegate).Clone();
1083 delete oldDelegate;
1084
1085 mNeedNotify = true;
1086 if ( inPreserveValue )
1087 this->SetValue ( mValue.Get() );
1088 else this->UpdateNormalizedValue ( normalizeValue );
1089}
1090
1091template<typename T>
1093{
1094 AAX_IDisplayDelegate<T>* oldDelegate = mDisplayDelegate;
1095 mDisplayDelegate = ((AAX_IDisplayDelegate<T> &)inDisplayDelegate).Clone();
1096 delete oldDelegate;
1097
1098 if (mAutomationDelegate != 0)
1099 mAutomationDelegate->PostCurrentValue(this->Identifier(), this->GetNormalizedValue()); //<DMT> Make sure GUIs are all notified of the change.
1100}
1101
1102template<typename T>
1104{
1105 return mTaperDelegate;
1106}
1107
1108template<typename T>
1110{
1111 return mDisplayDelegate;
1112}
1113
1114template<typename T>
1116{
1117 return mAutomatable;
1118}
1119
1120template<typename T>
1122{
1123 //Remove the old automation delegate
1124 if ( mAutomationDelegate )
1125 {
1126 mAutomationDelegate->UnregisterParameter ( this->Identifier() );
1127 }
1128
1129 //Add the new automation delegate, wrapped by the versioning layer.
1130 mAutomationDelegate = iAutomationDelegate;
1131 if ( mAutomationDelegate )
1132 mAutomationDelegate->RegisterParameter ( this->Identifier() );
1133}
1134
1135template<typename T>
1137{
1138 //<DT> Always send the touch command, even if the control isn't automatable.
1139 if (mAutomationDelegate)
1140 mAutomationDelegate->PostTouchRequest( this->Identifier() );
1141}
1142
1143template<typename T>
1145{
1146 //<DT> Always send the release command, even if the control isn't automatable.
1147 if (mAutomationDelegate)
1148 mAutomationDelegate->PostReleaseRequest( this->Identifier() );
1149}
1150
1151
1153#if 0
1154#pragma mark -
1155#pragma mark AAX_CStatelessParameter
1156#endif
1158
1166{
1167public:
1168 AAX_CStatelessParameter(AAX_CParamID identifier, const AAX_IString& name, const AAX_IString& inValueString)
1169 : mNames(name)
1170 , mID(identifier)
1171 , mAutomationDelegate(NULL)
1172 , mValueString(inValueString)
1173 {
1174 }
1175
1176 AAX_CStatelessParameter(const AAX_IString& identifier, const AAX_IString& name, const AAX_IString& inValueString)
1177 : mNames(name)
1178 , mID(identifier)
1179 , mAutomationDelegate(NULL)
1180 , mValueString(inValueString)
1181 {
1182 }
1183
1185
1187
1194 {
1195 mNames.SetPrimary(name);
1196 if (mAutomationDelegate) {
1198 }
1199 }
1200 const AAX_CString& Name() const AAX_OVERRIDE { return mNames.Primary(); }
1202 const AAX_CString& ShortenedName(int32_t iNumCharacters) const AAX_OVERRIDE { return mNames.Get(iNumCharacters); }
1205
1210 bool Automatable() const AAX_OVERRIDE { return false; }
1212 {
1213 //Remove the old automation delegate
1214 if ( mAutomationDelegate )
1215 {
1217 }
1218
1219 //Add the new automation delegate, wrapped by the versioning layer.
1220 mAutomationDelegate = iAutomationDelegate;
1221 if ( mAutomationDelegate )
1223 }
1227
1232 void SetNormalizedValue(double /*newNormalizedValue*/) AAX_OVERRIDE {}
1233 double GetNormalizedValue() const AAX_OVERRIDE { return 0.; }
1234 void SetNormalizedDefaultValue(double /*normalizedDefault*/) AAX_OVERRIDE {}
1235 double GetNormalizedDefaultValue() const AAX_OVERRIDE { return 0.; }
1237 void SetNumberOfSteps(uint32_t /*numSteps*/) AAX_OVERRIDE {}
1238 uint32_t GetNumberOfSteps() const AAX_OVERRIDE { return 1; }
1239 uint32_t GetStepValue() const AAX_OVERRIDE { return 0; }
1240 double GetNormalizedValueFromStep(uint32_t /*iStep*/) const AAX_OVERRIDE { return 0.; }
1241 uint32_t GetStepValueFromNormalizedValue(double /*normalizedValue*/) const AAX_OVERRIDE { return 0; }
1242 void SetStepValue(uint32_t /*iStep*/) AAX_OVERRIDE {}
1244
1251 bool GetValueString(AAX_CString* valueString) const AAX_OVERRIDE { if (valueString) *valueString = mValueString; return true; }
1252 bool GetValueString(int32_t /*iMaxNumChars*/, AAX_CString* valueString) const AAX_OVERRIDE { return this->GetValueString(valueString); }
1253 bool GetNormalizedValueFromBool(bool /*value*/, double* normalizedValue) const AAX_OVERRIDE { if (normalizedValue) { *normalizedValue = 0.; } return true; }
1254 bool GetNormalizedValueFromInt32(int32_t /*value*/, double* normalizedValue) const AAX_OVERRIDE { if (normalizedValue) { *normalizedValue = 0.; } return true; }
1255 bool GetNormalizedValueFromFloat(float /*value*/, double* normalizedValue) const AAX_OVERRIDE { if (normalizedValue) { *normalizedValue = 0.; } return true; }
1256 bool GetNormalizedValueFromDouble(double /*value*/, double* normalizedValue) const AAX_OVERRIDE { if (normalizedValue) { *normalizedValue = 0.; } return true; }
1257 bool GetNormalizedValueFromString(const AAX_CString& /*valueString*/, double* normalizedValue) const AAX_OVERRIDE { if (normalizedValue) { *normalizedValue = 0.; } return true; }
1258 bool GetBoolFromNormalizedValue(double /*normalizedValue*/, bool* value) const AAX_OVERRIDE { if (value) { *value = false; } return true; }
1259 bool GetInt32FromNormalizedValue(double /*normalizedValue*/, int32_t* /*value*/) const AAX_OVERRIDE { return false; }
1260 bool GetFloatFromNormalizedValue(double /*normalizedValue*/, float* /*value*/) const AAX_OVERRIDE { return false; }
1261 bool GetDoubleFromNormalizedValue(double /*normalizedValue*/, double* /*value*/) const AAX_OVERRIDE { return false; }
1262 bool GetStringFromNormalizedValue(double /*normalizedValue*/, AAX_CString& valueString) const AAX_OVERRIDE { valueString = mValueString; return true; }
1263 bool GetStringFromNormalizedValue(double normalizedValue, int32_t /*iMaxNumChars*/, AAX_CString& valueString) const AAX_OVERRIDE { return this->GetStringFromNormalizedValue(normalizedValue, valueString); }
1264 bool SetValueFromString(const AAX_CString& newValueString) AAX_OVERRIDE { mValueString = newValueString; return true; }
1266
1271 bool GetValueAsBool(bool* value) const AAX_OVERRIDE { if (value) { *value = false; } return true; }
1272 bool GetValueAsInt32(int32_t* /*value*/) const AAX_OVERRIDE { return false; }
1273 bool GetValueAsFloat(float* /*value*/) const AAX_OVERRIDE { return false; }
1274 bool GetValueAsDouble(double* /*value*/) const AAX_OVERRIDE { return false; }
1275 bool GetValueAsString(AAX_IString* /*value*/) const AAX_OVERRIDE { return false; }
1276 bool SetValueWithBool(bool /*value*/) AAX_OVERRIDE { return true; }
1277 bool SetValueWithInt32(int32_t /*value*/) AAX_OVERRIDE { return false; }
1278 bool SetValueWithFloat(float /*value*/) AAX_OVERRIDE { return false; }
1279 bool SetValueWithDouble(double /*value*/) AAX_OVERRIDE { return false; }
1280 bool SetValueWithString(const AAX_IString& value) AAX_OVERRIDE { mValueString = value; return true; }
1282
1283 void SetType( AAX_EParameterType /*iControlType*/ ) AAX_OVERRIDE {};
1285
1288
1289 void SetTaperDelegate ( AAX_ITaperDelegateBase & /*inTaperDelegate*/, bool /*inPreserveValue*/ ) AAX_OVERRIDE {};
1290 void SetDisplayDelegate ( AAX_IDisplayDelegateBase & /*inDisplayDelegate*/ ) AAX_OVERRIDE {};
1291
1296 void UpdateNormalizedValue(double /*newNormalizedValue*/) AAX_OVERRIDE {};
1298
1299protected:
1304};
1305
1306
1307
1308
1309#endif //AAX_CParameter_H
A generic AAX string class with similar functionality to std::string.
AAX_EParameterType
FIC stuff that I can't include without DAE library dependence.
Definition: AAX_Enums.h:898
@ AAX_eParameterType_Discrete
Definition: AAX_Enums.h:899
@ AAX_eParameterType_Continuous
Definition: AAX_Enums.h:900
int32_t AAX_EParameterOrientation
Typedef for a bitfield of AAX_EParameterOrientationBits values.
Definition: AAX_Enums.h:931
@ AAX_eParameterOrientation_Default
Definition: AAX_Enums.h:910
Defines the display behavior for a parameter.
Defines the taper conversion behavior for a parameter.
Interface allowing an AAX plug-in to interact with the host's automation system.
const char * AAX_CParamID
Parameter identifier.
Definition: AAX.h:362
AAX_CONSTEXPR size_t kAAX_ParameterIdentifierMaxSize
Definition: AAX.h:377
#define AAX_OVERRIDE
override keyword macro
Definition: AAX.h:164
Declarations for cross-platform AAX_ASSERT, AAX_TRACE and related facilities.
#define AAX_ASSERT(condition)
Asserts that a condition is true and logs an error if the condition is false.
Definition: AAX_Assert.h:281
The base interface for all normalizable plug-in parameters.
Concrete implementation of AAX_IParameterValue.
Definition: AAX_CParameter.h:65
AAX_DEFAULT_MOVE_OPER(AAX_CParameterValue)
bool GetValueAsInt32(int32_t *value) const AAX_OVERRIDE
Retrieves the parameter's value as an int32_t.
Definition: AAX_CParameter.h:168
bool GetValueAsDouble(double *value) const AAX_OVERRIDE
Retrieves the parameter's value as a double.
Definition: AAX_CParameter.h:184
bool GetValueAsString(AAX_IString *value) const AAX_OVERRIDE
Retrieves the parameter's value as a string.
Definition: AAX_CParameter.h:192
Defaults
Definition: AAX_CParameter.h:67
@ eParameterDefaultMaxIdentifierLength
Definition: AAX_CParameter.h:69
@ eParameterDefaultMaxIdentifierSize
Definition: AAX_CParameter.h:68
void Set(const T &inValue)
Direct access to the template instance's value.
Definition: AAX_CParameter.h:108
bool GetValueAsBool(bool *value) const AAX_OVERRIDE
Retrieves the parameter's value as a bool.
Definition: AAX_CParameter.h:159
AAX_IParameterValue * Clone() const AAX_OVERRIDE
Clones the parameter object.
Definition: AAX_CParameter.h:112
AAX_DEFAULT_DTOR_OVERRIDE(AAX_CParameterValue)
bool GetValueAsFloat(float *value) const AAX_OVERRIDE
Retrieves the parameter's value as a float.
Definition: AAX_CParameter.h:176
AAX_CParameterValue(AAX_CParamID identifier)
Constructs an AAX_CParameterValue object.
Definition: AAX_CParameter.h:138
AAX_DELETE(AAX_CParameterValue &operator=(const AAX_CParameterValue &))
AAX_CParamID Identifier() const AAX_OVERRIDE
Returns the parameter's unique identifier.
Definition: AAX_CParameter.h:113
AAX_DEFAULT_MOVE_CTOR(AAX_CParameterValue)
const T & Get() const
Direct access to the template instance's value.
Definition: AAX_CParameter.h:105
Generic implementation of an AAX_IParameter.
Definition: AAX_CParameter.h:248
bool SetValueWithString(const AAX_IString &value) AAX_OVERRIDE
Sets the parameter's value as a string.
Definition: AAX_CParameter.h:803
AAX_CParameterValue< T > mValue
Definition: AAX_CParameter.h:496
Type
Definition: AAX_CParameter.h:251
@ eParameterTypeUndefined
Definition: AAX_CParameter.h:252
@ eParameterTypeInt32
Definition: AAX_CParameter.h:254
@ eParameterTypeCustom
Definition: AAX_CParameter.h:256
@ eParameterTypeFloat
Definition: AAX_CParameter.h:255
@ eParameterTypeBool
Definition: AAX_CParameter.h:253
bool GetBoolFromNormalizedValue(double normalizedValue, bool *value) const AAX_OVERRIDE
Converts a normalized parameter value to a bool representing the corresponding real value.
Definition: AAX_CParameter.h:1008
AAX_EParameterType GetType() const AAX_OVERRIDE
Returns the type of this parameter as an AAX_EParameterType.
Definition: AAX_CParameter.h:917
const AAX_CString & Name() const AAX_OVERRIDE
Returns the parameter's display name.
Definition: AAX_CParameter.h:612
AAX_EParameterOrientation mOrientation
Definition: AAX_CParameter.h:490
AAX_EParameterType mControlType
Definition: AAX_CParameter.h:489
AAX_CStringAbbreviations mNames
Definition: AAX_CParameter.h:486
AAX_DELETE(AAX_CParameter())
T mDefaultValue
Definition: AAX_CParameter.h:497
bool SetValueWithBool(bool value) AAX_OVERRIDE
Sets the parameter's value as a bool.
Definition: AAX_CParameter.h:771
AAX_IAutomationDelegate * mAutomationDelegate
Definition: AAX_CParameter.h:493
AAX_CParameter(AAX_CParamID identifier, const AAX_IString &name, T defaultValue, const AAX_ITaperDelegate< T > &taperDelegate, const AAX_IDisplayDelegate< T > &displayDelegate, bool automatable=false)
Constructs an AAX_CParameter object using the specified taper and display delegates.
Definition: AAX_CParameter.h:507
const AAX_CString & ShortenedName(int32_t iNumCharacters) const AAX_OVERRIDE
Returns the parameter's shortened display name.
Definition: AAX_CParameter.h:624
bool mNeedNotify
Definition: AAX_CParameter.h:494
double GetNormalizedValue() const AAX_OVERRIDE
Returns the normalized representation of the parameter's current real value.
Definition: AAX_CParameter.h:942
T GetDefaultValue() const
Returns the parameter's default value.
Definition: AAX_CParameter.h:833
bool GetNormalizedValueFromFloat(float value, double *normalizedValue) const AAX_OVERRIDE
Converts a float to a normalized parameter value.
Definition: AAX_CParameter.h:978
uint32_t mNumSteps
Definition: AAX_CParameter.h:488
bool GetValueAsFloat(float *value) const AAX_OVERRIDE
Retrieves the parameter's value as a float.
Definition: AAX_CParameter.h:739
void SetValue(T newValue)
Initiates a host request to set the parameter's value.
Definition: AAX_CParameter.h:638
~AAX_CParameter() AAX_OVERRIDE
Virtual destructor used to delete all locally allocated pointers.
Definition: AAX_CParameter.h:579
void Release() AAX_OVERRIDE
Signals the automation system that a control has been released.
Definition: AAX_CParameter.h:1144
AAX_DEFAULT_MOVE_CTOR(AAX_CParameter)
bool GetNormalizedValueFromBool(bool value, double *normalizedValue) const AAX_OVERRIDE
Converts a bool to a normalized parameter value.
Definition: AAX_CParameter.h:962
const AAX_IDisplayDelegate< T > * DisplayDelegate() const
Returns a reference to the parameter's display delegate.
Definition: AAX_CParameter.h:1109
Defaults
Definition: AAX_CParameter.h:259
@ eParameterDefaultNumStepsDiscrete
Definition: AAX_CParameter.h:260
@ eParameterDefaultNumStepsContinuous
Definition: AAX_CParameter.h:261
bool GetNormalizedValueFromInt32(int32_t value, double *normalizedValue) const AAX_OVERRIDE
Converts an integer to a normalized parameter value.
Definition: AAX_CParameter.h:970
bool GetValueAsBool(bool *value) const AAX_OVERRIDE
Retrieves the parameter's value as a bool.
Definition: AAX_CParameter.h:727
void SetTaperDelegate(AAX_ITaperDelegateBase &inTaperDelegate, bool inPreserveValue=true) AAX_OVERRIDE
Sets the parameter's taper delegate.
Definition: AAX_CParameter.h:1077
bool SetValueWithDouble(double value) AAX_OVERRIDE
Sets the parameter's value as a double.
Definition: AAX_CParameter.h:795
void SetDisplayDelegate(AAX_IDisplayDelegateBase &inDisplayDelegate) AAX_OVERRIDE
Sets the parameter's display delegate.
Definition: AAX_CParameter.h:1092
AAX_IParameterValue * CloneValue() const AAX_OVERRIDE
Clone the parameter's value to a new AAX_IParameterValue object.
Definition: AAX_CParameter.h:591
bool GetValueAsString(AAX_IString *value) const AAX_OVERRIDE
Retrieves the parameter's value as a string.
Definition: AAX_CParameter.h:751
bool GetNormalizedValueFromDouble(double value, double *normalizedValue) const AAX_OVERRIDE
Converts a double to a normalized parameter value.
Definition: AAX_CParameter.h:986
void SetStepValue(uint32_t iStep) AAX_OVERRIDE
Returns the current step for the current value of the parameter.
Definition: AAX_CParameter.h:901
T GetValue() const
Returns the parameter's value.
Definition: AAX_CParameter.h:720
AAX_EParameterOrientation GetOrientation() const AAX_OVERRIDE
Returns the orientation of this parameter.
Definition: AAX_CParameter.h:929
void UpdateNormalizedValue(double newNormalizedValue) AAX_OVERRIDE
Sets the parameter's state given a normalized value.
Definition: AAX_CParameter.h:670
AAX_DEFAULT_MOVE_OPER(AAX_CParameter)
void SetName(const AAX_CString &name) AAX_OVERRIDE
Sets the parameter's display name.
Definition: AAX_CParameter.h:603
uint32_t GetStepValue() const AAX_OVERRIDE
Returns the current step for the current value of the parameter.
Definition: AAX_CParameter.h:861
double GetNormalizedDefaultValue() const AAX_OVERRIDE
Returns the normalized representation of the parameter's real default value.
Definition: AAX_CParameter.h:819
void SetOrientation(AAX_EParameterOrientation iOrientation) AAX_OVERRIDE
Sets the orientation of this parameter.
Definition: AAX_CParameter.h:923
void SetToDefaultValue() AAX_OVERRIDE
Restores the state of this parameter to its default value.
Definition: AAX_CParameter.h:839
AAX_DELETE(AAX_CParameter(const AAX_CParameter &other))
void SetType(AAX_EParameterType iControlType) AAX_OVERRIDE
Sets the type of this parameter.
Definition: AAX_CParameter.h:911
void SetNormalizedDefaultValue(double normalizedDefault) AAX_OVERRIDE
Sets the parameter's default value using its normalized representation.
Definition: AAX_CParameter.h:812
const AAX_ITaperDelegate< T > * TaperDelegate() const
Returns a reference to the parameter's taper delegate.
Definition: AAX_CParameter.h:1103
double GetNormalizedValueFromStep(uint32_t iStep) const AAX_OVERRIDE
Returns the normalized value for a given step.
Definition: AAX_CParameter.h:867
void AddShortenedName(const AAX_CString &name) AAX_OVERRIDE
Sets the parameter's shortened display name.
Definition: AAX_CParameter.h:618
bool SetValueFromString(const AAX_CString &newValueString) AAX_OVERRIDE
Converts a string to a real parameter value and sets the parameter to this value.
Definition: AAX_CParameter.h:1067
bool GetInt32FromNormalizedValue(double normalizedValue, int32_t *value) const AAX_OVERRIDE
Converts a normalized parameter value to an integer representing the corresponding real value.
Definition: AAX_CParameter.h:1017
bool GetDoubleFromNormalizedValue(double normalizedValue, double *value) const AAX_OVERRIDE
Converts a normalized parameter value to a double representing the corresponding real value.
Definition: AAX_CParameter.h:1033
bool SetValueWithInt32(int32_t value) AAX_OVERRIDE
Sets the parameter's value as an int32_t.
Definition: AAX_CParameter.h:779
void ClearShortenedNames() AAX_OVERRIDE
Clears the internal list of shortened display names.
Definition: AAX_CParameter.h:630
AAX_ITaperDelegate< T > * mTaperDelegate
Definition: AAX_CParameter.h:491
bool SetValueWithFloat(float value) AAX_OVERRIDE
Sets the parameter's value as a float.
Definition: AAX_CParameter.h:787
uint32_t GetStepValueFromNormalizedValue(double normalizedValue) const AAX_OVERRIDE
Returns the step value for a normalized value of the parameter.
Definition: AAX_CParameter.h:884
void SetNumberOfSteps(uint32_t numSteps) AAX_OVERRIDE
Sets the number of discrete steps for this parameter.
Definition: AAX_CParameter.h:845
void SetNormalizedValue(double newNormalizedValue) AAX_OVERRIDE
Sets a parameter value using it's normalized representation.
Definition: AAX_CParameter.h:935
void SetAutomationDelegate(AAX_IAutomationDelegate *iAutomationDelegate) AAX_OVERRIDE
Sets the automation delegate (if one is required)
Definition: AAX_CParameter.h:1121
AAX_DELETE(AAX_CParameter &operator=(const AAX_CParameter &other))
bool GetValueString(AAX_CString *valueString) const AAX_OVERRIDE
Serializes the parameter value into a string.
Definition: AAX_CParameter.h:950
bool GetStringFromNormalizedValue(double normalizedValue, AAX_CString &valueString) const AAX_OVERRIDE
Converts a normalized parameter value to a string representing the corresponding real value.
Definition: AAX_CParameter.h:1041
bool GetFloatFromNormalizedValue(double normalizedValue, float *value) const AAX_OVERRIDE
Converts a normalized parameter value to a float representing the corresponding real value.
Definition: AAX_CParameter.h:1025
bool GetValueAsDouble(double *value) const AAX_OVERRIDE
Retrieves the parameter's value as a double.
Definition: AAX_CParameter.h:745
bool Automatable() const AAX_OVERRIDE
Returns true if the parameter is automatable, false if it is not.
Definition: AAX_CParameter.h:1115
AAX_CParamID Identifier() const AAX_OVERRIDE
Returns the parameter's unique identifier.
Definition: AAX_CParameter.h:597
bool GetNormalizedValueFromString(const AAX_CString &valueString, double *normalizedValue) const AAX_OVERRIDE
Converts a given string to a normalized parameter value.
Definition: AAX_CParameter.h:994
AAX_IDisplayDelegate< T > * mDisplayDelegate
Definition: AAX_CParameter.h:492
void SetDefaultValue(T newDefaultValue)
Set the parameter's default value.
Definition: AAX_CParameter.h:826
bool mAutomatable
Definition: AAX_CParameter.h:487
bool GetValueAsInt32(int32_t *value) const AAX_OVERRIDE
Retrieves the parameter's value as an int32_t.
Definition: AAX_CParameter.h:733
void Touch() AAX_OVERRIDE
Signals the automation system that a control has been touched.
Definition: AAX_CParameter.h:1136
uint32_t GetNumberOfSteps() const AAX_OVERRIDE
Returns the number of discrete steps used by the parameter.
Definition: AAX_CParameter.h:855
A stateless parameter implementation.
Definition: AAX_CParameter.h:1166
bool SetValueWithDouble(double) AAX_OVERRIDE
Sets the parameter's value as a double.
Definition: AAX_CParameter.h:1279
uint32_t GetStepValueFromNormalizedValue(double) const AAX_OVERRIDE
Returns the step value for a normalized value of the parameter.
Definition: AAX_CParameter.h:1241
bool GetValueAsInt32(int32_t *) const AAX_OVERRIDE
Retrieves the parameter's value as an int32_t.
Definition: AAX_CParameter.h:1272
void ClearShortenedNames() AAX_OVERRIDE
Clears the internal list of shortened display names.
Definition: AAX_CParameter.h:1203
double GetNormalizedDefaultValue() const AAX_OVERRIDE
Returns the normalized representation of the parameter's real default value.
Definition: AAX_CParameter.h:1235
bool GetStringFromNormalizedValue(double, AAX_CString &valueString) const AAX_OVERRIDE
Converts a normalized parameter value to a string representing the corresponding real value.
Definition: AAX_CParameter.h:1262
double GetNormalizedValue() const AAX_OVERRIDE
Returns the normalized representation of the parameter's current real value.
Definition: AAX_CParameter.h:1233
double GetNormalizedValueFromStep(uint32_t) const AAX_OVERRIDE
Returns the normalized value for a given step.
Definition: AAX_CParameter.h:1240
void SetTaperDelegate(AAX_ITaperDelegateBase &, bool) AAX_OVERRIDE
Sets the parameter's taper delegate.
Definition: AAX_CParameter.h:1289
bool GetBoolFromNormalizedValue(double, bool *value) const AAX_OVERRIDE
Converts a normalized parameter value to a bool representing the corresponding real value.
Definition: AAX_CParameter.h:1258
void AddShortenedName(const AAX_CString &name) AAX_OVERRIDE
Sets the parameter's shortened display name.
Definition: AAX_CParameter.h:1201
bool GetValueString(int32_t, AAX_CString *valueString) const AAX_OVERRIDE
Serializes the parameter value into a string, size hint included.
Definition: AAX_CParameter.h:1252
uint32_t GetStepValue() const AAX_OVERRIDE
Returns the current step for the current value of the parameter.
Definition: AAX_CParameter.h:1239
bool GetInt32FromNormalizedValue(double, int32_t *) const AAX_OVERRIDE
Converts a normalized parameter value to an integer representing the corresponding real value.
Definition: AAX_CParameter.h:1259
AAX_CStringAbbreviations mNames
Definition: AAX_CParameter.h:1300
AAX_EParameterType GetType() const AAX_OVERRIDE
Returns the type of this parameter as an AAX_EParameterType.
Definition: AAX_CParameter.h:1284
bool GetNormalizedValueFromBool(bool, double *normalizedValue) const AAX_OVERRIDE
Converts a bool to a normalized parameter value.
Definition: AAX_CParameter.h:1253
void UpdateNormalizedValue(double) AAX_OVERRIDE
Sets the parameter's state given a normalized value.
Definition: AAX_CParameter.h:1296
void SetNumberOfSteps(uint32_t) AAX_OVERRIDE
Sets the number of discrete steps for this parameter.
Definition: AAX_CParameter.h:1237
void SetDisplayDelegate(AAX_IDisplayDelegateBase &) AAX_OVERRIDE
Sets the parameter's display delegate.
Definition: AAX_CParameter.h:1290
AAX_EParameterOrientation GetOrientation() const AAX_OVERRIDE
Returns the orientation of this parameter.
Definition: AAX_CParameter.h:1287
bool GetNormalizedValueFromInt32(int32_t, double *normalizedValue) const AAX_OVERRIDE
Converts an integer to a normalized parameter value.
Definition: AAX_CParameter.h:1254
void Release() AAX_OVERRIDE
Signals the automation system that a control has been released.
Definition: AAX_CParameter.h:1225
bool SetValueWithString(const AAX_IString &value) AAX_OVERRIDE
Sets the parameter's value as a string.
Definition: AAX_CParameter.h:1280
AAX_CStatelessParameter(const AAX_IString &identifier, const AAX_IString &name, const AAX_IString &inValueString)
Definition: AAX_CParameter.h:1176
bool GetNormalizedValueFromString(const AAX_CString &, double *normalizedValue) const AAX_OVERRIDE
Converts a given string to a normalized parameter value.
Definition: AAX_CParameter.h:1257
bool GetValueAsFloat(float *) const AAX_OVERRIDE
Retrieves the parameter's value as a float.
Definition: AAX_CParameter.h:1273
bool GetStringFromNormalizedValue(double normalizedValue, int32_t, AAX_CString &valueString) const AAX_OVERRIDE
Converts a normalized parameter value to a string representing the corresponding real,...
Definition: AAX_CParameter.h:1263
const AAX_CString & Name() const AAX_OVERRIDE
Returns the parameter's display name.
Definition: AAX_CParameter.h:1200
void Touch() AAX_OVERRIDE
Signals the automation system that a control has been touched.
Definition: AAX_CParameter.h:1224
void SetNormalizedValue(double) AAX_OVERRIDE
Sets a parameter value using it's normalized representation.
Definition: AAX_CParameter.h:1232
void SetNormalizedDefaultValue(double) AAX_OVERRIDE
Sets the parameter's default value using its normalized representation.
Definition: AAX_CParameter.h:1234
void SetToDefaultValue() AAX_OVERRIDE
Restores the state of this parameter to its default value.
Definition: AAX_CParameter.h:1236
bool Automatable() const AAX_OVERRIDE
Returns true if the parameter is automatable, false if it is not.
Definition: AAX_CParameter.h:1210
bool SetValueWithInt32(int32_t) AAX_OVERRIDE
Sets the parameter's value as an int32_t.
Definition: AAX_CParameter.h:1277
AAX_CParamID Identifier() const AAX_OVERRIDE
Returns the parameter's unique identifier.
Definition: AAX_CParameter.h:1192
bool GetDoubleFromNormalizedValue(double, double *) const AAX_OVERRIDE
Converts a normalized parameter value to a double representing the corresponding real value.
Definition: AAX_CParameter.h:1261
bool GetNormalizedValueFromFloat(float, double *normalizedValue) const AAX_OVERRIDE
Converts a float to a normalized parameter value.
Definition: AAX_CParameter.h:1255
bool SetValueWithBool(bool) AAX_OVERRIDE
Sets the parameter's value as a bool.
Definition: AAX_CParameter.h:1276
AAX_CString mID
Definition: AAX_CParameter.h:1301
AAX_CStatelessParameter(AAX_CParamID identifier, const AAX_IString &name, const AAX_IString &inValueString)
Definition: AAX_CParameter.h:1168
bool SetValueWithFloat(float) AAX_OVERRIDE
Sets the parameter's value as a float.
Definition: AAX_CParameter.h:1278
bool SetValueFromString(const AAX_CString &newValueString) AAX_OVERRIDE
Converts a string to a real parameter value and sets the parameter to this value.
Definition: AAX_CParameter.h:1264
bool GetNormalizedValueFromDouble(double, double *normalizedValue) const AAX_OVERRIDE
Converts a double to a normalized parameter value.
Definition: AAX_CParameter.h:1256
bool GetValueAsString(AAX_IString *) const AAX_OVERRIDE
Retrieves the parameter's value as a string.
Definition: AAX_CParameter.h:1275
void SetAutomationDelegate(AAX_IAutomationDelegate *iAutomationDelegate) AAX_OVERRIDE
Sets the automation delegate (if one is required)
Definition: AAX_CParameter.h:1211
bool GetValueString(AAX_CString *valueString) const AAX_OVERRIDE
Serializes the parameter value into a string.
Definition: AAX_CParameter.h:1251
void SetStepValue(uint32_t) AAX_OVERRIDE
Returns the current step for the current value of the parameter.
Definition: AAX_CParameter.h:1242
void SetType(AAX_EParameterType) AAX_OVERRIDE
Sets the type of this parameter.
Definition: AAX_CParameter.h:1283
AAX_CString mValueString
Definition: AAX_CParameter.h:1303
void SetName(const AAX_CString &name) AAX_OVERRIDE
Sets the parameter's display name.
Definition: AAX_CParameter.h:1193
bool GetFloatFromNormalizedValue(double, float *) const AAX_OVERRIDE
Converts a normalized parameter value to a float representing the corresponding real value.
Definition: AAX_CParameter.h:1260
const AAX_CString & ShortenedName(int32_t iNumCharacters) const AAX_OVERRIDE
Returns the parameter's shortened display name.
Definition: AAX_CParameter.h:1202
bool GetValueAsBool(bool *value) const AAX_OVERRIDE
Retrieves the parameter's value as a bool.
Definition: AAX_CParameter.h:1271
AAX_IAutomationDelegate * mAutomationDelegate
Definition: AAX_CParameter.h:1302
AAX_DEFAULT_DTOR_OVERRIDE(AAX_CStatelessParameter)
uint32_t GetNumberOfSteps() const AAX_OVERRIDE
Returns the number of discrete steps used by the parameter.
Definition: AAX_CParameter.h:1238
void SetOrientation(AAX_EParameterOrientation) AAX_OVERRIDE
Sets the orientation of this parameter.
Definition: AAX_CParameter.h:1286
AAX_IParameterValue * CloneValue() const AAX_OVERRIDE
Clone the parameter's value to a new AAX_IParameterValue object.
Definition: AAX_CParameter.h:1186
bool GetValueAsDouble(double *) const AAX_OVERRIDE
Retrieves the parameter's value as a double.
Definition: AAX_CParameter.h:1274
A generic AAX string class with similar functionality to std::string
Definition: AAX_CString.h:57
const char * CString() const
const char * Get() const AAX_OVERRIDE
Helper class to store a collection of name abbreviations.
Definition: AAX_CString.h:186
void Clear()
Definition: AAX_CString.h:220
void Add(const AAX_CString &inAbbreviation)
Definition: AAX_CString.h:197
const AAX_CString & Primary() const
Definition: AAX_CString.h:195
const AAX_CString & Get(int32_t inNumCharacters) const
Definition: AAX_CString.h:203
void SetPrimary(const AAX_CString &inPrimary)
Definition: AAX_CString.h:194
Interface allowing an AAX plug-in to interact with the host's event system.
Definition: AAX_IAutomationDelegate.h:57
virtual AAX_Result PostTouchRequest(AAX_CParamID iParameterID)=0
virtual AAX_Result RegisterParameter(AAX_CParamID iParameterID)=0
virtual AAX_Result PostReleaseRequest(AAX_CParamID iParameterID)=0
virtual AAX_Result UnregisterParameter(AAX_CParamID iParameterID)=0
virtual AAX_Result ParameterNameChanged(AAX_CParamID iParameterID)=0
Defines the display behavior for a parameter.
Definition: AAX_IDisplayDelegate.h:63
Definition: AAX_IDisplayDelegate.h:79
virtual AAX_IDisplayDelegate * Clone() const =0
Constructs and returns a copy of the display delegate.
An abstract interface representing a parameter value of arbitrary type.
Definition: AAX_IParameter.h:55
The base interface for all normalizable plug-in parameters.
Definition: AAX_IParameter.h:150
A simple string container that can be passed across a binary boundary. This class,...
Definition: AAX_IString.h:51
Defines the taper conversion behavior for a parameter.
Definition: AAX_ITaperDelegate.h:83
Definition: AAX_ITaperDelegate.h:99
virtual AAX_ITaperDelegate * Clone() const =0
Constructs and returns a copy of the taper delegate.