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