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)
 
virtual ~Envelope ()
 
bool IsTrivial () const
 
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) noexcept
 
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)
 
void RescaleTimesBy (double ratio)
 
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 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) noexcept
 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...
 
double GetDefaultValue () const
 
size_t GetVersion () const
 
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 278 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.

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

◆ Envelope() [2/3]

Envelope::Envelope ( const Envelope orig)

Definition at line 77 of file Envelope.cpp.

276 : mDB(orig.mDB)
277 , mMinValue(orig.mMinValue)
278 , mMaxValue(orig.mMaxValue)
280{
281 mOffset = orig.mOffset;
282 mTrackLen = orig.mTrackLen;
283 CopyRange(orig, 0, orig.GetNumberOfPoints());
284}
double mOffset
The time at which the envelope starts, i.e. the start offset.
Definition: Envelope.h:239
size_t GetNumberOfPoints() const
Return number of points.
Definition: Envelope.cpp:723
double mTrackLen
The length of the envelope, which is the same as the length of the underlying track (normally)
Definition: Envelope.h:242
void CopyRange(const Envelope &orig, size_t begin, size_t end)
Definition: Envelope.cpp:286

◆ Envelope() [3/3]

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

Definition at line 80 of file Envelope.cpp.

262 : mDB(orig.mDB)
263 , mMinValue(orig.mMinValue)
264 , mMaxValue(orig.mMaxValue)
266{
267 mOffset = wxMax(t0, orig.mOffset);
268 mTrackLen = wxMin(t1, orig.mOffset + orig.mTrackLen) - mOffset;
269
270 auto range1 = orig.EqualRange( t0 - orig.mOffset, 0 );
271 auto range2 = orig.EqualRange( t1 - orig.mOffset, 0 );
272 CopyRange(orig, range1.first, range2.second);
273}
std::pair< int, int > EqualRange(double when, double sampleDur) const noexcept
Definition: Envelope.cpp:801

References Envelope::Delete(), and Envelope::mDragPoint.

Here is the call graph for this function:

◆ GetRangeLower()

double BoundedEnvelope::GetRangeLower ( ) const
inline

Definition at line 283 of file Envelope.h.

283{ return mRangeLower; }
double mRangeLower
Definition: Envelope.h:290

References mRangeLower.

◆ GetRangeUpper()

double BoundedEnvelope::GetRangeUpper ( ) const
inline

Definition at line 284 of file Envelope.h.

284{ return mRangeUpper; }
double mRangeUpper
Definition: Envelope.h:290

References mRangeUpper.

◆ SetRangeLower()

void BoundedEnvelope::SetRangeLower ( double  lower)
inline

Definition at line 286 of file Envelope.h.

286{ mRangeLower = lower; }

References mRangeLower.

◆ SetRangeUpper()

void BoundedEnvelope::SetRangeUpper ( double  upper)
inline

Definition at line 287 of file Envelope.h.

287{ mRangeUpper = upper; }

References mRangeUpper.

Member Data Documentation

◆ mRangeLower

double BoundedEnvelope::mRangeLower {}
private

Definition at line 290 of file Envelope.h.

Referenced by GetRangeLower(), and SetRangeLower().

◆ mRangeUpper

double BoundedEnvelope::mRangeUpper {}
private

Definition at line 290 of file Envelope.h.

Referenced by GetRangeUpper(), and SetRangeUpper().


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