Missed one file
[pierogi] / keysets / directv.cpp
1 #include "directv.h"
2
3
4 // Note: volume keys are tricky!
5 DirectvReceiver1::DirectvReceiver1(
6   unsigned int index)
7   : PIRKeysetMetaData(
8       "Sat Keyset 1",
9       Directv_Make,
10       index)
11 {
12 }
13
14
15 void DirectvReceiver1::populateProtocol(
16   QObject *guiObject)
17 {
18   if (threadableProtocol)
19   {
20     // If the pointer is not null, the keyset must already be populated.
21     return;
22   }
23
24   dtvPopulateProtocol(guiObject, LongGap_Directv, LowFreq_Directv);
25 }
26
27
28 void DirectvReceiver1::dtvPopulateProtocol(
29   QObject *guiObject,
30   DirectvGapSize gap,
31   DirectvFreq freq)
32 {
33   DirectvProtocol *dp = new DirectvProtocol(guiObject, index);
34
35   threadableProtocol = dp;
36
37   dp->setProtocolParms(gap, freq);
38
39   setPreData(0xC, 4);
40
41   addKey("1", One_Key, 0x01, 8);
42   addKey("2", Two_Key, 0x02, 8);
43   addKey("3", Three_Key, 0x03, 8);
44   addKey("4", Four_Key, 0x04, 8);
45   addKey("5", Five_Key, 0x05, 8);
46   addKey("6", Six_Key, 0x06, 8);
47   addKey("7", Seven_Key, 0x07, 8);
48   addKey("8", Eight_Key, 0x08, 8);
49   addKey("9", Nine_Key, 0x09, 8);
50   addKey("Chan+", ChannelUp_Key, 0x0D, 8);
51   addKey("Chan-", ChannelDown_Key, 0x0E, 8);
52   addKey("Previous", PrevChannel_Key, 0xF, 8); // "last"
53
54   addKey("Power", Power_Key, 0x10, 8);
55   addKey("0", Zero_Key, 0x11, 8);
56   addKey("Dash", Dash_Key, 0x12, 8);
57   addKey("Enter", Enter_Key, 0x13, 8);
58
59   addKey("Menu", Menu_Key, 0x20, 8); // "alt menu"
60   addKey("Up", Up_Key, 0x21, 8);
61   addKey("Down", Down_Key, 0x22, 8);
62   addKey("Left", Left_Key, 0x23, 8);
63   addKey("Right", Right_Key, 0x24, 8);
64   addKey("Select", Select_Key, 0x25, 8);
65   addKey("Exit", Exit_Key, 0x26, 8);
66   addKey("Back", Unmapped_Key, 0x27, 8);
67   addKey("Guide", Guide_Key, 0x28, 8);
68   addKey("Active", DiscMenu_Key, 0x29, 8); // "menu"
69   addKey("List", Unmapped_Key, 0x2A, 8);
70   addKey("list-long", Unmapped_Key, 0x2B, 8);
71   addKey("info-long", Unmapped_Key, 0x2C, 8);
72   addKey("guide-long", Unmapped_Key, 0x2D, 8);
73   addKey("Info", Info_Key, 0x2E, 8);
74
75   addKey("Play", Play_Key, 0x30, 8);
76   addKey("Stop", Stop_Key, 0x31, 8);
77   addKey("Pause", Pause_Key, 0x32, 8);
78   addKey("Rewind", Rewind_Key, 0x33, 8);
79   addKey("Forward", FastForward_Key, 0x34, 8);
80   addKey("Record", Record_Key, 0x35, 8);
81   addKey("Replay", Replay_Key, 0x36, 8);
82   addKey("Skip", Advance_Key, 0x37, 8);
83   addKey("skip-forward-long", Unmapped_Key, 0x38, 8);
84   addKey("play-long", Unmapped_Key, 0x3A, 8);
85   addKey("pause-long", Unmapped_Key, 0x3B, 8);
86   addKey("rewind-long", Unmapped_Key, 0x3C, 8);
87   addKey("forward-long", Unmapped_Key, 0x3D, 8);
88   addKey("record-long", Unmapped_Key, 0x3E, 8);
89   addKey("skip-back-long", Unmapped_Key, 0x3F, 8);
90
91   addKey("Red", Red_Key, 0x41, 8);
92   addKey("Yellow", Yellow_Key, 0x42, 8);
93   addKey("Green", Green_Key, 0x43, 8);
94   addKey("Blue", Blue_Key, 0x44, 8);
95   addKey("pip on/off", PIP_Key, 0x47, 8);
96   addKey("pip swap", PIPSwap_Key, 0x48, 8);
97   addKey("red-long", Unmapped_Key, 0x4A, 8);
98   addKey("yellow-long", Unmapped_Key, 0x4B, 8);
99   addKey("green-long", Unmapped_Key, 0x4C, 8);
100   addKey("blue-long", Unmapped_Key, 0x4D, 8);
101
102   addKey("tv/vcr", Input_Key, 0x5B, 8);
103
104   addKey("format", Unmapped_Key, 0x73, 8);
105   addKey("format-long", Unmapped_Key, 0x75, 8);
106
107   addKey("On", PowerOn_Key, 0x80, 8);
108   addKey("Off", PowerOff_Key, 0x81, 8);
109 }
110
111
112 DirectvReceiver1a::DirectvReceiver1a(
113   unsigned int index)
114   : DirectvReceiver1(index)
115 {
116   setKeysetName("Sat Keyset 1a");
117 }
118
119
120 void DirectvReceiver1a::populateProtocol(
121   QObject *guiObject)
122 {
123   if (threadableProtocol)
124   {
125     // Keyset already populated.
126     return;
127   }
128
129   dtvPopulateProtocol(guiObject, ShortGap_Directv, LowFreq_Directv);
130 }
131
132
133 DirectvReceiver1b::DirectvReceiver1b(
134   unsigned int index)
135   : DirectvReceiver1(index)
136 {
137   setKeysetName("Sat Keyset 1b");
138 }
139
140
141 void DirectvReceiver1b::populateProtocol(
142   QObject *guiObject)
143 {
144   if (threadableProtocol)
145   {
146     // Keyset already populated.
147     return;
148   }
149
150   dtvPopulateProtocol(guiObject, ShortGap_Directv, MediumFreq_Directv);
151 }
152
153
154 DirectvReceiver1c::DirectvReceiver1c(
155   unsigned int index)
156   : DirectvReceiver1(index)
157 {
158   setKeysetName("Sat Keyset 1c");
159 }
160
161
162 void DirectvReceiver1c::populateProtocol(
163   QObject *guiObject)
164 {
165   if (threadableProtocol)
166   {
167     // Keyset already populated.
168     return;
169   }
170
171   dtvPopulateProtocol(guiObject, LongGap_Directv, MediumFreq_Directv);
172 }
173
174
175 DirectvReceiver1d::DirectvReceiver1d(
176   unsigned int index)
177   : DirectvReceiver1(index)
178 {
179   setKeysetName("Sat Keyset 1d");
180 }
181
182
183 void DirectvReceiver1d::populateProtocol(
184   QObject *guiObject)
185 {
186   if (threadableProtocol)
187   {
188     // Keyset already populated.
189     return;
190   }
191
192   dtvPopulateProtocol(guiObject, ShortGap_Directv, HighFreq_Directv);
193 }
194
195
196 DirectvReceiver1e::DirectvReceiver1e(
197   unsigned int index)
198   : DirectvReceiver1(index)
199 {
200   setKeysetName("Sat Keyset 1e");
201 }
202
203
204 void DirectvReceiver1e::populateProtocol(
205   QObject *guiObject)
206 {
207   if (threadableProtocol)
208   {
209     // Keyset already populated.
210     return;
211   }
212
213   dtvPopulateProtocol(guiObject, LongGap_Directv, HighFreq_Directv);
214 }