redirect box: add a Reset action to the Presets submenu

This commit is contained in:
Ben Loftis 2022-12-16 15:36:27 -06:00
parent 483047635c
commit 24ed994d02
2 changed files with 12 additions and 0 deletions

View File

@ -837,6 +837,15 @@ ProcessorEntry::plugin_preset_selected (ARDOUR::Plugin::PresetRecord preset)
}
}
void
ProcessorEntry::reset_plugin ()
{
/* compare to PlugUIBase::add_plugin_setting */
boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (_processor);
pi->reset_parameters_to_default();
}
void
ProcessorEntry::plugin_preset_add ()
{
@ -898,6 +907,8 @@ ProcessorEntry::build_presets_menu ()
if (!pset.uri.empty ()) {
items.push_back (MenuElem (_("Delete the current preset"), sigc::mem_fun (*this, &ProcessorEntry::plugin_preset_delete)));
}
items.push_back (SeparatorElem ());
items.push_back (MenuElem (_("Reset Plugin"), sigc::mem_fun (*this, &ProcessorEntry::reset_plugin)));
if (!presets.empty ()) {
items.push_back (SeparatorElem ());
}

View File

@ -263,6 +263,7 @@ private:
void plugin_preset_selected (ARDOUR::Plugin::PresetRecord);
void plugin_preset_add ();
void plugin_preset_delete ();
void reset_plugin();
class PluginInlineDisplay : public PluginDisplay {
public: