From c6415cb28d62633d24245a2d3fe013d5353f88aa Mon Sep 17 00:00:00 2001 From: Armin Date: Wed, 15 Jul 2026 23:52:43 +0200 Subject: [PATCH] Sort preset categories and names alphabetically --- Source/PresetManager.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/PresetManager.h b/Source/PresetManager.h index 45058ca..9e6b9ba 100644 --- a/Source/PresetManager.h +++ b/Source/PresetManager.h @@ -2,6 +2,7 @@ #include #include #include +#include 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; }