+
+void
+FramewalkToBeatsTest::singleTempoMeterTest ()
+{
+ int const sampling_rate = 48000;
+ int const bpm = 120;
+
+ double const frames_per_beat = (60 / double (bpm)) * double (sampling_rate);
+
+ TempoMap map (sampling_rate);
+ Tempo tempo (bpm, 4.0);
+ Meter meter (7, 8);
+
+ map.replace_meter (map.meter_section_at_frame (0), meter, BBT_Time (1, 1, 0), 0, AudioTime);
+ map.replace_tempo (map.tempo_section_at_frame (0), tempo, 0.0, 0, AudioTime);
+
+ /* Walk 1 qn beats-worth of frames from beat 3 */
+ double r = map.framewalk_to_qn (frames_per_beat * 2, frames_per_beat * 1).to_double();
+ CPPUNIT_ASSERT_EQUAL (1.0, r);
+
+ /* Walk 6 qn beats-worth of frames from beat 4 */
+ r = map.framewalk_to_qn (frames_per_beat * 3, frames_per_beat * 6).to_double();
+ CPPUNIT_ASSERT_EQUAL (6.0, r);
+
+ /* Walk 1.5 qn beats-worth of frames from beat 3 */
+ r = map.framewalk_to_qn (frames_per_beat * 2, frames_per_beat * 1.5).to_double();
+ CPPUNIT_ASSERT_EQUAL (1.5, r);
+
+ /* Walk 1.5 qn beats-worth of frames from beat 2.5 */
+ r = map.framewalk_to_qn (frames_per_beat * 2.5, frames_per_beat * 1.5).to_double();
+ CPPUNIT_ASSERT_EQUAL (1.5, r);
+}