Chapters, as the ID3v2 Chapter Frame Addendum defines them: CHAP and CTOC frames, and the order that a table of contents puts chapters in.
A CHAP frame is a chapter, a map of these fields:
A CTOC frame is a table of contents: a map of its :element-id, the element ids of its :children, its :frames and two flags. It's :top-level? when it's the root of the tables, and :ordered? when its children are in order.
A CHAP or CTOC frame inside another one keeps its content as bytes, as frames of unknown kinds do, so nesting can't go deeper than one level. To write chapters, put the table of contents that toc makes for them first.
Chapters, as the ID3v2 Chapter Frame Addendum defines them: CHAP and CTOC frames, and the order that a table of contents puts chapters in. A CHAP frame is a chapter, a map of these fields: - :element-id, its id in the tag - :start-time and :end-time, in milliseconds - :start-offset and :end-offset, the byte offsets in the file where it starts and ends, if it gives them - :frames, the frames inside it, such as its title in a TIT2 frame A CTOC frame is a table of contents: a map of its :element-id, the element ids of its :children, its :frames and two flags. It's :top-level? when it's the root of the tables, and :ordered? when its children are in order. A CHAP or CTOC frame inside another one keeps its content as bytes, as frames of unknown kinds do, so nesting can't go deeper than one level. To write chapters, put the table of contents that toc makes for them first.
The kinds of the CHAP and CTOC frames, by id.
The kinds of the CHAP and CTOC frames, by id.
(listed frames)The element ids that the top-level table of contents in frames lists,
in order, with the ids of each table it lists in that table's place, or
nil when there's no table. An id listed more than once comes where it's
first listed.
It follows each table once, however many tables list it, so chains of tables or repeated listings can't make the walk deep or long.
The element ids that the top-level table of contents in `frames` lists, in order, with the ids of each table it lists in that table's place, or nil when there's no table. An id listed more than once comes where it's first listed. It follows each table once, however many tables list it, so chains of tables or repeated listings can't make the walk deep or long.
(ordered frames)The CHAP frames in frames, in the order that the top-level table of
contents lists them, followed by the ones it doesn't list, by start
time.
The CHAP frames in `frames`, in the order that the top-level table of contents lists them, followed by the ones it doesn't list, by start time.
(read-chapter ctx b)The fields of the CHAP frame whose content is b, read in the context
ctx.
With the quirk :id3/chapter-end, a chapter that ends at or before its start gets no end.
The fields of the CHAP frame whose content is `b`, read in the context `ctx`. With the quirk :id3/chapter-end, a chapter that ends at or before its start gets no end.
(read-toc ctx b)The fields of the CTOC frame whose content is b, read in the context
ctx.
The fields of the CTOC frame whose content is `b`, read in the context `ctx`.
(toc chapters)A top-level, ordered CTOC frame that lists the CHAP frames chapters in
their order, with an element id that none of them has.
A top-level, ordered CTOC frame that lists the CHAP frames `chapters` in their order, with an element id that none of them has.
The value of an offset that a chapter doesn't give.
The value of an offset that a chapter doesn't give.
(write-chapter ctx
{:keys [element-id start-time end-time start-offset end-offset
frames]
:as frame})The content of the CHAP frame frame, written in the context ctx.
Without an :end-time, the chapter ends at its start, which reads back as no end by the quirk :id3/chapter-end. Missing offsets are written as unused.
The content of the CHAP frame `frame`, written in the context `ctx`. Without an :end-time, the chapter ends at its start, which reads back as no end by the quirk :id3/chapter-end. Missing offsets are written as unused.
(write-toc ctx
{:keys [element-id top-level? ordered? children frames] :as frame})The content of the CTOC frame frame, written in the context ctx. It
throws when the table lists no children, or more than 255.
The content of the CTOC frame `frame`, written in the context `ctx`. It throws when the table lists no children, or more than 255.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |