Lumiverse  2.5
A framework for creating lighting control applications
Public Member Functions | Protected Attributes | List of all members
Lumiverse::DMXInterface Class Referenceabstract

Provides a common interface to various DMX devices. More...

#include <DMXInterface.h>

Public Member Functions

virtual ~DMXInterface ()
 Virtual destructor yay.
 
virtual void init ()=0
 Initalizes the interface. More...
 
virtual void sendDMX (unsigned char *data, unsigned int universe)=0
 Sends DMX through the interface. More...
 
virtual void closeInt ()=0
 Closes the connection to the DMX device.
 
virtual void reset ()=0
 Resets the interface. More...
 
virtual JSONNode toJSON ()=0
 Returns the JSON representation of the interface. More...
 
virtual string getInterfaceType ()=0
 Returns the name of the interface's type. More...
 
string getInterfaceName ()
 Returns the name of this DMX interface. More...
 
string getInterfaceId ()
 Returns the ID of this DMX interface. More...
 
void setInterfaceId (string id)
 Sets the interface ID. More...
 

Protected Attributes

string m_ifaceName
 Name of the DMX interface.
 
string m_ifaceId
 Unique string identifying this particular interface.
 

Detailed Description

Provides a common interface to various DMX devices.

Adding a new type of DMX device should be simple. Just derive from this class and implement the required functions. Interfaces for a DMX system are expected to take a 512 byte buffer and send it across the network. Interfaces should be able to be initialized, closed and reset. Any additional functions must be handled specifically by subclasses.

Member Function Documentation

string Lumiverse::DMXInterface::getInterfaceId ( )
inline

Returns the ID of this DMX interface.

Returns
Unique identifier for this interface
string Lumiverse::DMXInterface::getInterfaceName ( )
inline

Returns the name of this DMX interface.

Note that name is not the same as Interface Type. The intent behind name is to allow users to choose a common name to display for their interfaces and still be able to use unique IDs to differentiate them.

Returns
Human-readable name for this particular interface.
virtual string Lumiverse::DMXInterface::getInterfaceType ( )
pure virtual

Returns the name of the interface's type.

The type of the interface referrs to what kind of device it is. So for a DMX Pro 2 Interface, this would return "DMXPro2Interface"

Returns
String containing the type of the interface.
virtual void Lumiverse::DMXInterface::init ( )
pure virtual

Initalizes the interface.

This function can throw exceptions if something comes up during the initialization stage.

virtual void Lumiverse::DMXInterface::reset ( )
pure virtual

Resets the interface.

Is essentially a disconnect then reconnect and any other refresher code needed.

virtual void Lumiverse::DMXInterface::sendDMX ( unsigned char *  data,
unsigned int  universe 
)
pure virtual

Sends DMX through the interface.

Also includes the universe number, for devices that may manage more than one universe or need to know the universe number. NOTE: The universe passed in here is ZERO-INDEXED as it is in the DMXPatch class.

Parameters
dataData to send across the Universe
universeUniverse number to send the DMX to
void Lumiverse::DMXInterface::setInterfaceId ( string  id)
inline

Sets the interface ID.

Parameters
idNew interface ID
virtual JSONNode Lumiverse::DMXInterface::toJSON ( )
pure virtual

Returns the JSON representation of the interface.

Returns
JSON node containing the data for this DMXInterface

The documentation for this class was generated from the following file: