
TCR1000SDK–Rev.3.0.0 Page10
TCR1000_ApiEnableCallback
TheTCR1000_ApiEnableCallbackfunctionenablestheasynchronouscallbackofauser‐supplied
callbackfunction,oraddshookstoanalready‐establishedcallbackfunction,onbehalfofthecalling
thread.
DWORDTCR1000_ApiEnableCallback(
DWORDcbToAdd,//maskofcallbackhooks
PTCRASYNC_CALLBACK_ROUTINEcbFunction//pointertouser‐suppliedcallbackfunction
);
Parameters
cbToAdd
AnycombinationofcallbackhooksASYNC_xxx(definedinINTAPI.H)tobeenabledoradded,from:
ASYNC_TIMESET Once/minuteinterrupt(second=30,frame=0)
ASYNC_PERSEC Once/secondinterrupt(second=0)
ASYNC_ENDTC Once/frameinterrupt(aftertimecodedata,beforesyncword)
ASYNC_STARTTC Once/frameinterrupt(beforetimecodedata,aftersyncword)
ASYNC_TIMELOSS Timecodelost
ASYNC_TIMEGAIN Timecoderegainedfromloststate
cbFunction
Auser‐suppliedcallbackfunctionoftypePTCRASYNC_CALLBACK_ROUTINE.Askeletonexampleof
thecallbackfunctionwouldbe:
DWORD_stdcallTCR1000_ApiAsyncCallback(DWORDdwStatus,PVOIDdata,DWORDdataLen)
{
//codeheretohandleasynchronousnotifications
}
ReturnValues
Onsuccess,thenewcallbackhooksmask(alwaysnon‐zero).Onfailure,0.
Remarks
Eachthreadinaprocessmayhaveanactivecallbackfunctionbutnomorethanone.Additionalcalls
toTCR1000_ApiEnableCallbackinthethreadwillusethefunctionpassedbytheinitialcall.Allcallsto
TCR1000_ApiEnableCallbackareonbehalfofthecallingthread,notthecallingprocess.
TCR1000_ApiEnableCallbackmust
becalledonceforeveryeventthatthecallbackfunctionshould
berunfor.Enablingacallback,insomecircumstances,can
affectthecallbackhooksofotherthreads
orotherprocessesusingtheAPI.SeethesectionentitledRelationshipofTCRInterruptstoAPI
AsynchronousNotificationsforadditionaldescriptionofissuesregardingtheuseofthisfunction.
Kommentare zu diesen Handbüchern