Chanmod

ILxChannelModItem

class ILxChannelModItem

Public Functions

LxResult Allocate(LXtObjectID self, LXtObjectID cmod, LXtObjectID eval, LXtObjectID item, void **ppvData)
unsigned int Flags(LXtObjectID self, LXtObjectID item, unsigned int index)
LxResult Evaluate(LXtObjectID self, LXtObjectID cmod, LXtObjectID attr, void *data)
void Cleanup(LXtObjectID self, void *data)

ILxChannelModifier

class ILxChannelModifier

Public Functions

LxResult AddInput(LXtObjectID self, LXtObjectID item, unsigned int index)
LxResult AddOutput(LXtObjectID self, LXtObjectID item, unsigned int index)
LxResult AddTime(LXtObjectID self)
LxResult InputCount(LXtObjectID self, unsigned int index, unsigned int *nInputs)
LxResult OutputCount(LXtObjectID self, unsigned int index, unsigned int *nOutputs)
LxResult ReadInputFloat(LXtObjectID self, LXtObjectID attr, unsigned int inputIndex, double *dVal)
LxResult ReadInputFloatByIndex(LXtObjectID self, LXtObjectID attr, unsigned int inputIndex, unsigned int linkIndex, double *dVal)
LxResult ReadInputAngle(LXtObjectID self, LXtObjectID attr, unsigned int inputIndex, double *dVal)
LxResult ReadInputInt(LXtObjectID self, LXtObjectID attr, unsigned int inputIndex, int *iVal)
LxResult ReadInputIntByIndex(LXtObjectID self, LXtObjectID attr, unsigned int inputIndex, unsigned int linkIndex, int *iVal)
LxResult ReadInputVal(LXtObjectID self, LXtObjectID attr, unsigned int inputIndex, void **val)
LxResult ReadInputValByIndex(LXtObjectID self, LXtObjectID attr, unsigned int inputIndex, unsigned int linkIndex, void **val)
LxResult WriteOutputFloat(LXtObjectID self, LXtObjectID attr, unsigned int outputIndex, double dVal)
LxResult WriteOutputInt(LXtObjectID self, LXtObjectID attr, unsigned int outputIndex, int iVal)
LxResult WriteOutputVal(LXtObjectID self, LXtObjectID attr, unsigned int outputIndex, void **val)
LxResult WriteOutputValByIndex(LXtObjectID self, LXtObjectID attr, unsigned int outputIndex, unsigned int linkIndex, void **val)

ILxChannelModManager

class ILxChannelModManager

Public Functions

LxResult Define(LXtObjectID self, LXtObjectID cmod)

The channel modifier manager is defined as an interface on the package implementing the item type. The manager provides methods to describe the channels it wants to use, and to allocate the actual operator object that performs the evaluation. The Define() method is passed a ChannelModSetup interface and is expected to call AddChannel() or AddTime() methods on that object to add the channels it wants for reading and writing. The names are all for channels on items of this type, and may be set as inputs or outputs.

LxResult Allocate(LXtObjectID self, LXtObjectID cmod, void **ppvObj)

The Allocate() method is also passed the setup object and will allocate the operator for this channel modifier.


LXfCHMOD_INPUT

Channel Modifiers are represented graphically in the Schematic viewport as nodes with input and output connectors for linking the channels with items and other Channel Modifiers via Channel Links. The flags passed with each channel provide information to the Schematic as to the role of the channels belonging to the modifier. For any given channel on the item the function can return some combination of the following flags. Note that zero is also a valid flag value and indicates a channel that’s used as input but doesn’t need to be added to schematic by default.

  • LXfCHMOD_OUTPUT This flag is used to inform the Schematic that a channel is to be represented as an output from the modifier and will be drawn with a Channel Link connector on the righthand side of the node. Channels specified as outputs will be automatically added to the node when the modifier is added to the Schematic view.

  • LXfCHMOD_INPUT Since all channels are treated as inputs by default this flag is used by the Schematic to identify ‘primary’ inputs that will be automatically added to a Channel Modifier node when it is first added to the Schematic.

  • LXfCHMOD_MULTILINK This flag is used in combination with the input flag to specify that an input channel can accept multiple Channel Links connected to it. If this flag is not set then the Schematic will prevent more than one link being made to the channel.

  • LXfCHMOD_OUTPUT

  • LXfCHMOD_MULTILINK

ILxChannelModOperator

class ILxChannelModOperator

Public Functions

LxResult Evaluate(LXtObjectID self)

Once set up, the operator will be called to read inputs and set outputs. Ideally there will be no reason to do any queries during the evaluation.

ILxChannelModSetup

class ILxChannelModSetup

Public Functions

LxResult AddChannel(LXtObjectID self, const char *name, unsigned int flags)

This interface provides methods for setting up the desired modifier channels and linking to their values. This function is used to assign a channel as part of the modifier operation, and can only be used from the Define() method.

LxResult AddTime(LXtObjectID self)

Channel modifiers that need to know the current evaluation time can use the following function to add time as an input to the modifier. This can be read back in the Evaluate function as a floating point value.

LxResult ReadValue(LXtObjectID self, const char *name, void **ppvObj)

Reading and writing is done by allocating Value and ValueArray interfaces from the setup object. These functions are called duirng the allocation stage for the operator, and return persistent objects for use in evaluation. This returns a single Value for a given input index. If there are multiple inputs linked to this channel only the first is returned.

LxResult ReadArray(LXtObjectID self, const char *name, void **ppvObj)

This returns multiple values for an input index as a ValueArray object. The individual input links can be examined and processed separately.

LxResult ReadTimeValue(LXtObjectID self, void **ppvObj)

Time is read as a value as well.

LxResult WriteValue(LXtObjectID self, const char *name, void **ppvObj)

This returns a single Value object for a given output index. There is no ability to individually address multiple outputs. If this is a matrix channel, then the value object can be queried for a Matrix interface and the output set using those methods.

LXtObjectID GetEvaluation(LXtObjectID self)

During channel binding the operator can also get a peek at the ILxEvalautionID for the modifier.