Vuo  0.4.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
Node Methods: Stateful

Description

Setup, event handler, and teardown methods to be implemented by stateful node classes.

Functions

struct nodeInstanceDatanodeInstanceInit (...)
 Called when a new instance of the node class is created.
 
void nodeInstanceCallbackStart (...)
 Called just after nodeInstanceInit() and each time the composition is updated during live coding.
 
void nodeInstanceEvent (...)
 Called each time this node instance receives an event.
 
void nodeInstanceCallbackStop (struct nodeInstanceData *const context)
 Called each time the composition is updated during live coding and just before nodeInstanceFini().
 
void nodeInstanceFini (struct nodeInstanceData *const context)
 Called when the specified node instance is no longer needed.
 

Function Documentation

void nodeInstanceCallbackStart (   ...)

Called just after nodeInstanceInit() and each time the composition is updated during live coding.

The implementation may start any dispatch sources or event loops that use VuoOutputTrigger functions as callbacks.

This function is optional.

Parameter decorations should include at least:

Parameter decorations may include:

  • VuoInputData — This argument has the initial (constant or default) value of the input port, before it has received any events.
  • VuoOutputTrigger — Stateful nodes may store references to trigger functions in their instance data, in order to generate events at any time.
void nodeInstanceCallbackStop ( struct nodeInstanceData *const  context)

Called each time the composition is updated during live coding and just before nodeInstanceFini().

The implementation should stop all VuoOutputTrigger callbacks started in nodeInstanceCallbackStart() or elsewhere. Any VuoOutputTrigger functions stored in instance data become invalid after this function returns.

This function is optional.

void nodeInstanceEvent (   ...)

Called each time this node instance receives an event.

Parameter decorations should include at least:

Parameter decorations may include:

void nodeInstanceFini ( struct nodeInstanceData *const  context)

Called when the specified node instance is no longer needed.

The implementation should close any services opened in nodeInstanceInit() or elsewhere.

struct nodeInstanceData* nodeInstanceInit (   ...)
read

Called when a new instance of the node class is created.

The implementation should allocate, initialize, register, and return whatever instance data is required. It may open services (file, network port, ...).

Parameter decorations may include:

  • VuoInputData — This argument has the initial (constant or default) value of the input port, before it has received any events.