Memory Management Improved
[pierogi] / keysets / sky.cpp
1 #include "sky.h"
2 #include "protocols/rc6skyprotocol.h"
3
4 SkyReceiver1::SkyReceiver1(
5   unsigned int index)
6   : PIRKeysetMetaData(
7       "Receiver Keyset 1",
8       Sky_Make,
9       index)
10 {
11 }
12
13
14 void SkyReceiver1::populateProtocol(
15   QObject *guiObject)
16 {
17   if (threadableProtocol)
18   {
19     // If the pointer is not null, the keyset must already be populated.
20     return;
21   }
22
23   threadableProtocol = new RC6SkyProtocol(guiObject, index);
24
25   setPreData(0x000, 12);
26
27   addKey("0", Zero_Key, 0x00, 8);
28   addKey("1", One_Key, 0x01, 8);
29   addKey("2", Two_Key, 0x02, 8);
30   addKey("3", Three_Key, 0x03, 8);
31   addKey("4", Four_Key, 0x04, 8);
32   addKey("5", Five_Key, 0x05, 8);
33   addKey("6", Six_Key, 0x06, 8);
34   addKey("7", Seven_Key, 0x07, 8);
35   addKey("8", Eight_Key, 0x08, 8);
36   addKey("9", Nine_Key, 0x09, 8);
37   addKey("POWER", Power_Key, 0x0C, 8);
38
39   addKey("CH+", ChannelUp_Key, 0x20, 8);
40   addKey("CH-", ChannelDown_Key, 0x21, 8);
41   addKey("PAUSE", Pause_Key, 0x24, 8);
42   addKey("FFW", FastForward_Key, 0x28, 8);
43
44   addKey("TEXT", Teletext_Key, 0x3C, 8); // is this right?
45   addKey("REW", Rewind_Key, 0x3D, 8);
46   addKey("PLAY", Play_Key, 0x3E, 8);
47   addKey("STOP", Stop_Key, 0x3F, 8);
48   addKey("REC", Record_Key, 0x40, 8);
49
50   addKey("UP", Up_Key, 0x58, 8);
51   addKey("DOWN", Down_Key, 0x59, 8);
52   addKey("LEFT", Left_Key, 0x5A, 8);
53   addKey("RIGHT", Right_Key, 0x5B, 8);
54   addKey("SELECT", Select_Key, 0x5C, 8);
55
56   addKey("RED", Red_Key, 0x6D, 8);
57   addKey("GREEN", Green_Key, 0x6E, 8);
58   addKey("YELLOW", Yellow_Key, 0x6F, 8);
59   addKey("BLUE", Blue_Key, 0x70, 8);
60
61   addKey("BOX_OFFICE", Unmapped_Key, 0x7D, 8);
62   addKey("SERVICES", Menu_Key, 0x7E, 8); // ?
63
64   addKey("SKY", Unmapped_Key, 0x80, 8);
65   addKey("HELP", Unmapped_Key, 0x81, 8); // menu?
66   addKey("BACK", Exit_Key, 0x83, 8);
67   addKey("TV", Input_Key, 0x84, 8);
68
69   addKey("INFO", Info_Key, 0xCB, 8);
70   addKey("TV_GUIDE", Guide_Key, 0xCC, 8);
71
72   addKey("INTERACTIVE", Unmapped_Key, 0xF5, 8);
73 }
74
75
76 SkyReceiver1a::SkyReceiver1a(
77   unsigned int index)
78   : SkyReceiver1(index)
79 {
80   setKeysetName("Receiver Keyset 1a");
81 }
82
83
84 void SkyReceiver1a::populateProtocol(
85   QObject *guiObject)
86 {
87   if (threadableProtocol)
88   {
89     // If the pointer is not null, the keyset must already be populated.
90     return;
91   }
92
93   SkyReceiver1::populateProtocol(guiObject);
94
95   setPreData(0x00C, 12);
96 }