diff options
author | nick_m <mainsbridge@gmail.com> | 2016-03-28 05:21:29 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:12 +1000 |
commit | 15f8f371c3854ae5370e01e643946a25e92a397b (patch) | |
tree | 33dce18a4b5990e7fd953cd1495bc349cffef1a5 /libs | |
parent | a7df009de73ad38026ff97d9aeafb8e2aa22e627 (diff) |
Tempo rampo - tempo tick lines no longer assume constant tempo.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/tempo.h | 6 | ||||
-rw-r--r-- | libs/ardour/tempo.cc | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index 453081395c..e5b3ba4390 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -307,12 +307,13 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible framepos_t frame; const MeterSection* meter; const Tempo tempo; + double c; uint32_t bar; uint32_t beat; BBTPoint (const MeterSection& m, const Tempo& t, framepos_t f, - uint32_t b, uint32_t e) - : frame (f), meter (&m), tempo (t.beats_per_minute(), t.note_type()), bar (b), beat (e) {} + uint32_t b, uint32_t e, double func_c) + : frame (f), meter (&m), tempo (t.beats_per_minute(), t.note_type()), c (func_c), bar (b), beat (e) {} Timecode::BBT_Time bbt() const { return Timecode::BBT_Time (bar, beat, 0); } operator Timecode::BBT_Time() const { return bbt(); } @@ -458,6 +459,7 @@ private: const MeterSection& meter_section_at_locked (framepos_t frame) const; const TempoSection& tempo_section_at_locked (framepos_t frame) const; + const Tempo tempo_at_locked (const framepos_t& frame) const; bool check_solved (Metrics& metrics, bool by_frame); bool solve_map (Metrics& metrics, TempoSection* section, const Tempo& bpm, const framepos_t& frame); diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 0ffe36485f..65f66be9b4 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -940,7 +940,6 @@ TempoMap::replace_meter (const MeterSection& ms, const Meter& meter, const BBT_T { Glib::Threads::RWLock::WriterLock lm (lock); MeterSection& first (first_meter()); - TempoSection& first_t (first_tempo()); const PositionLockStyle pl = ms.position_lock_style(); if (ms.pulse() != first.pulse()) { @@ -965,7 +964,6 @@ TempoMap::replace_meter (const MeterSection& ms, const Meter& meter, const frame MeterSection& first (first_meter()); TempoSection& first_t (first_tempo()); - const PositionLockStyle pl = ms.position_lock_style(); if (ms.pulse() != first.pulse()) { remove_meter_locked (ms); add_meter_locked (meter, frame, true); @@ -1450,6 +1448,7 @@ TempoMap::recompute_tempos (Metrics& metrics) prev_ts = t; } } + prev_ts->set_c_func (0.0); } /* tempos must be positioned correctly */ @@ -2551,7 +2550,7 @@ TempoMap::get_grid (vector<TempoMap::BBTPoint>& points, MeterSection const meter = meter_section_at_locked (pos); BBT_Time const bbt = beats_to_bbt (cnt); - points.push_back (BBTPoint (meter, Tempo (tempo.beats_per_minute(), tempo.note_type()), pos, bbt.bars, bbt.beats)); + points.push_back (BBTPoint (meter, tempo_at_locked (pos), pos, bbt.bars, bbt.beats, tempo.get_c_func())); ++cnt; } } @@ -2630,6 +2629,12 @@ const Tempo TempoMap::tempo_at (const framepos_t& frame) const { Glib::Threads::RWLock::ReaderLock lm (lock); + return tempo_at_locked (frame); +} + +const Tempo +TempoMap::tempo_at_locked (const framepos_t& frame) const +{ //frameoffset_t const frame_off = frame_offset_at (_metrics, frame); TempoSection* prev_ts = 0; |