OMget_obj_prop

OMget_obj_iprop

OMget_obj_rprop

OMget_obj_sprop

OMset_obj_prop

OMset_obj_iprop

OMset_obj_rprop

OMset_obj_sprop


Synopsis


OMobj_id  OMget_obj_prop (object_id,  property,  0  );

int  OMget_obj_iprop (object_id,  property,  int  *ival);
int  OMget_obj_rprop (object_id,  property,  double  *rval);
int  OMget_obj_sprop (object_id,  property,  char  **sval, maxlen);
int  OMset_obj_iprop (object_id,  property,  int  ival);
int  OMset_obj_rprop (object_id,  property,  double  rval);
int  OMset_obj_sprop (object_id,  property,  const char  *sval);
OMobj_id  object_id;
OMobj_name  property;

Description

These routines get and set an object's property.

OMget_obj_prop gets the id of a property. You can then call OMget_data_type to determine the property's data type, then OMget_obj_val and OMset_obj_val to get and set the property's value.

Alternatively, you can call one of the other routines, which combine these operations for particular data types.

These routines...

 

get and set the value of...

 

OMget_obj_iprop
OMset_obj_iprop

An integer property

OMget_obj_rprop
OMset_obj_rprop

A floating-point property

OMget_obj_sprop
OMset_obj_sprop

A character-string property

 

Arguments

object_id

The id of an object.

property

The name of a property.

AVS/Express-supplied properties, such as NEx and struct_name, have predefined names. The Network Editor names are defined in avs/ne_om.h . The OM names are defined in avs/om_att.h and avs/om_type.h .

Here are some commonly referenced property names and their data types. AVS/Express performs numeric data-type conversion, so, for example, you could refer to NE_name_NEheight in a call to OMget_obj_iprop even though it is defined to have a real value.

Property name

 

Data type

 

OM_prop_val_state

int

NE_name_NEdisplayMode

string

NE_name_NEx

real

NE_name_NEy

real

NE_name_NEwidth

real

NE_name_NEheight

real

 

ival
rval

In one of the get routines, an output argument containing the property's value.

In one of the set routines, an input argument specifying the property's new value.

sval

This value is passed to either OMget_str_val or OMset_str_val.

If you are using OMget_obj_prob, sval is an output argument containing the string. AVS/Express either allocates space for the string or places the array in an address you specify:

If sval is...

 

then AVS/Express...

 

NULL

Allocates space for the string using malloc and returns the string's address in value. AVS/Express ignores the maxlen argument.

After processing the string, you must free the space with the C library routine free (not ARRfree).

an address

Writes the string to the address pointed to by sval . The maxlen argument indicates the maximum number of characters to write.

 

If you are using OMset_obj_prob, sval is an input argument specifying the address of the new value.

maxlen

This parameter applies to OMget_obj_prob only. It is integer that is passed to OMget_str_val, and it indicates the maximum number of bytes to get. This argument is ignored if sval is a NULL pointer.

Returned value

The status code. See Status and Interuppt conrtrols in the Using AVS/Express manual

Example


/* Get object var1_id's coordinates. */
OMobj_id  var1_id;
int status;
int var1_x, var1_y;
...
status = OMget_obj_iprop(var1_id, NE_name_NEx, &var1_x);
status = OMget_obj_iprop(var1_id, NE_name_NEy, &var1_y);