aboutsummaryrefslogtreecommitdiff
path: root/guilib/common/LIRC.h
blob: 3cb43f1fee3b6523b9596987a0bef4bf7f9c2252 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef LIRC_H
#define LIRC_H

#include "../system.h"
#include "StdString.h"

class CRemoteControl
{
public:
  CRemoteControl();
  ~CRemoteControl();
  void Initialize();
  void Disconnect();
  void Reset();
  void Update();
  WORD GetButton();
  bool IsHolding();
  void setDeviceName(const CStdString& value);
  void setUsed(bool value);
  bool IsInUse() const { return m_used; }
  bool IsInitialized() const { return m_bInitialized; }

private:
  int     m_fd;
  int     m_inotify_fd;
  int     m_inotify_wd;
  int     m_lastInitAttempt;
  int     m_initRetryPeriod;
  FILE*   m_file;
  bool    m_isHolding;
  int32_t m_button;
  char    m_buf[128];
  bool    m_bInitialized;
  bool    m_skipHold;
  bool    m_used;
  bool    m_bLogConnectFailure;
  uint32_t    m_firstClickTime;
  CStdString  m_deviceName;
  bool        CheckDevice();
};

extern CRemoteControl g_RemoteControl;

#endif