summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-12-10 15:08:13 +0000
committerCarl Hetherington <carl@carlh.net>2011-12-10 15:08:13 +0000
commit6b27595c4e7f92fc996932ea1d5b98cfccdc8892 (patch)
tree84c13bef4d325ce72df04f29078a9fea6b30e5d5
parent5344f5ca0fefa9bd08f4231848a3e92f873538b4 (diff)
Comments.
git-svn-id: svn://localhost/ardour2/branches/3.0@10966 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/ardour/beats_frames_converter.h6
-rw-r--r--libs/ardour/beats_frames_converter.cc8
2 files changed, 11 insertions, 3 deletions
diff --git a/libs/ardour/ardour/beats_frames_converter.h b/libs/ardour/ardour/beats_frames_converter.h
index e76588ccaa..ee79430e4e 100644
--- a/libs/ardour/ardour/beats_frames_converter.h
+++ b/libs/ardour/ardour/beats_frames_converter.h
@@ -29,9 +29,9 @@ namespace ARDOUR {
class TempoMap;
-/** Converter between beats and frames. Takes durations in beats or frames
- * and converts them using the tempo at the \a origin supplied to the constructor.
- * Note that this does not covert positions, only durations.
+/** Converter between beats and frames. Takes distances in beats or frames
+ * from some origin (supplied to the constructor in frames), and converts
+ * them to the opposite unit, taking tempo changes into account.
*/
class BeatsFramesConverter : public Evoral::TimeConverter<double,framepos_t> {
public:
diff --git a/libs/ardour/beats_frames_converter.cc b/libs/ardour/beats_frames_converter.cc
index f5d1794abb..03a581e276 100644
--- a/libs/ardour/beats_frames_converter.cc
+++ b/libs/ardour/beats_frames_converter.cc
@@ -24,6 +24,10 @@
namespace ARDOUR {
+/** Takes a duration in beats and considers it as a distance from the origin
+ * supplied to the constructor. Returns the equivalent number of frames,
+ * taking tempo changes into account.
+ */
framecnt_t
BeatsFramesConverter::to (double beats) const
{
@@ -32,6 +36,10 @@ BeatsFramesConverter::to (double beats) const
return _tempo_map.framepos_plus_beats (_origin_b, beats) - _origin_b;
}
+/** Takes a duration in frames and considers it as a distance from the origin
+ * supplied to the constructor. Returns the equivalent number of beats,
+ * taking tempo changes into account.
+ */
double
BeatsFramesConverter::from (framecnt_t frames) const
{