libmapper 2.4.12

Functions

mpr_map mpr_map_new (int num_sources, mpr_sig *sources, int num_destinations, mpr_sig *destinations)
 
mpr_map mpr_map_new_from_str (const char *expression,...)
 
void mpr_map_release (mpr_map map)
 
mpr_list mpr_map_get_sigs (mpr_map map, mpr_loc endpoint)
 
int mpr_map_get_sig_idx (mpr_map map, mpr_sig signal)
 
int mpr_map_get_is_ready (mpr_map map)
 
void mpr_map_refresh (mpr_map map)
 
void mpr_map_add_scope (mpr_map map, mpr_dev device)
 
void mpr_map_remove_scope (mpr_map map, mpr_dev device)
 

Detailed Description

Maps define dataflow connections between sets of signals. A map consists of one or more sources, one destination, and properties which determine how the source data is processed.

Function Documentation

◆ mpr_map_add_scope()

void mpr_map_add_scope ( mpr_map map,
mpr_dev device )

Add a scope to this map. Map scopes configure the propagation of signal instance updates across the map. Changes to remote maps will not take effect until synchronized with the distributed graph using mpr_obj_push().

Parameters
mapThe map to modify.
deviceDevice to add as a scope for this map. After taking effect, this setting will cause instance updates originating at this device to be propagated across the map.

◆ mpr_map_get_is_ready()

int mpr_map_get_is_ready ( mpr_map map)

Detect whether a map is completely initialized.

Parameters
mapThe device to query.
Returns
Non-zero if map is completely initialized, zero otherwise.

◆ mpr_map_get_sig_idx()

int mpr_map_get_sig_idx ( mpr_map map,
mpr_sig signal )

Retrieve the index for a specific map signal.

Parameters
mapThe map to check.
signalThe signal to find.
Returns
The signal index, or -1 if not found.

◆ mpr_map_get_sigs()

mpr_list mpr_map_get_sigs ( mpr_map map,
mpr_loc endpoint )

Retrieve a list of connected signals for a specific map.

Parameters
mapThe map to check.
endpointThe map endpoint, must be MPR_LOC_SRC, MPR_LOC_DST, or MPR_LOC_ANY.
Returns
A list of results. Use mpr_list_get_next() to iterate.

◆ mpr_map_new()

mpr_map mpr_map_new ( int num_sources,
mpr_sig * sources,
int num_destinations,
mpr_sig * destinations )

Create a map between a set of signals. The map will not take effect until it has been added to the distributed graph using mpr_obj_push().

Parameters
num_sourcesThe number of source signals in this map.
sourcesArray of source signal data structures.
num_destinationsThe number of destination signals in this map. Currently restricted to 1.
destinationsArray of destination signal data structures.
Returns
A map data structure – either loaded from the graph (if the map already existed) or newly created. In the latter case the map will not take effect until it has been added to the distributed graph using mpr_obj_push().

◆ mpr_map_new_from_str()

mpr_map mpr_map_new_from_str ( const char * expression,
... )

Create a map between a set of signals using an expression string containing embedded format specifiers that are replaced by mpr_sig values specified in subsequent additional arguments. The map will not take effect until it has been added to the distributed graph using mpr_obj_push().

Parameters
expressionA string specifying the map expression to use when mapping source to destination signals. The format specifier "%x" is used to specify source signals and the "%y" is used to specify the destination signal. Please refer to the expression syntax documentation for more information.
...A sequence of additional mpr_sig arguments, one for each format specifier in the format string
Returns
A map data structure – either loaded from the graph (if the map already existed) or newly created. Changes to the map will not take effect until it has been added to the distributed graph using mpr_obj_push().

◆ mpr_map_refresh()

void mpr_map_refresh ( mpr_map map)

Re-create stale map if necessary.

Parameters
mapThe map to operate on.

◆ mpr_map_release()

void mpr_map_release ( mpr_map map)

Remove a map between a set of signals.

Parameters
mapThe map to destroy.

◆ mpr_map_remove_scope()

void mpr_map_remove_scope ( mpr_map map,
mpr_dev device )

Remove a scope from this map. Map scopes configure the propagation of signal instance updates across the map. Changes to remote maps will not take effect until synchronized with the distributed graph using mpr_obj_push().

Parameters
mapThe map to modify.
deviceDevice to remove as a scope for this map. After taking effect, this setting will cause instance updates originating at this device to be blocked from propagating across the map.