From f21d7d46143f63c39375326ae23b6b1ac1259ce1 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 28 Jun 2019 08:37:15 +0200 Subject: Add more attributes, and add separate properties for RGB vs CMY colour --- src/display.c | 11 +++++++---- src/nanolight.c | 5 +++-- src/nanolight.h | 32 +++++++++++++++++++------------- src/scanout.c | 4 ++-- 4 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/display.c b/src/display.c index cd1f0f4..111e5d4 100644 --- a/src/display.c +++ b/src/display.c @@ -43,7 +43,7 @@ int key_attrs[] = { 0, INTENSITY, /* F1 */ PANTILT, /* F2 */ - COL_CMY, /* F3 */ + COLOUR, /* F3 */ GOBO, /* F4 */ PRISM, /* F5 */ FOCUS, /* F6 */ @@ -52,7 +52,7 @@ int key_attrs[] = { FROST, /* F9 */ GOBO_ROTATE, /* F10 */ PRISM_ROTATE, /* F11 */ - IRIS, /* F12 */ + GOBO_SPIN, /* F12 */ }; @@ -135,14 +135,17 @@ static const char *attr_text(int cls) switch ( cls ) { case INTENSITY : return "Intensity"; case PANTILT : return "Pan/tilt"; - case COL_CMY : return "CMY colour"; - case COL_RGB : return "RGB colour"; + case COLOUR : return "Colour"; case GOBO : return "Gobo"; case PRISM : return "Prism"; case FOCUS : return "Focus"; case ZOOM : return "Zoom"; case IRIS : return "Iris"; case FROST : return "Frost"; + case GOBO_ROTATE : return "Gobo rotate"; + case PRISM_ROTATE : return "Prism rotate"; + case GOBO_SPIN : return "Gobo spin"; + case PRISM_SPIN : return "Prism spin"; } return "(unknown)"; } diff --git a/src/nanolight.c b/src/nanolight.c index cf6114c..45527fd 100644 --- a/src/nanolight.c +++ b/src/nanolight.c @@ -132,9 +132,10 @@ int main(int argc, char *argv[]) /* Set up data structures */ cls.name = "Robe Robin DL7S Profile Mode 1"; - cls.attributes = INTENSITY | COL_CMY | PANTILT | FOCUS | ZOOM + cls.properties = COL_CMY; + cls.attributes = INTENSITY | COLOUR | PANTILT | FOCUS | ZOOM | FROST | IRIS; - cls.attributes16 = INTENSITY | COL_CMY | PANTILT | FOCUS | ZOOM + cls.attributes16 = INTENSITY | COLOUR | PANTILT | FOCUS | ZOOM | FROST | IRIS; cls.intensity_offset = 49; diff --git a/src/nanolight.h b/src/nanolight.h index b896a57..85f1d3a 100644 --- a/src/nanolight.h +++ b/src/nanolight.h @@ -26,23 +26,29 @@ #include /* Fixture attributes */ -#define INTENSITY (1) -#define COL_RGB (2) -#define COL_CMY (4) -#define PANTILT (8) -#define FOCUS (16) -#define ZOOM (32) -#define FROST (64) -#define IRIS (128) -#define SHUTTERS (256) -#define GOBO (512) -#define GOBO_ROTATE (1024) -#define PRISM (2048) -#define PRISM_ROTATE (4096) +#define INTENSITY (1<<0) +#define COLOUR (1<<1) +#define PANTILT (1<<2) +#define FOCUS (1<<3) +#define ZOOM (1<<4) +#define FROST (1<<5) +#define IRIS (1<<6) +#define SHUTTERS (1<<7) +#define GOBO (1<<8) +#define GOBO_ROTATE (1<<9) +#define GOBO_SPIN (1<<10) +#define PRISM (1<<11) +#define PRISM_ROTATE (1<<12) +#define PRISM_SPIN (1<<13) + +/* Fixture properties */ +#define COL_RGB (1<<0) +#define COL_CMY (1<<1) struct fixture_class { char *name; + int properties; int attributes; int attributes16; diff --git a/src/scanout.c b/src/scanout.c index 53e5948..f0e6de3 100644 --- a/src/scanout.c +++ b/src/scanout.c @@ -87,7 +87,7 @@ int scanout_all(struct nanolight *nl) cls->attributes16 & PANTILT); } - if ( cls->attributes & COL_CMY ) { + if ( (cls->attributes & COLOUR) && (cls->properties & COL_CMY) ) { set_val(dmx, fix->base_addr, cls->cyan_offset, fix->cyan, cls->attributes16 & COL_CMY); set_val(dmx, fix->base_addr, cls->magenta_offset, fix->magenta, @@ -96,7 +96,7 @@ int scanout_all(struct nanolight *nl) cls->attributes16 & COL_CMY); } - if ( cls->attributes & COL_RGB ) { + if ( (cls->attributes & COLOUR) && (cls->properties & COL_RGB) ) { set_val(dmx, fix->base_addr, cls->red_offset, fix->red, cls->attributes16 & COL_RGB); set_val(dmx, fix->base_addr, cls->green_offset, fix->green, -- cgit v1.2.3