Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
BoundedEnvelope Class Referencefinal

#include <Envelope.h>

Inheritance diagram for BoundedEnvelope:
[legend]
Collaboration diagram for BoundedEnvelope:
[legend]

Public Member Functions

double GetRangeLower () const
 
double GetRangeUpper () const
 
void SetRangeLower (double lower)
 
void SetRangeUpper (double upper)
 
 Envelope (bool exponential, double minValue, double maxValue, double defaultValue)
 
 Envelope (const Envelope &orig)
 
 Envelope (const Envelope &orig, double t0, double t1)
 
- Public Member Functions inherited from Envelope
 Envelope (bool exponential, double minValue, double maxValue, double defaultValue)
 
 Envelope (const Envelope &orig)
 
 Envelope (const Envelope &orig, double t0, double t1)
 
void Initialize (int numPoints)
 
virtual ~Envelope ()
 
bool ConsistencyCheck ()
 
double GetOffset () const
 
double GetTrackLen () const
 
bool GetExponential () const
 
void SetExponential (bool db)
 
void Flatten (double value)
 
double GetMinValue () const
 
double GetMaxValue () const
 
void SetRange (double minValue, double maxValue)
 
double ClampValue (double value)
 
bool HandleXMLTag (const std::string_view &tag, const AttributesList &attrs) override
 
XMLTagHandlerHandleXMLChild (const std::string_view &tag) override
 
void WriteXML (XMLWriter &xmlFile) const
 
void CollapseRegion (double t0, double t1, double sampleDur)
 
void PasteEnvelope (double t0, const Envelope *e, double sampleDur)
 
void InsertSpace (double t0, double tlen)
 
void SetOffset (double newOffset)
 
void SetTrackLen (double trackLen, double sampleDur=0.0)
 
void RescaleValues (double minValue, double maxValue)
 
void RescaleTimes (double newLength)
 
double GetValue (double t, double sampleDur=0) const
 Get envelope value at time t. More...
 
void GetValues (double *buffer, int len, double t0, double tstep) const
 Get many envelope points at once. More...
 
void Cap (double sampleDur)
 
double Average (double t0, double t1) const
 
double AverageOfInverse (double t0, double t1) const
 
double Integral (double t0, double t1) const
 
double IntegralOfInverse (double t0, double t1) const
 
double SolveIntegralOfInverse (double t0, double area) const
 
void print () const
 
void testMe ()
 
bool IsDirty () const
 
void Clear ()
 
int InsertOrReplace (double when, double value)
 Add a point at a particular absolute time coordinate. More...
 
int Reassign (double when, double value)
 Move a point at when to value. More...
 
void Delete (int point)
 DELETE a point by its position in array. More...
 
void Insert (int point, const EnvPoint &p)
 insert a point More...
 
void Insert (double when, double value)
 
size_t GetNumberOfPoints () const
 Return number of points. More...
 
const EnvPointoperator[] (int index) const
 Accessor for points. More...
 
void GetPoints (double *bufferWhen, double *bufferValue, int bufferLen) const
 Returns the sets of when and value pairs. More...
 
int GetDragPoint () const
 
void SetDragPoint (int dragPoint)
 
void SetDragPointValid (bool valid)
 
bool GetDragPointValid () const
 
void MoveDragPoint (double newWhen, double value)
 
void ClearDragPoint ()
 
- Public Member Functions inherited from XMLTagHandler
 XMLTagHandler ()
 
virtual ~XMLTagHandler ()
 
virtual bool HandleXMLTag (const std::string_view &tag, const AttributesList &attrs)=0
 
virtual void HandleXMLEndTag (const std::string_view &WXUNUSED(tag))
 
virtual void HandleXMLContent (const std::string_view &WXUNUSED(content))
 
virtual XMLTagHandlerHandleXMLChild (const std::string_view &tag)=0
 
void ReadXMLEndTag (const char *tag)
 
void ReadXMLContent (const char *s, int len)
 
XMLTagHandlerReadXMLChild (const char *tag)
 

Private Attributes

double mRangeLower {}
 
double mRangeUpper {}
 

Detailed Description

Definition at line 275 of file Envelope.h.

Member Function Documentation

◆ Envelope() [1/3]

Envelope::Envelope ( bool  exponential,
double  minValue,
double  maxValue,
double  defaultValue 
)

Definition at line 75 of file Envelope.cpp.

44 : mDB(exponential)
45 , mMinValue(minValue)
46 , mMaxValue(maxValue)
47 , mDefaultValue { ClampValue(defaultValue) }
48{
49}
double mMinValue
Definition: Envelope.h:248
bool mDB
Definition: Envelope.h:247
double ClampValue(double value)
Definition: Envelope.h:102
double mDefaultValue
Definition: Envelope.h:249
double mMaxValue
Definition: Envelope.h:248

◆ Envelope() [2/3]

Envelope::Envelope ( const Envelope orig)

Definition at line 77 of file Envelope.cpp.

258 : mDB(orig.mDB)
259 , mMinValue(orig.mMinValue)
260 , mMaxValue(orig.mMaxValue)
262{
263 mOffset = orig.mOffset;
264 mTrackLen = orig.mTrackLen;
265 CopyRange(orig, 0, orig.GetNumberOfPoints());
266}
double mOffset
The time at which the envelope starts, i.e. the start offset.
Definition: Envelope.h:237
size_t GetNumberOfPoints() const
Return number of points.
Definition: Envelope.cpp:689
double mTrackLen
The length of the envelope, which is the same as the length of the underlying track (normally)
Definition: Envelope.h:240
void CopyRange(const Envelope &orig, size_t begin, size_t end)
Definition: Envelope.cpp:268

◆ Envelope() [3/3]

Envelope::Envelope ( const Envelope orig,
double  t0,
double  t1 
)

Definition at line 80 of file Envelope.cpp.

244 : mDB(orig.mDB)
245 , mMinValue(orig.mMinValue)
246 , mMaxValue(orig.mMaxValue)
248{
249 mOffset = wxMax(t0, orig.mOffset);
250 mTrackLen = wxMin(t1, orig.mOffset + orig.mTrackLen) - mOffset;
251
252 auto range1 = orig.EqualRange( t0 - orig.mOffset, 0 );
253 auto range2 = orig.EqualRange( t1 - orig.mOffset, 0 );
254 CopyRange(orig, range1.first, range2.second);
255}
std::pair< int, int > EqualRange(double when, double sampleDur) const
Definition: Envelope.cpp:757

◆ GetRangeLower()

double BoundedEnvelope::GetRangeLower ( ) const
inline

Definition at line 280 of file Envelope.h.

280{ return mRangeLower; }
double mRangeLower
Definition: Envelope.h:287

References mRangeLower.

◆ GetRangeUpper()

double BoundedEnvelope::GetRangeUpper ( ) const
inline

Definition at line 281 of file Envelope.h.

281{ return mRangeUpper; }
double mRangeUpper
Definition: Envelope.h:287

References mRangeUpper.

◆ SetRangeLower()

void BoundedEnvelope::SetRangeLower ( double  lower)
inline

Definition at line 283 of file Envelope.h.

283{ mRangeLower = lower; }

References mRangeLower.

◆ SetRangeUpper()

void BoundedEnvelope::SetRangeUpper ( double  upper)
inline

Definition at line 284 of file Envelope.h.

284{ mRangeUpper = upper; }

References mRangeUpper.

Member Data Documentation

◆ mRangeLower

double BoundedEnvelope::mRangeLower {}
private

Definition at line 287 of file Envelope.h.

Referenced by GetRangeLower(), and SetRangeLower().

◆ mRangeUpper

double BoundedEnvelope::mRangeUpper {}
private

Definition at line 287 of file Envelope.h.

Referenced by GetRangeUpper(), and SetRangeUpper().


The documentation for this class was generated from the following file: