diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-18 12:39:17 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-18 12:39:17 -0400 |
commit | 30b087ab3d28f1585987fa3f6ae006562ae192e3 (patch) | |
tree | 620ae0250b5d77f90a18f8c2b83be61e4fe7b0b5 /libs/ardour/test/interpolation_test.cc | |
parent | cb956e3e480716a3efd280a5287bdd7bee1cedc5 (diff) |
globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
Diffstat (limited to 'libs/ardour/test/interpolation_test.cc')
-rw-r--r-- | libs/ardour/test/interpolation_test.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libs/ardour/test/interpolation_test.cc b/libs/ardour/test/interpolation_test.cc index 7a91160e7a..c9fae7e64f 100644 --- a/libs/ardour/test/interpolation_test.cc +++ b/libs/ardour/test/interpolation_test.cc @@ -9,7 +9,7 @@ using namespace ARDOUR; void InterpolationTest::linearInterpolationTest () { - framecnt_t result = 0; + samplecnt_t result = 0; // cout << "\nLinear Interpolation Test\n"; // cout << "\nSpeed: 1/3"; @@ -25,7 +25,7 @@ InterpolationTest::linearInterpolationTest () linear.set_speed (1.0); linear.set_target_speed (linear.speed()); result = linear.interpolate (0, NUM_SAMPLES, input, output); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES * linear.speed()), result); for (int i = 0; i < NUM_SAMPLES; i += INTERVAL) { CPPUNIT_ASSERT_EQUAL (1.0f, output[i]); } @@ -35,7 +35,7 @@ InterpolationTest::linearInterpolationTest () linear.set_speed (0.5); linear.set_target_speed (linear.speed()); result = linear.interpolate (0, NUM_SAMPLES, input, output); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES * linear.speed()), result); for (int i = 0; i < NUM_SAMPLES; i += (INTERVAL / linear.speed() +0.5)) { CPPUNIT_ASSERT_EQUAL (1.0f, output[i]); } @@ -45,14 +45,14 @@ InterpolationTest::linearInterpolationTest () linear.set_speed (0.2); linear.set_target_speed (linear.speed()); result = linear.interpolate (0, NUM_SAMPLES, input, output); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES * linear.speed()), result); // cout << "\nSpeed: 0.02"; linear.reset(); linear.set_speed (0.02); linear.set_target_speed (linear.speed()); result = linear.interpolate (0, NUM_SAMPLES, input, output); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES * linear.speed()), result); // cout << "\nSpeed: 0.002"; linear.reset(); @@ -60,14 +60,14 @@ InterpolationTest::linearInterpolationTest () linear.set_target_speed (linear.speed()); result = linear.interpolate (0, NUM_SAMPLES, input, output); linear.speed(); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * linear.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES * linear.speed()), result); // cout << "\nSpeed: 2.0"; linear.reset(); linear.set_speed (2.0); linear.set_target_speed (linear.speed()); result = linear.interpolate (0, NUM_SAMPLES / 2, input, output); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 2 * linear.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES / 2 * linear.speed()), result); for (int i = 0; i < NUM_SAMPLES / 2; i += (INTERVAL / linear.speed() +0.5)) { CPPUNIT_ASSERT_EQUAL (1.0f, output[i]); } @@ -76,7 +76,7 @@ InterpolationTest::linearInterpolationTest () linear.set_speed (10.0); linear.set_target_speed (linear.speed()); result = linear.interpolate (0, NUM_SAMPLES / 10, input, output); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 10 * linear.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES / 10 * linear.speed()), result); for (int i = 0; i < NUM_SAMPLES / 10; i += (INTERVAL / linear.speed() +0.5)) { CPPUNIT_ASSERT_EQUAL (1.0f, output[i]); } @@ -90,7 +90,7 @@ InterpolationTest::linearInterpolationTest () void InterpolationTest::cubicInterpolationTest () { - framecnt_t result = 0; + samplecnt_t result = 0; // cout << "\nCubic Interpolation Test\n"; // cout << "\nSpeed: 1/3"; @@ -107,7 +107,7 @@ InterpolationTest::cubicInterpolationTest () cubic.set_target_speed (cubic.speed()); result = cubic.interpolate (0, NUM_SAMPLES, input, output); CPPUNIT_ASSERT_EQUAL (result, cubic.interpolate (0, NUM_SAMPLES, NULL, NULL)); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES * cubic.speed()), result); for (int i = 0; i < NUM_SAMPLES; i += INTERVAL) { CPPUNIT_ASSERT_EQUAL (1.0f, output[i]); } @@ -118,7 +118,7 @@ InterpolationTest::cubicInterpolationTest () cubic.set_target_speed (cubic.speed()); result = cubic.interpolate (0, NUM_SAMPLES, input, output); CPPUNIT_ASSERT_EQUAL (result, cubic.interpolate (0, NUM_SAMPLES, NULL, NULL)); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES * cubic.speed()), result); for (int i = 0; i < NUM_SAMPLES; i += (INTERVAL / cubic.speed() +0.5)) { CPPUNIT_ASSERT_EQUAL (1.0f, output[i]); } @@ -129,7 +129,7 @@ InterpolationTest::cubicInterpolationTest () cubic.set_target_speed (cubic.speed()); result = cubic.interpolate (0, NUM_SAMPLES, input, output); CPPUNIT_ASSERT_EQUAL (result, cubic.interpolate (0, NUM_SAMPLES, NULL, NULL)); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES * cubic.speed()), result); // cout << "\nSpeed: 0.02"; cubic.reset(); @@ -137,7 +137,7 @@ InterpolationTest::cubicInterpolationTest () cubic.set_target_speed (cubic.speed()); result = cubic.interpolate (0, NUM_SAMPLES, input, output); CPPUNIT_ASSERT_EQUAL (result, cubic.interpolate (0, NUM_SAMPLES, NULL, NULL)); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES * cubic.speed()), result); /* This one fails due too error accumulation cout << "\nSpeed: 0.002"; @@ -146,7 +146,7 @@ InterpolationTest::cubicInterpolationTest () cubic.set_target_speed (cubic.speed()); result = cubic.interpolate (0, NUM_SAMPLES, input, output); cubic.speed(); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES * cubic.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES * cubic.speed()), result); */ // cout << "\nSpeed: 2.0"; @@ -155,7 +155,7 @@ InterpolationTest::cubicInterpolationTest () cubic.set_target_speed (cubic.speed()); result = cubic.interpolate (0, NUM_SAMPLES / 2, input, output); CPPUNIT_ASSERT_EQUAL (result, cubic.interpolate (0, NUM_SAMPLES / 2, NULL, NULL)); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 2 * cubic.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES / 2 * cubic.speed()), result); for (int i = 0; i < NUM_SAMPLES / 2; i += (INTERVAL / cubic.speed() +0.5)) { CPPUNIT_ASSERT_EQUAL (1.0f, output[i]); } @@ -165,7 +165,7 @@ InterpolationTest::cubicInterpolationTest () cubic.set_target_speed (cubic.speed()); result = cubic.interpolate (0, NUM_SAMPLES / 10, input, output); CPPUNIT_ASSERT_EQUAL (result, cubic.interpolate (0, NUM_SAMPLES / 10, NULL, NULL)); - CPPUNIT_ASSERT_EQUAL ((framecnt_t)(NUM_SAMPLES / 10 * cubic.speed()), result); + CPPUNIT_ASSERT_EQUAL ((samplecnt_t)(NUM_SAMPLES / 10 * cubic.speed()), result); for (int i = 0; i < NUM_SAMPLES / 10; i += (INTERVAL / cubic.speed() +0.5)) { CPPUNIT_ASSERT_EQUAL (1.0f, output[i]); } |