diff options
author | David Robillard <d@drobilla.net> | 2014-12-01 14:28:03 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2014-12-01 23:35:24 -0500 |
commit | 767c0238a34ef4acc4d345e88cd5ddb0c8a8e421 (patch) | |
tree | fed11fb6f4e4e08a7c35eb45f53aea70dc66e4f8 /libs/ardour/automation_list.cc | |
parent | cb8abbe8d2f0e4dfe52bd35613ebba7689628eca (diff) |
Replace half-baked param metadata with descriptor.
Among other things, this means that automation controls/lists have the actual
min/max/normal/toggled of parameters, and not those inferred from the Parameter
ID, which is not correct for things like plugin parameters.
Pushing things down to the Evoral::ParmeterDescriptor may be useful in the
future to have lists do smarter things based on parameter range, but currently
I have just pushed down the above-mentioned currently used attributes.
Diffstat (limited to 'libs/ardour/automation_list.cc')
-rw-r--r-- | libs/ardour/automation_list.cc | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/libs/ardour/automation_list.cc b/libs/ardour/automation_list.cc index e5a4493618..cf41c41839 100644 --- a/libs/ardour/automation_list.cc +++ b/libs/ardour/automation_list.cc @@ -25,6 +25,7 @@ #include <algorithm> #include "ardour/automation_list.h" #include "ardour/event_type_map.h" +#include "ardour/parameter_descriptor.h" #include "evoral/Curve.hpp" #include "pbd/stacktrace.h" #include "pbd/enumwriter.h" @@ -47,8 +48,21 @@ static void dumpit (const AutomationList& al, string prefix = "") cerr << "\n"; } #endif -AutomationList::AutomationList (Evoral::Parameter id) - : ControlList(id) +AutomationList::AutomationList (const Evoral::Parameter& id, const Evoral::ParameterDescriptor& desc) + : ControlList(id, desc) +{ + _state = Off; + _style = Absolute; + g_atomic_int_set (&_touching, 0); + + create_curve_if_necessary(); + + assert(_parameter.type() != NullAutomation); + AutomationListCreated(this); +} + +AutomationList::AutomationList (const Evoral::Parameter& id) + : ControlList(id, ARDOUR::ParameterDescriptor(id)) { _state = Off; _style = Absolute; @@ -91,7 +105,7 @@ AutomationList::AutomationList (const AutomationList& other, double start, doubl * in or below the AutomationList node. It is used if @param id is non-null. */ AutomationList::AutomationList (const XMLNode& node, Evoral::Parameter id) - : ControlList(id) + : ControlList(id, ARDOUR::ParameterDescriptor(id)) { g_atomic_int_set (&_touching, 0); _state = Off; @@ -114,9 +128,10 @@ AutomationList::~AutomationList() } boost::shared_ptr<Evoral::ControlList> -AutomationList::create(Evoral::Parameter id) +AutomationList::create(const Evoral::Parameter& id, + const Evoral::ParameterDescriptor& desc) { - return boost::shared_ptr<Evoral::ControlList>(new AutomationList(id)); + return boost::shared_ptr<Evoral::ControlList>(new AutomationList(id, desc)); } void @@ -414,7 +429,7 @@ AutomationList::set_state (const XMLNode& node, int version) } if ((prop = node.property (X_("automation-id"))) != 0){ - _parameter = EventTypeMap::instance().new_parameter(prop->value()); + _parameter = EventTypeMap::instance().from_symbol(prop->value()); } else { warning << "Legacy session: automation list has no automation-id property." << endmsg; } |