domain bouncing for Automatable/ControlLists
This commit is contained in:
@@ -747,10 +747,21 @@ Automatable::find_prev_ac_event (std::shared_ptr<AutomationControl> c, timepos_t
|
||||
void
|
||||
Automatable::start_domain_bounce (Temporal::DomainBounceInfo& cmd)
|
||||
{
|
||||
#warning paul automatable domain bouncing still needs work
|
||||
for (auto & c : _controls) {
|
||||
std::shared_ptr<Evoral::ControlList> cl = c.second->list();
|
||||
if (cl) {
|
||||
cl->start_domain_bounce (cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Automatable::finish_domain_bounce (Temporal::DomainBounceInfo& cmd)
|
||||
{
|
||||
for (auto & c : _controls) {
|
||||
std::shared_ptr<Evoral::ControlList> cl = c.second->list();
|
||||
if (cl) {
|
||||
cl->finish_domain_bounce (cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2235,6 +2235,44 @@ ControlList::set_interpolation (InterpolationStyle s)
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
ControlList::start_domain_bounce (Temporal::DomainBounceInfo& dbi)
|
||||
{
|
||||
if (time_domain() == dbi.to) {
|
||||
return;
|
||||
}
|
||||
|
||||
Glib::Threads::RWLock::ReaderLock olm (_lock);
|
||||
|
||||
for (auto const & e : _events) {
|
||||
timepos_t t (e->when);
|
||||
t.set_time_domain (dbi.to);
|
||||
dbi.positions.insert (std::make_pair (&e->when, e->when));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ControlList::finish_domain_bounce (Temporal::DomainBounceInfo& dbi)
|
||||
{
|
||||
if (time_domain() == dbi.from) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
Glib::Threads::RWLock::WriterLock lm (_lock);
|
||||
for (auto const & e : _events) {
|
||||
Temporal::TimeDomainPosChanges::iterator tdc = dbi.positions.find (&e->when);
|
||||
assert (tdc != dbi.positions.end());
|
||||
|
||||
timepos_t t (tdc->second);
|
||||
t.set_time_domain (dbi.from);
|
||||
e->when = t;
|
||||
}
|
||||
}
|
||||
|
||||
maybe_signal_changed ();
|
||||
}
|
||||
|
||||
bool
|
||||
ControlList::operator!= (ControlList const& other) const
|
||||
{
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "pbd/signals.h"
|
||||
|
||||
#include "temporal/domain_provider.h"
|
||||
#include "temporal/domain_swap.h"
|
||||
#include "temporal/timeline.h"
|
||||
#include "temporal/types.h"
|
||||
#include "temporal/range.h"
|
||||
@@ -85,7 +86,7 @@ public:
|
||||
|
||||
/** A list (sequence) of time-stamped values for a control
|
||||
*/
|
||||
class LIBEVORAL_API ControlList : public Temporal::TimeDomainProvider
|
||||
class LIBEVORAL_API ControlList : public Temporal::TimeDomainProvider, public Temporal::TimeDomainSwapper
|
||||
{
|
||||
public:
|
||||
typedef std::list<ControlEvent*> EventList;
|
||||
@@ -371,6 +372,9 @@ public:
|
||||
|
||||
void invalidate_insert_iterator ();
|
||||
|
||||
void start_domain_bounce (Temporal::DomainBounceInfo&);
|
||||
void finish_domain_bounce (Temporal::DomainBounceInfo&);
|
||||
|
||||
protected:
|
||||
|
||||
/** Called by unlocked_eval() to handle cases of 3 or more control points. */
|
||||
|
||||
Reference in New Issue
Block a user