Capture interaction
Capture & calibration
Returned by device.capture_control() for externally controlled capture. Request and stage identifiers must come from the latest capture progress.
CaptureControl::confirm()
Confirm the current request so capture can continue.
Type
void CaptureControl::confirm(const std::string& request_id) const;Parameters
request_id: required; a non-empty identifier from the latest progress or session snapshot.
Returns
void.
Details
- Call conditions: After external interaction receives the current request.
Errors
- Empty, expired, or state mismatch.
Example
Obtain control from device.capture_control(). Run this in external mode after the user approves the prompt, and track handled requests to avoid duplicate confirmation.
const auto sample = device.capture_progress().latest();
if (sample) {
const auto& stage = sample->value.stage;
if (stage.state == qnbot::CaptureStageState::awaiting_confirmation
&& stage.request_id) {
control.confirm(*stage.request_id);
}
}Complete example: external_input_run_background.cpp.
See also
CaptureControl::skip()
Skip the current capture stage when skipping is allowed.
Type
void CaptureControl::skip(const std::string& request_id) const;Parameters
request_id: required; a non-empty identifier from the latest progress or session snapshot.
Returns
void.
Details
- Call conditions: After external interaction receives the current request.
Errors
- Empty, expired, or state mismatch.
See also
CaptureControl::retry()
Retry the specified capture stage.
Type
void CaptureControl::retry(const std::string& stage_id) const;Parameters
stage_id: required; a non-empty identifier from the latest progress or session snapshot.
Returns
void.
Details
- Call conditions: When external interaction needs a retry.
Errors
- Empty, unknown, or not currently retryable.
See also
CaptureControl::cancel()
Cancel externally controlled capture using the current request identifier.
Type
void CaptureControl::cancel(const std::string& request_id) const;Parameters
request_id: required; a non-empty identifier from the latest progress or session snapshot.
Returns
void.
Details
- Call conditions: After external interaction receives the current request.
Errors
- Empty, expired, or state mismatch.
See also