#pragma once
// Pure, REAPER-free new-content detection: which GUIDs appeared since the last
// poll. See src/core/view/CLAUDE.md for the module contract.

#include <set>
#include <string>
#include <vector>

namespace reasampler::view {

// GUIDs in `current` but not `previous`, ascending order; empty GUIDs ignored.
std::vector<std::string> newGuids(const std::set<std::string>& previous,
                                  const std::set<std::string>& current);

// Tracks the live GUID set across polls for one project.
class GuidBaseline {
public:
    // First call after construction/reset() establishes the baseline and
    // returns {}; later calls return GUIDs added since the prior call.
    std::vector<std::string> observe(const std::set<std::string>& current);

    // Re-arms the first-poll guard on a detected project switch.
    void reset();

    bool primed() const { return primed_; }

private:
    std::set<std::string> baseline_;
    bool                  primed_ = false;
};

}  // namespace reasampler::view
