summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/tempo.h1
-rw-r--r--libs/ardour/tempo.cc12
2 files changed, 10 insertions, 3 deletions
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h
index 05d65602cf..631b709a28 100644
--- a/libs/ardour/ardour/tempo.h
+++ b/libs/ardour/ardour/tempo.h
@@ -61,6 +61,7 @@ class Meter {
double note_divisor() const { return _note_type; }
double frames_per_bar (const Tempo&, framecnt_t sr) const;
+ double frames_per_division (const Tempo&, framecnt_t sr) const;
protected:
/** The number of beats in a bar. This is a real value because
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index dc811aff83..3231e56327 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -47,7 +47,7 @@ Tempo TempoMap::_default_tempo (120.0);
double Tempo::frames_per_beat (framecnt_t sr, const Meter& meter) const
{
- return ((60.0 * sr) / (_beats_per_minute * meter.note_divisor()/_note_type));
+ return (60.0 * sr) / _beats_per_minute;
}
/***********************************************************************/
@@ -58,6 +58,12 @@ Meter::frames_per_bar (const Tempo& tempo, framecnt_t sr) const
return ((60.0 * sr * _beats_per_bar) / (tempo.beats_per_minute() * _note_type/tempo.note_type()));
}
+double
+Meter::frames_per_division (const Tempo& tempo, framecnt_t sr) const
+{
+ return ((60.0 * sr) / (tempo.beats_per_minute() * _note_type/tempo.note_type()));
+}
+
/***********************************************************************/
const string TempoSection::xml_state_node_name = "Tempo";
@@ -1402,7 +1408,7 @@ TempoMap::get_points (framepos_t lower, framepos_t upper) const
beats_per_bar = meter->beats_per_bar ();
frames_per_bar = meter->frames_per_bar (*tempo, _frame_rate);
- beat_frames = tempo->frames_per_beat (_frame_rate, *meter);
+ beat_frames = meter->frames_per_division (*tempo,_frame_rate);
if (meter->frame() > tempo->frame()) {
bar = meter->start().bars;
@@ -1530,7 +1536,7 @@ TempoMap::get_points (framepos_t lower, framepos_t upper) const
beats_per_bar = meter->beats_per_bar ();
frames_per_bar = meter->frames_per_bar (*tempo, _frame_rate);
- beat_frames = tempo->frames_per_beat (_frame_rate, *meter);
+ beat_frames = meter->frames_per_division (*tempo, _frame_rate);
++i;
}