More Keysets
[pierogi] / keysets / canon.cpp
1 #include "canon.h"
2 #include "protocols/lircprotocol.h"
3 #include "protocols/necprotocol.h"
4
5
6 CanonDSLR1::CanonDSLR1(
7   unsigned int index)
8   : PIRKeysetMetaData(
9       "RC 1/5/6 Keyset",
10       Canon_Make,
11       index)
12 {
13 }
14
15
16 void CanonDSLR1::populateProtocol(
17   QObject *guiObject)
18 {
19   if (threadableProtocol)
20   {
21     // Keyset already populated.
22     return;
23   }
24
25   LIRCProtocol *lp = new LIRCProtocol(
26     guiObject, index,
27     550, 5250,
28     550, 7143,
29     100000, true);
30
31   threadableProtocol = lp;
32   lp->setTrailerPulse(550);
33
34   addKey("S", VolumeDown_Key, 0x1, 1); // Open shutter immediately (?)
35   addKey("2S", VolumeUp_Key, 0x0, 1); // Two second delay (?)
36 }
37
38
39 CanonCamcorder1::CanonCamcorder1(
40   unsigned int index)
41   : PIRKeysetMetaData(
42       "Camcorder Keyset 1",
43       Canon_Make,
44       index)
45 {
46 }
47
48
49 void CanonCamcorder1::populateProtocol(
50   QObject *guiObject)
51 {
52   if (threadableProtocol)
53   {
54     // Keyset already populated
55     return;
56   }
57
58   threadableProtocol = new NECProtocol(guiObject, index, true, false);
59
60   setPreData(0x7685, 16);
61
62   addKey("ff", FastForward_Key, 0x00, 8);
63   addKey("play", Play_Key, 0x01, 8);
64   addKey("rew", Rewind_Key, 0x02, 8);
65   addKey("startstop", Unmapped_Key, 0x03, 8); // "remote_set"  ?
66   addKey("pause", Pause_Key, 0x04, 8);
67   addKey("slow", Slow_Key, 0x05, 8);
68   addKey("TAPE-RETURN", Unmapped_Key, 0x06, 8); // "tr"
69   addKey("rec", Record_Key, 0x07, 8);
70   addKey("COUNTER-RESET", Clear_Key, 0x0D, 8); // "cr"
71   addKey("title", Unmapped_Key, 0x0E, 8);
72   addKey("date", Unmapped_Key, 0x0F, 8);
73
74   addKey("fadv", StepForward_Key, 0x10, 8); //"+", "next_frame"
75   addKey("self_timer", Sleep_Key, 0x12, 8);
76   addKey("stop", Stop_Key, 0x17, 8);
77   addKey("display", Info_Key, 0x1B, 8); // "tv_screen"
78   addKey("t", Unmapped_Key, 0x1C, 8); // "ZOOM-T"
79   addKey("w", Unmapped_Key, 0x1D, 8); // "ZOOM-W"
80
81   addKey("up", Up_Key, 0x20, 8);
82   addKey("down", Down_Key, 0x21, 8);
83   addKey("set", Select_Key, 0x24, 8);
84   addKey("menu", Menu_Key, 0x25, 8);
85   addKey("on/off", Power_Key, 0x27, 8); // might be wrong
86   addKey("d.effects", Unmapped_Key, 0x28, 8);
87   addKey("CARD+", Unmapped_Key, 0x2A, 8);
88   addKey("CARD-", Unmapped_Key, 0x2B, 8);
89   addKey("SLIDE-SHOW", Unmapped_Key, 0x2C, 8);
90
91   addKey("PHOTO", Unmapped_Key, 0x30, 8);
92   addKey("data_code", Unmapped_Key, 0x31, 8);
93   addKey("zero_set_memory", Unmapped_Key, 0x32, 8);
94   addKey("audio_dub.", Unmapped_Key, 0x33, 8);
95   addKey("search_select", Memory_Key, 0x34, 8);
96   addKey("fwd", Next_Key, 0x35, 8); // "search_select_forward"
97   addKey("bwd", Previous_Key, 0x36, 8); // "search_select_rewind"
98   addKey("audio_monitor", Audio_Key, 0x39, 8);
99   addKey("st-2", Unmapped_Key, 0x3A, 8);
100   addKey("st-1", Unmapped_Key, 0x3B, 8);
101   addKey("-", StepBack_Key, 0x50, 8); // "prev_frame"
102   addKey("x2", Unmapped_Key, 0x55, 8);
103   addKey("AV-INSERT", Unmapped_Key, 0x5B, 8);
104 }
105
106
107 CanonPowershot1::CanonPowershot1(
108   unsigned int index)
109   : PIRKeysetMetaData(
110       "Powershot Keyset 1",
111       Canon_Make,
112       index)
113 {
114 }
115
116
117 void CanonPowershot1::populateProtocol(
118   QObject *guiObject)
119 {
120   if (threadableProtocol)
121   {
122     // Keyset already populated.
123     return;
124   }
125
126   threadableProtocol = new NECProtocol(guiObject, index, true, true);
127
128   setPreData(0xB1CA, 16);
129
130   addKey("Snap", Select_Key, 0x1F, 8);
131   addKey("ZoomIn", Up_Key, 0x42, 8);
132   addKey("ZoomOut", Down_Key, 0x43, 8);
133   addKey("Right", Right_Key, 0x40, 8);
134   addKey("Left", Left_Key, 0x41, 8);
135   addKey("Multi", Menu_Key, 0x44, 8);
136   addKey("Magnify", Guide_Key, 0x46, 8);
137   addKey("Display", DiscMenu_Key, 0x47, 8);
138 }