There is a special type of commands that could be used in MPlatform SDK to manage a Character Generator. It is "CG" command. A command contains its name and its parameters. For CG commands, the name is always the same - it is "CG". And there are only 3 types of parameters. The way of usage is the same as for playlist commands.
Make sure before using the CG commands that a CG object is added to your main object (e.g. MPlaylist) as a plugin.
Load
A command like "CG load=[parameters]" loads a configuration of a CG.
Parameters
Right after "load", you should set a path to a file with a configuration. For example, "load='c:\myCGconfig.xml'".
Other parameters:
- 'clear' - sets whether the current items should be cleared. For example, "load='c:\myCGconfig.xml' clear='true'", to clear the items before loading a new configuration.
- 'clear-items' - once set to 'true' removes all previously loaded CG items. If not specified, matches 'clear' value.
- 'clear-compositions' once set to 'true' removes all previously loaded CG compositions. If not specified, matches 'clear' value.
- 'clear-schedule' once set to 'true' removes all previously loaded CG timelines. If not specified, matches 'clear' value.
- 'load-items' once set to 'true' loads CG items from the configuration. The default value is 'true'.
- 'load-compositions' once set to 'true' loads CG compositions from the configuration. The default value is 'true'.
- 'load-schedule' once set to 'true' loads CG timelines (schedules) from the configuration. The default value is 'true'.
Example
MItem item; int index = -1; m_objPlaylist.PlaylistCommandAdd("CG", @"load='c:\myConfig.xml' clear='true'", null, ref index, out item);
Display
The command displays or hides an item or a composition.
Parameters
You should specify an item or a composition ID as a main parameter of the command. For this item, the command is run. For example, "display='text-000'".
Other parameters:
- 'param' - sets a special parameter value for a CG item or a composition. For example, "display='text-000' param=text='New Item Text'" to set a new text value.
- 'cg-show' - sets whether an item or a composition is displayed or hidden.
- 'cg-time-in' - sets a time delay to display item or composition in seconds.
- 'cg-time-show' - sets a duration of displaying the item or the composition in seconds.
- 'cg-time-ramp' - sets a duration of updating the display properties of the item or the composition (transition time) in seconds.
Example
MItem item; int index = -1; m_objPlaylist.PlaylistCommandAdd("CG", @"display='myComposition' cg-show='true' cg-time-in='0.5' cg-time-show='15'", null, ref index, out item);
As a result, the 'myComposition' (if it has been loaded previously) will be displayed using 0.5 seconds for appearance and 15 seconds for showing.
Set
The command specifies parameters of items or starts a timeline.
Parameters
The main parameter for the command is an item ID. Once specified, the following parameters are implemented to the item.
- 'param' - sets any possible property for the item. For example, "set=img-000 param=img::path='c:\testImage.png'" to update a path to an image.
- 'text' - sets a text to be updated for a text item. For example, "set=text-000 text='New Text String'".
- 'cg-time-ramp' - sets a duration for changes of properties in seconds. For example, "set=text-000 param=cg-props::width='100' cg-time-ramp=2".
Example
MItem item; int index = -1; m_objPlaylist.PlaylistCommandAdd("CG", @"set=text-000 param=cg-props::width='100' cg-time-ramp=2", null, ref index, out item);