18937
|
1 #ifndef __ASS_TYPES_H__
|
|
2 #define __ASS_TYPES_H__
|
|
3
|
|
4 #define VALIGN_SUB 0
|
|
5 #define VALIGN_CENTER 8
|
|
6 #define VALIGN_TOP 4
|
|
7 #define HALIGN_LEFT 1
|
|
8 #define HALIGN_CENTER 2
|
|
9 #define HALIGN_RIGHT 3
|
|
10
|
|
11 /// ass Style: line
|
|
12 typedef struct ass_style_s {
|
|
13 char* Name;
|
|
14 char* FontName;
|
|
15 int FontSize;
|
|
16 uint32_t PrimaryColour;
|
|
17 uint32_t SecondaryColour;
|
|
18 uint32_t OutlineColour;
|
|
19 uint32_t BackColour;
|
|
20 int Bold;
|
|
21 int Italic;
|
|
22 int Underline;
|
|
23 int StrikeOut;
|
|
24 double ScaleX;
|
|
25 double ScaleY;
|
|
26 int Spacing;
|
|
27 int Angle;
|
|
28 int BorderStyle;
|
|
29 double Outline;
|
|
30 double Shadow;
|
|
31 int Alignment;
|
|
32 int MarginL;
|
|
33 int MarginR;
|
|
34 int MarginV;
|
|
35 // int AlphaLevel;
|
|
36 int Encoding;
|
|
37 } ass_style_t;
|
|
38
|
|
39 /// ass_event_t corresponds to a single Dialogue line
|
|
40 /// Text is stored as-is, style overrides will be parsed later
|
|
41 typedef struct ass_event_s {
|
|
42 long long Start; // ms
|
|
43 long long Duration; // ms
|
|
44
|
|
45 int ReadOrder;
|
|
46 int Layer;
|
|
47 int Style;
|
|
48 char* Name;
|
|
49 int MarginL;
|
|
50 int MarginR;
|
|
51 int MarginV;
|
|
52 char* Effect;
|
|
53 char* Text;
|
|
54 } ass_event_t;
|
|
55
|
19492
|
56 typedef struct parser_priv_s parser_priv_t;
|
|
57
|
18937
|
58 /// ass track represent either an external script or a matroska subtitle stream (no real difference between them)
|
|
59 /// it can be used in rendering after the headers are parsed (i.e. events format line read)
|
|
60 typedef struct ass_track_s {
|
|
61 int n_styles; // amount used
|
|
62 int max_styles; // amount allocated
|
|
63 int n_events;
|
|
64 int max_events;
|
|
65 ass_style_t* styles; // array of styles, max_styles length, n_styles used
|
|
66 ass_event_t* events; // the same as styles
|
|
67
|
|
68 char* style_format; // style format line (everything after "Format: ")
|
|
69 char* event_format; // event format line
|
|
70
|
19492
|
71 enum {TRACK_TYPE_UNKNOWN = 0, TRACK_TYPE_ASS, TRACK_TYPE_SSA} track_type;
|
18937
|
72
|
|
73 // script header fields
|
|
74 int PlayResX;
|
|
75 int PlayResY;
|
|
76 double Timer;
|
|
77 int WrapStyle;
|
|
78
|
|
79
|
|
80 int default_style; // index of default style
|
|
81 char* name; // file name in case of external subs, 0 for streams
|
19492
|
82
|
|
83 parser_priv_t* parser_priv;
|
18937
|
84 } ass_track_t;
|
|
85
|
|
86 #endif
|
|
87
|