#pragma once

#include <array>
#include <atomic>

namespace deeppluck
{
class DeepPluckOutputMeter final
{
public:
    void reset() noexcept;
    void publish (float leftPeak, float rightPeak) noexcept;
    [[nodiscard]] std::array<float, 2> consume() noexcept;
    [[nodiscard]] bool isLockFree() const noexcept;

private:
    static void publishOne (std::atomic<float>& destination, float peak) noexcept;
    std::atomic<float> left { 0.0f };
    std::atomic<float> right { 0.0f };
};
}
