4 // The generic remote controller.
8 #include "pirkeynames.h"
9 //#include "pirdevice.h"
14 // We'll define a maximum number of repetitions, regardless of how long the
15 // user presses the button. (This is just in case we miss the point at which
16 // he stops pressing it...) 500 should be plenty.
17 #define MAX_REPEAT_COUNT 500
19 typedef std::deque<bool> CommandSequence;
21 // I'll go ahead and use associative arrays to build up lists of keycodes.
22 typedef std::map<int, CommandSequence> KeycodeCollection;
25 // Right now, the only reason for this object to inherit from QObject is
26 // so it can participate in Qt-style threading. Note that it has no
27 // event loop, and no access to the GUI, so don't go trying to communicate
28 // with the user here...
29 class PIRProtocol: public QObject
46 // unsigned int index);
48 void setCarrierFrequency(
54 void setMinimumRepetitions(
58 virtual void startSendingCommand(
59 unsigned int threadableID,
60 PIRKeyName command) = 0;
64 const char *errString);
67 bool isCommandSupported(
70 void clearRepeatFlag();
71 bool checkRepeatFlag();
73 unsigned int carrierFrequency;
74 unsigned int dutyCycle;
76 // "appendToBitSeq" really doesn't belong in this class...
78 CommandSequence &sequence,
82 KeycodeCollection keycodes;
84 // A sleep function for all protocols:
85 void sleepUntilRepeat(
88 // The "gap" parameter from LIRC. If the commands are "variable-length",
89 // this indicates the amount of time between the last pulse of one
90 // command and the first pulse of the next. If "constant-length", it is
91 // the time between the _first_ pulse of one command and the first pulse
94 bool isConstantLength;
97 // Some remotes require a minimum number of repetitions:
98 int minimumRepetitions;
103 #endif // PIRPROTOCOL_H