diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-14 22:50:08 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-18 11:40:54 -0400 |
commit | 9bc8b32b8eaf8304d0c51c3340e15345b7300988 (patch) | |
tree | 804dc665b3ca5b5f1c11266bf301def8c4145527 /nutemp/t.cc | |
parent | 7b0c5a0def2b1de8dd968a24c73bd835103fc353 (diff) |
add back-pointer to TempoMap from points, and push dirty=true into map
Diffstat (limited to 'nutemp/t.cc')
-rw-r--r-- | nutemp/t.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/nutemp/t.cc b/nutemp/t.cc index 2ea87a0a16..c8336ccde8 100644 --- a/nutemp/t.cc +++ b/nutemp/t.cc @@ -306,6 +306,23 @@ TempoMetric::superclock_at_qn (Evoral::Beats const & qn) const return llrint (superclocks_per_quarter_note() * (log1p (_c_per_quarter * qn.to_double()) / _c_per_quarter)); } +void +TempoMapPoint::set_map (TempoMap* m) +{ + _map = m; +} + +void +TempoMapPoint::set_dirty (bool yn) +{ + if (yn != _dirty) { + _dirty = yn; + if (yn && _map) { + _map->set_dirty (true); + } + } +} + Evoral::Beats TempoMapPoint::quarters_at (superclock_t sc) const { @@ -339,11 +356,18 @@ TempoMapPoint::bbt_at (Evoral::Beats const & qn) const TempoMap::TempoMap (Tempo const & initial_tempo, Meter const & initial_meter, framecnt_t sr) : _sample_rate (sr) + , _dirty (false) { TempoMapPoint tmp (TempoMapPoint::Flag (TempoMapPoint::ExplicitMeter|TempoMapPoint::ExplicitTempo), initial_tempo, initial_meter, 0, Evoral::Beats(), Timecode::BBT_Time(), AudioTime); _points.push_back (tmp); } +void +TempoMap::set_dirty (bool yn) +{ + _dirty = yn; +} + Meter const & TempoMap::meter_at (superclock_t sc) const { |