Add API to check for plugin-presets with description
This commit is contained in:
parent
95676a5f66
commit
0fa38c0002
|
@ -424,15 +424,7 @@ GenericPluginUI::build ()
|
|||
}
|
||||
|
||||
if (control_uis.empty ()) {
|
||||
std::vector<Plugin::PresetRecord> presets = insert->plugin()->get_presets();
|
||||
bool show_preset_browser = false;
|
||||
for (std::vector<Plugin::PresetRecord>::const_iterator i = presets.begin(); i != presets.end(); ++i) {
|
||||
if (i->valid && !i->description.empty()) {
|
||||
show_preset_browser = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (show_preset_browser) {
|
||||
if (has_descriptive_presets ()) {
|
||||
preset_gui = new PluginPresetsUI (insert);
|
||||
hpacker.pack_start (*preset_gui, true, true);
|
||||
}
|
||||
|
|
|
@ -685,6 +685,18 @@ PlugUIBase::reset_plugin_parameters ()
|
|||
insert->reset_parameters_to_default ();
|
||||
}
|
||||
|
||||
bool
|
||||
PlugUIBase::has_descriptive_presets () const
|
||||
{
|
||||
std::vector<Plugin::PresetRecord> presets = insert->plugin()->get_presets();
|
||||
for (std::vector<Plugin::PresetRecord>::const_iterator i = presets.begin(); i != presets.end(); ++i) {
|
||||
if (i->valid && !i->description.empty()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
PlugUIBase::manage_pins ()
|
||||
{
|
||||
|
|
|
@ -188,6 +188,8 @@ protected:
|
|||
void preset_added_or_removed ();
|
||||
void update_preset_modified ();
|
||||
|
||||
bool has_descriptive_presets () const;
|
||||
|
||||
PBD::ScopedConnection death_connection;
|
||||
PBD::ScopedConnection active_connection;
|
||||
PBD::ScopedConnection preset_added_connection;
|
||||
|
|
Loading…
Reference in New Issue