#pragma once

#include "core/audio_backend.h"
#include "core/device_lifecycle.h"
#include "core/signal_generator.h"

namespace aptt {

class NullBackend final : public IAudioBackend {
 public:
  BackendApi api() const override;
  DeviceList enumerateDevices() override;
  FormatProbeResult probeFormats(const DeviceInfo& device) override;
  OperationResult initialize(const PlaybackConfig& config) override;
  OperationResult start() override;
  OperationResult stop() override;
  OperationResult reset() override;
  RealtimeStats getRealtimeStats() const override;
  BackendError getLastError() const override;
  OperationResult shutdown() override;

  DeviceLifecycleState lifecycle_state() const { return state_; }

 private:
  bool TransitionTo(DeviceLifecycleState next);

  PlaybackConfig config_;
  RealtimeStats stats_;
  BackendError last_error_;
  DeviceLifecycleState state_ = DeviceLifecycleState::kDiscovered;
  PcmSineGenerator generator_;
};

}  // namespace aptt

