Vuo  1.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
VuoRuntimeHelper.cc File Reference

Description

VuoRuntimeHelper implementation.

Functions

unsigned long vuoGetNextEventId (void)
 Returns a unique event ID.
 
void vuoAddNodeContext (const char *nodeIdentifier, struct NodeContext *nodeContext)
 Registers a node context for the node identifier.
 
struct NodeContextvuoGetNodeContext (const char *nodeIdentifier)
 Returns the node context registered for the node identifier, or null if none is found.
 
void * vuoGetDataForPort (const char *compositionIdentifier, const char *portIdentifier)
 Returns the data field in a port's context, given the port's identifier.
 
dispatch_semaphore_t vuoGetNodeSemaphoreForPort (const char *compositionIdentifier, const char *portIdentifier)
 Returns the semaphore field in a node's context, given the identifier of a port on the node.
 
unsigned long vuoGetNodeIndexForPort (const char *compositionIdentifier, const char *portIdentifier)
 Returns the numerical index for a node, given the identifier of a port on the node.
 
unsigned long vuoGetTypeIndexForPort (const char *compositionIdentifier, const char *portIdentifier)
 Returns the numerical index for a port's type, given the port's identifier.
 
void vuoAddPortIdentifier (const char *compositionIdentifier, const char *portIdentifier, void *data, dispatch_semaphore_t nodeSemaphore, unsigned long nodeIndex, unsigned long typeIndex)
 Stores information about the port, indexed on the port's identifier, so it can be efficiently retrieved later.
 
bool isNodeInBothCompositions (const char *nodeIdentifier)
 Returns true if the node is found in both the old and the new composition, when replacing compositions for live coding.
 
graph_topenGraphvizGraph (const char *graphString)
 Returns a Graphviz graph constructed from the given Graphviz-format string.
 
void closeGraphvizGraph (graph_t *graph)
 Cleans up a Graphviz graph when it is no longer in use.
 
static void mapFromReplacementNodeAndPort (const char *newNodeIdentifier, const char *newPortIdentifier, char **oldNodeIdentifier, char **oldPortIdentifier)
 If the new node and port have a mapping from the old composition, when replacing compositions for live coding, finds the old node and port that they map from.
 
const char * getConstantValueFromGraphviz (graph_t *graph, const char *node, const char *port)
 Returns the constant value of the input port in the serialized composition, or null if it is not found.
 
char * vuoTranscodeToGraphvizIdentifier (const char *originalString)
 Replaces '"' with '"' and '\' with '\' in a string.
 
char * vuoConcatenateStrings2 (const char *s0, const char *s1)
 Returns the strings appended in order.
 
char * vuoConcatenateStrings3 (const char *s0, const char *s1, const char *s2)
 Returns the strings appended in order.
 
char * vuoConcatenateStrings (const char **strings, size_t stringCount)
 Returns the strings appended in order.
 

Variables

bool isPaused = false
 True if node execution is currently paused.
 
unsigned long vuoLastEventId = 0
 The ID most recently assigned to any event, composition-wide. Used to generate a unique ID for each event.
 
static map< string, struct
NodeContext * > 
nodeContextForIdentifier
 A registry of all NodeContext values in the running composition.
 
char * vuoTopLevelCompositionIdentifier
 The key of the top-level composition in nodeContextForIdentifier.
 
static map< string, map
< string, void * > > 
dataForPort
 The data field in the port's context, indexed by composition and port identifier.
 
static map< string, map
< string, dispatch_semaphore_t > > 
nodeSemaphoreForPort
 The semaphore field in the node's context, indexed by composition and port identifier.
 
static map< string, map
< string, unsigned long > > 
nodeIndexForPort
 The index for a node, indexed by composition and port identifier.
 
static map< string, map
< string, unsigned long > > 
typeIndexForPort
 The index for the port's type, indexed by composition and port identifier.
 
char * compositionDiff = NULL
 Differences between the old and new composition, when replacing compositions for live coding.
 
gvplugin_library_t gvplugin_dot_layout_LTX_library
 Reference to the statically-built Graphviz Dot library.
 
gvplugin_library_t gvplugin_core_LTX_library
 Reference to the statically-built Graphviz core library.
 
static GVC_t * graphvizContext = NULL
 The context used when working with a Graphviz graph.
 

Function Documentation

void closeGraphvizGraph ( graph_t graph)

Cleans up a Graphviz graph when it is no longer in use.

const char* getConstantValueFromGraphviz ( graph_t graph,
const char *  node,
const char *  port 
)

Returns the constant value of the input port in the serialized composition, or null if it is not found.

The input port is looked up from the Graphviz graph, using any mappings of old-to-new nodes and ports in the composition diff.

bool isNodeInBothCompositions ( const char *  nodeIdentifier)

Returns true if the node is found in both the old and the new composition, when replacing compositions for live coding.

This needs to be kept in sync with VuoCompilerComposition::diffAgainstOlderComposition().

static void mapFromReplacementNodeAndPort ( const char *  newNodeIdentifier,
const char *  newPortIdentifier,
char **  oldNodeIdentifier,
char **  oldPortIdentifier 
)
static

If the new node and port have a mapping from the old composition, when replacing compositions for live coding, finds the old node and port that they map from.

This needs to be kept in sync with VuoCompilerComposition::diffAgainstOlderComposition().

graph_t* openGraphvizGraph ( const char *  graphString)

Returns a Graphviz graph constructed from the given Graphviz-format string.

void vuoAddNodeContext ( const char *  nodeIdentifier,
struct NodeContext nodeContext 
)

Registers a node context for the node identifier.

void vuoAddPortIdentifier ( const char *  compositionIdentifier,
const char *  portIdentifier,
void *  data,
dispatch_semaphore_t  nodeSemaphore,
unsigned long  nodeIndex,
unsigned long  typeIndex 
)

Stores information about the port, indexed on the port's identifier, so it can be efficiently retrieved later.

char* vuoConcatenateStrings ( const char **  strings,
size_t  stringCount 
)

Returns the strings appended in order.

char* vuoConcatenateStrings2 ( const char *  s0,
const char *  s1 
)

Returns the strings appended in order.

char* vuoConcatenateStrings3 ( const char *  s0,
const char *  s1,
const char *  s2 
)

Returns the strings appended in order.

void* vuoGetDataForPort ( const char *  compositionIdentifier,
const char *  portIdentifier 
)

Returns the data field in a port's context, given the port's identifier.

unsigned long vuoGetNextEventId ( void  )

Returns a unique event ID.

struct NodeContext* vuoGetNodeContext ( const char *  nodeIdentifier)
read

Returns the node context registered for the node identifier, or null if none is found.

unsigned long vuoGetNodeIndexForPort ( const char *  compositionIdentifier,
const char *  portIdentifier 
)

Returns the numerical index for a node, given the identifier of a port on the node.

dispatch_semaphore_t vuoGetNodeSemaphoreForPort ( const char *  compositionIdentifier,
const char *  portIdentifier 
)

Returns the semaphore field in a node's context, given the identifier of a port on the node.

unsigned long vuoGetTypeIndexForPort ( const char *  compositionIdentifier,
const char *  portIdentifier 
)

Returns the numerical index for a port's type, given the port's identifier.

char* vuoTranscodeToGraphvizIdentifier ( const char *  originalString)

Replaces '"' with '"' and '\' with '\' in a string.

Variable Documentation

char* compositionDiff = NULL

Differences between the old and new composition, when replacing compositions for live coding.

map<string, map<string, void *> > dataForPort
static

The data field in the port's context, indexed by composition and port identifier.

GVC_t* graphvizContext = NULL
static

The context used when working with a Graphviz graph.

gvplugin_library_t gvplugin_core_LTX_library

Reference to the statically-built Graphviz core library.

gvplugin_library_t gvplugin_dot_layout_LTX_library

Reference to the statically-built Graphviz Dot library.

bool isPaused = false

True if node execution is currently paused.

map<string, struct NodeContext *> nodeContextForIdentifier
static

A registry of all NodeContext values in the running composition.

map<string, map<string, unsigned long> > nodeIndexForPort
static

The index for a node, indexed by composition and port identifier.

map<string, map<string, dispatch_semaphore_t> > nodeSemaphoreForPort
static

The semaphore field in the node's context, indexed by composition and port identifier.

map<string, map<string, unsigned long> > typeIndexForPort
static

The index for the port's type, indexed by composition and port identifier.

unsigned long vuoLastEventId = 0

The ID most recently assigned to any event, composition-wide. Used to generate a unique ID for each event.

char* vuoTopLevelCompositionIdentifier

The key of the top-level composition in nodeContextForIdentifier.