Base interface to operate CG items
Methods
AddCallback
adds callback (for C++ and Delphi) to CG.
Syntax
AddCallback(
IMLCharGenCallback _pCallback,
int _nCookie
)
Parameters
_pCallback - callback interface
_nCookie - callback cookie
AddImageByHandle
adds an image from memory by its handle.
Syntax
AddImageByHandle(
int _hBitmap,
double _dblPosX,
double _dblPosY,
int _bRelativePos,
int _bShow,
out string _pbsItemID
)
Parameters
_hBitmap - image handle
_dblPosX - X-axis position
_dblPosY - Y-axis position
_bRelativePos - indicates whether the position is relative
_bShow - indicates whether the item is shown
_pbsItemID - ID of new item
AddNewItem
adds a new item to the current configuration.
Syntax
AddNewItem(
string _bsFileNameOrItemDesc,
double _dblPosX,
double _dblPosY,
int _bRelativePosAndSize,
int _bShow,
out string _pbsItemID
)
Parameters
_bsFileNameOrItemDesc - file name or item XML description
_dblPosX - X-axis position
_dblPosY - Y-axis position
_bRelativePosAndSize - indicates whether position and item size are relative
_bShow - indicates whether a new item is shown
_pbsItemID - new item ID
AddNewTextItem
adds a new text item to the current configuration.
Syntax
AddNewTextItem(
ref CG_TEXT_PROPS _pTextProps,
double _dblPosX,
double _dblPosY,
int _bRelativePos,
int _bShow,
out string _pbsItemID
)
Parameters
_pTextProps - text properties
_dblPosX - X-axis position
_dblPosY - Y-axis position
_bRelativePos - indicates whether the position in relative
_bShow - indicates whether an item is shown
_pbsItemID - new item ID
CaptureItemImage
captures the item image to a file.
Syntax
CaptureItemImage(
string _bsItemID,
string _bsFileName,
eCG_FileType _eFileType
)
Parameters
_bsItemID - item ID
_bsFileName - output file name
_eFileType - file type
ChangeItemID
changes item ID.
Syntax
ChangeItemID(
string _bsItemID,
string _bsItemNewID
)
Parameters
_bsItemID - item ID
_bsItemNewID - new ID of the item
ChangeItemZOrder
changes order of item on Z axis (front - back).
Syntax
ChangeItemZOrder(
string _bsItemID,
int _nChange
)
Parameters
_bsItemID - item ID
_nChange - direction and length of changes (negative is to back, positive is to front)
CloneItem
clones the item.
Syntax
CloneItem(
string _bsOriginalItemID,
int _bMakeReference,
out string _pbsNewItemID
)
Parameters
_bsOriginalItemID - original item ID
_bMakeReference - indicates whether the new item is a reference to the original item. It means that if you change the original item then all these changes are implemented to the new one.
_pbsNewItemID - new item ID
CompositionsAddItems
adds an item to a composition.
Syntax
CompositionsAddItems(
string _bsItemsID,
int _bClearBeforeAdd,
string _bsCompositionComment,
out string _pbsCompositionName
)
Parameters
_bsItemsID - item ID
_bClearBeforeAdd - indicates whether the composition is cleared before adding this item
_bsCompositionComment - comment to the composition
_pbsCompositionName - name of the composition
CompositionsChangeName
changes the composition name.
Syntax
CompositionsChangeName(
string _bsCompositionName,
string _bsNewCompositionName,
string _bsNewCommment
)
Parameters
_bsCompositionName - composition name
_bsNewCompositionName - new composition name
_bsNewCommment - new composition comment
CompositionsDisplay
displays a composition.
Syntax
CompositionsDisplay(
string _bsCompositionName,
string _bsParamString,
double _dblTimeIntro,
double _dblShowTime,
double _dblTimeExit
)
Parameters
_bsCompositionName - composition name
_bsParamString - additional parameters
_dblTimeIntro - time to introduce a composition in seconds
_dblShowTime - time to show composition in seconds. To display composition forever you should set 0.
_dblTimeExit - time to hide a composition in seconds
CompositionsDisplayInLayer
displays composition in some layer. You need to create layer before call this method.
Syntax
CompositionsDisplayInLayer(
string _bsCompositionName,
string _bsParamString,
string _bsLayerID,
double _dblTimeIntro,
double _dblShowTime,
double _dblTimeExit
)
Parameters
_bsCompositionName - composition name
_bsParamString - additional parameters
_bsLayerID -layer ID to display the composition in
_dblTimeIntro - time to introduce a composition in seconds
_dblShowTime - time to show composition in seconds. To display composition forever you should set 0.
_dblTimeExit - time to hide a composition in seconds
CompositionsGetByIndex
gets composition by its index.
Syntax
CompositionsGetByIndex(
int _nIndex,
out string _pbsName,
out string _pbsComment
)
Parameters
_nIndex - composition index
_pbsName - name of the composition
_pbsComment - composition comment
CompositionsGetCount
gets a number of compositions.
Syntax
CompositionsGetCount(
out int _pnCount
)
Parameters
_pnCount - number of compositions
CompositionsGetItem
gets an item in a composition by its index.
Syntax
CompositionsGetItem(
string _bsCompositionName,
int _nIndex,
out string _pbsItemID,
out string _pbsItemXMLDesc
)
Parameters
_bsCompositionName - composition name
_nIndex - item index
_pbsItemID - item ID
_pbsItemXMLDesc - descriprion of the item
CompositionsGetItemsCount
gets count of items in a composition.
Syntax
CompositionsGetItemsCount(
string _bsCompositionName,
ref int _pnCount
)
Parameters
_bsCompositionName - composition name
_pnCount - number of items
CompositionsLoadAll
loads several compositions at once.
Syntax
CompositionsLoadAll(
string _bsFileNameOrXMLDescription,
int _bClearBeforeLoad
)
Parameters
_bsFileNameOrXMLDescription - file name or XML description of compositions
_bClearBeforeLoad - indicates whether all composition will be cleared before loading
CompositionsLoadOne
loads a single composition.
Syntax
CompositionsLoadOne(
string _bsFileNameOrXMLDescription,
out string _pbsCompositionName
)
Parameters
_bsFileNameOrXMLDescription - file name or XML description of composition
_pbsCompositionName - composition name
CompositionsRemove
removes the composition.
Syntax
CompositionsRemove(
string _bsCompositionName
)
Parameters
_bsCompositionName - a composition name
CompositionsRemoveItem
removes an item from a composition.
Syntax
CompositionsRemoveItem(
string _bsCompositionName,
string _bsItemID
)
Parameters
_bsCompositionName - composition name
_bsItemID - item ID
CompositionsSaveToFile
saves a composition configuration to a file.
Syntax
CompositionsSaveToFile(
string _bsCompositionName,
string _bsFileName
)
Parameters
_bsCompositionName - composition name
_bsFileName - output file name
CompositionsSaveToString
saves composition configuration to a string.
Syntax
CompositionsSaveToString(
string _bsCompositionName,
out string _pbsXMLDesc
)
Parameters
_bsCompositionName - composition name
_pbsXMLDesc - output string with description
EnableKeyingMode
enables keyig mode. Doesn't work in MPlatform and MFormats SDKs (only for DirectShow filter)
Syntax
EnableKeyingMode(
int _bEnable
)
Parameters
_bEnable - "1" to enable keying, "0" to desable keying
FlashCallFunction
calls function of a flash object.
Syntax
FlashCallFunction(
string _bsItemID,
string _bsRequest,
out string _pbsResponce
)
Parameters
_bsItemID - item ID
_bsRequest - flash function name
_pbsResponce - result of request
FlashGetClipInfo
gets flash clip information.
Syntax
FlashGetClipInfo(
string _bsItemID,
out int _pnTotalFrames,
out double _pdblFrameRate
)
Parameters
_bsItemID - item ID
_pnTotalFrames - number of frames
_pdblFrameRate - frame rate
FlashGetVariable
gets flash variable.
Syntax
FlashGetVariable(
string _bsItemID,
string _bsVarName,
out string _pbsVarValue
)
Parameters
_bsItemID - item ID
_bsVarName - name of variable
_pbsVarValue - value of variable
FlashGetVariableName
gets name of variable by its index.
Syntax
FlashGetVariableName(
string _bsItemID,
int _nIndex,
out string _pbsVarName
)
Parameters
_bsItemID - item ID
_nIndex - variable index
_pbsVarName - name of a variable
FlashGetVariablesCount
gets count of flash variables.
Syntax
FlashGetVariablesCount(
string _bsItemID,
out int _pnCount
)
Parameters
_bsItemID - item ID
_pnCount - number of variables
FlashGoToFrame
seeks to the frame in flash.
Syntax
FlashGoToFrame(
string _bsItemID,
string _bsTarget,
int _nFrame
)
Parameters
_bsItemID - item ID
_bsTarget - flash target
_nFrame - frame number
FlashGoToLabel
seeks to a flash label.
Syntax
FlashGoToLabel(
string _bsItemID,
string _bsTarget,
string _bsLabel
)
Parameters
_bsItemID - item ID
_bsTarget - flash target
_bsLabel - flash label
FlashSetReturnValueCB
sets flash returned value.
Syntax
FlashSetReturnValueCB(
string _bsReturnValue
)
Parameters
_bsReturnValue - returned value
FlashSetVariable
sets flash variable.
Syntax
FlashSetVariable(
string _bsItemID,
string _bsVarName,
string _bsVarValue
)
Parameters
_bsItemID - item ID
_bsVarName - name of variable
_bsVarValue - value of variable
GetAutoBlend
gets auto-blend configuration of an item.
Syntax
GetAutoBlend(
string _bsItemID,
out CG_AUTO_BLEND _pAutoBlend
)
Parameters
_bsItemID - item ID
_pAutoBlend - auto-blend configuration
GetItem
gets an item by its index.
Syntax
GetItem(
int _nIndex,
out string _pbsItemID
)
Parameters
_nIndex - item index
_pbsItemID - item ID
GetItemAnchorPos
gets item anchor position.
Syntax
GetItemAnchorPos(
string _bsItemID,
out eCG_Align _peItemRelAnchor,
out eCG_Align _peScreenRelAnchor
)
Parameters
_bsItemID - item ID
_peItemRelAnchor - item relative anchor
_peScreenRelAnchor - screen relative anchor
GetItemMovement
gets item movement configuration.
Syntax
GetItemMovement(
string _bsItemID,
out CG_ITEM_MOVEMENT _pItemMove
)
Parameters
_bsItemID - item ID
_pItemMove - item movement structure
GetItemOriginalSize
gets original size of the item.
Syntax
GetItemOriginalSize(
string _bsItemID,
out tagSIZE _pSize
)
Parameters
_bsItemID - item ID
_pSize - size of the item
GetItemProperties
gets item property.
Syntax
GetItemProperties(
string _bsItemID,
string _bsPropertyName,
out string _pbsPropertyDesc
)
Parameters
_bsItemID - item ID
_bsPropertyName - name of the property
_pbsPropertyDesc - description (value) of the property
GetItemRate
gets item rate.
Syntax
GetItemRate(
string _bsItemID,
out int _pbOriginalRate,
out double _pdblSpeed
)
Parameters
_bsItemID - item ID
_pbOriginalRate - original rate
_pdblSpeed - rate of the item
GetItemsCount
gets a count of items in the current configuration.
Syntax
GetItemsCount(
out int _pnItems
)
Parameters
_pnItems - number of items
GetPlayingFrame
gets a current frame.
Syntax
GetPlayingFrame(
string _bsItemID,
out int _pnFrame,
out string _bsCurrentImage
)
Parameters
_bsItemID - item ID
_pnFrame - frame number
_bsCurrentImage - description of current image
GetVideoOutputRect
gets item output rectangular.
Syntax
GetVideoOutputRect(
out tagRECT _prcSource,
out tagRECT _prcTarget,
out int _pcrBackColor,
out int _pbTopmostVideo
)
Parameters
_prcSource - source rectangular
_prcTarget - target rectangular
_pcrBackColor - background color
_pbTopmostVideo - index of the most top video
GetVideoProperties
gets video properties.
Syntax
GetVideoProperties(
out CG_VIDEO_PROPS _pVideoPropsSet,
out CG_VIDEO_PROPS _pVideoPropsOrigin
)
Parameters
_pVideoPropsSet - video properties
_pVideoPropsOrigin - original video properties
GroupAddItem
adds an item to a group.
Syntax
GroupAddItem(
string _bsItemID,
int _bAddAsReference,
string _bsGroupType,
out string _pbsGroupID
)
Parameters
_bsItemID - item ID
_bAddAsReference - indicates whether the new item is a reference of the current item. It means that if you change the original item then all the changes affect the new one.
_bsGroupType - a type of a group
_pbsGroupID - group ID
GroupGetItem
gets group item by its index.
Syntax
GroupGetItem(
string _bsGroupID,
int _nIndex,
out string _pbsItemID
)
Parameters
_bsGroupID - group ID
_nIndex - item index within the group
_pbsItemID - item ID
GroupGetItemGroup
gets a group ID with an item ID.
Syntax
GroupGetItemGroup(
string _bsItemID,
out string _pbsGroupID
)
Parameters
_bsItemID - item ID
_pbsGroupID - group ID (if the item is not in the group then empty string)
GroupItemsCount
gets a number of items in a group.
Syntax
GroupItemsCount(
string _bsGroupID,
out int _pnItemsCount
)
Parameters
_bsGroupID - group ID
_pnItemsCount - number of items
GroupRemoveAll
removes all items from the group.
Syntax
GroupRemoveAll(
string _bsGroupID,
eCG_GroupItemsRemoveType _eRemoveType
)
Parameters
_bsGroupID - group ID
_eRemoveType - type of remove
GroupRemoveItem
removes a single item from a group.
Syntax
GroupRemoveItem(
string _bsGroupID,
string _bsItemID
)
Parameters
_bsGroupID - group ID
_bsItemID - item ID
IsKeyingMode
indicates whether CG is in keying mode. For DirectShow filter only.
Syntax
IsKeyingMode(
out int _pbKeying
)
Parameters
_pbKeying - 1 is for keying ON, 0 is for OFF
IsUseExtraBuffer
indicates whether CG uses an extra buffer.
Syntax
IsUseExtraBuffer(
out int _pnUse
)
Parameters
_pnUse - 1 means that CG uses an extra buffer, 0 means that doesn't
LoadConfig
load a configuration.
Syntax
LoadConfig(
string _bsConfigPathXML,
int _bDefaultClear,
string _bsParam
)
Parameters
_bsConfigPathXML - path to XML configuration
_bDefaultClear - indicates whether to clear the current configuration
_bsParam - parameters
PauseItem
pauses an item.
Syntax
PauseItem(
string _bsItemID,
int _bPause
)
Parameters
_bsItemID - item ID
_bPause - 1 to pause an item, 0 to unpause the one
RemoveCallback
removes a CG callback.
Syntax
RemoveCallback(
IMLCharGenCallback _pCallback
)
Parameters
_pCallback - callback interface
RemoveCallback2
removes callback cookie.
Syntax
RemoveCallback2(
int _nCookie
)
Parameters
_nCookie - callback cookie
RemoveItem
removes an item.
Syntax
RemoveItem(
string _bsItemID,
int _nFadeOutMsec
)
Parameters
_bsItemID - item ID
_nFadeOutMsec - time to fade the item (in msec)
RemoveItemWithDelay
removes item with delay.
Syntax
RemoveItemWithDelay(
string _bsItemID,
int _nMsecDelay,
int _nFadeOutMsec
)
Parameters
_bsItemID - item ID
_nMsecDelay - a delay duration (in msec)
_nFadeOutMsec - a time to fade the item (in msec)
RewindItem
rewinds an item.
Syntax
RewindItem(
string _bsItemID
)
Parameters
_bsItemID - item item
SetAutoBlend
sets an item auto-blend parameters.
Syntax
SetAutoBlend(
string _bsItemID,
ref CG_AUTO_BLEND _pAutoBlend
)
Parameters
_bsItemID - item ID
_pAutoBlend - auto-blend parameters
SetItemAlpha
sets item transparency (from 0 to 255).
Syntax
SetItemAlpha(
string _bsItemID,
int _nNewAlpha,
int _nMsecForChange
)
Parameters
_bsItemID - item ID
_nNewAlpha - alpha value
_nMsecForChange - time for changes (in msec)
SetItemAnchorPos
sets item anchor position.
Syntax
SetItemAnchorPos(
string _bsItemID,
eCG_Align _eItemRelAnchor,
eCG_Align _eScreenRelAnchor
)
Parameters
_bsItemID - item ID
_eItemRelAnchor - item relative anchor
_eScreenRelAnchor - screen relative anchor
SetItemBackground
sets an item background.
Syntax
SetItemBackground(
string _bsItemID,
int _nBackground,
int _nMsecForChange
)
Parameters
_bsItemID - item ID
_nBackground - background color (HEX code 0xAARRGGBB converted to integer)
_nMsecForChange - time for changes (in msec)
SetItemBaseProps
sets an item base properties.
Syntax
SetItemBaseProps(
string _bsItemID,
ref CG_ITEM_PROPS _pItemInfo,
int _nMsecForChange
)
Parameters
_bsItemID - item ID
_pItemInfo - item properties
_nMsecForChange - time for changes (in msec)
SetItemMovement
sets item movement.
Syntax
SetItemMovement(
string _bsItemID,
ref CG_ITEM_MOVEMENT _pItemMove
)
Parameters
_bsItemID - item ID
_pItemMove - movement parameters
SetItemPos
sets item positions.
Syntax
SetItemPos(
string _bsItemID,
double _dblPosX,
double _dblPosY,
int _bRelativePos,
int _nMsecForChange
)
Parameters
_bsItemID - item ID
_dblPosX - X axis position
_dblPosY - Y axis position
_bRelativePos - indicates whether position is relative
_nMsecForChange - time for changes (in msec)
SetItemProperties
sets item properties.
Syntax
SetItemProperties(
string _bsItemID,
string _bsPropertyName,
string _bsPropertyValue,
string _bsChangeType,
int _nMsecForChange
)
Parameters
_bsItemID - item ID
_bsPropertyName - property name
_bsPropertyValue - value of the property
_bsChangeType - type of change
_nMsecForChange - time for change (in msec)
SetItemRate
sets item rate.
Syntax
SetItemRate(
string _bsItemID,
int _bOriginalRate,
double _dblSpeed
)
Parameters
_bsItemID - item ID
_bOriginalRate - original rate
_dblSpeed - item rate
SetItemSize
sets item size.
Syntax
SetItemSize(
string _bsItemID,
double _dblSizeX,
double _dblSizeY,
int _bRelativeSize,
int _nMsecForChange
)
Parameters
_bsItemID - item ID
_dblSizeX - width
_dblSizeY - height
_bRelativeSize - indicates whether size is relative
_nMsecForChange - time for changes (in msec)
SetPlayingFrame
sets item playing frame.
Syntax
SetPlayingFrame(
string _bsItemID,
int _nFrame
)
Parameters
_bsItemID - item ID
_nFrame - frame number
SetTimeOffset
sets offset position.
Syntax
SetTimeOffset(
double _dblTime,
int _bStreamTime
)
Parameters
_dblTime - offset position
_bStreamTime - stream time
SetVideoOutputRect
sets video output rectangular.
Syntax
SetVideoOutputRect(
ref tagRECT _prcSource,
ref tagRECT _prcTarget,
int _crBackColor,
int _bTopmostVideo
)
Parameters
_prcSource - source rectangular
_prcTarget - target rectangular
_crBackColor - background color
_bTopmostVideo - index of the most top video
SetVideoOutputRectWithDelay
sets video output rectangular with delay.
Syntax
SetVideoOutputRectWithDelay(
ref tagRECT _prcSource,
ref tagRECT _prcTarget,
int _crBackColor,
int _bTopmostVideo,
int _nMsecDelay,
int _nMsecForChange
)
Parameters
_prcSource - source rectangular
_prcTarget - target rectangular
_crBackColor - background color
_bTopmostVideo - index of the most top video
_nMsecDelay - delay duration (in msec)
_nMsecForChange - time for changes (in msec)
SetVideoProperties
sets video properties.
Syntax
SetVideoProperties(
ref CG_VIDEO_PROPS _pVideoProps
)
Parameters
_pVideoProps - video properties
ShowItem
shows or hides an item.
Syntax
ShowItem(
string _bsItemID,
int _bShow,
int _nMsecForChange
)
Parameters
_bsItemID - item ID
_bShow - 1 to show an item, 0 to hide the one
_nMsecForChange - time for changes (in msec)
ShowItemWithDelay
shows or hides item with delay.
Syntax
ShowItemWithDelay(
string _bsItemID,
int _bShow,
int _nMsecDelay,
int _nMsecForChange
)
Parameters
_bsItemID - item ID
_bShow - 1 to show an item, 0 to hide the one
_nMsecDelay - delay duration (in msec)
_nMsecForChange - time for changes (in msec)
ShowPropertiesPage
shows CG properties menu.
Syntax
ShowPropertiesPage(
int _lHWndParent
)
Parameters
_lHWndParent - parent window handle
TextGetProps
gets text item properties.
Syntax
TextGetProps(
string _bsItemID,
out CG_TEXT_PROPS _pTextProps
)
Parameters
_bsItemID - text item ID
_pTextProps - text properties
TextSetProps
sets text item properties.
Syntax
TextSetProps(
string _bsItemID,
ref CG_TEXT_PROPS _pItemInfo,
int _bUpdateItemSize,
int _nMsecForChange
)
Parameters
_bsItemID - text item ID
_pItemInfo - text properties
_bUpdateItemSize - indicates whether item size is updated after setting new properties (1 to update, 0 to ignore)
_nMsecForChange - time for changes (in msec)
TickerAddContent
adds content to the ticker.
Syntax
TickerAddContent(
string _bsTickerItemID,
string _bsTickerTextOrFile,
string _bsAddType
)
Parameters
_bsTickerItemID - ticker item ID
_bsTickerTextOrFile - text ot file path to add to ticker
_bsAddType - The adding type.
Supported:
'add-to-end' (default) - the new ticker item added to the end of items list
'remove-first' - the first items from ticker removed, new one - added to the end
'remove-all' - all items removed (except displaying now) - new item/items added
Flag:
'multiline' - each line of text string added as separate item
'not-track-file' - not track the text file changing (for update tickers)
Usage:
TickerAddContent( cbsTickerID, "Some Text...", "remove-first, multiline" );
TickerAddContent( cbsTickerID, "C:\Folder\news.txt", "remove-all, not-track-file" );
TickerAddNew
adds new ticker item.
Syntax
TickerAddNew(
string _bsItemTypeOrXMLDesc,
double _dblPosX,
double _dblPosY,
double _dblSizeX,
double _dblSizeY,
int _bRelativePos,
int _bShow,
out string _pbsTickerID
)
Parameters
_bsItemTypeOrXMLDesc - description of ticker
_dblPosX - X axis position
_dblPosY - Y axis position
_dblSizeX - width
_dblSizeY - height
_bRelativePos - indicates whether position is relative
_bShow - 1 to show an item, 0 to hide the one
_pbsTickerID - item ID
UseExtraBuffer
start or stop using extra buffer.
Syntax
UseExtraBuffer(
int _nUse
)
Parameters
_nUse - 1 to use buffer, 0 to stop its usage