summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-08-23 16:31:34 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-08-23 16:31:34 +0000
commit6e904b1e1600f4ccc0338d0b0864f7e02d417b13 (patch)
treea224669b7ff25e3f680a68920701e4498d495793 /libs
parent6b6e6f49b4840183f29dfa1e74483c52603bffc1 (diff)
3.0 version of rev 5564 from 2.x - basic boolean plugin parameter automation (no graphical editing intended). this involved adding a new "toggled" property to Evoral::Parameter
git-svn-id: svn://localhost/ardour2/branches/3.0@7670 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/automation_control.cc10
-rw-r--r--libs/ardour/event_type_map.cc2
-rw-r--r--libs/ardour/plugin_insert.cc5
-rw-r--r--libs/evoral/evoral/Parameter.hpp22
4 files changed, 25 insertions, 14 deletions
diff --git a/libs/ardour/automation_control.cc b/libs/ardour/automation_control.cc
index a4e0a7bbc0..2989d82818 100644
--- a/libs/ardour/automation_control.cc
+++ b/libs/ardour/automation_control.cc
@@ -52,8 +52,16 @@ AutomationControl::set_value(double value)
{
bool to_list = _list && _session.transport_stopped()
&& ((AutomationList*)_list.get())->automation_write();
+
+ if (to_list && parameter().toggled()) {
- Control::set_double(value, to_list, _session.transport_frame());
+ //store the previous value just before this so any
+ // interpolation works right
+
+ _list->add (get_double(), _session.transport_frame()-1);
+ }
+
+ Control::set_double (value, to_list, _session.transport_frame());
Changed(); /* EMIT SIGNAL */
}
diff --git a/libs/ardour/event_type_map.cc b/libs/ardour/event_type_map.cc
index a2db60f4ba..d88e5afd26 100644
--- a/libs/ardour/event_type_map.cc
+++ b/libs/ardour/event_type_map.cc
@@ -168,7 +168,7 @@ EventTypeMap::new_parameter(uint32_t type, uint8_t channel, uint32_t id) const
return p;
}
- p.set_range(type, min, max, normal);
+ p.set_range(type, min, max, normal, false);
return p;
}
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc
index d6dfc014cf..a0deec6807 100644
--- a/libs/ardour/plugin_insert.cc
+++ b/libs/ardour/plugin_insert.cc
@@ -195,7 +195,7 @@ PluginInsert::set_automatable ()
but we want the Controllable related to this Parameter to have those limits.
*/
- param.set_range (desc.lower, desc.upper, _plugins.front()->default_value(i->id()));
+ param.set_range (desc.lower, desc.upper, _plugins.front()->default_value(i->id()), desc.toggled);
can_automate (param);
boost::shared_ptr<AutomationList> list(new AutomationList(param));
add_control (boost::shared_ptr<AutomationControl>(new PluginControl(this, param, list)));
@@ -402,8 +402,9 @@ PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end
void
PluginInsert::set_parameter (Evoral::Parameter param, float val)
{
- if (param.type() != PluginAutomation)
+ if (param.type() != PluginAutomation) {
return;
+ }
/* the others will be set from the event triggered by this */
diff --git a/libs/evoral/evoral/Parameter.hpp b/libs/evoral/evoral/Parameter.hpp
index 95ee5daa8e..f5dd3e95e4 100644
--- a/libs/evoral/evoral/Parameter.hpp
+++ b/libs/evoral/evoral/Parameter.hpp
@@ -79,22 +79,23 @@ public:
/** Not used in indentity/comparison */
struct Metadata {
- Metadata(double low=0.0, double high=1.0, double mid=0.0)
- : min(low), max(high), normal(mid)
+ Metadata(double low=0.0, double high=1.0, double mid=0.0, bool tog=false)
+ : min(low), max(high), normal(mid), toggled(tog)
{}
double min;
double max;
double normal;
+ bool toggled;
};
- inline static void set_range(uint32_t type, double min, double max, double normal) {
- _type_metadata[type] = Metadata(min, max, normal);
+ inline static void set_range(uint32_t type, double min, double max, double normal, bool toggled) {
+ _type_metadata[type] = Metadata(min, max, normal, toggled);
}
- inline void set_range(double min, double max, double normal) {
- _metadata = boost::shared_ptr<Metadata>(new Metadata(min, max, normal));
+ inline void set_range(double min, double max, double normal, bool toggled) {
+ _metadata = boost::shared_ptr<Metadata>(new Metadata(min, max, normal, toggled));
}
-
+
inline Metadata& metadata() const {
if (_metadata)
return *_metadata.get();
@@ -102,9 +103,10 @@ public:
return _type_metadata[_type];
}
- inline double min() const { return metadata().min; }
- inline double max() const { return metadata().max; }
- inline double normal() const { return metadata().normal; }
+ inline double min() const { return metadata().min; }
+ inline double max() const { return metadata().max; }
+ inline double normal() const { return metadata().normal; }
+ inline double toggled() const { return metadata().toggled; }
protected:
// Default copy constructor is ok