#ifndef LIRC_HPP
#define LIRC_HPP

#include "input.hpp"

// lirc
struct IR {
  char *buf;
  unsigned int code;
  unsigned int serial;
  char key[64];
  char remote[64];
  char rxkey;
};

class Lirc : public Input_device 
{
private:
  int irsd, number_of_keypresses;
  int pid_lircd;
  bool running;
  bool flush; //used after returning from external programs
              //if set, all lirc events in the first 200ms time interval
             //are discarded; it's a 1 shot flag, it gets reset after the said time
  void connect();

  // hack to fix lirc giving the same command twice
  int dump_fast;

  unsigned long long  next_time;
  unsigned long long  this_time;

  int timeinterv;

public:
  void run();

  Lirc();
  ~Lirc();

  void suspend();
  void wake_up();
};


#endif
