Liking cljdoc? Tell your friends :D
All platforms.

dk.simongray.podcast.profile.player

The events of a player for a profile: what playing, skipping and reaching the end of an episode change in it, and the effects that tell the UI what to do next.

The events of a player for a profile: what playing, skipping and
reaching the end of an episode change in it, and the effects that tell
the UI what to do next.
raw docstring

listening-gapclj/s

How many seconds can pass between two reports of the position that are still one stretch of listening, by default.

How many seconds can pass between two reports of the position that are
still one stretch of listening, by default.
sourceraw docstring

stepclj/s

(step profile event at)
(step profile
      [kind id & args :as event]
      at
      {:keys [sleep continue-fn] :as opts})

Advance profile by the player event at at with opts, returning a map of the new :profile and the :effects, which say what the UI should do next.

The event is a vector of its kind, an episode id and any arguments:

  • [:progress id position duration] records the position, and counts the seconds heard, with the effect [:played id] when the episode now counts as played.
  • [:ended id] marks it played and drops it from the queue when it was current, with the effect [:play next] when another episode is queued, or else with the listener's :continuous?, the one that :continue-fn gives.
  • [:play id] makes it current, at the front of the queue.
  • [:next id] skips it: it leaves the queue without counting as played, with the effect [:play next] for the first episode left in the queue. Nothing changes when no other episode is queued.
  • [:previous id] goes back to the episode heard before it, the latest other one of profile/history, which becomes current, with the effect [:play earlier].
  • [:skip id amount] moves that many seconds, or the preferred amount for :forward or :back, with the effect [:seek id position], and [:played id] when it now counts as played.
  • [:chapter id direction doc] jumps to the :next or :previous chapter of the chapters document, with the effects of a skip.

A progress, skip or jump that reaches the outro ends the episode as [:ended id] does, with [:stop id] first and no seek. The opts are:

  • :sleep, the sleep timer of this device, e.g. {:episodes 1} stops at the end of this episode. The result has what's left of it under :sleep, and the last episode gives [:stop id] instead of [:play next].
  • :restart, the seconds into a chapter in which a jump back goes to the chapter before
  • :played-threshold, how many seconds before the end count as having heard an episode
  • :listening-gap, how many seconds can pass between two reports of the position in one stretch of listening
  • :continue-fn, a function of the id of an episode that ended, which gives the episode to play next when none is queued, e.g. the next of its show, or nil
Advance `profile` by the player `event` at `at` with `opts`, returning a
map of the new :profile and the :effects, which say what the UI should do
next.

The event is a vector of its kind, an episode id and any arguments:

- [:progress id position duration] records the position, and counts the
  seconds heard, with the effect [:played id] when the episode now
  counts as played.
- [:ended id] marks it played and drops it from the queue when it was
  current, with the effect [:play next] when another episode is queued,
  or else with the listener's :continuous?, the one that :continue-fn
  gives.
- [:play id] makes it current, at the front of the queue.
- [:next id] skips it: it leaves the queue without counting as played,
  with the effect [:play next] for the first episode left in the queue.
  Nothing changes when no other episode is queued.
- [:previous id] goes back to the episode heard before it, the latest
  other one of profile/history, which becomes current, with the effect
  [:play earlier].
- [:skip id amount] moves that many seconds, or the preferred amount for
  :forward or :back, with the effect [:seek id position], and
  [:played id] when it now counts as played.
- [:chapter id direction doc] jumps to the :next or :previous chapter of
  the chapters document, with the effects of a skip.

A progress, skip or jump that reaches the outro ends the episode as
[:ended id] does, with [:stop id] first and no seek. The `opts` are:

- :sleep, the sleep timer of this device, e.g. {:episodes 1} stops at
  the end of this episode. The result has what's left of it under
  :sleep, and the last episode gives [:stop id] instead of [:play next].
- :restart, the seconds into a chapter in which a jump back goes to the
  chapter before
- :played-threshold, how many seconds before the end count as having
  heard an episode
- :listening-gap, how many seconds can pass between two reports of the
  position in one stretch of listening
- :continue-fn, a function of the id of an episode that ended, which
  gives the episode to play next when none is queued, e.g. the next of
  its show, or nil
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