15 #include "LumiverseCoreConfig.h"
22 #include "lib/libjson/libjson.h"
23 #include "lib/Eigen/Dense"
36 FocusPalette(
string name,
float pan,
float tilt,
string area,
string system,
string image) :
37 _name(name), _pan(pan), _tilt(tilt), _area(area), _system(system), _image(image) {}
68 Device(
string id,
unsigned int channel,
string type);
78 Device(
string id,
const JSONNode data);
106 std::ostream & operator<< (std::ostream &str) {
116 inline string getId() {
return m_id; }
130 inline void setChannel(
unsigned int newChan) { m_channel = newChan; }
144 inline void setType(
string newType) { m_type = newType; }
155 T* getParam(
string param);
168 bool getParam(
string param,
float& val);
279 bool setParam(
string param,
float val);
292 bool setParam(
string param,
string val,
float val2 = -1.0f);
312 bool setParam(
string param,
string channel,
double val);
324 bool setParam(
string param,
double x,
double y,
double weight = 1.0);
329 bool addFloatParam(
string name,
float val,
float def,
float max = 1.0f,
float min = 0.0f);
334 bool addColorParam(
string name,
int m);
343 bool setColorRGBRaw(
string param,
double r,
double g,
double b,
double weight = 1.0);
351 bool setColorRGB(
string param,
double r,
double g,
double b,
double weight = 1.0,
RGBColorSpace cs =
sRGB);
356 bool setColorHSV(
string param,
double H,
double S,
double V,
double weight = 1.0);
361 bool setColorWeight(
string param,
double weight);
366 bool setRGBRaw(
double r,
double g,
double b,
double weight = 1.0);
388 bool setColorChannel(
string param,
string channel,
double val);
408 bool paramExists(
string param);
420 vector<string> getParamNames();
425 bool metadataExists(
string key);
434 bool getMetadata(
string key,
string& val);
442 string getMetadata(
string key);
451 bool setMetadata(
string key,
string val);
458 void deleteMetadata(
string key);
465 void deleteParameter(
string key);
472 void clearMetadataValues();
479 void clearAllMetadata();
484 size_t numMetadataKeys();
489 vector<string> getMetadataKeyNames();
536 int addParameterChangedCallback(DeviceCallbackFunction func);
548 int addMetadataChangedCallback(DeviceCallbackFunction func);
556 void deleteParameterChangedCallback(
int id);
564 void deleteMetadataChangedCallback(
int id);
572 bool isIdentical(
Device* d);
581 Eigen::Vector3d getGelColor();
598 void deleteFocusPalette(
string name);
603 void setFocusPalette(
string name);
608 vector<string> getFocusPaletteNames();
631 void setId(
string newId) { m_id = newId; }
637 void loadJSON(
const JSONNode data);
645 void loadParams(
const JSONNode data);
652 JSONNode parametersToJSON();
659 JSONNode metadataToJSON();
665 void onParameterChanged();
671 void onMetadataChanged();
734 map<string, FocusPalette>
m_fp;
739 T* Device::getParam(
string param) {
740 return dynamic_cast<T*
>(getParam(param));
Defines an enumeration in Lumiverse.
Definition: LumiverseEnum.h:43
unsigned int getChannel()
Accessor for channel.
Definition: Device.h:123
Utility functions for manipulating LumiverseTypes.
map< int, DeviceCallbackFunction > m_onParameterChangedFunctions
List of functions to run when a parameter is changed. Each function has an int id.
Definition: Device.h:720
This class is a wapper around a variety of different possible data types that might be needed by a De...
Definition: LumiverseType.h:33
This class describes a color.
Definition: LumiverseColor.h:83
A LumiverseType contains information about a Device Parameter.
Definition: LumiverseColorLib.h:30
RGBColorSpace
Selects a RGB color space to use in color conversion functions.
Definition: LumiverseColorLib.h:29
map< int, DeviceCallbackFunction > m_onMetadataChangedFunctions
List of functions to run when a metadata is changed. Each function has an int id. ...
Definition: Device.h:729
function< void(Device *)> DeviceCallbackFunction
Definition: Device.h:525
A Focus Palette is a preset configuration for the pan and tilt of a light.
Definition: Device.h:34
string getId()
Accessor for Device id.
Definition: Device.h:116
InterpolationMode
Sets the interpolation mode when transitioning between two LumiverseEnums.
Definition: LumiverseEnum.h:71
string getType()
Accessor for Device type.
Definition: Device.h:137
bool setParam(string param, LumiverseEnum *val)
Sets a parameter to an enumeration type.
Definition: Device.h:247
unordered_map< string, LumiverseType * > & getRawParameters()
Gets the raw map of parameters to data.
Definition: Device.h:519
Defines an orientation in Lumiverse.
Definition: LumiverseOrientation.h:61
string m_type
Device type name. "Source Four ERS" for example.
Definition: Device.h:692
bool setIntensity(float val)
Proxy for setParam("intensity", val). Assumes the existence of an "intensity" parameter.
Definition: Device.h:371
Contains functions for logging information to console or file.
Stores an enumeration in Lumiverse.
Stores a floating point value in Lumiverse.
Mode
When you select an enumeration, mode determines where in the range the calculated value will fall...
Definition: LumiverseEnum.h:56
A LumiverseColor contains information about a Device Color parameter.
map< string, FocusPalette > m_fp
List of focus palettes known by the device.
Definition: Device.h:734
map< string, string > m_metadata
Map for program-side information.
Definition: Device.h:711
bool setParam(string param, LumiverseColor *val)
Sets a parameter to a color value.
Definition: Device.h:253
void setId(string newId)
Sets the id for the device.
Definition: Device.h:631
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2
void setType(string newType)
Assigns Device type.
Definition: Device.h:144
Defines a float in Lumiverse.
Definition: LumiverseFloat.h:21
bool setParam(string param, LumiverseOrientation *val)
Sets a parameter to a orientation value.
Definition: Device.h:259
A Device in Lumiverse maintains information about a lighting device.
Definition: Device.h:55
unordered_map< string, LumiverseType * > m_parameters
Map for time-varying parameters.
Definition: Device.h:702
bool setParam(string param, LumiverseFloat *val)
Sets a parameter to a floating point value.
Definition: Device.h:241
string m_id
Unique identifier for the device.
Definition: Device.h:681
unsigned int m_channel
Channel number for the fixture. Does not have to be unique.
Definition: Device.h:686
void setChannel(unsigned int newChan)
Assigns channel number.
Definition: Device.h:130