#pragma once

#include "Parameters/DeepPluckParameterState.h"
#include <cstddef>
#include <cstdint>
#include <string>
#include <vector>

namespace deeppluck::benchmark
{
inline constexpr auto manifestVersion = "DeepPluck-CPU-0.11.5-Rev1";
inline constexpr auto representativeProtocol = "DeepPluck-CPU-Representative-20260903-Rev1";
inline constexpr size_t representativeCaseCount = 39;
using Values = DeepPluckParameterValues;
enum class Kind { noteOff, controller, noteOn, parameter, tempo, state, factory };
struct Event
{
    std::int64_t sample = 0;
    Kind kind = Kind::noteOn;
    int index = 0;
    double value = 0;
};
struct Phase
{
    std::string name;
    std::int64_t begin = 0, end = 0;
};
struct Case
{
    std::string id, family;
    std::string originId; // Nonempty only for the explicitly authorised short-window protocol.
    int rate = 48000, block = 128, polyphony = 1;
    Values requested {};
    std::int64_t samples = 0;
    std::vector<Event> events;
    std::vector<Phase> phases;
    bool sustainLoad = false;
    bool lifecycle = false;
};

Values foundation();
std::vector<Case> makeCases();
Case prefixWindow (const Case&, double seconds);
std::vector<Case> selectCases (const std::vector<Case>&, const std::string& suite,
                             const std::string& caseId, int shardIndex, int shardCount);
juce::var describe (const Case&);
void validateInventory (const std::vector<Case>&);
}
