From 6d154c14b459b8d7e3a47f5f5bd7bde6a220eaf6 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 16 Feb 2021 15:50:27 -0700 Subject: [PATCH] libevoral: add a new method to set the time domain that can be used from ::set_state(), when the event list is not (yet) empty --- libs/evoral/ControlList.cc | 12 +++++++++++- libs/evoral/evoral/ControlList.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/libs/evoral/ControlList.cc b/libs/evoral/ControlList.cc index 4f7603ffc3..5f8b5f7228 100644 --- a/libs/evoral/ControlList.cc +++ b/libs/evoral/ControlList.cc @@ -2181,9 +2181,19 @@ ControlList::dump (ostream& o) void ControlList::set_time_domain (Temporal::TimeDomain td) { - /* can only do this on an emtpy list */ assert (_events.empty()); _time_domain = td; + /* XXX: TODO: apply to all points */ +} + +void +ControlList::set_time_domain_empty (Temporal::TimeDomain td) +{ + /* the event list may or may not be empty, but we act as if it is. This + is used in e.g. ::set_state(), since we do not need to modify the + event time domains there. + */ + _time_domain = td; } } // namespace Evoral diff --git a/libs/evoral/evoral/ControlList.h b/libs/evoral/evoral/ControlList.h index 02e505d5e8..95c3ef72cb 100644 --- a/libs/evoral/evoral/ControlList.h +++ b/libs/evoral/evoral/ControlList.h @@ -380,6 +380,8 @@ public: virtual void maybe_signal_changed (); + void set_time_domain_empty (Temporal::TimeDomain td); + void _x_scale (Temporal::ratio_t const &); mutable LookupCache _lookup_cache;