Missing file.
[ardour.git] / libs / ardour / beats_frames_converter.cc
index c2c54eb9cda410f26cdab742c888e12afceddbe2..a960f1a221b34b654a78cb392e3575ab3dee4b77 100644 (file)
@@ -1,6 +1,6 @@
 /*
     Copyright (C) 2009 Paul Davis
-    Author: Dave Robillard
+    Author: David Robillard
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 namespace ARDOUR {
 
 framecnt_t
-BeatsFramesConverter::to(double beats) const
+BeatsFramesConverter::to (double beats) const
 {
-        return _tempo_map.framepos_plus_bbt (_origin_b, Timecode::BBT_Time(beats));
+       assert (beats >= 0);
+       
+       return _tempo_map.framepos_plus_bbt (_origin_b, Timecode::BBT_Time(beats)) - _origin_b;
 }
 
 double
 BeatsFramesConverter::from (framecnt_t frames) const
 {
-        return _tempo_map.framewalk_to_beats (_origin_b, frames);
+       return _tempo_map.framewalk_to_beats (_origin_b, frames);
 }
 
 } /* namespace ARDOUR */