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