return ((ARDOUR::AutomationList*)_list.get())->stop_touch();
}
+ /** Set the value and do the right thing based on automation state
+ * (e.g. record if necessary, etc.)
+ */
void set_value(float val);
+
+ /** Get the current effective value based on automation state.
+ */
float get_value() const;
protected:
{
public:
Parameter(AutomationType type = NullAutomation, uint32_t id=0, uint8_t channel=0)
- : Evoral::Parameter((uint32_t)type, id, channel)
+ : Evoral::Parameter((uint32_t)type, channel, id)
{
init_metadata(type);
}
boost::shared_ptr<AutomationControl> c
= boost::dynamic_pointer_cast<AutomationControl>(i->second);
if (c->automation_write()) {
- c->list()->rt_add (now, i->second->user_value());
+ c->list()->rt_add (now, i->second->user_float());
}
}
}
-/** Get the currently effective value (ie the one that corresponds to current output)
- */
float
AutomationControl::get_value() const
{
bool from_list = _list && ((AutomationList*)_list.get())->automation_playback();
- return Control::get_value(from_list, _session.transport_frame());
+ return Control::get_float(from_list, _session.transport_frame());
}
bool to_list = _list && _session.transport_stopped()
&& ((AutomationList*)_list.get())->automation_playback();
- Control::set_value(value, to_list, _session.transport_frame());
+ Control::set_float(value, to_list, _session.transport_frame());
Changed(); /* EMIT SIGNAL */
}
_plugins[0]->set_parameter (param.id(), val);
- boost::shared_ptr<Evoral::Control> c = data().control (param);
- if (c)
- c->set_value(val);
+ boost::shared_ptr<AutomationControl> ac
+ = boost::dynamic_pointer_cast<AutomationControl>(data().control(param));
+
+ if (ac) {
+ ac->set_value(val);
+ } else {
+ warning << "set_parameter called for nonexistant parameter "
+ << param.symbol() << endmsg;
+ }
_session.set_dirty();
}
Control(const Parameter& parameter, boost::shared_ptr<ControlList>);
virtual ~Control() {}
- void set_value(float val, bool to_list=false, nframes_t frame=0);
- float get_value(bool from_list=false, nframes_t frame=0) const;
- float user_value() const;
+ virtual void set_float(float val, bool to_list=false, nframes_t frame=0);
+ virtual float get_float(bool from_list=false, nframes_t frame=0) const;
+ virtual float user_float() const;
void set_list(boost::shared_ptr<ControlList>);
/** Get the currently effective value (ie the one that corresponds to current output)
*/
float
-Control::get_value(bool from_list, nframes_t frame) const
+Control::get_float(bool from_list, nframes_t frame) const
{
if (from_list)
return _list->eval(frame);
void
-Control::set_value(float value, bool to_list, nframes_t frame)
+Control::set_float(float value, bool to_list, nframes_t frame)
{
_user_value = value;
* to the AutomationList.
*/
float
-Control::user_value() const
+Control::user_float() const
{
return _user_value;
}