From 6b27595c4e7f92fc996932ea1d5b98cfccdc8892 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 10 Dec 2011 15:08:13 +0000 Subject: [PATCH] Comments. git-svn-id: svn://localhost/ardour2/branches/3.0@10966 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/beats_frames_converter.h | 6 +++--- libs/ardour/beats_frames_converter.cc | 8 ++++++++ 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 { 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 {