fix BeatFramesConverter so that it at least works even if its not optimally named...
[ardour.git] / libs / ardour / beats_frames_converter.cc
index 4cda4173b3a9f38e9efc970090ac92e499d20964..69610aecd3a550af1fee2f85ca0e754da4728e83 100644 (file)
 namespace ARDOUR {
 
 framecnt_t
-BeatsFramesConverter::to(double beats) const
+BeatsFramesConverter::to (double beats) const
 {
-        Timecode::BBT_Time delta;
-
-        delta.bars = 0;
-        delta.beats = rint (floor (beats));
-        delta.ticks = rint (floor (Meter::ticks_per_beat * fmod (beats, 1.0)));
-
-        return _tempo_map.framepos_plus_bbt (_origin_b, delta);
+        return _tempo_map.framepos_plus_bbt (_origin_b, Timecode::BBT_Time(beats)) - _origin_b;
 }
 
 double