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

Method testMe

libraries/lib-time-track/TimeTrack.cpp:327–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327void TimeTrack::testMe()
328{
329 GetEnvelope()->Flatten(0.0);
330 GetEnvelope()->InsertOrReplace(0.0, 0.2);
331 GetEnvelope()->InsertOrReplace(5.0 - 0.001, 0.2);
332 GetEnvelope()->InsertOrReplace(5.0 + 0.001, 1.3);
333 GetEnvelope()->InsertOrReplace(10.0, 1.3);
334
335 double value1 = GetEnvelope()->Integral(2.0, 13.0);
336 double expected1 = (5.0 - 2.0) * 0.2 + (13.0 - 5.0) * 1.3;
337 double value2 = GetEnvelope()->IntegralOfInverse(2.0, 13.0);
338 double expected2 = (5.0 - 2.0) / 0.2 + (13.0 - 5.0) / 1.3;
339 if( fabs(value1 - expected1) > 0.01 )
340 {
341 wxPrintf( "TimeTrack: Integral failed! expected %f got %f\n", expected1, value1);
342 }
343 if( fabs(value2 - expected2) > 0.01 )
344 {
345 wxPrintf( "TimeTrack: IntegralOfInverse failed! expected %f got %f\n", expected2, value2);
346 }
347
348 /*double reqt0 = 10.0 - .1;
349 double reqt1 = 10.0 + .1;
350 double t0 = warp( reqt0 );
351 double t1 = warp( reqt1 );
352 if( t0 > t1 )
353 {
354 wxPrintf( "TimeTrack: Warping reverses an interval! [%.2f,%.2f] -> [%.2f,%.2f]\n",
355 reqt0, reqt1,
356 t0, t1 );
357 }*/
358}
359
360//! Installer of the time warper
361static Mixer::WarpOptions::DefaultWarp::Scope installer{

Callers

nothing calls this directly

Calls 4

IntegralMethod · 0.80
IntegralOfInverseMethod · 0.80
GetEnvelopeFunction · 0.70
FlattenMethod · 0.45

Tested by

no test coverage detected