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 {