Mercurial > mplayer.hg
annotate libass/ass_types.h @ 26807:1b34360d41de
In case 2 styles have the same name, prefer the latest one.
author | eugeni |
---|---|
date | Mon, 19 May 2008 18:37:27 +0000 |
parents | 588ce97b44f2 |
children | 0366ab2c1cb9 |
rev | line source |
---|---|
20008
fa122b7c71c6
Add copyright notice and vim/emacs comments to libass and vf_ass.c.
eugeni
parents:
19638
diff
changeset
|
1 // -*- c-basic-offset: 8; indent-tabs-mode: t -*- |
fa122b7c71c6
Add copyright notice and vim/emacs comments to libass and vf_ass.c.
eugeni
parents:
19638
diff
changeset
|
2 // vim:ts=8:sw=8:noet:ai: |
fa122b7c71c6
Add copyright notice and vim/emacs comments to libass and vf_ass.c.
eugeni
parents:
19638
diff
changeset
|
3 /* |
26723 | 4 * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com> |
5 * | |
26738
588ce97b44f2
Speak of libass instead of MPlayer in the libass license headers.
diego
parents:
26723
diff
changeset
|
6 * This file is part of libass. |
26723 | 7 * |
26738
588ce97b44f2
Speak of libass instead of MPlayer in the libass license headers.
diego
parents:
26723
diff
changeset
|
8 * libass is free software; you can redistribute it and/or modify |
26723 | 9 * it under the terms of the GNU General Public License as published by |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
12 * | |
26738
588ce97b44f2
Speak of libass instead of MPlayer in the libass license headers.
diego
parents:
26723
diff
changeset
|
13 * libass is distributed in the hope that it will be useful, |
26723 | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU General Public License along | |
26738
588ce97b44f2
Speak of libass instead of MPlayer in the libass license headers.
diego
parents:
26723
diff
changeset
|
19 * with libass; if not, write to the Free Software Foundation, Inc., |
26723 | 20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
21 */ | |
20008
fa122b7c71c6
Add copyright notice and vim/emacs comments to libass and vf_ass.c.
eugeni
parents:
19638
diff
changeset
|
22 |
25897
aaebaf255b23
Consistently give all libass multiple inclusion guards a LIBASS_ prefix.
diego
parents:
25535
diff
changeset
|
23 #ifndef LIBASS_TYPES_H |
aaebaf255b23
Consistently give all libass multiple inclusion guards a LIBASS_ prefix.
diego
parents:
25535
diff
changeset
|
24 #define LIBASS_TYPES_H |
18937 | 25 |
26138
74055622161d
Add missing header #includes to fix 'make checkheaders'.
diego
parents:
25897
diff
changeset
|
26 #include <stdint.h> |
74055622161d
Add missing header #includes to fix 'make checkheaders'.
diego
parents:
25897
diff
changeset
|
27 |
18937 | 28 #define VALIGN_SUB 0 |
29 #define VALIGN_CENTER 8 | |
30 #define VALIGN_TOP 4 | |
31 #define HALIGN_LEFT 1 | |
32 #define HALIGN_CENTER 2 | |
33 #define HALIGN_RIGHT 3 | |
34 | |
35 /// ass Style: line | |
36 typedef struct ass_style_s { | |
37 char* Name; | |
38 char* FontName; | |
23300 | 39 double FontSize; |
18937 | 40 uint32_t PrimaryColour; |
41 uint32_t SecondaryColour; | |
42 uint32_t OutlineColour; | |
43 uint32_t BackColour; | |
44 int Bold; | |
45 int Italic; | |
46 int Underline; | |
47 int StrikeOut; | |
48 double ScaleX; | |
49 double ScaleY; | |
22259 | 50 double Spacing; |
18937 | 51 int Angle; |
52 int BorderStyle; | |
53 double Outline; | |
54 double Shadow; | |
55 int Alignment; | |
56 int MarginL; | |
57 int MarginR; | |
58 int MarginV; | |
59 // int AlphaLevel; | |
60 int Encoding; | |
61 } ass_style_t; | |
62 | |
19638
a3473d990fed
Better collision detection algorithm. The idea is to keep a subtitle in place
eugeni
parents:
19492
diff
changeset
|
63 typedef struct render_priv_s render_priv_t; |
a3473d990fed
Better collision detection algorithm. The idea is to keep a subtitle in place
eugeni
parents:
19492
diff
changeset
|
64 |
18937 | 65 /// ass_event_t corresponds to a single Dialogue line |
66 /// Text is stored as-is, style overrides will be parsed later | |
67 typedef struct ass_event_s { | |
68 long long Start; // ms | |
69 long long Duration; // ms | |
70 | |
71 int ReadOrder; | |
72 int Layer; | |
73 int Style; | |
74 char* Name; | |
75 int MarginL; | |
76 int MarginR; | |
77 int MarginV; | |
78 char* Effect; | |
79 char* Text; | |
19638
a3473d990fed
Better collision detection algorithm. The idea is to keep a subtitle in place
eugeni
parents:
19492
diff
changeset
|
80 |
a3473d990fed
Better collision detection algorithm. The idea is to keep a subtitle in place
eugeni
parents:
19492
diff
changeset
|
81 render_priv_t* render_priv; |
18937 | 82 } ass_event_t; |
83 | |
19492 | 84 typedef struct parser_priv_s parser_priv_t; |
85 | |
20477 | 86 typedef struct ass_library_s ass_library_t; |
87 | |
18937 | 88 /// ass track represent either an external script or a matroska subtitle stream (no real difference between them) |
89 /// it can be used in rendering after the headers are parsed (i.e. events format line read) | |
90 typedef struct ass_track_s { | |
91 int n_styles; // amount used | |
92 int max_styles; // amount allocated | |
93 int n_events; | |
94 int max_events; | |
95 ass_style_t* styles; // array of styles, max_styles length, n_styles used | |
96 ass_event_t* events; // the same as styles | |
97 | |
98 char* style_format; // style format line (everything after "Format: ") | |
99 char* event_format; // event format line | |
100 | |
19492 | 101 enum {TRACK_TYPE_UNKNOWN = 0, TRACK_TYPE_ASS, TRACK_TYPE_SSA} track_type; |
18937 | 102 |
103 // script header fields | |
104 int PlayResX; | |
105 int PlayResY; | |
106 double Timer; | |
107 int WrapStyle; | |
108 | |
109 | |
110 int default_style; // index of default style | |
111 char* name; // file name in case of external subs, 0 for streams | |
19492 | 112 |
20477 | 113 ass_library_t* library; |
19492 | 114 parser_priv_t* parser_priv; |
18937 | 115 } ass_track_t; |
116 | |
25897
aaebaf255b23
Consistently give all libass multiple inclusion guards a LIBASS_ prefix.
diego
parents:
25535
diff
changeset
|
117 #endif /* LIBASS_TYPES_H */ |