Create/Clear PTZF Preset¶
Create PTZF Preset¶
To create PTZF Preset specified index, call SCRSDK::PresetPTZFSet(). PresetPTZFSet() needs four parameters.
PTZF Preset is displayed on WebUI.
Example:
constexpr CrInt16u index = 2;
SCRSDK::CrError ret = SCRSDK::PresetPTZFSet(handle, index, SCRSDK::CrPresetPTZFSettingType_current, SCRSDK::CrPresetPTZFThumbnail_On);
if (CR_FAILED(ret))
{
printf("fail create ptzf preset.\n");
return;
}
Clear PTZF Preset¶
To clear PTZF Preset specified index, call SCRSDK::PresetPTZFClear(). PresetPTZFClear() needs two parameter.
Example:
constexpr CrInt16u index = 2;
SCRSDK::CrError ret = SCRSDK::PresetPTZFClear(handle, index);
if (CR_FAILED(ret))
{
printf("fail clear ptzf preset.\n");
return;
}
Handling preset ptzf events
Example:
void OnWarningExt(CrInt32u warning, CrInt32 param1, CrInt32 param2, CrInt32 param3)
{
if(warning==CrWarningExt_PresetPTZFEvent) {
(void)param2; // not used
(void)param3; // not used
CrWarningExtParam_PresetPTZFEvent result = (CrWarningExtParam_PresetPTZFEvent)param1;
switch(result) {
case CrWarningExtParam_PresetPTZFEvent_Invalid:
// result is invalid.
break;
case CrWarningExtParam_PresetPTZFEvent_DriveCompleted:
// drive is stopped(Completed).
break;
case CrWarningExtParam_PresetPTZFEvent_DriveInterrupted:
// drive is stopped(Interrupted).
break;
case CrWarningExtParam_PresetPTZFEvent_DriveError:
// drive is stopped(Error).
break;
}
}
...
}