MCPcopy Create free account
hub / github.com/audacity/audacity / SetTrackLen

Method SetTrackLen

libraries/lib-mixer/Envelope.cpp:832–852  ·  view source on GitHub ↗

! @excsafety{No-fail} */

Source from the content-addressed store, hash-verified

830
831/*! @excsafety{No-fail} */
832void Envelope::SetTrackLen( double trackLen, double sampleDur )
833{
834 // Preserve the left-side limit at trackLen.
835 auto range = EqualRange( trackLen, sampleDur );
836 bool needPoint = ( range.first == range.second && trackLen < mTrackLen );
837 double value=0.0;
838 if ( needPoint )
839 value = GetValueRelative( trackLen );
840
841 mTrackLen = trackLen;
842
843 // Shrink the array.
844 // If more than one point already at the end, keep only the first of them.
845 int newLen = std::min( 1 + range.first, range.second );
846 mEnv.resize( newLen );
847
848 ++mVersion;
849
850 if ( needPoint )
851 AddPointAtEnd( mTrackLen, value );
852}
853
854/*! @excsafety{No-fail} */
855void Envelope::RescaleTimes( double newLength )

Callers 12

RebuildJoinedEnvelopeFunction · 0.80
InsertSilenceMethod · 0.80
setCurveMethod · 0.80
EqualizationFilterMethod · 0.80
CleanStateMethod · 0.80
TimeTrackMethod · 0.80
FlattenMethod · 0.80
EnvLogToLinMethod · 0.80
EnvLinToLogMethod · 0.80
GraphicEQMethod · 0.80
PopulateOrExchangeMethod · 0.80

Calls 1

minFunction · 0.50

Tested by

no test coverage detected