diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index 1a37ecffe5..06fdbf77be 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -193,6 +193,9 @@ class LIBARDOUR_API TempoSection : public MetricSection, public Tempo { void set_type (Type type); Type type () const { return _type; } + double c_func () const { return _c_func; } + void set_c_func (double c_func) { _c_func = c_func; } + double tempo_at_frame (const framepos_t& frame, const framecnt_t& frame_rate) const; framepos_t frame_at_tempo (const double& ppm, const double& beat, const framecnt_t& frame_rate) const; @@ -205,9 +208,6 @@ class LIBARDOUR_API TempoSection : public MetricSection, public Tempo { double compute_c_func_pulse (const double& end_bpm, const double& end_pulse, const framecnt_t& frame_rate); double compute_c_func_frame (const double& end_bpm, const framepos_t& end_frame, const framecnt_t& frame_rate) const; - double get_c_func () const { return _c_func; } - void set_c_func (double c_func) { _c_func = c_func; } - Timecode::BBT_Time legacy_bbt () { return _legacy_bbt; } private: diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index d198963ec0..d869bed42c 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -2608,7 +2608,7 @@ TempoMap::get_grid (vector& points, const TempoSection tempo = tempo_section_at_locked (pos); const MeterSection meter = meter_section_at_locked (pos); const BBT_Time bbt = beats_to_bbt (cnt); - points.push_back (BBTPoint (meter, tempo_at_locked (pos), pos, bbt.bars, bbt.beats, tempo.get_c_func())); + points.push_back (BBTPoint (meter, tempo_at_locked (pos), pos, bbt.bars, bbt.beats, tempo.c_func())); ++cnt; } } @@ -2862,12 +2862,12 @@ TempoMap::set_state (const XMLNode& node, int /*version*/) } if (prev_m && prev_m->pulse() < 0.0) { /*XX we cannot possibly make this work??. */ - pair start = make_pair (((m->bbt().bars - 1) * m->note_divisor()) + pair start = make_pair (((m->bbt().bars - 1) * prev_m->note_divisor()) + (m->bbt().beats - 1) + (m->bbt().ticks / BBT_Time::ticks_per_beat) , m->bbt()); m->set_beat (start); - const double start_beat = ((m->bbt().bars - 1) * m->note_divisor()) + const double start_beat = ((m->bbt().bars - 1) * prev_m->note_divisor()) + (m->bbt().beats - 1) + (m->bbt().ticks / BBT_Time::ticks_per_beat); m->set_pulse (start_beat / prev_m->note_divisor());