# `ExOxvif.PTZ`
[🔗](https://github.com/cortfritz/ex_oxvif/blob/v0.1.0/lib/ex_oxvif/ptz.ex#L1)

PTZ service: pan, tilt and zoom.

Positions and velocities are in the device's generic spaces: pan and tilt
in `-1.0..1.0`, zoom in `0.0..1.0` (positions) or `-1.0..1.0`
(continuous velocity). Mapping those to degrees is device-specific; read
the node's spaces with `nodes/2` and the configured limits with
`configurations/2`.

`profile` is a media profile token (`ExOxvif.MediaProfile` `:token`) whose
profile has a PTZ configuration.

# `absolute_move`

```elixir
@spec absolute_move(ExOxvif.Session.t(), String.t(), keyword()) ::
  :ok | {:error, ExOxvif.Error.t()}
```

Move to an absolute position. Requires `:pan`, `:tilt` and `:zoom`.

# `configuration_options`

```elixir
@spec configuration_options(ExOxvif.Session.t(), String.t(), ExOxvif.call_opts()) ::
  {:ok, ExOxvif.PTZ.ConfigurationOptions.t()} | {:error, ExOxvif.Error.t()}
```

Accepted options for a PTZ configuration token.

# `configurations`

```elixir
@spec configurations(ExOxvif.Session.t(), ExOxvif.call_opts()) ::
  {:ok, [ExOxvif.PTZ.Configuration.t()]} | {:error, ExOxvif.Error.t()}
```

List PTZ configurations, including default spaces and position limits.

# `continuous_move`

```elixir
@spec continuous_move(ExOxvif.Session.t(), String.t(), keyword()) ::
  :ok | {:error, ExOxvif.Error.t()}
```

Start moving at a velocity until `stop/3`. `:pan`, `:tilt` and `:zoom`
default to `0.0`.

# `goto_home`

```elixir
@spec goto_home(ExOxvif.Session.t(), String.t(), keyword()) ::
  :ok | {:error, ExOxvif.Error.t()}
```

Move to the home position. Option `:speed` (`0.0..1.0`).

# `goto_preset`

```elixir
@spec goto_preset(ExOxvif.Session.t(), String.t(), String.t(), ExOxvif.call_opts()) ::
  :ok | {:error, ExOxvif.Error.t()}
```

Move to a stored preset.

# `nodes`

```elixir
@spec nodes(ExOxvif.Session.t(), ExOxvif.call_opts()) ::
  {:ok, [ExOxvif.PTZ.Node.t()]} | {:error, ExOxvif.Error.t()}
```

List PTZ nodes and the coordinate spaces each supports.

# `presets`

```elixir
@spec presets(ExOxvif.Session.t(), String.t(), ExOxvif.call_opts()) ::
  {:ok, [ExOxvif.PTZ.Preset.t()]} | {:error, ExOxvif.Error.t()}
```

List stored presets.

# `relative_move`

```elixir
@spec relative_move(ExOxvif.Session.t(), String.t(), keyword()) ::
  :ok | {:error, ExOxvif.Error.t()}
```

Move by an offset from the current position. `:pan`, `:tilt` and `:zoom`
default to `0.0`.

# `remove_preset`

```elixir
@spec remove_preset(ExOxvif.Session.t(), String.t(), String.t(), ExOxvif.call_opts()) ::
  :ok | {:error, ExOxvif.Error.t()}
```

Delete a stored preset.

# `set_home`

```elixir
@spec set_home(ExOxvif.Session.t(), String.t(), ExOxvif.call_opts()) ::
  :ok | {:error, ExOxvif.Error.t()}
```

Store the current position as the home position.

# `set_preset`

```elixir
@spec set_preset(ExOxvif.Session.t(), String.t(), keyword()) ::
  {:ok, String.t()} | {:error, ExOxvif.Error.t()}
```

Store the current position as a preset and return its token.

Options: `:name` (a new preset's name) and `:token` (overwrite an existing
preset).

# `status`

```elixir
@spec status(ExOxvif.Session.t(), String.t(), ExOxvif.call_opts()) ::
  {:ok, ExOxvif.PTZ.Status.t()} | {:error, ExOxvif.Error.t()}
```

Current position and movement state.

# `stop`

```elixir
@spec stop(ExOxvif.Session.t(), String.t(), ExOxvif.call_opts()) ::
  :ok | {:error, ExOxvif.Error.t()}
```

Stop all pan, tilt and zoom movement.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
