Vuo  0.8.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Enumerations

Description

Parameter decorations to be used by node classes.

Each parameter of nodeEvent(), nodeInstanceEvent(), and other node class functions refers to one of the node's ports or the node's instance data. This is indicated by its decoration.

Macros

#define VuoInstanceData(type)
 Use this to decorate parameters referring to a stateful node's instance data.
 
#define VuoInputData(type,...)
 Use this to decorate parameters referring to the data part of a data-and-event input port.
 
#define VuoInputEvent(eventBlocking, name,...)
 Use this to decorate parameters referring to an event-only input port or the event part of a data-and-event input port.
 
#define VuoOutputData(type)
 Use this to decorate parameters referring to the data part of a data-and-event output port.
 
#define VuoOutputEvent(name)
 Use this to decorate parameters referring to an event-only output port or the event part of a data-and-event output port.
 
#define VuoOutputTrigger(name, type,...)
 Use this to decorate parameters referring to a trigger output port.
 

Enumerations

enum  VuoPortEventBlocking { VuoPortEventBlocking_None, VuoPortEventBlocking_Door, VuoPortEventBlocking_Wall }
 Options for input ports to block events. More...
 
enum  VuoPortEventThrottling { VuoPortEventThrottling_Enqueue, VuoPortEventThrottling_Drop }
 Options for trigger ports to throttle events when triggers are firing events faster than the composition can process them. More...
 

Macro Definition Documentation

#define VuoInputData (   type,
  ... 
)

Use this to decorate parameters referring to the data part of a data-and-event input port.

The parameter's name becomes the port name.

When this parameter's function is called, the argument passed will be a value of type type that holds the input port's data.

If type is heap data (a pointer), the parameter's function should not modify the heap data. See Developing Node Classes for more information.

Parameters
typeThe port type. See Built-in Types.
...Optionally, a JSON object specification containing additional details about the data, such as its default value. The "default" key is recognized for all port types, and should have the format accepted by the port type's MyType_valueFromJson() function. The "defaults" key is recognized for generic port types; its value should be a JSON object in which each key is a specialized port type name and each value has the format accepted by that port type's MyType_valueFromJson() function. Additional keys may be recognized by the port type's input editor (see Developing an Input Editor).
Example:
void nodeEvent(VuoInputData(VuoInteger,{"default":60,"suggestedMin":0,"suggestedMax":127}) noteNumber);
#define VuoInputEvent (   eventBlocking,
  name,
  ... 
)

Use this to decorate parameters referring to an event-only input port or the event part of a data-and-event input port.

When this parameter's function is called, the argument passed will be a bool that is true if the port received an event.

For an event-only port, the parameter's name becomes the port name.

Parameters
eventBlockingA value of type VuoPortEventBlocking, indicating the port's event-blocking behavior.
nameThe identifier of the corresponding data port, or blank if this is intended to be an event-only input port.
...Optionally, a JSON object specification containing additional details about the event. Currently, the only supported key is "hasPortAction"; its value should be a boolean.
Example:
void nodeEvent(VuoInputData(VuoInteger,"0") seconds, VuoInputEvent(VuoPortEventBlocking_Wall,seconds) secondsEvent);
Example:
#define VuoInstanceData (   type)

Use this to decorate parameters referring to a stateful node's instance data.

When this parameter's function is called, the argument passed will be a pointer to the instance data created by nodeInstanceEvent().

Parameters
typeThe instance data's C type.
Example:
void nodeInstanceEvent(VuoInstanceData(struct nodeInstanceData) ctx);
#define VuoOutputData (   type)

Use this to decorate parameters referring to the data part of a data-and-event output port.

When this parameter's function is called, the argument passed will be a value of type type* that points to the output port's data. Set this data to set the output port's value.

The parameter's name becomes the port name.

If type is heap data (a pointer), the node should not modify the heap data after the node function returns. See Developing Node Classes for more information.

Parameters
typeThe port type. See Built-in Types.
Example:
void nodeEvent(VuoOutputData(VuoInteger) seconds);
#define VuoOutputEvent (   name)

Use this to decorate parameters referring to an event-only output port or the event part of a data-and-event output port.

When this parameter's function is called, the argument passed will be a bool*. Set this to true if an event should be sent through the output port. However, if any input port with the VuoPortEventBlocking_None option received an event, then an event will be sent through the output port regardless of this parameter's value.

For an event-only port, the parameter's name becomes the port name.

Parameters
nameThe identifier of the corresponding data port, or blank if this is intended to be an event-only output port.
Example:
void nodeEvent(VuoOutputData(VuoInteger) seconds, VuoOutputEvent(seconds) secondsEvent);
Example:
void nodeEvent(VuoOutputEvent() started);
#define VuoOutputTrigger (   name,
  type,
  ... 
)

Use this to decorate parameters referring to a trigger output port.

When this parameter's function is called, the argument passed will be a callback function. Call the function to fire an event through the trigger port.

Parameters
nameThe name of the trigger port.
typeThe port type, or void for an event-only trigger port. See Built-in Types.
...Optionally, a VuoPortEventThrottling value.
Example:
void nodeEvent(VuoOutputTrigger(started,void))
{
// Fire an event without any data.
started();
}
Example:
void nodeEvent(VuoOutputTrigger(didSomething,VuoInteger))
{
// Fire an event with stack data.
didSomething(5);
}
Example:
void nodeEvent(VuoOutputTrigger(didSomething,VuoText))
{
// Fire an event with heap data.
VuoText t = VuoText_make("hello");
didSomething(t);
}

Enumeration Type Documentation

Options for input ports to block events.

Enumerator
VuoPortEventBlocking_None 

An event received by this input port is never blocked.

It always flows to all non-trigger output ports.

VuoPortEventBlocking_Door 

An event received by this input port may or may not be blocked.

Although it always flows to the "done" port, it may or may not flow to any other non-trigger output port.

VuoPortEventBlocking_Wall 

An event received by this input port is always blocked.

Although it always flows to the "done" port, it never flows to any other output port.

Options for trigger ports to throttle events when triggers are firing events faster than the composition can process them.

Enumerator
VuoPortEventThrottling_Enqueue 

An event fired by this port will eventually reach downstream nodes, waiting if necessary for previous events to flow through the composition.

VuoPortEventThrottling_Drop 

An event fired by this port will be dropped (not transmitted to any nodes downstream of the trigger port) if it would otherwise have to wait for previous events to flow through the composition.