From c24c210ccee7e7565b686e5dd81a80bf416c2c9d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 23 Jan 2023 03:19:20 +0100 Subject: [PATCH] Use Controllist's time-domain for guard-point delta This fixes copy/paste of pan automation (amongst other things). --- libs/evoral/ControlList.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/evoral/ControlList.cc b/libs/evoral/ControlList.cc index 60cfb601b0..3aae855659 100644 --- a/libs/evoral/ControlList.cc +++ b/libs/evoral/ControlList.cc @@ -33,7 +33,7 @@ #define isnan_local std::isnan #endif -#define GUARD_POINT_DELTA(foo) (foo.time_domain () == Temporal::AudioTime ? Temporal::timecnt_t (64) : Temporal::timecnt_t (Beats (0, 1))) +#define GUARD_POINT_DELTA(foo) ((foo).time_domain () == Temporal::AudioTime ? Temporal::timecnt_t (64) : Temporal::timecnt_t (Beats (0, 1))) #include #include @@ -1945,8 +1945,8 @@ ControlList::paste (const ControlList& alist, timepos_t const& time) /* when pasting a range of automation, first add guard points so the automation data before and after this range is retained */ const ControlEvent* last = alist.back (); - add_guard_point (time, -GUARD_POINT_DELTA (time)); - add_guard_point (time + last->when, GUARD_POINT_DELTA (time)); + add_guard_point (time, -GUARD_POINT_DELTA (*this)); + add_guard_point (time + last->when, GUARD_POINT_DELTA (*this)); { Glib::Threads::RWLock::WriterLock lm (_lock);