2 * Copyright (C) 2003-2006 Gabest
3 * http://www.gabest.org
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GNU Make; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
29 class SubtitleFile
: public File
31 static LPCWSTR s_predef
;
40 class Segment
: public CAtlList
<SegmentItem
>
43 float m_start
, m_stop
;
45 Segment(float start
, float stop
, const SegmentItem
* si
= NULL
);
46 Segment(const Segment
& s
);
47 void operator = (const Segment
& s
);
50 class SegmentList
: public CAtlList
<Segment
>
52 CAtlArray
<Segment
*> m_index
;
53 size_t Index(bool fForce
= false);
57 void Insert(float start
, float stop
, Definition
* pDef
);
58 void Lookup(float at
, CAtlList
<SegmentItem
>& sis
);
59 bool Lookup(float at
, size_t& k
);
60 const Segment
* GetSegment(size_t k
);
63 SegmentList m_segments
;
67 virtual ~SubtitleFile();
69 void Parse(InputStream
& s
);
70 void Append(InputStream
& s
, float start
, float stop
, bool fSetTime
= false);
71 bool Lookup(float at
, CAutoPtrList
<Subtitle
>& subs
);