summaryrefslogtreecommitdiff
path: root/libs/ardour/tempo.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-05-27 10:22:51 +1000
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:18 +1000
commit7ab9f36c8aadfdb78c975473a0960e3f42dc3a2a (patch)
treef6f4379f64fc60f17833c2d05ccbba824389299e /libs/ardour/tempo.cc
parent877a0de3a8e39a8f98f30f06f2373a96480e640b (diff)
Tempo ramps - comments,
Diffstat (limited to 'libs/ardour/tempo.cc')
-rw-r--r--libs/ardour/tempo.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index c1cd9e9d7c..8a23512c1b 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -1524,6 +1524,9 @@ TempoMap::frame_at_tempo_locked (const Metrics& metrics, const Tempo& tempo) con
return prev_t->frame();
}
+/** more precise than doing tempo_at_frame (frame_at_beat (b)),
+ * as there is no intermediate frame rounding.
+ */
Tempo
TempoMap::tempo_at_beat (const double& beat) const
{
@@ -1987,6 +1990,7 @@ TempoMap::solve_map_frame (Metrics& imaginary, TempoSection* section, const fram
TempoSection* section_prev = 0;
framepos_t first_m_frame = 0;
+ /* can't move a tempo before the first meter */
for (Metrics::iterator i = imaginary.begin(); i != imaginary.end(); ++i) {
MeterSection* m;
if ((m = dynamic_cast<MeterSection*> (*i)) != 0) {
@@ -2140,10 +2144,8 @@ TempoMap::solve_map_frame (Metrics& imaginary, MeterSection* section, const fram
}
}
- /* it would make sense to bail out if there is no audio-locked meter,
- however it may be desirable to move a music-locked meter by frame at some point.
- */
TempoSection* meter_locked_tempo = 0;
+
for (Metrics::const_iterator ii = imaginary.begin(); ii != imaginary.end(); ++ii) {
TempoSection* t;
if ((t = dynamic_cast<TempoSection*> (*ii)) != 0) {
@@ -2197,7 +2199,10 @@ TempoMap::solve_map_frame (Metrics& imaginary, MeterSection* section, const fram
return false;
}
} else {
- /* all is ok. set section's tempo */
+ /* all is ok. set section's locked tempo if allowed.
+ possibly disallowed if there is an adjacent audio-locked tempo.
+ XX this check could possibly go. its never actually happened here.
+ */
MeterSection* meter_copy = const_cast<MeterSection*> (&meter_section_at_frame_locked (future_map, section->frame()));
meter_copy->set_frame (frame);