This class includes information on how to translate the device properties for a given device to DMX values.
More...
#include <DMXDevicePatch.h>
|
void | floatToSingle (unsigned char *data, unsigned int address, LumiverseFloat *val) |
| Converts a float value to a single DMX channel of data. min-max -> 0-255. More...
|
|
void | floatToFine (unsigned char *data, unsigned int address, float val) |
| Converts a float value to two DMX channels of data. min-max -> 0 - 65535. More...
|
|
void | toEnum (unsigned char *data, unsigned int address, LumiverseEnum *val) |
| Converts an enum to a single DMX channel of data. More...
|
|
void | RGBRepeat (unsigned char *data, unsigned int address, LumiverseFloat *val, int repeats) |
| Converts a float value to a single DMX channel of data. min-max -> 0-255 and repeats it a number of times, offset by 3 each time. More...
|
|
void | ColorToRGB (unsigned char *data, unsigned int address, LumiverseColor *val) |
| Converts a LumiverseColor to 3 channels of DMX data. More...
|
|
void | ColorToRGBW (unsigned char *data, unsigned int address, LumiverseColor *val) |
| Converts a LumiverseColor to 4 channels of DMX data. More...
|
|
void | ColorToLustrPlus (unsigned char *data, unsigned int address, LumiverseColor *val) |
| Converts a LumiverseColor to 7 channels of DMX data. More...
|
|
void | setDMXVal (unsigned char *data, unsigned int address, unsigned char val) |
| Helper for setting DMX values. More...
|
|
|
unsigned int | m_baseAddress |
| Base address for the device (zero-indexed)
|
|
unsigned int | m_universe |
| Universe number for the device (zero-indexed)
|
|
unsigned int | m_numAddresses |
| Number of addresses this device uses on a DMX network.
|
|
string | m_dmxMapKey |
| Key to get the map that maps device parameters to a start DMX address. More...
|
|
This class includes information on how to translate the device properties for a given device to DMX values.
This information can be loaded from a JSON document while the base address is always set dynamically. Note that the map of parameter to relative DMX address is stored not in this object, but in the DMX Patch. This allows reuse of the patch data for similar instruments.
- See also
- DMXPatch, DMXDevicePatch, patchData
Lumiverse::DMXDevicePatch::DMXDevicePatch |
( |
string |
mapKey, |
|
|
unsigned int |
baseAddress, |
|
|
unsigned int |
universe |
|
) |
| |
Constructs an empty patch.
- Parameters
-
mapKey | Key to lookup the DMX Map |
baseAddress | Base address for the device as a whole |
universe | Universe the device lives in |
void Lumiverse::DMXDevicePatch::ColorToLustrPlus |
( |
unsigned char * |
data, |
|
|
unsigned int |
address, |
|
|
LumiverseColor * |
val |
|
) |
| |
|
private |
void Lumiverse::DMXDevicePatch::ColorToRGB |
( |
unsigned char * |
data, |
|
|
unsigned int |
address, |
|
|
LumiverseColor * |
val |
|
) |
| |
|
private |
Converts a LumiverseColor to 3 channels of DMX data.
This function assumes colors are laid out in standard RGB order.
- Parameters
-
data | DMX universe buffer |
address | Address to write the value to. |
val | LumiverseColor value to convert. |
void Lumiverse::DMXDevicePatch::ColorToRGBW |
( |
unsigned char * |
data, |
|
|
unsigned int |
address, |
|
|
LumiverseColor * |
val |
|
) |
| |
|
private |
Converts a LumiverseColor to 4 channels of DMX data.
Conversion assumes that colors are laid out in standard RGBW order.
- Parameters
-
data | DMX Universe buffer |
address | Address to write the value to |
val | LumiverseColor value to convert |
void Lumiverse::DMXDevicePatch::floatToFine |
( |
unsigned char * |
data, |
|
|
unsigned int |
address, |
|
|
float |
val |
|
) |
| |
|
private |
Converts a float value to two DMX channels of data. min-max -> 0 - 65535.
Corresponds to the FLOAT_TO_FINE and ORI_TO_FINE values of conversionType The first channel is the upper bits (coarse) and the second channel is the lower (fine) The given float must be between 0 and 1 otherwise overflow will occur.
- Parameters
-
data | DMX Universe buffer |
address | First address to write the value to (the coarse bits) |
val | The float value to convert. Must be in the range [0, 1]. |
void Lumiverse::DMXDevicePatch::floatToSingle |
( |
unsigned char * |
data, |
|
|
unsigned int |
address, |
|
|
LumiverseFloat * |
val |
|
) |
| |
|
private |
Converts a float value to a single DMX channel of data. min-max -> 0-255.
Corresponds to the FLOAT_TO_SINGLE value of conversionType
- Parameters
-
data | DMX Universe buffer |
address | Address to write the value to |
LumiverseFloat | value to convert |
unsigned int Lumiverse::DMXDevicePatch::getBaseAddress |
( |
| ) |
|
|
inline |
Gets the base address for the device.
- Returns
- The Device's base address
string Lumiverse::DMXDevicePatch::getDMXMapKey |
( |
| ) |
|
|
inline |
Gets the key for the DMX map this device should use to translate its Lumiverse values to DMX values.
- Returns
- The DMX map key for this patch object.
unsigned int Lumiverse::DMXDevicePatch::getUniverse |
( |
| ) |
|
|
inline |
Gets the universe the device is patched to.
- Returns
- The Device's universe
void Lumiverse::DMXDevicePatch::RGBRepeat |
( |
unsigned char * |
data, |
|
|
unsigned int |
address, |
|
|
LumiverseFloat * |
val, |
|
|
int |
repeats |
|
) |
| |
|
private |
Converts a float value to a single DMX channel of data. min-max -> 0-255 and repeats it a number of times, offset by 3 each time.
This function is meant to assist the programming of fixtures where less precision is required, but still have a large number of channels to deal with.
- Parameters
-
data | DMX Universe buffer |
address | Address to write the value to |
val | LumiverseFloat value to convert |
repeats | Number of times to repeat the writing of the data. |
void Lumiverse::DMXDevicePatch::setBaseAddress |
( |
unsigned int |
newAddress | ) |
|
|
inline |
Sets the base address for the device.
- Parameters
-
newAddress | The new base address for the device |
void Lumiverse::DMXDevicePatch::setDMXVal |
( |
unsigned char * |
data, |
|
|
unsigned int |
address, |
|
|
unsigned char |
val |
|
) |
| |
|
inlineprivate |
Helper for setting DMX values.
Not as helpful for small functions but better to just write it once.
- Parameters
-
data | DMX Universe buffer |
address | Address to write the value to |
DMX | value to write, single byte. |
void Lumiverse::DMXDevicePatch::setUniverse |
( |
unsigned char |
newUniverse | ) |
|
|
inline |
Sets the universe the device is patched to.
- Parameters
-
newUniverse | The new universe to patch the device to. |
void Lumiverse::DMXDevicePatch::toEnum |
( |
unsigned char * |
data, |
|
|
unsigned int |
address, |
|
|
LumiverseEnum * |
val |
|
) |
| |
|
private |
Converts an enum to a single DMX channel of data.
Corresponds to the ENUM value of conversionType
- Parameters
-
data | DMX Universe buffer |
address | First address to write the value to |
val | the LumiverseEnum value to convert. |
void Lumiverse::DMXDevicePatch::updateDMX |
( |
unsigned char * |
data, |
|
|
Device * |
device, |
|
|
map< string, patchData > & |
dmxMap |
|
) |
| |
Given a universe of DMX, update the device.
This function will throw logic errors if the device and the patch don't match up.
- Parameters
-
data | Buffer of 512 bytes representing the universe to update |
device | The Device to pull data from |
dmxMap | Table to DMX Maps to tell this function how to interpret the Device's data. |
string Lumiverse::DMXDevicePatch::m_dmxMapKey |
|
private |
Key to get the map that maps device parameters to a start DMX address.
The actual translation is handled by a function specified by the conversionType enum in the patchData struct. This value can be shared by multiple devices.
The documentation for this class was generated from the following files: