SetActionCallback
|
|
[in] void* context
|
Address of the context in which the callback function will be called.
|
|
[in] ActionCallback 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.
|
S_OK
|
Success
|
E_FAIL
|
Failure
|
bool CGigemuDlg::onActionCommand(const ActionParameters* params)
|
{
|
if((params.device_key==m_DeviceKey) && (params.group_key==m_GroupKey))
|
{
|
//action command is intended for our virtual camera, implement corresponding action and return true
|
if(params.group_mask & 1))
|
{
|
ImplementAction1();
|
return true;
|
}
|
else if(params.group_mask & 2))
|
{
|
ImplementAction2();
|
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->SetActionCallback(this, &::onActionCommand);
|
....
|
}
|
|