patch from colinf that adds an 'empty' preset to the preset drop-down list, so that plugins can be set back to the 'no preset' state rather than being stuck in the state of 'preset loaded and modified'. This should apply to all plugin types, though I've only tried it on LV2 and LADSPA.

git-svn-id: svn://localhost/ardour2/branches/3.0@12787 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-06-19 16:02:24 +00:00
parent 7a24e49fa0
commit 1df227424a
3 changed files with 17 additions and 0 deletions

View File

@ -593,6 +593,9 @@ PlugUIBase::preset_selected ()
warning << string_compose(_("Plugin preset %1 not found"),
_preset_combo.get_active_text()) << endmsg;
}
} else {
// blank selected = no preset
plugin->clear_preset();
}
}
@ -745,6 +748,8 @@ PlugUIBase::update_preset_list ()
preset_labels.push_back (i->label);
}
preset_labels.push_back("");
set_popdown_strings (_preset_combo, preset_labels);
--_no_load_preset;
@ -768,6 +773,7 @@ PlugUIBase::update_preset ()
void
PlugUIBase::update_preset_modified ()
{
if (plugin->last_preset().uri.empty()) {
_preset_modified.set_text ("");
return;

View File

@ -183,6 +183,7 @@ class Plugin : public PBD::StatefulDestructible, public Latent
void remove_preset (std::string);
virtual bool load_preset (PresetRecord);
void clear_preset ();
const PresetRecord * preset_by_label (const std::string &);
const PresetRecord * preset_by_uri (const std::string &);

View File

@ -327,6 +327,16 @@ Plugin::load_preset (PresetRecord r)
return true;
}
void
Plugin::clear_preset ()
{
_last_preset.uri = "";
_last_preset.label = "";
_parameter_changed_since_last_preset = false;
PresetLoaded (); /* EMIT SIGNAL */
}
/** @param val `plugin' value */
void
Plugin::set_parameter (uint32_t which, float val)