#ifndef BUSY_INDICATOR_HPP
#define BUSY_INDICATOR_HPP

#include "image.hpp"
#include "config.hpp"
#include "renderer.hpp"

enum IdleStatus { IDLE, BUSY, ERROR };

class BusyIndicator
{
private:
  // Constructor adds itself to the updater loop
  BusyIndicator();

  int check_status();
  void print_status();
  
  Overlay status_overlay;

  IdleStatus status;
  IdleStatus old_status;
  Config *conf;
  Render *render;

  bool disabled;
  
public:
  // singleton
  static BusyIndicator& get_instance();

  void idle();
  void busy();
  void busy_no_print();

  void disable();
  void enable();
};

#endif
