gavl

Macros | Typedefs | Functions
Chapter list

Chapter list. More...

## Macros
#define | GAVL_CHAPTERLIST_CHAPTERLIST "chapterlist"
| Chapter list.
#define | GAVL_CHAPTERLIST_CHAPTERS "chap"
#define | GAVL_CHAPTERLIST_TIME "time"
#define | GAVL_CHAPTERLIST_TIMESCALE "timescale"

## Typedefs
typedef gavl_dictionary_t | gavl_chapter_list_t

## Functions
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.
GAVL_PUBLIC int | gavl_chapter_list_get_current (const gavl_chapter_list_t *list, gavl_time_t time)
| Get current chapter.
GAVL_PUBLIC int | gavl_chapter_list_is_valid (const gavl_chapter_list_t *list)
GAVL_PUBLIC void | gavl_chapter_list_set_timescale (gavl_chapter_list_t *list, int timescale)
GAVL_PUBLIC int | gavl_chapter_list_get_timescale (const gavl_chapter_list_t *list)
GAVL_PUBLIC int | gavl_chapter_list_get_num (const gavl_chapter_list_t *list)
GAVL_PUBLIC gavl_dictionary_t * | gavl_chapter_list_get_nc (gavl_chapter_list_t *list, int idx)
GAVL_PUBLIC const gavl_dictionary_t * | gavl_chapter_list_get (const gavl_chapter_list_t *list, int idx)
GAVL_PUBLIC int64_t | gavl_chapter_list_get_time (const gavl_chapter_list_t *list, int idx)
GAVL_PUBLIC const char * | gavl_chapter_list_get_label (const gavl_chapter_list_t *list, int idx)
GAVL_PUBLIC gavl_dictionary_t * | gavl_dictionary_add_chapter_list (gavl_dictionary_t *m, int timescale)
GAVL_PUBLIC gavl_dictionary_t * | gavl_dictionary_get_chapter_list_nc (gavl_dictionary_t *m)
GAVL_PUBLIC const gavl_dictionary_t * | gavl_dictionary_get_chapter_list (const gavl_dictionary_t *m)

## Detailed Description

Chapter list.

Chapters in gavl are simply seekpoints with (optionally) associated names.

Since 1.5.0

## Macro Definition Documentation

## ◆ GAVL_CHAPTERLIST_CHAPTERLIST

#define GAVL_CHAPTERLIST_CHAPTERLIST "chapterlist"

Chapter list.

## Function Documentation

## ◆ gavl_chapter_list_insert()

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.

Parameters

  list | A chapter list
  index | Position (starting with 0) where the new chapter will be placed
  Time | Start time of the chapter
  name | Chapter name (or NULL)

## ◆ gavl_chapter_list_delete()

GAVL_PUBLIC void gavl_chapter_list_delete | ( | gavl_chapter_list_t * | list,
|  | int | index )

Delete a chapter from a chapter list.

Parameters

  list | A chapter list
  index | Position (starting with 0) of the chapter to delete

## ◆ gavl_chapter_list_get_current()

GAVL_PUBLIC int gavl_chapter_list_get_current | ( | const gavl_chapter_list_t * | list,
|  | gavl_time_t | time )

Get current chapter.

Parameters

  list | A chapter list
  Time | Playback time

Returns
  The current chapter index

Use this function after seeking to signal a chapter change