summaryrefslogtreecommitdiff
path: root/libs/ardour/test/framepos_plus_beats_test.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-22 04:05:42 -0500
committerDavid Robillard <d@drobilla.net>2014-11-22 04:05:42 -0500
commitc1cfa12d6e5136d2e3e5501e83ff74c5009a9e60 (patch)
tree56d2811bc8b9d6f2a5accfa8e497ddd5976c7c7a /libs/ardour/test/framepos_plus_beats_test.cc
parentcae74309a583c29dd6cc2081425c2e7b673ea13e (diff)
Wrap MusicalTime in a class.
This lets us get a more explicit handle on time conversions, and is the main step towards using actual beat:tick time and getting away from floating point precision problems.
Diffstat (limited to 'libs/ardour/test/framepos_plus_beats_test.cc')
-rw-r--r--libs/ardour/test/framepos_plus_beats_test.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/ardour/test/framepos_plus_beats_test.cc b/libs/ardour/test/framepos_plus_beats_test.cc
index c95c2a7a66..abe1310f62 100644
--- a/libs/ardour/test/framepos_plus_beats_test.cc
+++ b/libs/ardour/test/framepos_plus_beats_test.cc
@@ -25,11 +25,11 @@ FrameposPlusBeatsTest::singleTempoTest ()
map.add_tempo (tempo, BBT_Time (1, 1, 0));
/* Add 1 beat to beat 3 of the first bar */
- framepos_t r = map.framepos_plus_beats (frames_per_beat * 2, 1);
+ framepos_t r = map.framepos_plus_beats (frames_per_beat * 2, Evoral::MusicalTime(1));
CPPUNIT_ASSERT_EQUAL (framepos_t (frames_per_beat * 3), r);
/* Add 4 beats to a -ve frame of 1 beat before zero */
- r = map.framepos_plus_beats (-frames_per_beat * 1, 4);
+ r = map.framepos_plus_beats (-frames_per_beat * 1, Evoral::MusicalTime(4));
CPPUNIT_ASSERT_EQUAL (framepos_t (frames_per_beat * 3), r);
}
@@ -69,15 +69,15 @@ FrameposPlusBeatsTest::doubleTempoTest ()
/* Now some tests */
/* Add 1 beat to 1|2 */
- framepos_t r = map.framepos_plus_beats (24e3, 1);
+ framepos_t r = map.framepos_plus_beats (24e3, Evoral::MusicalTime(1));
CPPUNIT_ASSERT_EQUAL (framepos_t (48e3), r);
/* Add 2 beats to 3|4 (over the tempo change) */
- r = map.framepos_plus_beats (264e3, 2);
+ r = map.framepos_plus_beats (264e3, Evoral::MusicalTime(2));
CPPUNIT_ASSERT_EQUAL (framepos_t (264e3 + 24e3 + 12e3), r);
/* Add 2.5 beats to 3|3|960 (over the tempo change) */
- r = map.framepos_plus_beats (264e3 - 12e3, 2.5);
+ r = map.framepos_plus_beats (264e3 - 12e3, Evoral::MusicalTime(2.5));
CPPUNIT_ASSERT_EQUAL (framepos_t (264e3 + 24e3 + 12e3), r);
}
@@ -123,15 +123,15 @@ FrameposPlusBeatsTest::doubleTempoWithMeterTest ()
/* Now some tests */
/* Add 1 beat to 1|2 */
- framepos_t r = map.framepos_plus_beats (24e3, 1);
+ framepos_t r = map.framepos_plus_beats (24e3, Evoral::MusicalTime(1));
CPPUNIT_ASSERT_EQUAL (framepos_t (48e3), r);
/* Add 2 beats to 3|4 (over the tempo change) */
- r = map.framepos_plus_beats (264e3, 2);
+ r = map.framepos_plus_beats (264e3, Evoral::MusicalTime(2));
CPPUNIT_ASSERT_EQUAL (framepos_t (264e3 + 24e3 + 12e3), r);
/* Add 2.5 beats to 3|3|960 (over the tempo change) */
- r = map.framepos_plus_beats (264e3 - 12e3, 2.5);
+ r = map.framepos_plus_beats (264e3 - 12e3, Evoral::MusicalTime(2.5));
CPPUNIT_ASSERT_EQUAL (framepos_t (264e3 + 24e3 + 12e3), r);
}