Comments.

git-svn-id: svn://localhost/ardour2/branches/3.0@10966 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington
2011-12-10 15:08:13 +00:00
parent 5344f5ca0f
commit 6b27595c4e
2 changed files with 11 additions and 3 deletions

View File

@@ -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:

View File

@@ -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
{