// PRE-GENERATED (design session). Writes the live APO include file (ai_eq.txt).
// NOTE: config.txt must Include this file + the file must be user-writable — that is the
// one-time elevated setup (M3/M6). Untested on this machine (no APO installed here).
using System.IO;
using DansoriEQ.Core.Apo;

namespace DansoriEQ.App.Apo;

public sealed class ApoIncludeWriter : IApoWriter
{
    private readonly string _includePath;

    public ApoIncludeWriter(string configDir)
        => _includePath = Path.Combine(configDir, "ai_eq.txt");

    public bool IsLive => true;
    public string TargetPath => _includePath;
    public string? LastConfig { get; private set; }

    public void Apply(string apoConfigText)
    {
        File.WriteAllText(_includePath, apoConfigText);   // APO live-reloads on save
        LastConfig = apoConfigText;
    }
}
