Rockbox (rockbox_ex_ffi v0.6.1)

Copy Markdown View Source

Elixir bindings for the Rockbox DSP / metadata / playback engine.

Thin wrappers over the shared :rockbox_ffi_nif NIF (see c_src/ and src/). The interesting modules are Rockbox.Metadata, Rockbox.Dsp, and Rockbox.Player.

Summary

Functions

ABI major version of the loaded native library.

Whether a string looks like an http(s):// URL.

Peek at a resume file (an .m3u8 saved by a player) without a live player.

Parse an .m3u/.m3u8 playlist file into a list of entry maps with atom keys (:path, :duration_ms, :title). Returns {:error, reason} on failure.

Write a list of paths/URLs to path as an .m3u8 file (atomic write).

Functions

abi_version()

@spec abi_version() :: non_neg_integer()

ABI major version of the loaded native library.

is_url?(s)

@spec is_url?(String.t()) :: boolean()

Whether a string looks like an http(s):// URL.

load_resume(path)

@spec load_resume(Path.t()) :: {:ok, map()} | {:error, :absent}

Peek at a resume file (an .m3u8 saved by a player) without a live player.

Returns {:ok, %{tracks: [...], index: i, elapsed_ms: ms}} or {:error, :absent}.

m3u_read(path)

@spec m3u_read(Path.t()) :: {:ok, [map()]} | {:error, term()}

Parse an .m3u/.m3u8 playlist file into a list of entry maps with atom keys (:path, :duration_ms, :title). Returns {:error, reason} on failure.

m3u_write(path, paths)

@spec m3u_write(Path.t(), [Path.t()]) :: :ok | {:error, :write_failed}

Write a list of paths/URLs to path as an .m3u8 file (atomic write).