Medialooks Knowledge Base Support Center

Contact Us

CG Events

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:

Examples of bsEventType:

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:

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;