SetScheduledActionCallback
|
![]() ![]() ![]() |
|
[in] void* context
|
Address of the context in which the callback function will be called.
|
|
[in] ScheduledActionCallback callback
|
Address of the callback function
|
|
[in] const ActionParameters* params
|
Pointer to an ActionParameters structure containing the following fields:
|
|
unsigned int group_mask
|
The 32-bit value of the group mask in the received action command.
|
|
unsigned __int64 action_time
|
The 64-bit value of the scheduled action time in nanoseconds.
|
S_OK
|
Success
|
E_FAIL
|
Failure
|
bool CGigemuDlg::onScheduledActionCommand(const ActionParameters* params)
|
{
|
if((params.device_key==m_DeviceKey) && (params.group_key==m_GroupKey))
|
{
|
//action command is intended for our virtual camera, convert action time into windows file time
|
#define SEC_TO_UNIX_EPOCH 11644473600LL
|
#define WINDOWS_TICK 10000000
|
unsigned __int64 ll;
|
LPFILETIME pft;
|
ll = (params->action_time/1000000000 + SEC_TO_UNIX_EPOCH) * WINDOWS_TICK;
|
pft->dwLowDateTime = (DWORD)ll;
|
ScheduleTriggerTimer(pft); //User-defined function for scheduling a frame transfer
|
return true;
|
}
|
//action parameters do not match action key settings of the virtual camera, ignore it
|
return false;
|
}
|
....
|
static CGevCamera* m_pCamera;
|
m_pCamera = createCamera();
|
m_pCamera->SetActionCount(1);
|
m_pCamera->SetScheduledActionCallback(this, &::onScheduledActionCommand);
|
....
|
}
|
|