EXPOSED_OBJECTS
This element contains a list of objects that should be exposed to other data models referencing the current model, or to the scripting engine. Multiple instances of this element are allowed: any new object identifier will be added to the list of objects to be exposed.
Attributes brief detailed show all inherited
Name | Description | |
---|---|---|
object_ids | List of identifiers of objects to be declared as exposed |
Example
- <EXPOSED_OBJECTS object_ids="dsp.input1.BeginCapture;dsp.input1.EndCapture" />
Explanations
In comparison to REQUIRED_OBJECTS which just makes sure that object is created and not stripped, the EXPOSED_OBJECTS makes the object accessible from the scripts and from other data models (like KUIML_WIDGET "sub-skins").
EXPOSED_OBJECTS is equivalent to "requires" attribute in the SCRIPT or ACTION_TRIGGER and does the same as "exposed" attribute for PARAM or STRING.
For example, a simple TIMER to delay some action:
- <TIMER refresh_time_ms="1000" id="DelayTimer" enabled="false" exposed="true" />
- <ACTION_TRIGGER event_id="DelayTimer.elapsed" script="
- DelayTimer.enabled = false;
- /* do something useful */
- if (some_widget.mouse_over > 0) {
- some_param = 20;
- }
- " requires="DelayTimer.enabled;some_param;some_widget.mouse_over" />
Instead of using "requires" we could use EXPOSED_OBJECTS.
- <EXPOSED_OBJECTS object_ids="DelayTimer.enabled;some_param;some_widget.mouse_over" />
You would also need EXPOSED_OBJECTS when you plan to use some objects in another sub-skins (KUIML_WIDGET) or other data models.
Wildcards
Though it's possible to use wildcards (*) in objects_ids like:
- <EXPOSED_OBJECTS object_ids="my_param.*" />
It's highly not recommended (only for some simplest testing), because wildcards often create and expose tons of parameters which makes the skin loading time huge. Instead expose only what you really use:
- <EXPOSED_OBJECTS object_ids="my_param.capturing;my_param.min;my_param.max" />