1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 16:39:30 +02:00

An overload of Envelope::GetValues for nonuniform time steps, taking ZoomInfo

This commit is contained in:
Paul Licameli 2015-06-09 11:42:38 -04:00
parent c4386f4dc8
commit 5316032fee
2 changed files with 12 additions and 0 deletions

View File

@ -1180,6 +1180,13 @@ void Envelope::GetValues(double *buffer, int bufferLen,
}
}
void Envelope::GetValues
(double *buffer, int bufferLen, int leftOffset, const ZoomInfo &zoomInfo) const
{
for (int xx = 0; xx < bufferLen; ++xx)
buffer[xx] = GetValue(zoomInfo.PositionToTime(xx, -leftOffset));
}
int Envelope::NumberOfPointsAfter(double t)
{
if( t >= mEnv[mEnv.Count()-1]->GetT() )

View File

@ -160,6 +160,11 @@ class Envelope : public XMLTagHandler {
* more than one value in a row. */
void GetValues(double *buffer, int len, double t0, double tstep) const;
/** \brief Get many envelope points at once, but don't assume uniform time step.
*/
void GetValues
(double *buffer, int bufferLen, int leftOffset, const ZoomInfo &zoomInfo) const;
int NumberOfPointsAfter(double t);
double NextPointAfter(double t);