1 #define SUB_MAX_TEXT 16 /* max nr lines of subtitles allowed */
2 
3 typedef struct { /* holds subtitle info to be displayed over a particular interval */
4     int lines; /* length of text array */
5     unsigned long start; /* start time for displaying subtitle */
6     unsigned long end; /* end time for displaying subtitle */
7     char *text[SUB_MAX_TEXT]; /* array [lines] of char* */
8     unsigned char alignment;
9 } subtitle_elt;
10 
11 typedef struct { /* holds text and related information read from a subtitle file */
12     subtitle_elt *subtitles; /* array [sub_num] */ /* succession of subtitles to be displayed */
13     const char *filename;
14     bool sub_uses_time; /* true => start and end are in hundredths of a second; false => they are frame numbers */
15     int sub_num;          // number of subtitle structs
16     int sub_errs;
17 } sub_data;
18 
19 enum /* horizontal alignment settings */
20   {
21     H_SUB_ALIGNMENT_LEFT = 1,
22     H_SUB_ALIGNMENT_CENTER = 0,
23     H_SUB_ALIGNMENT_RIGHT = 2,
24     H_SUB_ALIGNMENT_DEFAULT = 4,
25   };
26 
27 enum /* vertical alignment settings */
28   {
29     V_SUB_ALIGNMENT_TOP = 0,
30     V_SUB_ALIGNMENT_CENTER = 1,
31     V_SUB_ALIGNMENT_BOTTOM = 2,
32   };
33 
34 enum /* values for subtitle_autoscale */
35   {
36     AUTOSCALE_NONE = 0, /* no autoscale */
37     AUTOSCALE_MOVIE_HEIGHT = 1, /* video height */
38     AUTOSCALE_MOVIE_WIDTH = 2, /* video width */
39     AUTOSCALE_MOVIE_DIAGONAL = 3, /* diagonal */
40   };
41 
42 /* parameters for subreader */
43 extern float sub_delay; /* not used anywhere */
44 extern float sub_fps;
45 extern int suboverlap_enabled;
46 #ifdef HAVE_ICONV
47 extern char *subtitle_charset; /* code page for interpreting subtitles */
48 #endif
49 
50 /* parameters for subfont */
51 extern float font_factor;
52 extern float text_font_scale_factor;
53 extern char * sub_font;
54 extern int subtitle_autoscale; /* fixme: not user-settable */
55 extern float subtitle_font_thickness;
56 extern colorspec subtitle_fill_color, subtitle_outline_color, subtitle_shadow_color;
57 extern int subtitle_shadow_dx, subtitle_shadow_dy;
58 
59 /* parameters for subrender */
60 extern float movie_fps;
61 extern int movie_width;
62 extern int movie_height;
63 extern int h_sub_alignment;
64 extern int v_sub_alignment;
65 extern int sub_justify;
66 extern int sub_left_margin;
67 extern int sub_right_margin;
68 extern int sub_bottom_margin;
69 extern int sub_top_margin;
70 /* maintained by subrender: */
71 extern unsigned char * textsub_image_buffer; /* where text subtitles are rendered */
72 extern size_t textsub_image_buffer_size; /* size of buffer */
73 
74 /* parameters for subgen-image */
75 extern bool text_forceit;
76 /* maintained by subgen-image: */
77 extern sub_data *textsub_subdata;
78 
79 /* kept in subgen.c, but usable elsewhere: */
80 extern int default_video_format;
81 extern bool widescreen;
82