1
Properties, attributes, primitives, and functions
This appendix provides a central point of reference for information on properties (NEx, cptr, and so on), attributes (read, notify, and so on), primitive objects (int, float, macro, and so on), and built-in functions (cos, merge, and so on) in AVS/Express.
This appendix discusses:
1.1 Properties and attributes
A property is name-value association placed on an object that defines a characteristic of that object, such as its x,y placement in the Network Editor, the number of levels of exported ports it has, or its dimensionality.
Property names are usually defined by the system (though you can create your own) and relate to a specific aspect of object behavior. In V code, properties appear after the object name delimited by < and > characters.
An attribute is a boolean characteristic that you can apply to an object to modify its behavior. A fixed set of these characteristics are defined by AVS/Express.
1.1.1 General properties and attributes
This table describes miscellaneous properties and attributes that appear under the General Properties category in the Properties Editor.
|
|
|
|
string ("dictionary_name")
|
Specifies the name of a dictionary file to be loaded into a translation table for localization. The OM loads the dictionary from a file with the following relative pathname:
runtime/nls/<locale_name>/<dictionary_name>
|
|
|
If set (to 1) on any hierarchical object (that is, a library, macro, group, or module), that object (and any children of the object) are not included in any compile operation.
|
|
|
If set, declares an object as an array and sets the dimensions of that array.
|
|
boolean (0 or 1, depending on state of object)
|
Changes the instanced state of an object. If this property is set to 0 on an instanced object, that object and all of its subobjects are deinstanced (all deinstanced methods are called). Conversely, if this property is set to 1 on a deinstanced object, that object and all of its subobjects are instanced (all instance functions are called).
|
|
|
Specifies the .v file to associate with an flibrary object. If the ".v" suffix is omitted from the specified file name, Express will add one, and will generate a binary .vo file to make subsequent loads of the flibrary faster.
|
|
|
Can be used with the libfile property or with the file library syntax:
It indicates that the library is to be loaded immediately when it is encountered (rather than waiting for some reference to objects in the library to force it to be loaded). You need this property when you define any objects with virtual data.
|
|
|
If set to 1 on an object, this property prevents you from adding or removing subobjects of that object.
|
|
string ("<virt_name1> <virt_name2>")
|
Used to define a dependency between an object or library on one or more pieces of "virtual data". When this object or library is needed for a project, all objects that define virtual data are also added to this project.
|
|
|
If the nosave parameter is set, the object is not saved with the rest of the application state.
|
|
|
If set, warnings normally generated if the object is not immediately resolvable are suppressed.
|
|
|
If set, makes connections to an object read only.
|
|
|
Specifies the reference mode (*, &, or ^) on an object.
|
|
|
Perform a trace on the object.
|
|
|
If set to 0 on a DefaultApplication object, prevents UImod_panel objects instantiated in the application or its children from creating and displaying their own shells.
|
|
|
For an object in a library on which user_library is set to 0 (see below), you can set user_class=1 on that object to force that object to be derived from when copies are made
|
|
|
If set to 0 on a library, this property indicates that the objects in this library should not be derived from
|
|
|
Specifies an alternate name for the object to display in the Network Editor.
|
|
|
Sets an explicit value state for the object for save and restore operations
|
|
|
If set, specifies that the object is virtual
|
1.1.2 Network Editor properties and attributes
These properties affect the object's appearance in the Network Editor.
For more details see the
User's Guide.
|
|
|
|
|
The name of an AVS image file that contains the definition of a pixmap to be displayed in the background of the subwindow of an open macro object.
Absolute pathnames are accepted. If you specify a relative pathname, the following directories are searched:
the directory specified by the XP_PIXMAP_PATH environment variable (if set)
the runtime/pixmaps subdirectory of each component of the XP_PATH variable, defined in either the environment or your avsenv file
|
NEcolor0 NEcolor1 NEcolor2 NEcolor3 NEcolor4 NEcolor5
|
|
The value of the i'th color of an object's port. This should be specified as a hex number of the form 0xrrggbb, where rr, gg, and bb are the RGB components of the color. (Example: yellow = 0xffff00).
The number of colors is specified using the NEnumColors property. Each color occupies an equal portion of the port.
|
|
string ("closed") Possible values: "closed" "open" "maximized"
|
A value indicating if the object is closed, open, or maximized. This property does not appear in the Properties Editor, because the display mode is normally controlled by popup commands. However, it is included in an object's V definition when you save it to a file.
|
|
|
A flag indicating if subobjects can be added to or deleted from an object, or if the characteristics of the subobjects can be edited. Also indicates if an object can be destroyed.
|
|
|
The size (in pixels) of the grid to which all subobjects of a macro are "snapped" when positioning them.
|
|
|
The height (in pixels) of an open object, when displayed inside an open macro object.
|
|
|
The HyperHelp context ID associated with the online help for an object.
This property is provided for developers who have obtained a license from Bristol Technologies Inc. for developing their own online help.
|
|
|
The name of the HyperHelp .hlp file containing the online help for an object. Absolute pathnames are accepted. If a relative pathname is specified, AVS/Express searches for the file in the runtime subdirectory of each component of the XP_PATH variable, defined in either the environment or your avsenv file.
This property is provided for developers who have obtained a license from Bristol Technologies Inc. for developing their own online help.
|
|
|
The HyperHelp topic associated with the online help for an object.
This property is provided for developers who have obtained a license from Bristol Technologies Inc. for developing their own online help.
|
|
string ("pixmap_and_text") Possible values: "pixmap" "text" "pixmap_and_text"
|
A value indicating whether a pixmap, text, or both are displayed in an object's icon.
|
|
|
The name of the file that contains the pixmap that is displayed when the value of the NEpixmapMode property is "large".
(See the description of the NEbackgroundPixmap property for file search rules).
|
|
string ("bmx") Possible values: "avs_image" "x_bitmap" "bmx"
|
The format of the file containing the pixmap that is displayed when the value of the NEpixmapMode property is "large". BMX format is an AVS/Express format that is derived from the Windows BMP format. The other two formats are AVS image format and the standard monochrome X bitmap format.
|
|
|
The number of colors used when drawing the object's port. The maximum is 6. Individual colors are specified using the properties NEcolor0 through NEcolor5.
|
|
|
A flag indicating if an object can be opened in the Network Editor. This can be used to prevent users from viewing and modifying certain components.
This property does not appear in the Properties Editor.
|
|
string ("small") Possible values: "small" "large"
|
A value indicating the layout of the pixmap and text in the object icon. If the value is "small", then the pixmap is displayed at the left side of the icon, and the text is displayed to the right of the pixmap. If the value is "large", then the pixmap is displayed above the text, and both the pixmap and the text are horizontally centered. Note that "small" pixmap mode is always used when an object is open.
|
|
string ("Templates. NE_MACROS. NEobjPopupMenu")
|
The pathname of the temporary object that is used for displaying the popup menu for an object. You can customize the popup menu for your objects by providing the pathname of your own popup menu object as the value of this property.
The default version of the popup menu is defined in ne_macro.v, and the components of the menu are defined in ne.v.
|
|
|
The extent to which the input and output ports of an object are exposed. The first integer controls the input port, and the second controls the output port.
0 means that the port is not exposed.
1 means that the object is exposed to the level of the object's siblings.
2 means that the object is exposed to the level of both the object's siblings and the siblings of the object's parent.
Higher levels expose the object further.
|
|
|
The scaling (or "zoom") factor for objects in the subwindow of an open macro object. This property does not appear in the Properties Editor because the zooming is normally controlled by the mouse or a popup menu. However, it is included in an object's V definition when you save it to a file.
|
|
|
The name of the file containing the pixmap displayed when the value of the NEpixmapMode property is "small".
(See the description of the NEbackgroundPixmap property for file search rules).
|
|
string ("bmx") Possible values: "avs_image" "x_bitmap" "bmx"
|
The format of the file containing the pixmap that is displayed when the value of the NEpixmapMode property is "small". BMX format is an AVS/Express format that is derived from the Windows BMP format. The other two formats are AVS image format and the standard monochrome X bitmap format.
|
|
|
A flag that prevents an object's port from being considered when executing the "Arrange Icons" popup command for an open macro object.
|
|
|
A flag indicating if an object is to be displayed in the Network Editor. Allows objects to be hidden from end-users.
|
|
|
The width (in pixels) of an open object, when displayed inside an open macro object.
|
|
|
The X and Y position (in pixels) of an object, when displayed inside an open macro object.
|
|
|
The X and Y "panning offset" (in pixels) of all children of a macro object. This property does not appear in the Properties Editor because panning is normally controlled by the mouse. However, it is included in an object's V definition when you save it to a file.
|
1.1.3 Module control properties
Module control properties are used to specify the information necessary to determine the behavior of methods and parameters included in a module.
|
|
|
|
|
If an object with an update method is instanced, and a new subobject is added whose "notify" attribute is set, you would expect the update method to fire in response to a change in the value of the new subobject. However, this does not occur unless no_meth_ctx is set to 1.
|
|
|
If set on a parameter, specifies that the module does not affect that parameter or its subobjects in any way (equivalent to setting nonotify+noread+nowrite on a parameter)
|
|
|
If set, forces the "notify" attribute off, even it the inherited value is on
|
|
|
If set, forces the "read" attribute off, even it the inherited value is on
|
|
|
Specifies that all of the object's methods should be invoked when the value of the subobject on which this attribute is set changes
|
|
|
If set for a method subobject, specifies that method will be invoked when the object is instantiated
|
|
|
If set for a method subobject, specifies that method will be invoked when the object is destroyed
|
|
|
If set, forces the "write" attribute off, even it the inherited value is on
|
|
|
Helps determine the conditions for invoking an update method. Also specifies that the object is optional for the purposes of object matching
|
|
|
If set on a subobject of a module, this attribute causes AVS/Express to generate code that makes it easier to get the value of that subobject inside a method. For C, it will actually generate the code to get the method; using OMX, it will generate a comment noting that the variable is exported and available
|
|
|
Set on a subobject of a module, this attribute tells AVS/Express not to fire any method that reads this subobject unless it has a defined value
|
|
|
Specifies the order in which a set of methods all responding to the same event should be called. Without this property, the order is not defined
|
|
|
Set on a subobject of a module, this property tells AVS/Express to export that subobject for writing. That is, to generate code in methods of the module to make it easier to set the value of this subobject
|
1.1.4 Code management properties
Code management properties are used when compiling projects. These generally apply only to (and are therefore only displayed in the Properties Editor for) modules and libraries.
|
|
|
|
|
A make command to execute. The command is performed in the build directory (see build_dir).
|
|
|
|
|
string ("my_hdr1.h my_hdr2.h")
|
C header files that AVS/Express should include in code it generates as part of encapsulating a structure or function. The header files specified must be in the directories specified by the hdr_dirs property.
|
|
|
A list of C source files to be compiled. You can specify a pathname relative to the build directory (see build_dir) or a full pathname.
c_src_files="src1.c src2.c"
|
|
|
If set to 0, specifies that the object and objects below it in the object hierarchy are never compiled.
You use this property for efficiency. For example, a macro object typically consists of objects defined elsewhere, so does not itself need to be compiled. If you have a large library of such objects, you can spare AVS/Express the effort of searching the library. You typically insert this property into the library:
|
|
string ("my_hdr1.hxx my_hdr2.hxx")
|
C++ header files that AVS/Express should include in code it generates as part of encapsulating a structure or function. The header files specified must be in the directories specified by the hdr_dirs property.
|
|
string ("src1.cxx src2.cxx")
|
A list of C++ source files to be compiled. You can specify a pathname relative to the build directory (see build_dir) or a full pathname. The default make rules can compile only c++ source files with the .cxx suffix.
cxx_src_files="src1.cxx src2.cxx"
|
|
|
|
|
|
A list of directories to search for header files (equivalent to a compiler's -I option). A pathname can be absolute or relative to the build directory (see build_dir).
|
|
|
A line of C code to execute when the process starts. If the C code calls a function that's not declared, you use the hdr_code property to declare it.
hdr_code="int FLD_METHinit();" init_code=FLD_METHinit();"
|
|
|
The language (C or C++) of a method's function. The default language is C, so you specify this property only when the language is C++. Unlike the other process properties, lang is not inherited. You need only specify this property if the OM will not be able to determine this itself, for example, for a C module that calls a C++ function.
Notice that you use the string "cxx" rather than "c++".
|
|
|
Names of other AVS/Express libraries that must be included into the each process that this object is placed in. This is a way to specify dependencies in code that are not expressed in the dependencies between the AVS/Express objects themselves. Any link files associated with the specified libraries will be included in any process that this object is used in.
|
|
string "-lmy_lib1 libmy_lib2.a my_obj1.o my_obj2.o"
|
Text to pass to the linker (without interpretation, in the linker line), typically object (.o) files and object libraries. Useful for specifying library paths, libraries, and/or object files to link in, and so on. Use this property instead of (or in addition to) c_src_files and cxx_src_files when you use your own make file compile your source.
link_files="-L /my_lib_dir -lmods -lmutil"
|
|
|
If set to 1, specifies that the C++ linker is required for this process. AVS/Express can generally determine this on its own, if any method object specifies lang="cxx" or has a cxxmethod. You use this when, for example, a method calls a C function and that function in turn calls a C++ function. AVS/Express does not know about that C++ function, so does not know that the C++ linker is required.
|
|
|
Specifies the path names of other AVS/Express objects created dynamically by this module. You need to use this property to ensure that these objects are included in a compiled project that contains your modules.
need_objs = "UIbutton MODS.clamp"
|
|
|
If this property is set to 1 on any object that is included into a process, AVS/Express does not link a "main()" function into this process. In this case, you should supply your own "main()" function using a cxx_src_file, c_src_file, or link_files property.
|
|
|
Specifies the name of a header file that contains automatically generated header definitions for this object and its subobjects. You should not edit this header file as it maintained by AVS/Express. It is maintained relative to the current build_dir. This file includes the declaration of any methods and definitions for OMX and UCI objects. If you do not specify a value of this property for an object or its ancestor, definitions are placed in processname.h.
out_hdr_file="uci_gmod.h"
|
|
|
Specifies the name of a source file that contains automatically generated source for this object and its subobjects. You should not edit this source file as it is maintained by AVS/Express. The file is defined relative to the current build_dir. This file includes code to support OMX and UCI objects. It should be specified without a suffix so that the system can append a .c or .cxx suffix depending upon whether or not C++ definitions are included in this file. If you do not specify a value of this property for an object or its ancestor, definitions are placed in processname.[c,cxx].
|
|
|
A line of C code to execute before templates are loaded. If the C code calls a function that is not declared, use the hdr_code property to declare it.
|
|
|
The process to which the object belongs.
|
|
|
Specifies a file into which to generate prototype source code for the object on which it is set. If the generated code is C, any existing source code is not overwritten; it must be explicitly deleted each time new code is to be generated. For C++, the existing source code is not changed, but any methods to be generated that aren't already defined in the existing code are added to the end. src_file is also used in conjunction with the Project 'Edit Source pull-down command.
|
|
|
Set this property to 0 to disable the generation of prototype source for an object and its subobjects. For C++ only, use this property if you do not want AVS/Express to maintain the correspondence between the src_file and the methods in these objects.
|
1.1.5 C++ interface properties
C++ interface properties are used by objects that have a C++ method (cxxmethod) and control the interface between objects and C++ code.
|
|
|
|
|
If set, prevents AVS/Express from generating a constructor call for an abstract class
|
|
|
Specifies a name to use for the object in generated C++ code
|
|
|
Specifies the name of a C++ class with which to associate an Express object. When the object is instanced, an instance of the class is created; when the object is deinstanced, the class instance is also deinstanced. When a cxxmethod is called, a pointer to the C++ class instance can be obtained.
The "cxx_hdr_files" and "cxx_src_files" properties should be set to include the source files that define the C++ class to be thus imported.
|
|
|
Used in conjunction with the cxx_class property to specify the parameters (if any) to the constructor for an imported C++ class. The specified string is placed between the parentheses in the generated call to the class's constructor.
|
|
string ("my_hdr1.hxx my_hdr2.hxx")
|
C++ header files that AVS/Express should include in code it generates as part of encapsulating a structure or function. The header files specified must be in the directories specified by the hdr_dirs property.
|
|
|
Allows you to define additional members in an exported C++ class. Normally, the only class members are the exported objects in the object hierarchy. This property allows other members to be defined, for example:
cxx_members="char *my_ptr;"
Note that the text is dropped directly into the class definition, so must have correct C++ syntax. Note also that the member can be made private:
cxx_members="private: char *my_ptr;"
|
|
|
Allows you to add code to construct new C++ class members added using the "cxx_members" property. The specified string is added to a comma-separated list after the class constructor. For example:
cxx_members_constr="my_ptr(0)"
|
|
string ("src1.cxx src2.cxx")
|
A list of C++ source files to be compiled. You can specify a pathname relative to the build directory (see build_dir) or a full pathname. The default make rules can compile only c++ source files with the .cxx suffix.
cxx_src_files="src1.cxx src2.cxx"
|
|
|
Specifies how many levels up the object hierarchy an object should be exported. For example, a value of 0 indicates that the object should not be exported. A value of 1 exports the subobject to its parent. A value of 2 exports the subobject to its parent's parent, and so on.
This is useful to fine-tune the exporting of individual subobjects in an exported object hierarchy.
|
|
|
Controls how Express generates C++ code for an object. The following values are supported:
0 - Don't generate a C++ class for this object. 1 - Generate a C++ member for each Express subobject unless that object's "export" property is set to 0. This is the default for any module with a cxxmethod subobject. 2 - Generate a C++ member ONLY for Express subobjects that either have the "NEportLevels" property or the "export" property set to 2 or higher (that is. so that they export themselves at least to their parent object). 3 - Generate a C++ member for each subobject that exports itself to this object's level using either the "NEportLevels" property or the "export" property.
|
|
|
If set, specifies that subobjects are exported by default
|
|
|
If set, specifies that subobjects should exported.
|
Base types (or primitives) are AVS/Express' fundamental building blocks.
|
|
boolean byte char double enum float int short string ptr prim
|
Primitive data objects are used to hold the raw system data
Boolean integer (0 or 1 only) One-byte integer object. One-byte object capable of holding a single character. Double-precision floating point object. Enumerated data type Single-precision floating point object. Integer object. Short integer object. NULL-terminated character string object. Pointer data object used to point to user data structure. Object with unset data type used for any one of the above.
|
|
Defines an object with subobjects.
|
|
Creates a library of objects. Creates a library of objects whose V-code definition is stored in a V file.
|
|
Hold combinations of modules, macros, and connections.
|
|
Holds parameters and methods to implement objects that interface to C or C++ code.
|
method omethod cmethod cxxmethod
|
Objects that interface directly to a C function or C++ method.
|
|
Objects that route connections, often into or out of a macro or application object.
|
AVS/Express supplies several types of built-in functions: mathematical, logical, array, index_of, merge, name_of, str_array, and str_format.
The following table summarizes the AVS/Express mathematical functions. For more details, see Section 2.14.1, Mathematical functions [page 2-61].
|
|
abs( arg) acos( arg) add( arg1...) asin( arg) atan( arg)
|
Absolute value of arg
Arc cosine of arg, expressed in radians Addition. Equivalent to arg1 + arg2 + ... Arc sine of arg, expressed in radians Arc tan of arg, expressed in radians
|
cos( arg) cosh( arg) divide( arg1...) exp( arg) log( arg)
|
Cosine of arg, expressed in radians Hyperbolic cosine of arg, expressed in radians Division. Equivalent to arg1 / arg2 / ... e raised to the power of arg
Natural logarithm of arg
|
log10( arg) modulo( arg1...) multiply( arg1...) pow( arg1, arg2) sin( arg)
|
Base 10 logarithm of arg
Modulo. Equivalent to arg1 % arg2 % ... Multiplication. Equivalent to arg1 * arg2 * ... arg1 raised to the power of arg2
Sine of arg, expressed in radians
|
sinh( arg) sqrt( arg) sub( arg1...) tan( arg) tanh( arg)
|
Hyperbolic sine of arg, expressed in radians Square root of arg
Subraction. Equivalent to arg1 - arg2 - ... Tan of arg, expressed in radians Hyperbolic tan of arg, expressed in radians
|
|
A random scalar or array with values between 0 and range. If no seed argument is specified, it gives a different random array for each object (i.e., the object id is used as the seed). If seed is specified, it is used as the seed for the random numbers.
|
The following table summarizes the AVS/Express logical functions. For more details, see Section 2.14.2, Logical functions [page 2-62].
|
|
and( arg1...) or( arg1...) xor( arg1...)
|
Logical and. Equivalent to arg1 & arg2 & ... Logical or. Equivalent to arg1 | arg2 | ... Logical exclusive or. Equivalent to ((arg1 ^ arg2) ^ ...)
|
The following table summarizes the AVS/Express array functions. For more details, see Section 2.14.3, Array functions [page 2-63].
|
|
|
Returns the total number of elements in arg.
|
|
Returns the dimensions of the array specified in arg.
|
|
Combines arg1, arg2, ... The arrays must have the same number of dimensions, n, and the same size in the first n-1 dimensions. The function returns an n-dimension array, where the size in the first n-1 dimensions is the same as the source arrays, and the size of the nth dimension is the sum of the sizes of the source arrays' nth dimension.
|
|
Concatenates arg1, arg2, ... to create one array with dimensions equal to the sum of dimensions of all the arrays.
|
|
Returns the index of the current object in the array of groups specified by arg. This function must be used by an object that is in a group in the array of groups specified by arg. It is used to create connections between objects in two parallel arrays of groups.
|
init_array( size,start,end)
|
Returns a one-dimensional array of size elements that range in ascending order from start to end.
|
|
Returns the magnitude (square root of sum of squares) of each column in arg. The function returns an n-1 dimension array, where n is the number of dimensions in arg.
|
max_array( arg) max_array( arg, f, v)
|
Returns (in a one-dimensional array) the maximum value found in each column in the array arg.
If the array has null values, you can include two additional arguments, setting flag f to 1 to indicate that the function should ignore null values, and v to the number that represents a null value. By default, f is 0, meaning that the function operates on all array values.
|
min_array( arg) min_array( arg, f, v)
|
Like max_array, but returns the minimum value.
|
|
Returns the product of all of the elements in arg1, arg2, ...
|
|
Returns the sum of all of the elements in arg1, arg2, ...
|
|
Creates a new array, each element of which is a sum of all the previous elements in the original array.
|
The following table summarizes other miscellaneous AVS/Express functions.
|
|
|
Instructs AVS/Express to cache the results of the enclosed expression so that the expression is only recalculated when necessary.
|
|
Returns the current index of an array of groups.
|
|
Defines an object that has all the subobjects of two or more other objects.
|
|
Returns a string value containing the name of a referenced object.
|
|
Returns an array of strings obtained by splitting a referenced string object into pieces.
|
|
Provides string formatting functionality like that of the standard C routine printf.
|
switch( index,arg1,arg2...)
|
Returns one of its arguments depending on the value of an index.
|