AXptz
ax_ptz_preset_handler.h File Reference

The preset handler and its functions. More...

Go to the source code of this file.

Enumerations

enum  AXPTZPresetMovementSpace { AX_PTZ_PRESET_MOVEMENT_UNITLESS, AX_PTZ_PRESET_MOVEMENT_NUM_SPACES }
 

Functions

gboolean ax_ptz_preset_handler_create_preset_name (const AXPTZControlQueueGroup *group, gint video_channel, const gchar *preset_name, gint *preset_number, GError **error)
 Creates a PTZ preset with the specified preset_name. The preset number is returned. More...
 
gboolean ax_ptz_preset_handler_remove_preset_number (const AXPTZControlQueueGroup *group, gint video_channel, gint preset_number, GError **error)
 Removes the PTZ preset with the specified preset_number. More...
 
gboolean ax_ptz_preset_handler_remove_preset_name (const AXPTZControlQueueGroup *group, gint video_channel, const gchar *preset_name, GError **error)
 Removes the PTZ preset with the specified preset_name. More...
 
gboolean ax_ptz_preset_handler_set_preset_number (const AXPTZControlQueueGroup *group, gint video_channel, gint preset_number, gboolean home, GError **error)
 Sets the current PTZ position as a preset with the specified preset_number. More...
 
gboolean ax_ptz_preset_handler_set_preset_name (const AXPTZControlQueueGroup *group, gint video_channel, const gchar *preset_name, gboolean home, GError **error)
 Sets the current PTZ position as a preset with the specified preset_name. More...
 
gboolean ax_ptz_preset_handler_goto_preset_number (const AXPTZControlQueueGroup *group, gint video_channel, gint preset_number, fixed_t speed, AXPTZPresetMovementSpace movement_space, AXPTZInvoke invoke, void *callback_func, void *user_data, GError **error)
 Go to the PTZ preset with the specified preset_number. More...
 
gboolean ax_ptz_preset_handler_goto_preset_name (const AXPTZControlQueueGroup *group, gint video_channel, const gchar *preset_name, fixed_t speed, AXPTZPresetMovementSpace movement_space, AXPTZInvoke invoke, void *callback_func, void *user_data, GError **error)
 Go to the PTZ preset with the specified preset_name. More...
 
gboolean ax_ptz_preset_handler_goto_home (const AXPTZControlQueueGroup *group, gint video_channel, fixed_t speed, AXPTZPresetMovementSpace movement_space, AXPTZInvoke invoke, void *callback_func, void *user_data, GError **error)
 Go to the PTZ preset which is set as home. More...
 
GList * ax_ptz_preset_handler_query_presets (const AXPTZControlQueueGroup *group, gint video_channel, gboolean position_info, GError **error)
 Gets a list with the names of the PTZ presets. More...
 

Detailed Description

The preset handler and its functions.

Preset handler

The preset handler AXPTZPresetHandler is used to create, set and remove PTZ presets. Presets can also be listed and the camera view can be moved to one of the presets.

The goto functions have movement_space as one of the input parameters. This is the unit space to use when moving to a preset position. Available space types and spaces are:

  • AXPTZPresetMovementSpace for the speed of the preset movement.
    • AX_PTZ_PRESET_MOVEMENT_UNITLESS In this space, unitless speed is used.

Here, unitless means a normalized range from 0 to 1.

Enumeration Type Documentation

◆ AXPTZPresetMovementSpace

Available spaces for the preset movements.

Enumerator
AX_PTZ_PRESET_MOVEMENT_UNITLESS 

Use unitless preset movements.

AX_PTZ_PRESET_MOVEMENT_NUM_SPACES 

The number of preset movement spaces.

Function Documentation

◆ ax_ptz_preset_handler_create_preset_name()

gboolean ax_ptz_preset_handler_create_preset_name ( const AXPTZControlQueueGroup group,
gint  video_channel,
const gchar *  preset_name,
gint *  preset_number,
GError **  error 
)

Creates a PTZ preset with the specified preset_name. The preset number is returned.

Parameters
groupA group in the PTZ control queue.
video_channelA video channel. Starts from video channel 1.
preset_nameThe preset name.
preset_numberReturns the preset number.
errorReturn location for a GError or NULL.
Returns
TRUE on success, FALSE on failure.
Examples:
axptzexample.c.

◆ ax_ptz_preset_handler_remove_preset_number()

gboolean ax_ptz_preset_handler_remove_preset_number ( const AXPTZControlQueueGroup group,
gint  video_channel,
gint  preset_number,
GError **  error 
)

Removes the PTZ preset with the specified preset_number.

Parameters
groupA group in the PTZ control queue.
video_channelA video channel. Starts from video channel 1.
preset_numberThe preset number.
errorReturn location for a GError or NULL.
Returns
TRUE on success, FALSE on failure.
Examples:
axptzexample.c.

◆ ax_ptz_preset_handler_remove_preset_name()

gboolean ax_ptz_preset_handler_remove_preset_name ( const AXPTZControlQueueGroup group,
gint  video_channel,
const gchar *  preset_name,
GError **  error 
)

Removes the PTZ preset with the specified preset_name.

Parameters
groupA group in the PTZ control queue.
video_channelA video channel. Starts from video channel 1.
preset_nameThe preset name.
errorReturn location for a GError or NULL.
Returns
TRUE on success, FALSE on failure.

◆ ax_ptz_preset_handler_set_preset_number()

gboolean ax_ptz_preset_handler_set_preset_number ( const AXPTZControlQueueGroup group,
gint  video_channel,
gint  preset_number,
gboolean  home,
GError **  error 
)

Sets the current PTZ position as a preset with the specified preset_number.

Parameters
groupA group in the PTZ control queue.
video_channelA video channel. Starts from video channel 1.
preset_numberThe preset number.
homeSet the preset as home.
errorReturn location for a GError or NULL.
Returns
TRUE on success, FALSE on failure.
Examples:
axptzexample.c.

◆ ax_ptz_preset_handler_set_preset_name()

gboolean ax_ptz_preset_handler_set_preset_name ( const AXPTZControlQueueGroup group,
gint  video_channel,
const gchar *  preset_name,
gboolean  home,
GError **  error 
)

Sets the current PTZ position as a preset with the specified preset_name.

Parameters
groupA group in the PTZ control queue.
video_channelA video channel. Starts from video channel 1.
preset_nameThe preset name.
homeSet the preset as home.
errorReturn location for a GError or NULL.
Returns
TRUE on success, FALSE on failure.

◆ ax_ptz_preset_handler_goto_preset_number()

gboolean ax_ptz_preset_handler_goto_preset_number ( const AXPTZControlQueueGroup group,
gint  video_channel,
gint  preset_number,
fixed_t  speed,
AXPTZPresetMovementSpace  movement_space,
AXPTZInvoke  invoke,
void *  callback_func,
void *  user_data,
GError **  error 
)

Go to the PTZ preset with the specified preset_number.

Parameters
groupA group in the PTZ control queue.
video_channelA video channel. Starts from video channel 1.
preset_numberThe preset number.
speedThe speed of the movement.
movement_spaceThe space for the preset movement. Supported: AX_PTZ_PRESET_MOVEMENT_UNITLESS.
invokeThe invoke type. Supported: ACAP_PTZ_INVOKE_ASYNC.
callback_funcFuture use. Must be set to NULL.
user_dataFuture use. Must be set to NULL.
errorReturn location for a GError or NULL.
Returns
TRUE if the movement command was successfully sent to the underlying PTZ framework, FALSE on failure.
Examples:
axptzexample.c.

◆ ax_ptz_preset_handler_goto_preset_name()

gboolean ax_ptz_preset_handler_goto_preset_name ( const AXPTZControlQueueGroup group,
gint  video_channel,
const gchar *  preset_name,
fixed_t  speed,
AXPTZPresetMovementSpace  movement_space,
AXPTZInvoke  invoke,
void *  callback_func,
void *  user_data,
GError **  error 
)

Go to the PTZ preset with the specified preset_name.

Parameters
groupA group in the PTZ control queue.
video_channelA video channel. Starts from video channel 1.
preset_nameThe preset name.
speedThe speed of the movement.
movement_spaceThe space for the preset movement. Supported: AX_PTZ_PRESET_MOVEMENT_UNITLESS.
invokeThe invoke type. Supported: ACAP_PTZ_INVOKE_ASYNC.
callback_funcFuture use. Must be set to NULL.
user_dataFuture use. Must be set to NULL.
errorReturn location for a GError or NULL.
Returns
TRUE if the movement command was successfully sent to the underlying PTZ framework, FALSE on failure.

◆ ax_ptz_preset_handler_goto_home()

gboolean ax_ptz_preset_handler_goto_home ( const AXPTZControlQueueGroup group,
gint  video_channel,
fixed_t  speed,
AXPTZPresetMovementSpace  movement_space,
AXPTZInvoke  invoke,
void *  callback_func,
void *  user_data,
GError **  error 
)

Go to the PTZ preset which is set as home.

Parameters
groupA group in the PTZ control queue.
video_channelA video channel. Starts from video channel 1.
speedThe speed of the movement.
movement_spaceThe space for the preset movement. Supported: AX_PTZ_PRESET_MOVEMENT_UNITLESS.
invokeThe invoke type. Supported: ACAP_PTZ_INVOKE_ASYNC.
callback_funcFuture use. Must be set to NULL.
user_dataFuture use. Must be set to NULL.
errorReturn location for a GError or NULL.
Returns
TRUE if the movement command was successfully sent to the underlying PTZ framework, FALSE on failure.

◆ ax_ptz_preset_handler_query_presets()

GList* ax_ptz_preset_handler_query_presets ( const AXPTZControlQueueGroup group,
gint  video_channel,
gboolean  position_info,
GError **  error 
)

Gets a list with the names of the PTZ presets.

Parameters
groupA group in the PTZ control queue.
video_channelA video channel. Starts from video channel 1.
position_infoAppend position information (pan, tilt, zoom, focus and iris) to each element in the returned presets list.
errorReturn location for a GError or NULL.
Returns
A GList of allocated strings with the names of the presets on success, NULL on failure. Destroy it by using g_free on the elements and g_list_free on the list.