Memory Management Improved
[pierogi] / keysets / mitsubishi.cpp
1 #include "mitsubishi.h"
2 #include "protocols/lircprotocol.h"
3
4 MitsubishiTV1::MitsubishiTV1(
5   unsigned int index)
6   : PIRKeysetMetaData(
7       "TV Keyset 1",
8       Mitsubishi_Make,
9       index)
10 {
11 }
12
13
14 void MitsubishiTV1::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   LIRCProtocol *lp = new LIRCProtocol(
24     guiObject,
25     index,
26     300, 900,
27     300, 2100,
28     53715, true);
29
30   threadableProtocol = lp;
31
32   lp->setTrailerPulse(300);
33
34 //  lp->setMinimumRepetitions(1);
35
36   setPreData(0xE2, 8);
37
38   addKey("POWER", Power_Key, 0x40, 8);
39   addKey("0", Zero_Key, 0x90, 8);
40   addKey("1", One_Key, 0x00, 8);
41   addKey("2", Two_Key, 0x10, 8);
42   addKey("3", Three_Key, 0x08, 8);
43   addKey("4", Four_Key, 0x18, 8);
44   addKey("5", Five_Key, 0x04, 8);
45   addKey("6", Six_Key, 0x14, 8);
46   addKey("7", Seven_Key, 0x0C, 8);
47   addKey("8", Eight_Key, 0x1C, 8);
48   addKey("9", Nine_Key, 0x80, 8);
49   addKey("-/--", DoubleDigit_Key, 0x88, 8); // "1-"
50   addKey("2-", Unmapped_Key, 0x98, 8);
51   addKey("VOL_UP", VolumeUp_Key, 0x44, 8);
52   addKey("VOL_DOWN", VolumeDown_Key, 0x54, 8);
53   addKey("MUTE", Mute_Key, 0x4C, 8);
54   addKey("OFF_TIMER", Sleep_Key, 0xE8, 8);
55   addKey("ENTER", Enter_Key, 0xAC, 8);
56   addKey("ENTER", Select_Key, 0xAC, 8);
57   addKey("TV/EXT", Input_Key, 0x5C, 8); // "tv/av", "INPUT"
58   addKey("CHANNEL_UP", ChannelUp_Key, 0x50, 8);
59   addKey("CHANNEL_DOWN", ChannelDown_Key, 0x48, 8);
60   addKey("VIDEO", Unmapped_Key, 0x02, 8);
61   addKey("ADJ_LEFT", Unmapped_Key, 0x92, 8);
62   addKey("ADJ_RIGHT", Unmapped_Key, 0x82, 8);
63   addKey("LAST", PrevChannel_Key, 0xF0, 8); // "Q.V."
64   addKey("display", Info_Key, 0xF8, 8); // "clear"
65   addKey("menu", Menu_Key, 0x4A, 8); // "MODE"
66   addKey("up", Up_Key, 0x26, 8);
67   addKey("down", Down_Key, 0x36, 8);
68   addKey("right", Right_Key, 0x82, 8);
69   addKey("left", Left_Key, 0x92, 8);
70   addKey("TEXT", Teletext_Key, 0x30, 8);
71   addKey("HOLD", TeletextHold_Key, 0xA8, 8);
72   addKey("INDEX", TeletextIndex_Key, 0x64, 8);
73   addKey("CANCEL/TIME", TeletextTime_Key, 0xB8, 8);
74   addKey("RED", Red_Key, 0xF4, 8);
75   addKey("GREEN", Green_Key, 0xEC, 8);
76   addKey("YELLOW", Yellow_Key, 0xFC, 8);
77   addKey("BLUE", Blue_Key, 0xE4, 8);
78   addKey("SIZE", TeletextSize_Key, 0x34, 8);
79   addKey("S****", Unmapped_Key, 0x74, 8);
80   addKey("REVEAL", TeletextReveal_Key, 0x7C, 8);
81   addKey("MODE", Unmapped_Key, 0xA4, 8);
82   addKey("STORE", TeletextStore_Key, 0x78, 8);
83   addKey("STATUS", Unmapped_Key, 0xB0, 8);
84   addKey("BROWSE", Unmapped_Key, 0x6C, 8);
85   addKey("PIP", PIP_Key, 0xEE, 8);
86   addKey("SOURCE", PIPSource_Key, 0xFA, 8);
87   addKey("POSITION", PIPMove_Key, 0x76, 8);
88   addKey("EXCHANGE", PIPSwap_Key, 0xFE, 8);
89   addKey("STILL", PIPPause_Key, 0xE6, 8);
90   addKey("PREVMENU", Exit_Key, 0xD2, 8);
91   addKey("ENTER", Select_Key, 0xDE, 8);
92   addKey("VIDEO", PictureMode_Key, 0xCC, 8);
93   addKey("AUDIO", SoundMode_Key, 0xDC, 8);
94   addKey("ST/MONO", Unmapped_Key, 0xC0, 8);
95   addKey("DEGAUSS", Unmapped_Key, 0xCE, 8);
96   addKey("DEMO", Unmapped_Key, 0x62, 8);
97   addKey("PRESET", Unmapped_Key, 0xA2, 8);
98   addKey("BAND", TunerBand_Key, 0xAE, 8);
99   addKey("AFT", Unmapped_Key, 0xA6, 8);
100   addKey("SKIP", Unmapped_Key, 0xB6, 8);
101   addKey("REALNAME", Unmapped_Key, 0xDA, 8);
102 }
103
104
105 MitsubishiTV1a::MitsubishiTV1a(
106   unsigned int index)
107   : MitsubishiTV1(index)
108 {
109   setKeysetName("TV Keyset 1a");
110 }
111
112
113 void MitsubishiTV1a::populateProtocol(
114   QObject *guiObject)
115 {
116   if (threadableProtocol)
117   {
118     // If the pointer is not null, the keyset must already be populated.
119     return;
120   }
121
122   MitsubishiTV1::populateProtocol(guiObject);
123
124   addKey("TURNLEFT", Unmapped_Key, 0xAC, 8);
125   addKey("TURNRIGHT", Unmapped_Key, 0xB4, 8);
126   addKey("COLOUR-SELECT", PictureMode_Key, 0x30, 8);
127   addKey("AUDIO-SELECT", SoundMode_Key, 0xC8, 8);
128 }
129
130
131 MitsubishiVCR1::MitsubishiVCR1(
132   unsigned int index)
133   : PIRKeysetMetaData(
134       "VCR Keyset 1",
135       Mitsubishi_Make,
136       index)
137 {
138 }
139
140
141
142 void MitsubishiVCR1::populateProtocol(
143   QObject *guiObject)
144 {
145   if (threadableProtocol)
146   {
147     // If the pointer is not null, the keyset must already be populated.
148     return;
149   }
150
151   LIRCProtocol *lp = new LIRCProtocol(
152     guiObject,
153     index,
154     300, 900,
155     300, 2100,
156     53815, true);
157
158   threadableProtocol = lp;
159
160   lp->setTrailerPulse(300);
161
162 //  lp->setMinimumRepetitions(1);
163
164   setPreData(0xEA, 8);
165
166   addKey("POWER", Power_Key, 0x40, 8);
167   addKey("CH-", ChannelDown_Key, 0x48, 8);
168   addKey("CH+", ChannelUp_Key, 0x50, 8);
169   addKey("PROG_ON-OFF", Unmapped_Key, 0xD8, 8); // "SHOWVIEW"
170   addKey("PROG_REC", Unmapped_Key, 0xF8, 8);
171   addKey("PROG_NBR", Unmapped_Key, 0xD4, 8);
172   addKey("SELECT", Select_Key, 0xCC, 8); // "OKPROG", "quick_program"
173   addKey("SET", Enter_Key, 0xC8, 8);
174   addKey("CLEAR", Clear_Key, 0xD0, 8);
175   addKey("INDEX_ENTER", Unmapped_Key, 0xF0, 8);
176   addKey("FAST_PLAY", Unmapped_Key, 0xA4, 8);
177   addKey("COUNTER_RESET", Unmapped_Key, 0xA8, 8);
178   addKey("COUNTER_MEMORY", Unmapped_Key, 0xB0, 8);
179   addKey("REC", Record_Key, 0x30, 8);
180   addKey("PAUSE", Pause_Key, 0x38, 8);
181   addKey("STOP", Stop_Key, 0x28, 8);
182   addKey("SLOW", Slow_Key, 0x2C, 8); // "UP"
183   addKey("REW", Rewind_Key, 0x34, 8);
184   addKey("PLAY", Play_Key, 0x20, 8);
185   addKey("FF", FastForward_Key, 0x24, 8);
186   addKey("REPEAT", Repeat_Key, 0xE8, 8);
187   addKey("SKIP_SEARCH", Advance_Key, 0xBC, 8);
188   addKey("INDEX_SEARCH-", Previous_Key, 0x68, 8);
189   addKey("INDEX_SEARCH+", Next_Key, 0x70, 8);
190   addKey("EJECT", Eject_Key, 0x6C, 8);
191   addKey("MENU", Menu_Key, 0x4A, 8);
192   addKey("123MENU", Unmapped_Key, 0x0A, 8);
193   addKey("AV", Unmapped_Key, 0x58, 8);
194   addKey("0", Zero_Key, 0x90, 8);
195   addKey("1", One_Key, 0x00, 8);
196   addKey("2", Two_Key, 0x10, 8);
197   addKey("3", Three_Key, 0x08, 8);
198   addKey("4", Four_Key, 0x18, 8);
199   addKey("5", Five_Key, 0x04, 8);
200   addKey("6", Six_Key, 0x14, 8);
201   addKey("7", Seven_Key, 0x0C, 8);
202   addKey("8", Eight_Key, 0x1C, 8);
203   addKey("9", Nine_Key, 0x80, 8);
204   addKey("10-60", DoubleDigit_Key, 0x88, 8);
205   addKey("MONITOR", Unmapped_Key, 0xC0, 8);
206   addKey("CANCEL", Unmapped_Key, 0x60, 8);
207   addKey("SP/LP", VHSSpeed_Key, 0x7C, 8);
208   addKey("DAILY/WEEKLY", Unmapped_Key, 0xF2, 8);
209   addKey("COUNT_RES", Unmapped_Key, 0xDC, 8);
210   addKey("display", Info_Key, 0xE4, 8); // "DATA_SCRN"
211   addKey("x2", Unmapped_Key, 0x5C, 8);
212   addKey("audio/video", Unmapped_Key, 0x02, 8);
213   addKey("adjust+", Right_Key, 0x82, 8);
214   addKey("cancel", Exit_Key, 0xD0, 8);
215   addKey("enter", Select_Key, 0xAC, 8);
216   addKey("adjust-", Left_Key, 0x92, 8);
217   addKey("vcr/tv", Input_Key, 0xA0, 8);
218 //  addKey("ENCORE", Unmapped_Key, 0xA0, 8);
219 }
220
221
222 MitsubishiVCR1a::MitsubishiVCR1a(
223   unsigned int index)
224   : MitsubishiVCR1(index)
225 {
226   setKeysetName("VCR Keyset 1a");
227 }
228
229
230 void MitsubishiVCR1a::populateProtocol(
231   QObject *guiObject)
232 {
233   if (threadableProtocol)
234   {
235     // If the pointer is not null, the keyset must already be populated.
236     return;
237   }
238
239   MitsubishiVCR1::populateProtocol(guiObject);
240
241   addKey("->", Unmapped_Key, 0xAC, 8); // Shuttle right
242   addKey("<-", Unmapped_Key, 0xD0, 8);  // Shuttle left
243   addKey("UP", Up_Key, 0x2C, 8);
244   addKey("JOG+", Unmapped_Key, 0x50, 8);
245   addKey("JOG-", Unmapped_Key, 0x48, 8);
246 }