Memory Management Improved
[pierogi] / keysets / wd.cpp
1 #include "wd.h"
2 #include "protocols/necprotocol.h"
3
4 WDMediaPlayer1::WDMediaPlayer1(
5   unsigned int index)
6   : PIRKeysetMetaData(
7       "Media Player Keyset 1",
8       WD_Make,
9       index)
10 {
11 }
12
13
14 void WDMediaPlayer1::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 NECProtocol(guiObject, index, true, true);
24
25   setPreData(0x7984, 16);
26
27   addKey("KEY_DOWN", Down_Key, 0x00, 8); // "down arrow"
28   addKey("KEY_NEXT", Next_Key, 0x01, 8); // "next"
29   addKey("KEY_NEXT", PageDown_Key, 0x01, 8);
30   addKey("KEY_PREVIOUS", Previous_Key, 0x02, 8); // "prev"
31   addKey("KEY_PREVIOUS", PageUp_Key, 0x02, 8);
32   addKey("KEY_STOP", Stop_Key, 0x04, 8); // "stop"
33   addKey("KEY_UP", Up_Key, 0x05, 8); // "up arrow"
34   addKey("KEY_HOME", Menu_Key, 0x06, 8); // "home"
35   addKey("KEY_LEFT", Left_Key, 0x07, 8); // "left arrow"
36   addKey("KEY_ENTER", Select_Key, 0x08, 8); // "enter"
37   addKey("KEY_ENTER", Info_Key, 0x08, 8);
38   addKey("KEY_RIGHT", Right_Key, 0x09, 8); // "right arrow"
39   addKey("KEY_PLAYPAUSE", Play_Key, 0x0A, 8); // "pause/play"
40   addKey("KEY_PLAYPAUSE", Pause_Key, 0x0A, 8);
41   addKey("KEY_SEARCH", Scan_Key, 0x0F, 8); // "search"
42   addKey("KEY_EJECTCD", Eject_Key, 0x10, 8);
43   addKey("KEY_POWER", Power_Key, 0x12, 8); // "power"
44   addKey("KEY_OPTION", Unmapped_Key, 0x1A, 8); // "option"
45   addKey("KEY_BACK", Exit_Key, 0x1B, 8); // "back"
46   addKey("KEY_FASTFORWARD", FastForward_Key, 0x1E, 8); // "fast fwd"
47   addKey("KEY_REWIND", Rewind_Key, 0x1F, 8); // "rewind"
48 }
49
50
51 WDMediaPlayer1a::WDMediaPlayer1a(
52   unsigned int index)
53   : WDMediaPlayer1(index)
54 {
55   setKeysetName("Media Player Keyset 1a");
56 }
57
58
59 void WDMediaPlayer1a::populateProtocol(
60   QObject *guiObject)
61 {
62   if (threadableProtocol)
63   {
64     // If the pointer is not null, the keyset must already be populated.
65     return;
66   }
67
68   WDMediaPlayer1::populateProtocol(guiObject);
69
70   addKey("next page", PageDown_Key, 0x03, 8);
71   addKey("subtitle", Captions_Key, 0x0C, 8);
72   addKey("audio", Audio_Key, 0x0D, 8);
73   addKey("3", Three_Key, 0x0E, 8);
74   addKey("mute", Mute_Key, 0x28, 8);
75   addKey("prev page", PageUp_Key, 0x2C, 8);
76   addKey("setup", Guide_Key, 0x2E, 8);
77   addKey("8", Eight_Key, 0x5C, 8);
78   addKey("7", Seven_Key, 0x5D, 8);
79   addKey("6", Six_Key, 0x5E, 8);
80   addKey("9", Nine_Key, 0x5F, 8);
81   addKey("eject", Eject_Key, 0xE0, 8);
82   addKey("2", Two_Key, 0xE6, 8);
83   addKey("1", One_Key, 0xE7, 8);
84   addKey("B (red)", Red_Key, 0xE5, 8);
85   addKey("D (blue)", Blue_Key, 0xE8, 8);
86   addKey("C (yellow)", Yellow_Key, 0xE9, 8);
87   addKey("A (green)", Green_Key, 0xEB, 8);
88   addKey("4", Four_Key, 0xEC, 8);
89   addKey("5", Five_Key, 0xED, 8);
90   addKey("0", Zero_Key, 0xEE, 8);
91 }