Liking cljdoc? Tell your friends :D

rockbox.ffi.player

Queue-based player with native ReplayGain and Rockbox crossfade.

A player owns a live audio output device and a background engine thread — construct it only where an output device exists. A handle is an opaque MemorySegment; every function takes it as the first argument. Free it with free (or use with-player).

ReplayGain mode here uses the player values (rockbox.ffi.enums/replaygain-mode: :off :track :album) — distinct from the DSP encoding.

Queue-based player with native ReplayGain and Rockbox crossfade.

A player owns a live audio output device and a background engine thread —
construct it only where an output device exists. A handle is an opaque
MemorySegment; every function takes it as the first argument. Free it with
`free` (or use `with-player`).

ReplayGain `mode` here uses the *player* values (rockbox.ffi.enums/replaygain-mode:
:off :track :album) — distinct from the DSP encoding.
raw docstring

clear-resumeclj

(clear-resume p)

Delete the player's resume file.

Delete the player's resume file.
sourceraw docstring

default-configclj

source

enqueueclj

(enqueue p path)
source

export-m3uclj

(export-m3u p path)

Export the current queue to an .m3u8 at path (atomic). Returns true on success, false on error.

Export the current queue to an .m3u8 at `path` (atomic). Returns true on
success, false on error.
sourceraw docstring

freeclj

(free p)

Free the native handle. Safe to call with nil.

Free the native handle. Safe to call with nil.
sourceraw docstring

import-m3uclj

(import-m3u p path)
(import-m3u p path position)
(import-m3u p path position index)

Import the playlist file at path into the queue at position (rockbox.ffi.enums/insert-position; default :insert-last). index is only used when position is :index. Returns the imported paths as a vector, or nil on error.

Import the playlist file at `path` into the queue at `position`
(rockbox.ffi.enums/insert-position; default :insert-last). `index` is only
used when `position` is :index. Returns the imported paths as a vector, or
nil on error.
sourceraw docstring

insertclj

(insert p paths)
(insert p paths position)
(insert p paths position index)

Splice paths (local paths or http(s):// URLs) into the queue at position (rockbox.ffi.enums/insert-position; default :insert-last). index is only used when position is :index.

Splice `paths` (local paths or http(s):// URLs) into the queue at `position`
(rockbox.ffi.enums/insert-position; default :insert-last). `index` is only
used when `position` is :index.
sourceraw docstring

is-url?clj

(is-url? s)

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

Whether `s` looks like an http(s):// URL.
sourceraw docstring

load-m3uclj

(load-m3u p path)

Replace the queue with the playlist file at path. Returns the loaded paths as a vector, or nil on error.

Replace the queue with the playlist file at `path`. Returns the loaded paths
as a vector, or nil on error.
sourceraw docstring

load-resumeclj

(load-resume path)

Peek at a resume/.m3u8 file at path without a player. Returns a map {:tracks [...] :index n :elapsed_ms n}, or nil if absent/invalid.

Peek at a resume/.m3u8 file at `path` without a player. Returns a map
{:tracks [...] :index n :elapsed_ms n}, or nil if absent/invalid.
sourceraw docstring

m3u-readclj

(m3u-read path)

Parse a playlist file at path into a vector of maps {:path s :duration_ms n :title s}, or nil on error. No player needed.

Parse a playlist file at `path` into a vector of maps
{:path s :duration_ms n :title s}, or nil on error. No player needed.
sourceraw docstring

m3u-writeclj

(m3u-write path paths)

Write paths (a seq of path/URL strings) as an .m3u8 at path. Returns true on success, false on error. No player needed.

Write `paths` (a seq of path/URL strings) as an .m3u8 at `path`. Returns true
on success, false on error. No player needed.
sourceraw docstring

new-playerclj

(new-player)
(new-player config)

Create a player. config overrides default-config (see the C ABI's rb_player_new_with_config / _ex). Throws if no output device is available.

If :resume-file is set, the queue and exact position are auto-persisted to that .m3u8 every :resume-save-interval-ms ms (0 => 5 s), enabling resume/save-resume/clear-resume.

Create a player. `config` overrides `default-config` (see the C ABI's
rb_player_new_with_config / _ex). Throws if no output device is available.

If `:resume-file` is set, the queue and exact position are auto-persisted to
that .m3u8 every `:resume-save-interval-ms` ms (0 => 5 s), enabling
`resume`/`save-resume`/`clear-resume`.
sourceraw docstring

nextclj

(next p)
source

pauseclj

(pause p)
source

playclj

(play p)
source

previousclj

(previous p)
source

queueclj

(queue p)

The current queue as a vector of path/URL strings.

The current queue as a vector of path/URL strings.
sourceraw docstring

resumeclj

(resume p)

Restore the queue + exact position from the player's resume file (does NOT auto-play). Returns a map {:tracks [...] :index n :elapsed_ms n}, or nil if there was nothing to resume.

Restore the queue + exact position from the player's resume file (does NOT
auto-play). Returns a map {:tracks [...] :index n :elapsed_ms n}, or nil if
there was nothing to resume.
sourceraw docstring

sample-rateclj

(sample-rate p)
source

save-resumeclj

(save-resume p)

Persist the queue + current position to the player's resume file now.

Persist the queue + current position to the player's resume file now.
sourceraw docstring

seek-msclj

(seek-ms p ms)
source

set-crossfadeclj

(set-crossfade p
               mode
               &
               {:keys [fade-out-delay-ms fade-out-duration-ms fade-in-delay-ms
                       fade-in-duration-ms mix-mode]
                :or {fade-out-delay-ms 0
                     fade-out-duration-ms 2000
                     fade-in-delay-ms 0
                     fade-in-duration-ms 2000
                     mix-mode :crossfade}})
source

set-queueclj

(set-queue p paths)
source

set-replaygainclj

(set-replaygain p mode preamp-db prevent-clipping?)

mode: rockbox.ffi.enums/replaygain-mode (:off :track :album).

`mode`: rockbox.ffi.enums/replaygain-mode (:off :track :album).
sourceraw docstring

set-volumeclj

(set-volume p vol)
source

skip-toclj

(skip-to p index)
source

statusclj

(status p)

A snapshot of the player's status as a map (keyword keys).

A snapshot of the player's status as a map (keyword keys).
sourceraw docstring

stopclj

(stop p)
source

toggleclj

(toggle p)
source

volumeclj

(volume p)
source

with-playercljmacro

(with-player [sym & [config]] & body)

Bind sym to a fresh player (optional config), run body, then free it.

Bind `sym` to a fresh player (optional `config`), run `body`, then free it.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close