Memory Management Improved
[pierogi] / keysets / logitech.cpp
1 #include "logitech.h"
2 #include "protocols/necprotocol.h"
3
4 LogitechSpeakers::LogitechSpeakers(
5   unsigned int index)
6   : PIRKeysetMetaData(
7       "Digital Speakers Keyset",
8       Logitech_Make,
9       index)
10 {
11 }
12
13
14 void LogitechSpeakers::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, false, true);
24
25   setPreData(0x08, 8);
26
27   addKey("surround+", RearVolumeUp_Key, 0x00, 8);
28   addKey("sub-", WooferDown_Key, 0x01, 8);
29   addKey("center+", CenterVolumeUp_Key, 0x02, 8);
30   addKey("sub+", WooferUp_Key, 0x03, 8);
31   addKey("surround-", RearVolumeDown_Key, 0x04, 8);
32   addKey("test", Unmapped_Key, 0x05, 8);
33   addKey("center-", CenterVolumeDown_Key, 0x06, 8);
34   addKey("direct", PCInput_Key, 0x0A, 8);
35   addKey("optical", OpticalInput_Key, 0x0B, 8);
36   addKey("coax", DigitalCoaxInput_Key, 0x0C, 8);
37   addKey("vol-", VolumeDown_Key, 0x0E, 8);
38   addKey("power", Power_Key, 0x10, 8);
39   addKey("mute", Mute_Key, 0x16, 8);
40   addKey("effect", Red_Key, 0x1D, 8);
41   addKey("settings", Blue_Key, 0x1F, 8);
42   addKey("vol+", VolumeUp_Key, 0x1A, 8);
43 }