gavl
chapterlist.h
1 /*****************************************************************
2  * gavl - a general purpose audio/video processing library
3  *
4  * Copyright (c) 2001 - 2012 Members of the Gmerlin project
5  * gmerlin-general@lists.sourceforge.net
6  * http://gmerlin.sourceforge.net
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  * *****************************************************************/
21 
22 #ifndef GAVL_CHAPTERLIST_H_INCLUDED
23 #define GAVL_CHAPTERLIST_H_INCLUDED
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #include <gavl/gavldefs.h>
30 
46 typedef struct
47  {
48  uint32_t num_chapters;
49  uint32_t timescale;
50  struct
51  {
52  int64_t time;
53  char * name;
54  } * chapters;
56 
61 GAVL_PUBLIC
63 
68 GAVL_PUBLIC
70 
71 
76 GAVL_PUBLIC
85 GAVL_PUBLIC
86 void gavl_chapter_list_insert(gavl_chapter_list_t * list, int index,
87  int64_t time, const char * name);
88 
94 GAVL_PUBLIC
95 void gavl_chapter_list_delete(gavl_chapter_list_t * list, int index);
96 
97 
107 GAVL_PUBLIC
109  gavl_time_t time);
110 
121 GAVL_PUBLIC
123  gavl_time_t time, int * current_chapter);
124 
131 GAVL_PUBLIC
133 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif // GAVL_CHAPTERLIST_H_INCLUDED
uint32_t num_chapters
Number of chapters.
Definition: chapterlist.h:48
GAVL_PUBLIC void gavl_chapter_list_delete(gavl_chapter_list_t *list, int index)
Delete a chapter from a chapter list.
GAVL_PUBLIC void gavl_chapter_list_dump(const gavl_chapter_list_t *list)
Dump a chapter list to stderr.
int64_t time
Start time (seekpoint) of this chapter.
Definition: chapterlist.h:52
uint32_t timescale
Scale of the timestamps.
Definition: chapterlist.h:49
GAVL_PUBLIC void 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 gavl_chapter_list_t * gavl_chapter_list_create(int num_chapters)
Create chapter list.
GAVL_PUBLIC void gavl_chapter_list_destroy(gavl_chapter_list_t *list)
Destroy chapter list.
char * name
Name for this chapter (or NULL if unavailable)
Definition: chapterlist.h:53
GAVL_PUBLIC int gavl_chapter_list_get_current(gavl_chapter_list_t *list, gavl_time_t time)
Get current chapter.
int64_t gavl_time_t
Times in gavl are 64 bit signed integers.
Definition: gavltime.h:53
GAVL_PUBLIC int gavl_chapter_list_changed(gavl_chapter_list_t *list, gavl_time_t time, int *current_chapter)
Get current chapter.
Chapter list.
Definition: chapterlist.h:46
GAVL_PUBLIC gavl_chapter_list_t * gavl_chapter_list_copy(const gavl_chapter_list_t *list)
Copy chapter list.