Vuo  2.0.0
Macros | Typedefs | Functions | Variables
module.h File Reference

Description

Prototypes for node class, type, and library module implementations.

Definition in file module.h.

Go to the source code of this file.

Macros

#define VUO_STRINGIFY(...)   #__VA_ARGS__
 Creates a C string from raw text (saves having to doublequote-escape and/or use backslashes). More...
 
#define VuoModuleMetadata(...)   extern const char *moduleDetails; const char *moduleDetails = #__VA_ARGS__
 Name, version, and behavior information to be defined by node classes, port types, and library modules. More...
 
#define DISPATCH_RETURNS_RETAINED_BLOCK
 Disable DISPATCH_RETURNS_RETAINED_BLOCK, which emits warnings on Mac OS 10.10. More...
 
#define VuoJson_getObjectValue(type, js, key, ...)
 If js is a JSON object that has key, this macro decodes key as type and returns it. More...
 
#define VuoType_returnInequality(type, a, b)
 Compares using the specified type's Vuo*_isLessThan() method, returning if not equal, or falling through if equal. More...
 

Typedefs

typedef void(* VuoCompositionFiniCallback) (void)
 Callback prototype for VuoAddCompositionFiniCallback(). More...
 

Functions

const char * VuoGetWorkingDirectory (void)
 Returns the directory that nodes should use to resolve relative paths. More...
 
pid_t VuoGetRunnerPid (void)
 Returns the process ID of the runner that started the composition. More...
 
void VuoStopComposition (void)
 Asynchronously stops the composition. More...
 
void VuoStopCurrentComposition (void)
 Asynchronously stops the composition. More...
 
void VuoAddCompositionFiniCallback (VuoCompositionFiniCallback fini)
 Registers a callback to be invoked when the composition is shutting down, after nodeInstanceFini() has been called for all nodes. More...
 
void VuoDisableTermination (void)
 Temporarily disables automatic termination. More...
 
void VuoEnableTermination (void)
 Resumes automatic termination after a call to VuoDisableTermination(). More...
 
bool VuoShouldShowSplashWindow (void)
 Returns true if this composition should show the Vuo Community Edition splash window. More...
 
bool VuoProcessorSupportsAVX2 (void)
 Returns true if the current (runtime) processor supports Intel AVX2. More...
 

Variables

const int VuoGraphicsWindowDefaultWidth
 The standard Vuo graphics window width, in points. More...
 

Macro Definition Documentation

◆ DISPATCH_RETURNS_RETAINED_BLOCK

#define DISPATCH_RETURNS_RETAINED_BLOCK

Disable DISPATCH_RETURNS_RETAINED_BLOCK, which emits warnings on Mac OS 10.10.

https://b33p.net/kosada/node/9139

Definition at line 117 of file module.h.

◆ VUO_STRINGIFY

#define VUO_STRINGIFY (   ...)    #__VA_ARGS__

Creates a C string from raw text (saves having to doublequote-escape and/or use backslashes).

Definition at line 20 of file module.h.

◆ VuoJson_getObjectValue

#define VuoJson_getObjectValue (   type,
  js,
  key,
  ... 
)

If js is a JSON object that has key, this macro decodes key as type and returns it.

Otherwise, returns a default value (the last argument).

This may be useful for implementing Vuo*_makeFromJson() methods for compound types.

Example:
json_object *js = json_object_new_object();
json_object_object_add(js, "answer", json_object_new_double(42));
myObject.answer = VuoJson_getObjectValue(VuoReal, js, "answer", 0));
Changed in Vuo 2.0.0:
New.

Definition at line 206 of file module.h.

◆ VuoType_returnInequality

#define VuoType_returnInequality (   type,
  a,
 
)

Compares using the specified type's Vuo*_isLessThan() method, returning if not equal, or falling through if equal.

This may be useful for implementing Vuo*_isLessThan() methods for compound types.

Example:
VuoType_returnInequality(VuoText, myObject.question, thatObject.question);
VuoType_returnInequality(VuoReal, myObject.answer, thatObject.answer);
Changed in Vuo 2.0.0:
New.

Definition at line 230 of file module.h.

Typedef Documentation

◆ VuoCompositionFiniCallback

typedef void(* VuoCompositionFiniCallback) (void)

Callback prototype for VuoAddCompositionFiniCallback().

Definition at line 124 of file module.h.

Function Documentation

◆ VuoAddCompositionFiniCallback()

void VuoAddCompositionFiniCallback ( VuoCompositionFiniCallback  fini)

Registers a callback to be invoked when the composition is shutting down, after nodeInstanceFini() has been called for all nodes.

VuoCompositionFiniCallbacks are not called during livecoding reloads.

Definition at line 104 of file libmodule.c.

◆ VuoDisableTermination()

void VuoDisableTermination ( void  )

Temporarily disables automatic termination.

When a composition is asked to shut down, a watchdog timer waits a few seconds then force-quits if it hasn't cleanly shut down by then. This disables that watchdog.

Call this before entering a section where it would be undesirable to have the composition automatically force-quit, such as when saving a movie file that needs to be finalized.

When the work is over, call VuoEnableTermination().

Definition at line 119 of file libmodule.c.

◆ VuoEnableTermination()

void VuoEnableTermination ( void  )

Resumes automatic termination after a call to VuoDisableTermination().

Definition at line 131 of file libmodule.c.

◆ VuoGetRunnerPid()

pid_t VuoGetRunnerPid ( void  )

Returns the process ID of the runner that started the composition.

Definition at line 69 of file libmodule.c.

◆ VuoGetWorkingDirectory()

const char* VuoGetWorkingDirectory ( void  )

Returns the directory that nodes should use to resolve relative paths.

Returns the directory that nodes should use to resolve relative paths.

The returned string remains owned by this function; the caller should not modify or free it.

Definition at line 43 of file libmodule.c.

◆ VuoProcessorSupportsAVX2()

bool VuoProcessorSupportsAVX2 ( void  )

Returns true if the current (runtime) processor supports Intel AVX2.

Definition at line 159 of file libmodule.c.

◆ VuoShouldShowSplashWindow()

bool VuoShouldShowSplashWindow ( void  )

Returns true if this composition should show the Vuo Community Edition splash window.

Definition at line 143 of file libmodule.c.

◆ VuoStopComposition()

void VuoStopComposition ( void  )

Asynchronously stops the composition.

Definition at line 82 of file libmodule.c.

◆ VuoStopCurrentComposition()

void VuoStopCurrentComposition ( void  )

Asynchronously stops the composition.

VuoStopComposition() is typically preferable to this function, since this function doesn't handle multiple compositions running in the process.

Definition at line 94 of file libmodule.c.

Variable Documentation

◆ VuoGraphicsWindowDefaultWidth

const int VuoGraphicsWindowDefaultWidth

The standard Vuo graphics window width, in points.

Changed in Vuo 2.0.0:
New.

Definition at line 16 of file libmodule.c.