basesub
_Line
Source code in muxtools/subtitle/basesub.py
TYPE
instance-attribute
The type of line. Should either be Dialogue
or Comment
.
effect
instance-attribute
A legacy effect to be applied to the event. Can usually also be used as another freeform field.
end
instance-attribute
End of this line as a timedelta.
layer
instance-attribute
An integer value in the range [0, 2³¹-1]
. Events with a lower Layer value are placed behind events with a higher value.
margin_l
instance-attribute
Left margin overriding the value in the current style.
margin_r
instance-attribute
Right margin overriding the value in the current style.
margin_v
instance-attribute
Vertical margin overriding the value in the current style.
name
instance-attribute
Usually used for what character is currently speaking. Known as Actor
in aegisub.
start
instance-attribute
Start of this line as a timedelta.
style
instance-attribute
Style name used for this line. Must exactly match one of the styles in your subtitle file.
text
instance-attribute
The text displayed (or not, if this is a Comment)
ShiftMode
Bases: Enum
Source code in muxtools/subtitle/basesub.py
FRAME = 'frame'
class-attribute
instance-attribute
Shift lines by converting everything (including the offset) to a frame.
TIME = 'time'
class-attribute
instance-attribute
Shift lines directly by using the offset as a timedelta. You have to use this if you want to match subKT.
ASSHeader
Bases: IntEnum
Basic enum class for some functional ASS headers.
Check https://github.com/libass/libass/wiki/ASS-File-Format-Guide for more information on each member.
Also contains the function to validate the input.
Source code in muxtools/subtitle/basesub.py
LayoutResX = 1
class-attribute
instance-attribute
Video width this subtitle was originally authored on.
LayoutResY = 2
class-attribute
instance-attribute
Video height this subtitle was originally authored on.
PlayResX = 3
class-attribute
instance-attribute
Video width this subtitle is used on.
PlayResY = 4
class-attribute
instance-attribute
Video height this subtitle is used on.
ScaledBorderAndShadow = 6
class-attribute
instance-attribute
Scale border and shadow with playback resolution. Should ideally always be yes.
WrapStyle = 5
class-attribute
instance-attribute
The default line-wrapping behaviour.
YCbCr_Matrix = 7
class-attribute
instance-attribute
The color range and matrix this subtitle was authored for.
BaseSubFile
dataclass
Bases: ABC
, MuxingFile
A base class for the SubFile class.
Mostly contains the functions to read/write the file and some commonly reused functions to manipulate headers/lines.
Source code in muxtools/subtitle/basesub.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
|
OutOfBoundsMode
Bases: IntEnum
How lines that are below 0 after shifting/merging should be handled
Source code in muxtools/subtitle/basesub.py
DROP_LINE = 3
class-attribute
instance-attribute
Don't include the line in the output at all.
ERROR = 0
class-attribute
instance-attribute
Raise an error
MAX_TO_ZERO = 2
class-attribute
instance-attribute
Set the start to 0 and the end to what it would be after shifting or also 0 if also below 0.
SET_TO_ZERO = 1
class-attribute
instance-attribute
Set both start and end to 0. Essentially disabling the line.