Possible Uninstall Fix, plus cleanup, more keysets
[pierogi] / protocols / lircprotocol.h
1 #ifndef LIRCPROTOCOL_H
2 #define LIRCPROTOCOL_H
3
4 #include "spaceprotocol.h"
5
6 class PIRRX51Hardware;
7
8 //
9 // LIRC does not itself have an actual protocol; what it does do is attempt
10 // to capture IR pulses in more-or-less the most general method possible.
11 // I'm attempting to push all my keysets into using code paths specific to
12 // their actual protocols, but I still don't know all the protocols myself.
13 // Where I don't have that information, I'll use LIRC's system.  The following
14 // pretty much follows LIRC's system for space-based encoding patterns.
15 //
16
17 class LIRCProtocol: public SpaceProtocol
18 {
19 public:
20   LIRCProtocol(
21     QObject *guiObject,
22     unsigned int index,
23     unsigned int zPulse,
24     unsigned int zSpace,
25     unsigned int oPulse,
26     unsigned int oSpace,
27     unsigned int gapSpace,
28     bool iclflag);
29
30   void setHeaderPair(
31     unsigned int pulse,
32     unsigned int space);
33
34   void setTrailerPulse(
35     unsigned int pulse);
36
37   void setRepeatPair(
38     unsigned int pulse,
39     unsigned int space);
40
41   void setRepeatNeedsHeader(
42     bool flag);
43
44   void setFullHeadlessRepeat(
45     bool flag);
46
47 public slots:
48   void startSendingCommand(
49     unsigned int threadableID,
50     PIRKeyName command);
51
52 private:
53   bool hasHeaderPair;
54
55   bool hasTrailerPulse;
56
57   unsigned int repeatPulse;
58   unsigned int repeatSpace;
59   bool hasRepeatPair;
60   bool repeatNeedsHeader; // Put the header ahead of the repeat pulse
61   bool fullHeadlessRepeat; // Repeat full command but without header
62
63   int generateStandardCommand(
64     const PIRKeyBits &bits,
65     PIRRX51Hardware &device);
66
67   int generateHeadlessCommand(
68     const PIRKeyBits &bits,
69     PIRRX51Hardware &device);
70
71   int generateRepeatCommand(
72     PIRRX51Hardware &device);
73 };
74
75 #endif // LIRCPROTOCOL_H