#pragma once

#include "../Parameters/DeepPluckParameterState.h"

namespace deeppluck
{
struct UserPresetData
{
    juce::String name;
    juce::String author;
    juce::String pluginVersion;
    juce::String description;
    DeepPluckParameterValues values {};
};

// Pure control-thread codec shared by the production manager and developer tools.
// No filesystem permissions or scan policy are part of this interface.
[[nodiscard]] bool decodePreset (const juce::AudioProcessorValueTreeState& state,
                                  const DeepPluckParameterValues& defaults,
                                  const juce::String& json,
                                  UserPresetData& data, juce::String& error);
[[nodiscard]] bool encodePreset (const juce::AudioProcessorValueTreeState& state,
                                  const UserPresetData& data,
                                  juce::String& json, juce::String& error,
                                  bool pretty = false);
}
