Sort plugin presets by default

This commit is contained in:
Robin Gareus 2022-12-19 16:38:10 +01:00
parent 6725e8b661
commit 10d12599dd
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
6 changed files with 18 additions and 0 deletions

View File

@ -228,6 +228,14 @@ public:
return uri != a.uri || label != a.label;
}
bool operator< (PresetRecord const& a) const
{
if (label == a.label) {
return uri < a.uri;
}
return label < a.label;
}
std::string uri;
std::string label;
std::string description;

View File

@ -2424,6 +2424,7 @@ AUPluginInfo::get_presets (bool user_only) const
}
if (user_only) {
std::sort (p.begin (), p.end();
return p;
}
@ -2460,6 +2461,7 @@ AUPluginInfo::get_presets (bool user_only) const
CFRelease (presets);
unit->Uninitialize ();
std::sort (p.begin (), p.end ());
return p;
}

View File

@ -727,6 +727,8 @@ LadspaPluginInfo::get_presets (bool /*user_only*/) const
}
lrdf_free_uris(set_uris);
}
std::sort (p.begin (), p.end ());
#endif
return p;
}

View File

@ -3720,6 +3720,8 @@ LV2PluginInfo::get_presets (bool user_only) const
lilv_node_free(pset_Preset);
lilv_node_free(lv2_appliesTo);
std::sort (p.begin (), p.end ());
return p;
}

View File

@ -477,6 +477,8 @@ Plugin::get_presets ()
p.push_back (i->second);
}
std::sort (p.begin(), p.end());
return p;
}

View File

@ -1002,6 +1002,8 @@ VST3PluginInfo::get_presets (bool user_only) const
p.push_back (Plugin::PresetRecord (uri, preset_name, is_user));
}
std::sort (p.begin (), p.end ());
return p;
}