|
void | vuoSetPortContextData (struct PortContext *portContext, void *data) |
| Sets the port context's data field.
|
|
static unsigned long | hash (const char *str) |
| Returns an integer hash for a C string.
|
|
static vector< Worker > | dequeueWorkers (void) |
| Chooses one or more workers, from those waiting for threads, to be the next workers to get threads.
|
|
void | vuoInitWorkerThreadPool (void) |
| Sets up the pool of worker threads.
|
|
void | vuoFiniWorkerThreadPool (void) |
| Cleans up the pool of worker threads.
|
|
void | vuoScheduleTriggerWorker (dispatch_queue_t queue, void *context, void(*function)(void *), int minThreadsNeeded, int maxThreadsNeeded, unsigned long eventId, char *compositionIdentifier, int chainCount) |
| Schedules a trigger worker function to be called when enough threads are available from the thread pool.
|
|
void | vuoScheduleChainWorker (dispatch_queue_t queue, void *context, void(*function)(void *), int minThreadsNeeded, int maxThreadsNeeded, unsigned long eventId, char *compositionIdentifier, unsigned long chainIndex, unsigned long *upstreamChainIndices, int upstreamChainIndicesCount) |
| Schedules a chain worker function to be called when enough threads are available from the thread pool.
|
|
void | vuoGrantThreadsToSubcomposition (unsigned long eventId, char *compositionIdentifier, unsigned long chainIndex, char *subcompositionIdentifier) |
| Allows the published input trigger of a subcomposition node to use the threads allocated for the chain containing the node.
|
|
void | vuoReturnThreadsForTriggerWorker (unsigned long eventId) |
| Returns the threads allocated for the trigger worker to the thread pool.
|
|
void | vuoReturnThreadsForChainWorker (unsigned long eventId, char *compositionIdentifier, unsigned long chainIndex) |
| Returns the threads allocated for the chain worker to the thread pool.
|
|
unsigned long | vuoGetNextEventId (void) |
| Returns a unique event ID.
|
|
static void | splitCompositionIdentifier (const string &compositionIdentifier, string &parentCompositionIdentifier, string &nodeIdentifier) |
| If compositionIdentifier refers to a subcomposition, outputs the identifier of the parent composition and the subcomposition node within the parent composition.
|
|
static string | joinCompositionIdentifier (const string &parentCompositionIdentifier, const string &nodeIdentifier) |
| Constructs the composition identifier for a subcomposition.
|
|
static string | joinPortIdentifier (const string &nodeIdentifier, const string &portName) |
| Constructs the identifier of a port on a node.
|
|
void | vuoAddNodeMetadata (const char *compositionIdentifier, const char *nodeIdentifier) |
| Registers metadata for a node.
|
|
void | vuoAddPortMetadata (const char *compositionIdentifier, const char *portIdentifier, const char *portName, unsigned long typeIndex, const char *initialValue) |
| Registers metadata for a port.
|
|
static string | vuoGetNodeIdentifierForIndex (const char *compositionIdentifier, unsigned long nodeIndex) |
| Looks up the node identifier for the node with the given index.
|
|
static unsigned long | vuoGetNodeIndexForIdentifier (const string &compositionIdentifier, const string &nodeIdentifier) |
| Looks up the node index for the node with the given identifier.
|
|
static string | vuoGetCompositionIdentifierForHash (unsigned long compositionIdentifierHash) |
| Looks up the composition identifier that corresponds to the given hash.
|
|
static void | vuoAddNodeContext (const char *compositionIdentifier, unsigned long nodeIndex, struct NodeContext *nodeContext) |
| Registers a node context.
|
|
static void | vuoRemoveNodeContext (const char *compositionIdentifier, unsigned long nodeIndex) |
| Un-registers a node context.
|
|
static void | vuoRelocateAllNodeContexts (void) |
| Preserves all remaining node contexts to be accessed after a live-coding reload, and clears the list of registered node contexts.
|
|
static NodeContext * | vuoCarryOverNodeContext (const char *compositionIdentifier, unsigned long nodeIndex) |
| Carries over a node context from before a live-coding reload — registering it with the new node contexts and removing it from the list of carried-over node contexts.
|
|
static void | vuoRemoveCarriedOverNodeContext (const char *compositionIdentifier, const string &nodeIdentifier) |
| Removes the node from the list of carried-over node contexts.
|
|
static void | vuoRemoveAllCarriedOverNodeContexts (void(*compositionDestroyNodeContext)(const char *, const char *, NodeContext *)) |
| Removes all remaining items from the list of carried-over node contexts.
|
|
struct NodeContext * | vuoGetNodeContext (const char *compositionIdentifier, unsigned long nodeIndex) |
| Returns the node context registered for the node index, or null if none is found.
|
|
struct NodeContext * | vuoGetCompositionContext (const char *compositionIdentifier) |
| Returns the node context registered for the composition (top-level or subcomposition), 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.
|
|
static void | vuoAddPortIdentifier (const char *compositionIdentifier, const string &portIdentifier, void *data, dispatch_semaphore_t nodeSemaphore, unsigned long nodeIndex, unsigned long typeIndex) |
| Caches information about the port so it can be efficiently retrieved later.
|
|
static void | vuoRemovePortIdentifier (const char *compositionIdentifier, const string &portIdentifier) |
| Removes the port from the port cache.
|
|
static void | vuoRelocateAllPortIdentifiers (void) |
| Preserves all remaining port cache entries to be accessed after a live-coding reload, and clears the port cache.
|
|
static void | vuoCarryOverPortIdentifier (const char *compositionIdentifier, const string &portIdentifier, unsigned long nodeIndex, unsigned long typeIndex) |
| Carries over a port's cache entry from before a live-coding reload — transferring the entry to the new port cache and removing it from the list of carried-over port cache entries.
|
|
static void | vuoCarryOverPortIdentifiersForNode (const char *compositionIdentifier, const string &nodeIdentifier, unsigned long nodeIndex, const vector< string > &portIdentifiers, const vector< unsigned long > typeIndexes) |
| Carries over all of the node's port cache entries from before a live-coding reload — transferring the entries to the new port cache and removing them from the list of carried-over port cache entries.
|
|
static void | vuoRemoveCarriedOverPortIdentifier (const char *compositionIdentifier, const string &oldPortIdentifier) |
| Removes the port from the list of carried-over port cache entries.
|
|
static void | vuoRemoveAllCarriedOverPortIdentifiers (void) |
| Removes all remaining items from the list of carried-over port cache entries.
|
|
static void | vuoCarryOverPortData (const char *compositionIdentifier, const string &oldPortIdentifier, const string &newPortIdentifier, PortContext *newPortContext) |
| For a node being replaced across a live-coding reload, transfers port data from a port on the old node to the corresponding port on the new node (by copying the port data's heap address from the old PortContext to the new PortContext).
|
|
static enum ChangeType | findNodeInCompositionDiff (const char *nodeIdentifier, json_object **replacementObj) |
| Searches compositionDiff for changes made to the node across a live-coding reload.
|
|
bool | vuoIsNodeBeingRemovedOrReplaced (const char *nodeIdentifier, json_object **replacementObj) |
| Returns true if the node is among the removals or replacees across a live-coding reload, or if the composition is being stopped (not a live-coding reload).
|
|
bool | vuoIsNodeBeingAddedOrReplaced (const char *nodeIdentifier, json_object **replacementObj) |
| Returns true if the node is among the additions or replacers across a live-coding reload, or if the composition is being started (not a live-coding reload).
|
|
static bool | vuoIsPortBeingReplaced (const char *portName, json_object *replacementObj) |
| Returns true if the port is among the replacees across a live-coding reload.
|
|
static bool | vuoIsPortReplacingAnother (const char *portName, json_object *replacementObj, string &oldNodeIdentifier, string &oldPortIdentifier) |
| Returns true if the port is among the replacers across a live-coding reload.
|
|
NodeContext * | vuoCompositionContextInitHelper (const char *compositionIdentifier, bool hasInstanceData, unsigned long publishedOutputPortCount, NodeContext *(*compositionCreateNodeContext)(const char *, unsigned long), void(*compositionDestroyNodeContext)(const char *, const char *, NodeContext *), void(*compositionSetPortValue)(const char *, const char *, const char *, bool, bool, bool, bool, bool)) |
| Helper function for compositionContextInit() .
|
|
void | vuoCompositionContextFiniHelper (const char *compositionIdentifier, void(*compositionDestroyNodeContext)(const char *, const char *, NodeContext *), void(*compositionReleasePortData)(void *, unsigned long)) |
| Helper function for compositionContextFini() .
|
|
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.
|
|
|
NodeContext * | vuoCreateNodeContext (bool hasInstanceData, bool isComposition, size_t outputEventCount) |
| Creates a node context, initializing its fields to default values.
|
|
void | vuoFreeNodeContext (NodeContext *nodeContext) |
| Frees the port context and its fields.
|
|
PortContext * | vuoGetNodeContextPortContext (NodeContext *nodeContext, size_t index) |
| Gets the array element at the given index of the node context's portContexts field.
|
|
dispatch_semaphore_t | vuoGetNodeContextSemaphore (struct NodeContext *nodeContext) |
| Gets the node context's semaphore field.
|
|
void | vuoRetainPortContextData (struct PortContext *portContext) |
| Prevents the port context's data field from being freed by vuoFreePortContext() .
|
|
void * | vuoGetPortContextData (struct PortContext *portContext) |
| Gets the port context's data field.
|
|
|
bool | isPaused = false |
| True if node execution is currently paused.
|
|
dispatch_group_t | vuoTriggerWorkersScheduled = NULL |
| Keeps track of trigger workers that have been scheduled but have not yet launched an event into the composition.
|
|
unsigned long | vuoLastEventId = 0 |
| The ID most recently assigned to any event, composition-wide. Used to generate a unique ID for each event.
|
|
static WorkerQueue | workersWaitingForThreads |
| Queue of workers waiting to use threads from the pool.
|
|
ThreadPool | mainThreadPool |
| Trigger workers claim threads from this thread pool.
|
|
map< unsigned long, map
< unsigned long, ThreadPool > > | triggerThreadPools |
| Chain workers claim threads from the thread pool for their event ID and hashed composition identifier.
|
|
static dispatch_queue_t | workersWaitingSync |
| Synchronizes access to workersWaitingForThreads .
|
|
static dispatch_queue_t | threadPoolSync |
| Synchronizes access to mainThreadPool and triggerThreadPools .
|
|
static dispatch_semaphore_t | workersUpdated |
| Notifies dequeueWorker() when there may be a new worker available to dequeue.
|
|
static bool | mayMoreWorkersBeEnqueued |
| Becomes true when the composition is stopping, indicating that dequeueWorker() is now flushing out the remaining workers and shouldn't expect new events.
|
|
static bool | mayMoreWorkersBeDequeued |
| Becomes true when dequeueWorker() has finished flushing out the remaining workers.
|
|
static map< unsigned long, map
< unsigned long, struct
NodeContext * > > | nodeContextForIndex |
| A registry of all NodeContext values in the running composition, indexed by hashed composition identifier and node index.
|
|
static map< unsigned long, string > | compositionIdentifierForHash |
| The composition identifier for each hash registered in nodeContextForIndex .
|
|
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.
|
|
static map< string, map
< string, struct NodeContext * > > | carriedOverNodeContextForIdentifier |
| Info from nodeContextForIndex carried across a live-coding reload, indexed by composition identifier and node identifier.
|
|
static map< string, map
< string, void * > > | carriedOverDataForPort |
| Info from dataForPort carried across a live-coding reload.
|
|
static map< string, map
< string, dispatch_semaphore_t > > | carriedOverNodeSemaphoreForPort |
| Info from nodeSemaphoreForPort carried across a live-coding reload.
|
|
static map< string, map
< string, unsigned long > > | carriedOverNodeIndexForPort |
| Info from nodeIndexForPort carried across a live-coding reload.
|
|
static map< string, map
< string, unsigned long > > | carriedOverTypeIndexForPort |
| Info from typeIndexForPort carried across a live-coding reload.
|
|
char * | vuoTopLevelCompositionIdentifier |
| The composition identifier of the top-level composition.
|
|
static const unsigned long | topLevelCompositionIndex = ULONG_MAX |
| The index for the top-level composition's node context in nodeContextForIndex .
|
|
static const unsigned long | invalidCompositionIndex = ULONG_MAX - 1 |
| Used for error conditions.
|
|
char * | compositionDiff = NULL |
| Differences between the old and new composition, when replacing compositions for live coding.
|
|
static vector< Worker > | workersDequeued |
| Temporary storage in dequeueWorkers(), made global to avoid the cost of reallocating with every call.
|
|
static vector
< WorkerQueue::Node * > | workersDequeuedNodes |
| Temporary storage in dequeueWorkers(), made global to avoid the cost of reallocating with every call.
|
|
static map< string, vector
< NodeMetadata > > | nodeMetadatas |
| The metadata for each node, by composition identifier and node index.
|
|
static map< string, vector
< NodeMetadata > > | carriedOverNodeMetadatas |
| Node metadata for nodes within subcompositions that are kept across a live-coding reload.
|
|