GenericPluginUI::control_port_toggled (ControlUI* cui)
{
if (!cui->ignore_change) {
- insert->set_parameter (cui->parameter(), cui->button->get_active());
+ insert->automation_control(cui->parameter())->set_value(cui->button->get_active());
}
}
if (!cui->ignore_change) {
string value = cui->combo->get_active_text();
std::map<string,float> mapping = *cui->combo_map;
- insert->set_parameter (cui->parameter(), mapping[value]);
+ insert->automation_control(cui->parameter())->set_value(mapping[value]);
}
-
}
void
boost::shared_ptr<Evoral::Control>
control_factory(const Evoral::Parameter& id);
+ boost::shared_ptr<AutomationControl>
+ automation_control (const Evoral::Parameter& id, bool create_if_missing=false);
+
+ boost::shared_ptr<const AutomationControl>
+ automation_control (const Evoral::Parameter& id) const;
+
virtual void add_control(boost::shared_ptr<Evoral::Control>);
virtual void automation_snapshot(nframes_t now, bool force);
float get_value (void) const;
};
- boost::shared_ptr<AutomationControl> pan_control ( int id, int chan=0 ) {
- return boost::dynamic_pointer_cast<AutomationControl>( control( Evoral::Parameter (PanAutomation, chan, id) ));
+ boost::shared_ptr<AutomationControl> pan_control (int id, int chan=0) {
+ return automation_control(Evoral::Parameter (PanAutomation, chan, id));
}
- boost::shared_ptr<const AutomationControl> pan_control ( int id, int chan=0 ) const {
- return boost::dynamic_pointer_cast<const AutomationControl>( control( Evoral::Parameter (PanAutomation, chan, id) ));
+ boost::shared_ptr<const AutomationControl> pan_control (int id, int chan=0) const {
+ return automation_control(Evoral::Parameter (PanAutomation, chan, id));
}
private:
bool is_generator() const;
- void set_parameter (Evoral::Parameter param, float val);
- float get_parameter (Evoral::Parameter param);
-
- float default_parameter_value (const Evoral::Parameter& param);
-
struct PluginControl : public AutomationControl
{
PluginControl (PluginInsert* p, const Evoral::Parameter ¶m,
void parameter_changed (Evoral::Parameter, float);
+ void set_parameter (Evoral::Parameter param, float val);
+ float get_parameter (Evoral::Parameter param);
+
+ float default_parameter_value (const Evoral::Parameter& param);
+
std::vector<boost::shared_ptr<Plugin> > _plugins;
void automation_run (BufferSet& bufs, nframes_t nframes, nframes_t offset);
return boost::shared_ptr<Evoral::Control>(control);
}
+boost::shared_ptr<AutomationControl>
+Automatable::automation_control (const Evoral::Parameter& id, bool create)
+{
+ return boost::dynamic_pointer_cast<AutomationControl>(Evoral::ControlSet::control(id, create));
+}
+
+boost::shared_ptr<const AutomationControl>
+Automatable::automation_control (const Evoral::Parameter& id) const
+{
+ return boost::dynamic_pointer_cast<const AutomationControl>(Evoral::ControlSet::control(id));
+}
+