Using CG events, you can monitor the CG object itself and its items.
There are 5 events for a CG object.
OnCGEvent
The event is raised on every event for a CG item or a composition.
Parameters:
- bsItemOrCompositionID - ID of an item or a composition that has raised the event.
- bsEventType - name of the event.
- bsEventParam - parameters of the event.
Examples of bsEventType:
- TickerModified - raises when a ticker content has been modified. As parameters, a path to the ticker content is used.
- RSSUpdated - raises when a source of an RSS has been updated.
- FileModified - raises when a source file of an item has been modified. Works only in case "track-file" attribute is enabled for the item. As parameters, it uses a path to the file.
- CompositionsDisplay - raises when a composition has been displayed.
- CompositionsExit - raises when a composition has been hidden.
- ScheduleCompositionsDisplay - raises on displaying of a composition on a timeline.
- ScheduleCompositionsExit - raises on the hiding of a composition on a timeline.
- ScheduleShowItem - raises when an item is shown on a timeline.
- ScheduleHideItem - raises when an item is hidden on a timeline.
- ScheduleUpdateItem - raises when an item has been updated on a timeline.
OnEndOfClip
The event raises when a video clip is over, or an item is out of a frame. Works only in case of "play-mode" attribute is set to "onetime" or "onetime-hide".
It has only bsItemID as a parameter that shows the ID of the item that's over.
OnFlashCallback
Raises when a flash item event (flash callback) is used. Deprecated with latest releases.
OnFrame
Raises on each processed frame. Works only in case "OnFrameEvent.Enabled" property is enabled for the Character Generator.
OnTransitionDone
Raises when an item has been shown or hidden using a transition.
Parameters:
- bsItemID - item ID
- bShow - indicates whether the item is shown (true) or hidden (false).
Code examples of the events
C#
m_objCharGen.OnCGEvent += M_objCharGen_OnCGEvent; m_objCharGen.OnEndOfClip += M_objCharGen_OnEndOfClip; m_objCharGen.OnFlashCallback += M_objCharGen_OnFlashCallback; m_objCharGen.OnFrame += M_objCharGen_OnFrame; m_objCharGen.OnTransitionDone += M_objCharGen_OnTransitionDone;
private void M_objCharGen_OnTransitionDone(string bsItemID, bool bShow) { throw new NotImplementedException(); } private void M_objCharGen_OnFrame(double dblTime, int nMediaTime, int nFrameNum) { throw new NotImplementedException(); } private void M_objCharGen_OnFlashCallback(string bsItemID, string bsMethodName, string bsParameters) { throw new NotImplementedException(); } private void M_objCharGen_OnEndOfClip(string bsItemID) { throw new NotImplementedException(); } private void M_objCharGen_OnCGEvent(string bsItemOrCompositionID, string bsEventType, string bsEventParam) { throw new NotImplementedException(); }
Delphi
TCGEvents = class (TInterfacedObject, IMLCharGenCallback) function OnFrame(llCallbackCookie: Int64; dblTime: Double; nMediaTime: SYSINT; nFrameNum: SYSINT): HResult; stdcall; function OnEndOfClip(llCallbackCookie: Int64; const bsItemID: WideString): HResult; stdcall; function OnTransitionDone(llCallbackCookie: Int64; const bsItemID: WideString; bShow: WordBool): HResult; stdcall; function OnFlashCallback(llCallbackCookie: Int64; const bsItemID: WideString; const bsMethodName: WideString; const bsParameters: WideString): HResult; stdcall; function OnCGEvent(llCallbackCookie: Int64; const bsItemOrCompositionID: WideString; const bsEventType: WideString; const bsEventParam: WideString): HResult; stdcall; end;
function TCGEvents.OnCGEvent(llCallbackCookie: Int64; const bsItemOrCompositionID: WideString; const bsEventType: WideString; const bsEventParam: WideString): HResult; stdcall; begin MessageBox(bsItemOrCompositionID); end; function TCGEvents.OnFrame(llCallbackCookie: Int64; dblTime: Double; nMediaTime: SYSINT; nFrameNum: SYSINT): HResult; stdcall; begin end; function TCGEvents.OnEndOfClip(llCallbackCookie: Int64; const bsItemID: WideString): HResult; stdcall; begin MessageBox(bsItemID); end; function TCGEvents.OnTransitionDone(llCallbackCookie: Int64; const bsItemID: WideString; bShow: WordBool): HResult; stdcall; begin end; function TCGEvents.OnFlashCallback(llCallbackCookie: Int64; const bsItemID: WideString; const bsMethodName: WideString; const bsParameters: WideString): HResult; stdcall; begin end;