mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
Fix wrongly exposed set_parameter methods on PluginInsert.
Have plugin GUI stuff twiddle plugin parameters correctly. git-svn-id: svn://localhost/ardour2/branches/3.0@3957 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
2065092d25
commit
b3634a723d
5 changed files with 29 additions and 12 deletions
|
|
@ -683,7 +683,7 @@ void
|
||||||
GenericPluginUI::control_port_toggled (ControlUI* cui)
|
GenericPluginUI::control_port_toggled (ControlUI* cui)
|
||||||
{
|
{
|
||||||
if (!cui->ignore_change) {
|
if (!cui->ignore_change) {
|
||||||
insert->set_parameter (cui->parameter(), cui->button->get_active());
|
insert->automation_control(cui->parameter())->set_value(cui->button->get_active());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -693,9 +693,8 @@ GenericPluginUI::control_combo_changed (ControlUI* cui)
|
||||||
if (!cui->ignore_change) {
|
if (!cui->ignore_change) {
|
||||||
string value = cui->combo->get_active_text();
|
string value = cui->combo->get_active_text();
|
||||||
std::map<string,float> mapping = *cui->combo_map;
|
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
|
void
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,12 @@ public:
|
||||||
boost::shared_ptr<Evoral::Control>
|
boost::shared_ptr<Evoral::Control>
|
||||||
control_factory(const Evoral::Parameter& id);
|
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 add_control(boost::shared_ptr<Evoral::Control>);
|
||||||
|
|
||||||
virtual void automation_snapshot(nframes_t now, bool force);
|
virtual void automation_snapshot(nframes_t now, bool force);
|
||||||
|
|
|
||||||
|
|
@ -290,12 +290,12 @@ class Panner : public Processor
|
||||||
float get_value (void) const;
|
float get_value (void) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
boost::shared_ptr<AutomationControl> pan_control ( int id, int chan=0 ) {
|
boost::shared_ptr<AutomationControl> pan_control (int id, int chan=0) {
|
||||||
return boost::dynamic_pointer_cast<AutomationControl>( control( Evoral::Parameter (PanAutomation, chan, id) ));
|
return automation_control(Evoral::Parameter (PanAutomation, chan, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<const AutomationControl> pan_control ( int id, int chan=0 ) const {
|
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) ));
|
return automation_control(Evoral::Parameter (PanAutomation, chan, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -74,11 +74,6 @@ class PluginInsert : public Processor
|
||||||
|
|
||||||
bool is_generator() const;
|
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
|
struct PluginControl : public AutomationControl
|
||||||
{
|
{
|
||||||
PluginControl (PluginInsert* p, const Evoral::Parameter ¶m,
|
PluginControl (PluginInsert* p, const Evoral::Parameter ¶m,
|
||||||
|
|
@ -111,6 +106,11 @@ class PluginInsert : public Processor
|
||||||
|
|
||||||
void parameter_changed (Evoral::Parameter, float);
|
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;
|
std::vector<boost::shared_ptr<Plugin> > _plugins;
|
||||||
|
|
||||||
void automation_run (BufferSet& bufs, nframes_t nframes, nframes_t offset);
|
void automation_run (BufferSet& bufs, nframes_t nframes, nframes_t offset);
|
||||||
|
|
|
||||||
|
|
@ -417,3 +417,15 @@ Automatable::control_factory(const Evoral::Parameter& param)
|
||||||
return boost::shared_ptr<Evoral::Control>(control);
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue