aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/visca.h
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-09-19 01:09:43 +0200
committercbdev <cb@cbcdn.com>2020-09-19 01:09:43 +0200
commit7d3bde27e412ebb6783c2c94f52a08f0e8d8ba49 (patch)
tree12357a9dac252d816002f173c8a67abc2ce71bc6 /backends/visca.h
parente96ca85d8febf559817b43066ba16c8441ba391b (diff)
downloadmidimonster-7d3bde27e412ebb6783c2c94f52a08f0e8d8ba49.tar.gz
midimonster-7d3bde27e412ebb6783c2c94f52a08f0e8d8ba49.tar.bz2
midimonster-7d3bde27e412ebb6783c2c94f52a08f0e8d8ba49.zip
Fix VISCA channel parser
Diffstat (limited to 'backends/visca.h')
-rw-r--r--backends/visca.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/backends/visca.h b/backends/visca.h
index 481f5c7..160398d 100644
--- a/backends/visca.h
+++ b/backends/visca.h
@@ -22,10 +22,12 @@ typedef struct /*_ptz_instance_data*/ {
} ptz_instance_data;
enum /*ptz_channels*/ {
- pan = 0,
- tilt,
- panspeed,
+ //channels with a name that includes another channels as prefix
+ //go first so the channel matching logic works
+ panspeed = 0,
tiltspeed,
+ pan,
+ tilt,
zoom,
focus,
focus_mode,
@@ -62,10 +64,10 @@ static struct {
size_t offset; //channel value = normalised * range - offset
ptz_channel_set set;
} ptz_channels[] = {
- [pan] = {"pan", 15, {0x80, 0x01, 0x06, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF}, 0, 0x990 * 2, 0x990, ptz_set_pantilt},
- [tilt] = {"tilt", 15, {0x80, 0x01, 0x06, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF}, 0, 0x510 * 2, 0x510, ptz_set_pantilt},
[panspeed] = {"panspeed", 0, {0}, 0x01, 0x18, 0, ptz_set_ptspeed},
[tiltspeed] = {"tiltspeed", 0, {0}, 0x01, 0x14, 0, ptz_set_ptspeed},
+ [pan] = {"pan", 15, {0x80, 0x01, 0x06, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF}, 0, 0x990 * 2, 0x990, ptz_set_pantilt},
+ [tilt] = {"tilt", 15, {0x80, 0x01, 0x06, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF}, 0, 0x510 * 2, 0x510, ptz_set_pantilt},
[zoom] = {"zoom", 9, {0x80, 0x01, 0x04, 0x47, 0, 0, 0, 0, 0xFF}, 0, 0x4000, 0, ptz_set_zoom},
[focus] = {"focus", 9, {0x80, 0x01, 0x04, 0x48, 0, 0, 0, 0, 0xFF}, 0, 0x4000, 0, ptz_set_focus},
[focus_mode] = {"autofocus", 6, {0x80, 0x01, 0x04, 0x38, 0, 0xFF}, 0, 1, 0, ptz_set_focus_mode},