# `Rockbox.InsertPosition`
[🔗](https://github.com/tsirysndr/rockboxd/blob/master/bindings/elixir/lib/rockbox/insert_position.ex#L1)

Insert-position codes for `Rockbox.Player.insert/4` and
`Rockbox.Player.import_m3u/4`.

These mirror the C ABI enum:

| Atom                    | Value | Meaning                                  |
| ----------------------- | ----- | ---------------------------------------- |
| `:prepend`              | 0     | Before everything                        |
| `:insert`              | 1     | Block right after the current track      |
| `:insert_next`          | 2     | Immediately after the current track      |
| `:insert_last`          | 3     | At the end of the queue                  |
| `:insert_shuffled`      | 4     | At a random position                     |
| `:insert_last_shuffled` | 5     | Shuffled into the tail                   |
| `:replace`              | 6     | Replace the whole queue                  |
| `:index`                | 7     | At the explicit `index` argument         |

`to_int/1` accepts either the atom or the raw integer, so callers can pass
whichever they prefer.

# `t`

```elixir
@type t() ::
  :prepend
  | :insert
  | :insert_next
  | :insert_last
  | :insert_shuffled
  | :insert_last_shuffled
  | :replace
  | :index
```

# `to_int`

```elixir
@spec to_int(t() | 0..7) :: 0..7
```

Numeric code for an insert position (atom or already an integer).

---

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