diff options
author | Robin Gareus <robin@gareus.org> | 2017-06-19 16:47:02 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-06-21 18:12:58 +0200 |
commit | 394bd8f4281b16b1608b36dca28c3ef66e14d90b (patch) | |
tree | 32704a773e6053bc4167eb285eb1bd0d1bebcf55 /libs/ardour/automation_list.cc | |
parent | 16624f31391bae51db770a9e9bd8899e7746b068 (diff) |
Set default interpolation type (for new lanes)
Diffstat (limited to 'libs/ardour/automation_list.cc')
-rw-r--r-- | libs/ardour/automation_list.cc | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc index f456ac210b..ae78a217f7 100644 --- a/libs/ardour/automation_list.cc +++ b/libs/ardour/automation_list.cc @@ -60,6 +60,7 @@ AutomationList::AutomationList (const Evoral::Parameter& id, const Evoral::Param { _state = Off; g_atomic_int_set (&_touching, 0); + _interpolation = default_interpolation (); create_curve_if_necessary(); @@ -73,6 +74,7 @@ AutomationList::AutomationList (const Evoral::Parameter& id) { _state = Off; g_atomic_int_set (&_touching, 0); + _interpolation = default_interpolation (); create_curve_if_necessary(); @@ -115,6 +117,7 @@ AutomationList::AutomationList (const XMLNode& node, Evoral::Parameter id) , _before (0) { g_atomic_int_set (&_touching, 0); + _interpolation = default_interpolation (); _state = Off; set_state (node, Stateful::loading_state_version); @@ -165,7 +168,6 @@ AutomationList::operator= (const AutomationList& other) { if (this != &other) { - ControlList::operator= (other); _state = other._state; _touching = other._touching; @@ -202,6 +204,25 @@ AutomationList::set_automation_state (AutoState s) } } +Evoral::ControlList::InterpolationStyle +AutomationList::default_interpolation () const +{ + switch (_parameter.type()) { + case GainAutomation: + case BusSendLevel: + case EnvelopeAutomation: + return ControlList::Exponential; + break; + case TrimAutomation: + return ControlList::Logarithmic; + break; + default: + break; + } + /* based on Evoral::ParameterDescriptor log,toggle,.. */ + return ControlList::default_interpolation (); +} + void AutomationList::start_write_pass (double when) { @@ -489,7 +510,7 @@ AutomationList::set_state (const XMLNode& node, int version) } if (!node.get_property (X_("interpolation-style"), _interpolation)) { - _interpolation = Linear; + _interpolation = default_interpolation (); } if (node.get_property (X_("state"), _state)) { |