Sort preset categories and names alphabetically

This commit is contained in:
Armin 2026-07-15 23:52:43 +02:00
commit c6415cb28d

View file

@ -2,6 +2,7 @@
#include <juce_audio_processors/juce_audio_processors.h>
#include <vector>
#include <map>
#include <algorithm>
struct Preset {
juce::String name;
@ -23,6 +24,7 @@ public:
if (c == p.category) { found = true; break; }
if (!found) cats.push_back(p.category);
}
std::sort(cats.begin(), cats.end());
return cats;
}
@ -31,6 +33,8 @@ public:
for (auto& p : presets)
if (p.category == cat)
result.push_back(p);
std::sort(result.begin(), result.end(),
[](const Preset& a, const Preset& b) { return a.name < b.name; });
return result;
}