mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Add API allowing plugin preset load to affect automation
This commit is contained in:
parent
1b2a64c391
commit
5db22a33c1
3 changed files with 34 additions and 8 deletions
|
|
@ -256,6 +256,9 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent
|
||||||
*/
|
*/
|
||||||
PBD::Signal0<void> PresetDirty;
|
PBD::Signal0<void> PresetDirty;
|
||||||
|
|
||||||
|
/** Emitted for preset-load to set a control-port */
|
||||||
|
PBD::Signal2<void, uint32_t, float> PresetPortSetValue;
|
||||||
|
|
||||||
virtual bool has_editor () const = 0;
|
virtual bool has_editor () const = 0;
|
||||||
|
|
||||||
/** Emitted when a parameter is altered by something outside of our
|
/** Emitted when a parameter is altered by something outside of our
|
||||||
|
|
|
||||||
|
|
@ -374,6 +374,8 @@ class LIBARDOUR_API PluginInsert : public Processor
|
||||||
void latency_changed ();
|
void latency_changed ();
|
||||||
bool _latency_changed;
|
bool _latency_changed;
|
||||||
uint32_t _bypass_port;
|
uint32_t _bypass_port;
|
||||||
|
|
||||||
|
void preset_load_set_value (uint32_t, float);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ARDOUR
|
} // namespace ARDOUR
|
||||||
|
|
|
||||||
|
|
@ -490,7 +490,9 @@ PluginInsert::create_automatable_parameters ()
|
||||||
ac->Changed.connect_same_thread (*this, boost::bind (&PluginInsert::enable_changed, this));
|
ac->Changed.connect_same_thread (*this, boost::bind (&PluginInsert::enable_changed, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
plugin->PresetPortSetValue.connect_same_thread (*this, boost::bind (&PluginInsert::preset_load_set_value, this, _1, _2));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Called when something outside of this host has modified a plugin
|
/** Called when something outside of this host has modified a plugin
|
||||||
* parameter. Responsible for propagating the change to two places:
|
* parameter. Responsible for propagating the change to two places:
|
||||||
*
|
*
|
||||||
|
|
@ -649,6 +651,23 @@ PluginInsert::bypassable_changed ()
|
||||||
BypassableChanged ();
|
BypassableChanged ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PluginInsert::preset_load_set_value (uint32_t p, float v)
|
||||||
|
{
|
||||||
|
boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter(PluginAutomation, 0, p));
|
||||||
|
if (!ac) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ac->automation_state() & Play) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
start_touch (p);
|
||||||
|
ac->set_value (v, Controllable::NoGroup);
|
||||||
|
end_touch (p);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginInsert::inplace_silence_unconnected (BufferSet& bufs, const PinMappings& out_map, framecnt_t nframes, framecnt_t offset) const
|
PluginInsert::inplace_silence_unconnected (BufferSet& bufs, const PinMappings& out_map, framecnt_t nframes, framecnt_t offset) const
|
||||||
{
|
{
|
||||||
|
|
@ -3014,19 +3033,21 @@ PluginInsert::latency_changed ()
|
||||||
void
|
void
|
||||||
PluginInsert::start_touch (uint32_t param_id)
|
PluginInsert::start_touch (uint32_t param_id)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, param_id));
|
boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, param_id));
|
||||||
if (ac) {
|
if (ac) {
|
||||||
ac->start_touch (session().audible_frame());
|
// ToDo subtract _plugin_signal_latency from audible_frame() when rolling, assert > 0
|
||||||
}
|
ac->start_touch (session().audible_frame());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginInsert::end_touch (uint32_t param_id)
|
PluginInsert::end_touch (uint32_t param_id)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, param_id));
|
boost::shared_ptr<AutomationControl> ac = automation_control (Evoral::Parameter (PluginAutomation, 0, param_id));
|
||||||
if (ac) {
|
if (ac) {
|
||||||
ac->stop_touch (true, session().audible_frame());
|
// ToDo subtract _plugin_signal_latency from audible_frame() when rolling, assert > 0
|
||||||
}
|
ac->stop_touch (true, session().audible_frame());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m)
|
std::ostream& operator<<(std::ostream& o, const ARDOUR::PluginInsert::Match& m)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue