#pragma once

#include "layer.h"

class MainWindow;
//--------------------------------------------------------------
class ControlsLayer : public Layer
{
  public:
  enum class ButtonType
  {
    Play,
    Pause,
    Reset
  };

  struct ButtonStyle
  {
    quokka_gfx::FPos  pos;
    quokka_gfx::FSize size;
    bool              isHovered = false;
    bool              isPressed = false;
  };

  public:
  ControlsLayer()                                              = delete;      // Default constructor
  virtual ~ControlsLayer()                                     = default;     // Default destructor
  ControlsLayer(const ControlsLayer &obj)                = delete;      // Copy constructor
  ControlsLayer(ControlsLayer &&obj) noexcept            = delete;      // Move constructor
  ControlsLayer &operator=(const ControlsLayer &obj)     = delete;      // Copy assignment operator
  ControlsLayer &operator=(ControlsLayer &&obj) noexcept = delete;      // Move assignment operator

  explicit ControlsLayer(MainWindow &owner);     // Constructor

  void update(std::chrono::nanoseconds dt) override;     // Update the layer state
  void render() const override;       // Render the layer

  protected:
  ButtonStyle m_playButtonStyle;      // Style for the play button
  ButtonStyle m_pauseButtonStyle;     // Style for the pause button
  ButtonStyle m_stopButtonStyle;      // Style for the stop button

  private:
  void init();

  void drawPlayButton(const quokka_gfx::Renderer &renderer) const;
  void drawPauseButton(const quokka_gfx::Renderer &renderer) const;
  void drawStopButton(const quokka_gfx::Renderer &renderer) const;
};
//--------------------------------------------------------------
