22#ifndef GAVL_CHAPTERLIST_H_INCLUDED
23#define GAVL_CHAPTERLIST_H_INCLUDED
29#include <gavl/gavldefs.h>
30#include <gavl/value.h>
50 uint32_t num_chapters;
57 } gavl_chapter_list_t;
60#define GAVL_CHAPTERLIST_CHAPTERLIST "chapterlist"
61#define GAVL_CHAPTERLIST_CHAPTERS "chap"
62#define GAVL_CHAPTERLIST_TIME "time"
63#define GAVL_CHAPTERLIST_TIMESCALE "timescale"
65typedef gavl_dictionary_t gavl_chapter_list_t;
80 int64_t time,
const char * name);
106int gavl_chapter_list_is_valid(
const gavl_chapter_list_t * list);
109void gavl_chapter_list_set_timescale(gavl_chapter_list_t * list,
int timescale);
112int gavl_chapter_list_get_timescale(
const gavl_chapter_list_t * list);
115int gavl_chapter_list_get_num(
const gavl_chapter_list_t * list);
118gavl_dictionary_t * gavl_chapter_list_get_nc(gavl_chapter_list_t * list,
int idx);
121const gavl_dictionary_t * gavl_chapter_list_get(
const gavl_chapter_list_t * list,
int idx);
124int64_t gavl_chapter_list_get_time(
const gavl_chapter_list_t * list,
int idx);
127const char * gavl_chapter_list_get_label(
const gavl_chapter_list_t * list,
int idx);
131gavl_dictionary_add_chapter_list(gavl_dictionary_t * m,
int timescale);
135gavl_dictionary_get_chapter_list_nc(gavl_dictionary_t * m);
138const gavl_dictionary_t *
139gavl_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:53