23#ifndef GAVL_CHAPTERLIST_H_INCLUDED
24#define GAVL_CHAPTERLIST_H_INCLUDED
30#include <gavl/gavldefs.h>
31#include <gavl/value.h>
51 uint32_t num_chapters;
58 } gavl_chapter_list_t;
61#define GAVL_CHAPTERLIST_CHAPTERLIST "chapterlist"
62#define GAVL_CHAPTERLIST_CHAPTERS "chap"
63#define GAVL_CHAPTERLIST_TIME "time"
64#define GAVL_CHAPTERLIST_TIMESCALE "timescale"
66typedef gavl_dictionary_t gavl_chapter_list_t;
81 int64_t time,
const char * name);
107int gavl_chapter_list_is_valid(
const gavl_chapter_list_t * list);
110void gavl_chapter_list_set_timescale(gavl_chapter_list_t * list,
int timescale);
113int gavl_chapter_list_get_timescale(
const gavl_chapter_list_t * list);
116int gavl_chapter_list_get_num(
const gavl_chapter_list_t * list);
119gavl_dictionary_t * gavl_chapter_list_get_nc(gavl_chapter_list_t * list,
int idx);
122const gavl_dictionary_t * gavl_chapter_list_get(
const gavl_chapter_list_t * list,
int idx);
125int64_t gavl_chapter_list_get_time(
const gavl_chapter_list_t * list,
int idx);
128const char * gavl_chapter_list_get_label(
const gavl_chapter_list_t * list,
int idx);
132gavl_dictionary_add_chapter_list(gavl_dictionary_t * m,
int timescale);
136gavl_dictionary_get_chapter_list_nc(gavl_dictionary_t * m);
139const gavl_dictionary_t *
140gavl_dictionary_get_chapter_list(
const gavl_dictionary_t * m);
GAVL_PUBLIC int gavl_chapter_list_get_current(const gavl_chapter_list_t *list, gavl_time_t time)
Get current chapter.
GAVL_PUBLIC gavl_dictionary_t * gavl_chapter_list_insert(gavl_chapter_list_t *list, int index, int64_t time, const char *name)
Insert a chapter into a chapter list.
GAVL_PUBLIC void gavl_chapter_list_delete(gavl_chapter_list_t *list, int index)
Delete a chapter from a chapter list.
int64_t gavl_time_t
Times in gavl are 64 bit signed integers.
Definition gavltime.h:54