This type of properties has each item of Character Generator configuration. These properties define basic item parameters - size, position, background etc.
Base properties are specified in <cg-props> node of item XML description:
<cg-item id='graphics-000'> <graphics type='rect' round-corners='0.30' outline='3.0' color='Red(220)-Yellow(100)-Green(180)' color-angle='-45' outline-color='white'/> <cg-props pos-x='36' pos-y='24' show='yes' move-type='accel-both' alpha='255' bg-color='Black(0)' pixel-ar='0.' play-mode='loop' interlace='auto' scale='fit-ar' align='top-left' width='284' height='256' pause='no' edges-smooth='0'> <indent left='0' right='0' top='0' bottom='0' use-for-bg='no'/> <group-indent left='0' right='0' top='0' bottom='0'/> </cg-props> </cg-item>
You can specify base properties of an item with the SetItemBaseProps method. This method contains the following parameters:
- _bsItemID - item identifier
- _pItemInfo - item properties that are specified with CG_ITEM_PROPS structure
- _nMsecForChange - time interval to set properties smooth in milliseconds
Here is a table with description of structure fields and XML properties:
CG_ITEM_PROPS field | XML properties | Description | Possible values | Alternative ways to set |
---|---|---|---|---|
bPauseItem | pause='no' | Pauses the item (pauses movement or image sequent) or release pause state. Possible item types: flash, image sequences, crawls, rolls, tickers | For structure: 0, 1 For XML: 'no', 'yes' |
PauseItem method |
bShowItem | show='yes' | Shows or hides the item. | For structure: 0, 1 For XML: 'no', 'yes' |
ShowItem or ShowItemWithDelay method |
dblPixelAR | pixel-ar='0.' | Item pixel AR (not work for Flash items): 0 - Automated (based on screen AR or overridden props - e.g. for PAL 4:3 video the pixel AR is 1.066) 1.0 - Square pixels 2.0 - width doubled 0.5 - half of width |
For both - double value, e.g. '1.333' | |
eAlign | align='top-left' | Set item alignment | For structure: listed in eCG_Align enumeration For XML: 'top-left', 'top', 'top-right', 'left', 'center', 'right', 'bottom-left', 'bottom', 'bottom-right' |
|
eInterlace | interlace='auto' | Interlacing mode (for smooth animation over interlaced video). Note: For interlaced items flash rate ignored |
For structure: listed in eCG_Interlace enumeration For XML: 'auto', 'top', 'bottom', 'progressive' |
|
ePlayingMode | play-mode='loop' | Mode of item playback | For structure: listed in eCG_PlayingMode enumeration For XML: 'loop', 'onetime', 'onetime-hide' |
|
eScale | scale='text-scale' | Type of item scaling | For structure: listed in eCG_Scale enumeration For XML: 'fit-ar', 'exact-fit', 'no-scale', 'shrink-to-fit', 'shrink-to-fit-ar', 'cover-ar', 'text-scale' |
|
eType | Specified in separated node | Item type | For structure: listed in eCG_ItemType enumeration | |
nAlpha | alpha='255' | Opacity of the item | For both - integer value from 0 (transparent) to 255 (solid) | SetItemAlpha method |
nBackColor | bg-color='Black(0)' | Background color of the item | For structure: color in RGBA format 0xAABBGGRR, e.g. 0x0088AAEE | SetItemBackground method |
nEdgesSmooth | edges-smooth='0' | Smoothness | For both - integer value from 0 to 16 | |
ptPos | pos-x='36' pos-y='24' |
Item position | For structure: specifies in tagPOINT structure For XML: point coordinates in pixels |
SetItemPos method |
rcIndent | Specified in child <indent> node: <indent left='0' right='0' top='0' bottom='0' use-for-bg='no'/> |
The item content (image/text/flash) indent from item borders. Note: If item in group then the view area is decreased by indent size. |
For structure: specified in tagRECT structure For XML: indent from each border in pixels. use-for-bg - specifies whether the settings are implemented for background also ('yes') or not ('no') |
|
szItem | width='284' height='256' |
Item (group) size Special values: szItem = (0,0) - use original size szItem = (0,y) - set X size according to AR szItem = (x,0) - set Y size according to AR, szItem = (-1,-1) - (group only) update group size to cover all group items |
For structure: specified tagSIZE structure For XML: width and height in pixels |
SetItemSize method |
move-type='accel-both' | Movement acceleration type. | For XML: linear - no acceleration accel-start - acceleration for the beginning of a movement accel-stop - acceleration for stopping of movement accel-both - both types of acceleration |
||
intro-delay='1.0'; exit-delay='1.0' |
delay before showing CG item; delay after removing CG item |
For XML: time in seconds |
With source code, you can set base properties like:
string itemID = "text-000"; int timeToSet = 50; CG_ITEM_PROPS myProps = new CG_ITEM_PROPS(); myProps.bShowItem = 1; myProps.nAlpha = 100; myProps.ptPos = new tagPOINT{ x = 200, y = 150}; m_objCharGen.SetItemBaseProps(itemID, ref myProps, timeToSet);