1 #include "ardour/tempo.h"
2 #include "tempo_test.h"
4 CPPUNIT_TEST_SUITE_REGISTRATION (TempoTest);
7 using namespace ARDOUR;
8 using namespace Timecode;
11 TempoTest::recomputeMapTest ()
13 int const sampling_rate = 48000;
15 TempoMap map (sampling_rate);
17 map.add_meter (meterA, 0.0, BBT_Time (1, 1, 0));
20 120bpm at bar 1, 240bpm at bar 4
22 120bpm = 24e3 samples per beat
23 240bpm = 12e3 samples per beat
33 | 1.1 1.2 1.3 1.4 | 2.1 2.2 2.3.2.4 | 3.1 3.2 3.3 3.4 | 4.1 4.2 4.3 |
38 map.add_tempo (tempoA, 0.0, TempoSection::Constant);
40 map.add_tempo (tempoB, 12.0, TempoSection::Constant);
42 map.add_meter (meterB, 12.0, BBT_Time (4, 1, 0));
44 list<MetricSection*>::iterator i = map.metrics.begin();
45 CPPUNIT_ASSERT_EQUAL (framepos_t (0), (*i)->frame ());
47 i = map.metrics.end();
49 CPPUNIT_ASSERT_EQUAL (framepos_t (288e3), (*i)->frame ());