41 #if !defined(__CAVolumeCurve_h__)
42 #define __CAVolumeCurve_h__
48 #if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
49 #include <CoreAudio/CoreAudioTypes.h>
51 #include <CoreAudioTypes.h>
64 CARawPoint() : mMinimum(0), mMaximum(0) {}
65 CARawPoint(
const CARawPoint& inPoint) : mMinimum(inPoint.mMinimum), mMaximum(inPoint.mMaximum) {}
66 CARawPoint(SInt32 inMinimum, SInt32 inMaximum) : mMinimum(inMinimum), mMaximum(inMaximum) {}
67 CARawPoint& operator=(
const CARawPoint& inPoint) { mMinimum = inPoint.mMinimum; mMaximum = inPoint.mMaximum;
return *
this; }
69 static bool Overlap(
const CARawPoint& x,
const CARawPoint& y) {
return (x.mMinimum < y.mMaximum) && (x.mMaximum > y.mMinimum); }
72 inline bool operator<(
const CARawPoint& x,
const CARawPoint& y) {
return x.mMinimum < y.mMinimum; }
73 inline bool operator==(
const CARawPoint& x,
const CARawPoint& y) {
return (x.mMinimum == y.mMinimum) && (x.mMaximum == y.mMaximum); }
74 inline bool operator!=(
const CARawPoint& x,
const CARawPoint& y) {
return !(x == y); }
75 inline bool operator<=(
const CARawPoint& x,
const CARawPoint& y) {
return (x < y) || (x == y); }
76 inline bool operator>=(
const CARawPoint& x,
const CARawPoint& y) {
return !(x < y); }
77 inline bool operator>(
const CARawPoint& x,
const CARawPoint& y) {
return !((x < y) || (x == y)); }
84 CADBPoint() : mMinimum(0), mMaximum(0) {}
85 CADBPoint(
const CADBPoint& inPoint) : mMinimum(inPoint.mMinimum), mMaximum(inPoint.mMaximum) {}
86 CADBPoint(Float64 inMinimum, Float64 inMaximum) : mMinimum(inMinimum), mMaximum(inMaximum) {}
87 CADBPoint& operator=(
const CADBPoint& inPoint) { mMinimum = inPoint.mMinimum; mMaximum = inPoint.mMaximum;
return *
this; }
89 static bool Overlap(
const CADBPoint& x,
const CADBPoint& y) {
return (x.mMinimum < y.mMaximum) && (x.mMaximum >= y.mMinimum); }
92 inline bool operator<(
const CADBPoint& x,
const CADBPoint& y) {
return x.mMinimum < y.mMinimum; }
93 inline bool operator==(
const CADBPoint& x,
const CADBPoint& y) {
return (x.mMinimum == y.mMinimum) && (x.mMaximum == y.mMaximum); }
94 inline bool operator!=(
const CADBPoint& x,
const CADBPoint& y) {
return !(x == y); }
95 inline bool operator<=(
const CADBPoint& x,
const CADBPoint& y) {
return (x < y) || (x == y); }
96 inline bool operator>=(
const CADBPoint& x,
const CADBPoint& y) {
return !(x < y); }
97 inline bool operator>(
const CADBPoint& x,
const CADBPoint& y) {
return !((x < y) || (x == y)); }
120 kPow7Over1Curve = 10,
121 kPow8Over1Curve = 11,
122 kPow9Over1Curve = 12,
123 kPow10Over1Curve = 13,
124 kPow11Over1Curve = 14,
125 kPow12Over1Curve = 15
131 virtual ~CAVolumeCurve();
135 UInt32 GetTag()
const {
return mTag; }
136 void SetTag(UInt32 inTag) { mTag = inTag; }
137 SInt32 GetMinimumRaw()
const;
138 SInt32 GetMaximumRaw()
const;
139 Float64 GetMinimumDB()
const;
140 Float64 GetMaximumDB()
const;
142 void SetIsApplyingTransferFunction(
bool inIsApplyingTransferFunction) { mIsApplyingTransferFunction = inIsApplyingTransferFunction; }
143 int GetTransferFunction()
const {
return mTransferFunction; }
144 void SetTransferFunction(
int inTransferFunction);
148 void AddRange(SInt32 mMinRaw, SInt32 mMaxRaw, Float64 inMinDB, Float64 inMaxDB);
150 bool CheckForContinuity()
const;
152 SInt32 ConvertDBToRaw(Float64 inDB)
const;
153 Float64 ConvertRawToDB(SInt32 inRaw)
const;
154 Float64 ConvertRawToScalar(SInt32 inRaw)
const;
155 Float64 ConvertDBToScalar(Float64 inDB)
const;
156 SInt32 ConvertScalarToRaw(Float64 inScalar)
const;
157 Float64 ConvertScalarToDB(Float64 inScalar)
const;
161 typedef std::map<CARawPoint, CADBPoint> CurveMap;
165 bool mIsApplyingTransferFunction;
166 UInt32 mTransferFunction;
167 Float64 mRawToScalarExponentNumerator;
168 Float64 mRawToScalarExponentDenominator;
bool TTFOUNDATION_EXPORT operator!=(const TTObject &anObject, const TTObject &anotherObject)
Compare two objects for inequality.
bool TTFOUNDATION_EXPORT operator==(const TTObject &anObject, const TTObject &anotherObject)
Compare two objects for equality.