1 /*
2   ogmmerge -- utility for splicing together ogg bitstreams
3       from component media subtypes
4 
5   r_srt.h
6   class definitions for the SRT text subtitle reader
7 
8   Written by Moritz Bunkus <moritz@bunkus.org>
9   Based on Xiph.org's 'oggmerge' found in their CVS repository
10   See http://www.xiph.org
11 
12   Distributed under the GPL
13   see the file COPYING for details
14   or visit http://www.gnu.org/copyleft/gpl.html
15 */
16 
17 #ifndef __R_SRT_H__
18 #define __R_SRT_H__
19 
20 #include <stdio.h>
21 
22 #include <ogg/ogg.h>
23 
24 #include "ogmmerge.h"
25 #include "queue.h"
26 
27 #include "p_textsubs.h"
28 
29 class srt_reader_c: public generic_reader_c {
30   private:
31     char                   chunk[2048];
32     FILE                  *file;
33     textsubs_packetizer_c *textsubspacketizer;
34     int                    act_wchar;
35 
36   public:
37     srt_reader_c(char *fname, audio_sync_t *nasync, range_t *nrange,
38                  char **ncomments) throw (error_c);
39     virtual ~srt_reader_c();
40 
41     virtual int              read();
42     virtual int              serial_in_use(int);
43     virtual ogmmerge_page_t *get_page();
44     virtual ogmmerge_page_t *get_header_page(int header_type =
45                                              PACKET_TYPE_HEADER);
46 
47     virtual void             reset();
48     virtual int              display_priority();
49     virtual void             display_progress();
50 
51     static int               probe_file(FILE *file, off_t size);
52 };
53 
54 #endif  /* __R_SRT_H__*/
55