Synopsis
int OMget_array_ref (
OMobj_id object_id,
int ref_index,
OMobj_id *ref_id,
int mode );
Description
OMget_array_ref is used in conjunction with OMget_num_refs to access an objects list of connections as an array. The object specified can be any object that has connections but if the object is not an array object, the ref_index parameter must always be 0.
Arguments
object_id
The id of an object. The object can be any object that has connections currently.
ref_index
An array value. AVS/Express uses 0-based indexing; i.e., the index of the first connection in an array is 0.
ref_id
The id of the specified connection is returned.
mode
This argument is typically supplied with 0 but the constant OM_REF_SYMBOLIC can be used to obtain the id of a subobject of a by-reference group instead of the id of the subobject of the by-referenced group's value. This is the value that the Network Editor uses to display hierarchical connections properly.
Returned value
A status code. See Return Status .
Example
With V code specified as
group a, b, c;
group &grp1[] => {a, b, c};
and with grp1's object_id in grp1_id, the C code can be used to access the object ids of a, b, and c.
OMobj_id grp1_id, ref_id;
int i, num_refs;
grp1_id = ...
if (OMget_num_refs(grp1_id, &num_refs) != 1) num_refs = 0;
for (i = 0; i < num_refs; i++) {
if (OMget_array_ref(grp1_id, i, &ref_id, 0) != 1)
continue;
printf("object is: %s\n",OMret_obj_name(ref_id));
};
See also
OMget_obj_val, OMget_obj_pval, and OMset_obj_val