Vuo  0.4.9
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
VuoRuntime.c File Reference

Description

VuoRuntime implementation.

Functions

void _dispatch_main_queue_callback_4CF (mach_msg_header_t *msg)
 Private API function in libdispatch.
 
void vuoControlReplySend (enum VuoControlReply reply, zmq_msg_t *messages, unsigned int messageCount)
 Must be called on VuoControlQueue.
 
void vuoTelemetrySend (enum VuoTelemetry type, zmq_msg_t *messages, unsigned int messageCount)
 Safe to call from any thread.
 
void vuoInit (int argc, char **argv)
 Parses command-line arguments, then calls vuoInitInProcess().
 
void vuoInitInProcess (void *_ZMQContext, const char *controlURL, const char *telemetryURL, bool _isPaused)
 Sets up ZMQ control and telemetry sockets, then calls the generated function setup().
 
void sendNodeExecutionStarted (char *nodeIdentifier)
 Constructs and sends a message on the telemetry socket, indicating that a node has started execution.
 
void sendNodeExecutionFinished (char *nodeIdentifier)
 Constructs and sends a message on the telemetry socket, indicating that a node has finished execution.
 
void sendInputPortsUpdated (char *portIdentifier, bool receivedEvent, bool receivedData, char *portDataSummary)
 Constructs and sends a message on the telemetry socket, indicating that an input port has received an event or data.
 
void sendOutputPortsUpdated (char *portIdentifier, bool sentData, char *portDataSummary)
 Constructs and sends a message on the telemetry socket, indicating that an output port has conducted or fired an event.
 
void sendError (const char *message)
 Constructs and sends a message on the telemetry socket, indicating that an uncaught error has occurred.
 
char * vuoTranscodeToGraphvizIdentifier (const char *originalString)
 Replaces '"' with '"' and '\' with '\' in a string.
 
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.
 
const char * getConstantValueFromGraphviz (graph_t *graph, const char *node, const char *port)
 Returns the constant value of the input port or instance data listed in the Graphviz graph, or null if it is not listed.
 
void vuoFini (void)
 Cleans up composition execution: closes the ZMQ sockets and dispatch source and queues.
 
void setup (void)
 
void nodeInstanceInit (void)
 
void nodeInstanceFini (void)
 
void nodeInstanceCallbackStart (void)
 
void nodeInstanceCallbackStop (void)
 
void setInputPortValue (char *portIdentifier, char *valueAsString, int shouldUpdateCallbacks)
 
char * getInputPortValue (char *portIdentifier, int shouldUseInterprocessSerialization)
 
char * getOutputPortValue (char *portIdentifier, int shouldUseInterprocessSerialization)
 
char * getInputPortSummary (char *portIdentifier)
 
char * getOutputPortSummary (char *portIdentifier)
 
unsigned int getPublishedInputPortCount (void)
 
unsigned int getPublishedOutputPortCount (void)
 
char ** getPublishedInputPortNames (void)
 
char ** getPublishedOutputPortNames (void)
 
char ** getPublishedInputPortTypes (void)
 
char ** getPublishedOutputPortTypes (void)
 
int getPublishedInputPortConnectedIdentifierCount (char *name)
 
int getPublishedOutputPortConnectedIdentifierCount (char *name)
 
char ** getPublishedInputPortConnectedIdentifiers (char *name)
 
char ** getPublishedOutputPortConnectedIdentifiers (char *name)
 
void generatePublishedInputPortEvent (char *name)
 

Variables

dispatch_queue_t VuoControlQueue
 Dispatch queue for protecting access to the ZMQControl socket.
 
dispatch_queue_t VuoTelemetryQueue
 Dispatch queue for protecting access to the ZMQTelemetry socket.
 
void * ZMQContext
 The context used to initialize sockets.
 
void * ZMQControl
 The control socket. Use only on VuoControlQueue.
 
void * ZMQTelemetry = 0
 The telemetry socket. Use only on VuoControlQueue.
 
bool hasBeenUnpaused
 True if node execution was unpaused initially, or if it has since been unpaused.
 
bool isPaused
 True if node execution is currently paused.
 
bool isStopped
 True if composition execution has stopped.
 
dispatch_source_t telemetryTimer
 Timer for sending telemetry messages.
 
dispatch_source_t controlTimer
 Timer for receiving control messages.
 
dispatch_semaphore_t telemetryCanceledSemaphore
 Signaled when telemetry events are no longer being processed.
 
dispatch_semaphore_t controlCanceledSemaphore
 Signaled when control events are no longer being processed.
 
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.
 
const char * compositionDiff = NULL
 A string containing a space-delimited list of nodes present in both the old and new composition, when replacing compositions for live coding.
 
GVC_t * graphvizContext = NULL
 The context used when working with a Graphviz graph.
 

Function Documentation

void _dispatch_main_queue_callback_4CF ( mach_msg_header_t *  msg)

Private API function in libdispatch.

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 or instance data listed in the Graphviz graph, or null if it is not listed.

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().

graph_t* openGraphvizGraph ( const char *  graphString)

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

void sendError ( const char *  message)

Constructs and sends a message on the telemetry socket, indicating that an uncaught error has occurred.

void sendInputPortsUpdated ( char *  portIdentifier,
bool  receivedEvent,
bool  receivedData,
char *  portDataSummary 
)

Constructs and sends a message on the telemetry socket, indicating that an input port has received an event or data.

void sendNodeExecutionFinished ( char *  nodeIdentifier)

Constructs and sends a message on the telemetry socket, indicating that a node has finished execution.

void sendNodeExecutionStarted ( char *  nodeIdentifier)

Constructs and sends a message on the telemetry socket, indicating that a node has started execution.

void sendOutputPortsUpdated ( char *  portIdentifier,
bool  sentData,
char *  portDataSummary 
)

Constructs and sends a message on the telemetry socket, indicating that an output port has conducted or fired an event.

void vuoControlReplySend ( enum VuoControlReply  reply,
zmq_msg_t *  messages,
unsigned int  messageCount 
)

Must be called on VuoControlQueue.

void vuoFini ( void  )

Cleans up composition execution: closes the ZMQ sockets and dispatch source and queues.

Assumes the composition has received and replied to a VuoControlRequestCompositionStop message.

void vuoInit ( int  argc,
char **  argv 
)

Parses command-line arguments, then calls vuoInitInProcess().

void vuoInitInProcess ( void *  _ZMQContext,
const char *  controlURL,
const char *  telemetryURL,
bool  _isPaused 
)

Sets up ZMQ control and telemetry sockets, then calls the generated function setup().

If the composition is not paused, also calls nodeInstanceInit() and nodeInstanceCallbackStart().

void vuoTelemetrySend ( enum VuoTelemetry  type,
zmq_msg_t *  messages,
unsigned int  messageCount 
)

Safe to call from any thread.

Todo:
https://b33p.net/kosada/node/5567
char* vuoTranscodeToGraphvizIdentifier ( const char *  originalString)

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

Variable Documentation

const char* compositionDiff = NULL

A string containing a space-delimited list of nodes present in both the old and new composition, when replacing compositions for live coding.

dispatch_semaphore_t controlCanceledSemaphore

Signaled when control events are no longer being processed.

dispatch_source_t controlTimer

Timer for receiving control messages.

GVC_t* graphvizContext = NULL

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 hasBeenUnpaused

True if node execution was unpaused initially, or if it has since been unpaused.

bool isPaused

True if node execution is currently paused.

bool isStopped

True if composition execution has stopped.

True if the composition has stopped.

dispatch_semaphore_t telemetryCanceledSemaphore

Signaled when telemetry events are no longer being processed.

dispatch_source_t telemetryTimer

Timer for sending telemetry messages.

dispatch_queue_t VuoControlQueue

Dispatch queue for protecting access to the ZMQControl socket.

dispatch_queue_t VuoTelemetryQueue

Dispatch queue for protecting access to the ZMQTelemetry socket.

void* ZMQContext

The context used to initialize sockets.

void* ZMQControl

The control socket. Use only on VuoControlQueue.

void* ZMQTelemetry = 0

The telemetry socket. Use only on VuoControlQueue.