Memory Management Improved
[pierogi] / keysets / apple.cpp
1 #include "apple.h"
2 #include "protocols/lircprotocol.h"
3
4 // Based on LIRC Apple_A1156 config file
5 AppleWhiteRemote::AppleWhiteRemote(
6   unsigned int index)
7   : PIRKeysetMetaData(
8       "White Remote",
9       Apple_Make,
10       index)
11 {
12   addControlledDevice(Apple_Make, "Mac Mini", Computer_Device);
13 }
14
15
16 void AppleWhiteRemote::populateProtocol(
17   QObject *guiObject)
18 {
19   if (threadableProtocol)
20   {
21     // If the pointer is not null, the keyset must already be populated.
22     return;
23   }
24
25   // Set up the threadable object:
26   LIRCProtocol *lp = new LIRCProtocol(
27     guiObject, index,
28     560, 560,
29     560, 1680,
30     110000, true);
31
32   threadableProtocol = lp;
33
34   lp->setHeaderPair(9000, 4500);
35   lp->setTrailerPulse(560);
36   lp->setRepeatPair(9000, 2250);
37
38   setPreData(0x77e1, 16);
39   setPostData(0xc5, 8);
40
41 // Menu oriented:
42   addKey("menu", Menu_Key, 0x40, 8);
43   addKey("+", Up_Key, 0xD0, 8);
44   addKey("-", Down_Key, 0xB0, 8);
45   addKey("|<<", Left_Key, 0x10, 8);
46   addKey(">>|", Right_Key, 0xE0, 8);
47   addKey(">||", Select_Key, 0x20, 8);
48
49 // Media oriented:
50   addKey("+", VolumeUp_Key, 0xD0, 8);
51   addKey("-", VolumeDown_Key, 0xB0, 8);
52   addKey("|<<", Rewind_Key, 0x10, 8);
53   addKey(">>|", FastForward_Key, 0xE0, 8);
54   addKey(">||", Play_Key, 0x20, 8);
55   addKey(">||", Pause_Key, 0x20, 8);
56   addKey("|<<", Previous_Key, 0x10, 8);
57   addKey(">>|", Next_Key, 0xE0, 8);
58 }