2026-09-07 21:03:31 +02:00
|
|
|
#pragma once
|
|
|
|
|
#include "Params.h"
|
|
|
|
|
#include <juce_audio_processors/juce_audio_processors.h>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
struct Patch
|
|
|
|
|
{
|
|
|
|
|
const char* name;
|
|
|
|
|
const char* category;
|
|
|
|
|
float v[prm::num];
|
|
|
|
|
};
|
|
|
|
|
|
2026-09-08 21:57:34 +02:00
|
|
|
struct CategoryIndex
|
|
|
|
|
{
|
|
|
|
|
juce::StringArray names;
|
|
|
|
|
std::vector<std::vector<int>> patchIndices; // parallel to names
|
|
|
|
|
};
|
|
|
|
|
|
2026-09-07 21:03:31 +02:00
|
|
|
class PresetBank
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
PresetBank();
|
|
|
|
|
|
|
|
|
|
int size() const noexcept { return (int) patches.size(); }
|
|
|
|
|
const Patch& get (int i) const { return patches[(size_t) i]; }
|
|
|
|
|
int findByName (const juce::String&) const;
|
|
|
|
|
|
|
|
|
|
void writeTo (int i, juce::AudioProcessorValueTreeState&) const;
|
|
|
|
|
|
2026-09-08 21:57:34 +02:00
|
|
|
const CategoryIndex& categories() const { return catIndex; }
|
|
|
|
|
|
2026-09-07 21:03:31 +02:00
|
|
|
private:
|
|
|
|
|
std::vector<Patch> patches;
|
2026-09-08 21:57:34 +02:00
|
|
|
CategoryIndex catIndex;
|
|
|
|
|
void buildCategoryIndex();
|
2026-09-07 21:03:31 +02:00
|
|
|
};
|