1 /*****************************************************************************
2 * chapters.hpp : matroska demuxer
3 *****************************************************************************
4 * Copyright (C) 2003-2004 VLC authors and VideoLAN
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8 * Steve Lhomme <steve.lhomme@free.fr>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /* chapter_item, chapter_edition, and chapter_translation classes */
32 class chapter_translation_c
35 chapter_translation_c()
39 ~chapter_translation_c()
44 KaxChapterTranslateID *p_translated;
45 unsigned int codec_id;
46 std::vector<uint64_t> editions;
49 class chapter_codec_cmds_c;
57 ,p_segment_edition_uid(NULL)
58 ,b_display_seekpoint(true)
59 ,b_user_display(false)
64 virtual ~chapter_item_c();
65 void Append( const chapter_item_c & edition );
66 chapter_item_c * FindChapter( int64_t i_find_uid );
67 virtual chapter_item_c *BrowseCodecPrivate( unsigned int codec_id,
68 bool (*match)(const chapter_codec_cmds_c &data, const void *p_cookie, size_t i_cookie_size ),
70 size_t i_cookie_size );
71 std::string GetCodecName( bool f_for_title = false ) const;
72 bool ParentOf( const chapter_item_c & item ) const;
73 int16 GetTitleNumber( ) const;
75 int64_t i_start_time, i_end_time;
76 std::vector<chapter_item_c*> sub_chapters;
77 KaxChapterSegmentUID *p_segment_uid;
78 KaxChapterSegmentEditionUID *p_segment_edition_uid;
80 bool b_display_seekpoint;
83 chapter_item_c *p_parent;
86 std::vector<chapter_codec_cmds_c*> codecs;
88 bool Enter( bool b_do_subchapters );
89 bool Leave( bool b_do_subchapters );
90 bool EnterAndLeave( chapter_item_c *p_item, bool b_enter = true );
93 class chapter_edition_c : public chapter_item_c
96 chapter_edition_c(): b_ordered(false), b_default(false), b_hidden(false)
99 std::string GetMainName() const;
102 /* TODO handle hidden chapters */