1 // -*- c-basic-offset: 8; indent-tabs-mode: t -*-
2 // vim:ts=8:sw=8:noet:ai:
4 * Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
6 * This file is part of libass.
8 * libass is free software; you can redistribute it and/or modify
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.
13 * libass is distributed in the hope that it will be useful,
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.
18 * You should have received a copy of the GNU General Public License along
19 * with libass; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef LIBASS_TYPES_H
24 #define LIBASS_TYPES_H
29 #define VALIGN_CENTER 8
32 #define HALIGN_CENTER 2
33 #define HALIGN_RIGHT 3
36 typedef struct ass_style_s
{
40 uint32_t PrimaryColour
;
41 uint32_t SecondaryColour
;
42 uint32_t OutlineColour
;
61 int treat_fontname_as_pattern
;
64 typedef struct render_priv_s render_priv_t
;
66 /// ass_event_t corresponds to a single Dialogue line
67 /// Text is stored as-is, style overrides will be parsed later
68 typedef struct ass_event_s
{
69 long long Start
; // ms
70 long long Duration
; // ms
82 render_priv_t
* render_priv
;
85 typedef struct parser_priv_s parser_priv_t
;
87 typedef struct ass_library_s ass_library_t
;
89 /// ass track represent either an external script or a matroska subtitle stream (no real difference between them)
90 /// it can be used in rendering after the headers are parsed (i.e. events format line read)
91 typedef struct ass_track_s
{
92 int n_styles
; // amount used
93 int max_styles
; // amount allocated
96 ass_style_t
* styles
; // array of styles, max_styles length, n_styles used
97 ass_event_t
* events
; // the same as styles
99 char* style_format
; // style format line (everything after "Format: ")
100 char* event_format
; // event format line
102 enum {TRACK_TYPE_UNKNOWN
= 0, TRACK_TYPE_ASS
, TRACK_TYPE_SSA
} track_type
;
104 // script header fields
109 char ScaledBorderAndShadow
;
112 int default_style
; // index of default style
113 char* name
; // file name in case of external subs, 0 for streams
115 ass_library_t
* library
;
116 parser_priv_t
* parser_priv
;
119 #endif /* LIBASS_TYPES_H */