edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! Subtitles: a list of cues with a time on them, out of a file beside the |
| 2 | //! media (`.srt`, `.vtt`, `.ass`) or out of a track inside it. |
| 3 | //! |
| 4 | //! One model for both, because a timeline cannot care which it was: a |
| 5 | //! [`SubtitleTrack`] is where it came from -- a path, and the Matroska track |
| 6 | //! number when it is one of several inside that path -- plus the [`Cue`]s. That |
| 7 | //! pair is also all a `.edith` writes ([`crate::edith`]): the cues are read |
| 8 | //! back out of the file on the way in, exactly as a clip's *pictures* are, so a |
| 9 | //! project file stays an edit list and not a copy of the subtitles. |
| 10 | //! |
| 11 | //! Parsing is `ec-subs` (SRT, WebVTT) and `ec-ass` (ASS/SSA) -- |
| 12 | //! the markup, the override tags and the encoding quirks of a dozen dialects |
| 13 | //! are not this project's to re-derive. What comes back here is plain text: the |
| 14 | //! renderer is a later thing, and a cue nobody can draw yet is still a cue that |
| 15 | //! has to be listed, timed and saved. |
| 16 | //! |
| 17 | //! A cue is not always words. `S_HDMV/PGS` off a BluRay remux is *pictures* -- |
| 18 | //! run-length bitmaps the disc composed against its own frame -- and one of |
| 19 | //! those is a [`Cue`] with a [`CueImage`] on it and no text. The decoding is |
| 20 | //! `ec-pgs`, for the reason above. Everything downstream carries the |
| 21 | //! picture the way it carries the string: [`crate::export::timeline_cues`] maps |
| 22 | //! it onto the timeline, a front-end draws it over the film. |
| 23 | //! |
| 24 | //! What is still *refused* is refused by name rather than by omission |
| 25 | //! ([`SubtitleTrack::refused`]): VobSub off a DVD is a picture format nothing |
| 26 | //! here reads, and a file carrying one opens with a row that says so instead of |
| 27 | //! opening with an empty list. |
| 28 | |
| 29 | use HashMap; |
| 30 | use ; |
| 31 | use Arc; |
| 32 | |
| 33 | use plain_text; |
| 34 | |
| 35 | /// One line of subtitle: on screen from `start_us` to `end_us`, microseconds |
| 36 | /// from the start of the media, which is the unit every parser here speaks. |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | /// One karaoke beat of an ASS cue (`\k`, `\kf`, `\ko`): the text it sings and how it is lit. |
| 68 | /// Not stored in a project: it is read again from the imported file, with the cue. |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | /// The unsung colour of a style that names no secondary, libass's default. |
| 87 | const DEFAULT_SECONDARY: = ; |
| 88 | |
| 89 | /// The syllables of `cue`'s body, grouped by their `(start, length)` as the parser documents. |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | /// `syllables` moved with the cue they belong to, as [`map_words`] moves words: the cue's `[a, b]` |
| 149 | /// became `[from, to]` on the timeline, and a syllable that starts at or past `b` is dropped. |
| 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 | /// `words` moved with the cue they belong to: the cue's `[a, b]` in its own clock became |
| 186 | /// `[from, to]` on the timeline (a linear map, as a placement or a speed change is), and the |
| 187 | /// words before `a` are held at its edge; a word that starts at or past `b` -- the cue was cut |
| 188 | /// there, by a range end or a trim -- is dropped, and the last word kept ends no later than `to`. |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | /// A cue that is a picture: one PGS display set, kept the way the Matroska |
| 204 | /// block held it -- run-length and palettised, tens of kilobytes -- and turned |
| 205 | /// into pixels only when something is about to draw it ([`Self::rgba`]). |
| 206 | /// |
| 207 | /// Kept encoded because decoded is enormous: this film's canvas is 8 MB of |
| 208 | /// RGBA and its four PGS tracks carry about eleven thousand display sets |
| 209 | /// between them, so a track that decoded itself at import would cost gigabytes |
| 210 | /// where it now costs the thirty megabytes the file already spends on it. |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | /// What a [`CueImage`] keeps until something draws it. |
| 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 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | /// The pixels of a decoded subtitle frame: its one RGBA plane. |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | /// The segments of a display set as a Matroska block holds them: a type byte, a |
| 299 | /// big-endian size, that many bytes of body, and again until the block is out. |
| 300 | /// `None` for bytes that do not walk -- a truncated or mislabelled block. |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | /// A subtitle track: where it came from and what it says. |
| 313 | /// |
| 314 | /// `PartialEq` because it is one of the things an edit can change and therefore |
| 315 | /// one of the things an undo has to bring back exactly |
| 316 | /// ([`crate::Project::parts`], the sweep's round-trip). |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | |
| 338 | |
| 339 | |
| 340 | |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | |
| 358 | |
| 359 | |
| 360 | |
| 361 | |
| 362 | |
| 363 | |
| 364 | |
| 365 | |
| 366 | |
| 367 | |
| 368 | |
| 369 | |
| 370 | |
| 371 | |
| 372 | |
| 373 | |
| 374 | |
| 375 | |
| 376 | |
| 377 | |
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | |
| 386 | |
| 387 | |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | |
| 393 | |
| 394 | /// The one door a saved subtitle line comes back in through: a standalone file |
| 395 | /// (`track` is `None`) or track `n` of a media file, Matroska or mp4 |
| 396 | /// ([`of_media`]). |
| 397 | /// |
| 398 | /// Never an error, whatever is wrong: a deleted `.srt`, a media file that is |
| 399 | /// not there any more, a track number the file no longer has, a codec of |
| 400 | /// pictures. All of them come back [`refused`](SubtitleTrack::refused) by name, |
| 401 | /// because a project that opened yesterday has to open today -- a subtitle is |
| 402 | /// not what a whole timeline should refuse over. |
| 403 | |
| 404 | |
| 405 | |
| 406 | |
| 407 | |
| 408 | /// Every saved subtitle line of a project at once, back in the order they were |
| 409 | /// saved in -- which is the order they are picked by, so it is the row order |
| 410 | /// this hands back whatever it had to read. |
| 411 | /// |
| 412 | /// The reason this exists beside [`open`]: a Matroska file is walked whole to |
| 413 | /// reach *one* of its tracks, and a film whose project names thirty-five of them |
| 414 | /// was thirty-five walks of a 25 GB file -- seven seconds with the window |
| 415 | /// stopped, since a project opens on the UI thread. Each distinct file is walked |
| 416 | /// once here and every row that named it is picked out of that one walk. |
| 417 | |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | |
| 425 | |
| 426 | |
| 427 | |
| 428 | |
| 429 | |
| 430 | |
| 431 | |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | |
| 442 | |
| 443 | |
| 444 | |
| 445 | |
| 446 | |
| 447 | |
| 448 | |
| 449 | |
| 450 | |
| 451 | |
| 452 | |
| 453 | |
| 454 | |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | |
| 460 | |
| 461 | /// A standalone subtitle file, parsed by its extension. |
| 462 | |
| 463 | |
| 464 | |
| 465 | |
| 466 | |
| 467 | |
| 468 | |
| 469 | |
| 470 | |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | /// The languages a file name can name, as `(ISO 639-1, ISO 639-2, the 639-2 |
| 487 | /// bibliographic code when it differs, English name)`. Only the common ones, and |
| 488 | /// no two-letter word that would be a name in a file name (`is`, `no`, `to`). |
| 489 | const LANGUAGES: & = & |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | |
| 496 | |
| 497 | |
| 498 | |
| 499 | |
| 500 | |
| 501 | |
| 502 | |
| 503 | |
| 504 | |
| 505 | |
| 506 | |
| 507 | |
| 508 | |
| 509 | |
| 510 | |
| 511 | |
| 512 | |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | |
| 519 | |
| 520 | |
| 521 | |
| 522 | |
| 523 | |
| 524 | |
| 525 | |
| 526 | |
| 527 | |
| 528 | |
| 529 | ; |
| 530 | |
| 531 | /// The ISO 639-2 code a file name's language token names, when it names one |
| 532 | /// (`fr` and `fra` are both French, `fre` is French too). |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | |
| 538 | |
| 539 | |
| 540 | |
| 541 | |
| 542 | |
| 543 | |
| 544 | |
| 545 | /// The language a subtitle file's name says it is, as the ISO 639-2 code an |
| 546 | /// import sets: the last token of the name that is a language (`talk.fr.srt`, |
| 547 | /// `talk.fra.srt`, `fra.srt`, `talk_en.srt`, `eng.srt` are French, French, |
| 548 | /// French, English, English). `None` when no token of the name is one -- the |
| 549 | /// track is then left unset, not guessed. |
| 550 | |
| 551 | |
| 552 | |
| 553 | |
| 554 | |
| 555 | |
| 556 | /// The ISO 639-2 code a person typed for a language: a 639-1 two-letter code |
| 557 | /// (`fr`), an English name (`French`), or a three-letter code as it is written |
| 558 | /// (`fra`, `und`), which is taken as it is. `None` for anything else. |
| 559 | |
| 560 | |
| 561 | |
| 562 | |
| 563 | |
| 564 | |
| 565 | |
| 566 | |
| 567 | |
| 568 | |
| 569 | |
| 570 | |
| 571 | |
| 572 | |
| 573 | |
| 574 | |
| 575 | |
| 576 | /// The English name of an ISO 639-2 code, as an export titles its track |
| 577 | /// (`fra` is `French`). `None` for a code the list does not name. |
| 578 | |
| 579 | |
| 580 | |
| 581 | |
| 582 | |
| 583 | |
| 584 | |
| 585 | |
| 586 | /// The language an import gives a track: the `lang` a person typed, or else the |
| 587 | /// one the file name says, with where it came from for the reply (`as given`, |
| 588 | /// `from the file name`). `None` when neither names one. Refused, with the words |
| 589 | /// to say so, for a `lang` that is not a language. |
| 590 | |
| 591 | |
| 592 | |
| 593 | |
| 594 | |
| 595 | |
| 596 | |
| 597 | |
| 598 | |
| 599 | /// Names the language of `track` (an ISO 639-2 code, or empty for unset) and |
| 600 | /// keeps its row's label in step: an embedded track's label shows its language, |
| 601 | /// and a standalone file's label is its file name, which does not change. |
| 602 | |
| 603 | |
| 604 | |
| 605 | |
| 606 | |
| 607 | |
| 608 | |
| 609 | /// Every subtitle track *inside* a media file, whichever container it is: a |
| 610 | /// Matroska's ([`of_matroska`]) or an mp4's timed text ([`of_mp4`]). |
| 611 | /// |
| 612 | /// The one door for it, so a project row, an import and an export's read-back |
| 613 | /// cannot disagree about what a file carries -- and so an mp4 this project |
| 614 | /// wrote comes back into it, which is the whole reason the mp4 reader exists: |
| 615 | /// mp4 is the default export format, and a file edith writes and cannot open |
| 616 | /// is not a round trip. |
| 617 | |
| 618 | |
| 619 | |
| 620 | |
| 621 | /// [`of_media`], with the embedded closed captions ([`of_captions`]) listed after the container's |
| 622 | /// own tracks only when `captions` says so: they cost a read of every picture packet, so a |
| 623 | /// project re-open asks for them only for a file that has a caption row. |
| 624 | |
| 625 | |
| 626 | |
| 627 | |
| 628 | |
| 629 | |
| 630 | |
| 631 | |
| 632 | |
| 633 | |
| 634 | |
| 635 | |
| 636 | /// The CEA-608 (CC1-CC4) and CEA-708 (service 1) captions carried inside the picture of `path` |
| 637 | /// (H.264/HEVC SEI, MPEG-2 user data), one track per channel that has cues, named `CC1 (608)` or |
| 638 | /// `Service 1 (708)`. Timed on the picture's own clock. Found by one cached read of every |
| 639 | /// picture packet ([`crate::demux::captions`]); empty for a file without captions. |
| 640 | |
| 641 | |
| 642 | |
| 643 | |
| 644 | |
| 645 | |
| 646 | |
| 647 | |
| 648 | |
| 649 | |
| 650 | |
| 651 | |
| 652 | |
| 653 | |
| 654 | |
| 655 | |
| 656 | |
| 657 | |
| 658 | |
| 659 | |
| 660 | |
| 661 | |
| 662 | |
| 663 | |
| 664 | |
| 665 | |
| 666 | |
| 667 | /// Every PGS subtitle track of an MPEG transport stream (an AVCHD or Blu-ray `.m2ts`), in |
| 668 | /// PMT order: the same display sets a Matroska file carries, so they are read the same way |
| 669 | /// ([`pgs_cues`]). `track` is the demuxer's stream index. |
| 670 | |
| 671 | |
| 672 | |
| 673 | |
| 674 | |
| 675 | |
| 676 | |
| 677 | |
| 678 | |
| 679 | |
| 680 | |
| 681 | |
| 682 | |
| 683 | |
| 684 | |
| 685 | |
| 686 | |
| 687 | |
| 688 | |
| 689 | |
| 690 | |
| 691 | |
| 692 | |
| 693 | |
| 694 | /// Every timed-text (`tx3g`) subtitle track of an mp4, in track order, with its |
| 695 | /// cues -- the mp4 twin of [`of_matroska`]. |
| 696 | /// |
| 697 | /// A `tx3g` track is *continuous*: it states one sample per instant of the film |
| 698 | /// and the stretches with nothing on screen are samples of no text, so those are |
| 699 | /// dropped here rather than kept as cues with an empty line |
| 700 | /// ([`crate::demux::Mp4TextSample::payload`]). What is left is the cues, timed |
| 701 | /// on the file's own clock, and a track whose samples are all empty comes back |
| 702 | /// with none rather than with one per instant. |
| 703 | /// |
| 704 | /// Never a bitmap: an mp4 carries no PGS track this reads, so the refusal |
| 705 | /// [`of_matroska`] has for one has no counterpart here. |
| 706 | |
| 707 | |
| 708 | |
| 709 | |
| 710 | |
| 711 | |
| 712 | |
| 713 | |
| 714 | |
| 715 | |
| 716 | |
| 717 | |
| 718 | |
| 719 | |
| 720 | |
| 721 | |
| 722 | /// One `tx3g` sample as a cue, or `None` for the sample that is not one: the |
| 723 | /// empty one that says nothing is on screen between here and the next line, and |
| 724 | /// the truncated one whose declared length runs past its own bytes. |
| 725 | |
| 726 | |
| 727 | |
| 728 | |
| 729 | |
| 730 | |
| 731 | |
| 732 | |
| 733 | |
| 734 | |
| 735 | |
| 736 | |
| 737 | |
| 738 | |
| 739 | |
| 740 | |
| 741 | /// What a list row shows for a track a container declares: the language, the |
| 742 | /// muxer's title, or the pair. |
| 743 | /// |
| 744 | /// A row shows one string, so the two are flattened for it -- and *only* for it. |
| 745 | /// Both are kept on the track beside this |
| 746 | /// ([`SubtitleTrack::language`], [`SubtitleTrack::name`]), so an export writes |
| 747 | /// the container's own two fields rather than guessing them back out of this |
| 748 | /// string, which is what used to leave every French track marked English. |
| 749 | |
| 750 | |
| 751 | |
| 752 | |
| 753 | |
| 754 | |
| 755 | |
| 756 | |
| 757 | /// Every subtitle track of a Matroska file, in file order -- the text ones with |
| 758 | /// their cues, the bitmap ones refused by name (see the module docs). |
| 759 | |
| 760 | |
| 761 | |
| 762 | |
| 763 | |
| 764 | |
| 765 | |
| 766 | |
| 767 | |
| 768 | |
| 769 | |
| 770 | |
| 771 | |
| 772 | |
| 773 | |
| 774 | |
| 775 | |
| 776 | |
| 777 | |
| 778 | |
| 779 | |
| 780 | |
| 781 | |
| 782 | /// The cues of one Matroska subtitle track, or why it has none. |
| 783 | /// |
| 784 | /// A Matroska text track carries the *timing* on the block and the *text* in |
| 785 | /// it, so neither codec is parsed as its own file would be: `S_TEXT/UTF8` is |
| 786 | /// one SRT cue's body per block, `S_TEXT/ASS` is one `Dialogue` line per block |
| 787 | /// with the `Start` and `End` fields cut out and the `[Script Info]` header |
| 788 | /// filed away in `CodecPrivate`. Both are put back into the shape their parser |
| 789 | /// reads -- rather than the markup being re-derived here -- which is also what |
| 790 | /// makes an embedded track and the standalone file it was muxed from come back |
| 791 | /// as the same cues. |
| 792 | /// |
| 793 | /// A PGS track is neither: its blocks are pictures, and they are moved out of |
| 794 | /// `track` rather than copied ([`pgs_cues`]) -- thirty megabytes a track is not |
| 795 | /// a thing to hold twice. |
| 796 | |
| 797 | |
| 798 | |
| 799 | |
| 800 | |
| 801 | |
| 802 | |
| 803 | |
| 804 | |
| 805 | |
| 806 | |
| 807 | |
| 808 | |
| 809 | |
| 810 | |
| 811 | |
| 812 | |
| 813 | |
| 814 | |
| 815 | |
| 816 | |
| 817 | |
| 818 | |
| 819 | |
| 820 | |
| 821 | |
| 822 | |
| 823 | |
| 824 | /// The cues of an `S_HDMV/PGS` track: one display set per block, and a display |
| 825 | /// set is a picture the disc composes onto its own canvas. |
| 826 | /// |
| 827 | /// Only the blocks that compose *something* are cues. The other half of them |
| 828 | /// are the disc's "take it off again" -- a composition with no object on it -- |
| 829 | /// and they are what says when the picture before them goes away, which is why |
| 830 | /// they are walked and not skipped. A muxer writes `BlockDuration` zero for all |
| 831 | /// of them, so [`end_of`] is what pairs the two. |
| 832 | |
| 833 | |
| 834 | |
| 835 | |
| 836 | |
| 837 | |
| 838 | |
| 839 | |
| 840 | |
| 841 | |
| 842 | |
| 843 | |
| 844 | |
| 845 | |
| 846 | |
| 847 | |
| 848 | |
| 849 | |
| 850 | |
| 851 | |
| 852 | |
| 853 | |
| 854 | |
| 855 | |
| 856 | |
| 857 | /// How long a bitmap cue with no stated end stays up: two seconds. |
| 858 | const NO_END_US: i64 = 2_000_000; |
| 859 | |
| 860 | /// Gives every cue whose end is unstated the start of the next cue (or two seconds |
| 861 | /// for the last), and never lets a stated end run past the next cue's start. |
| 862 | |
| 863 | |
| 864 | |
| 865 | |
| 866 | |
| 867 | |
| 868 | |
| 869 | |
| 870 | |
| 871 | |
| 872 | |
| 873 | |
| 874 | |
| 875 | |
| 876 | /// The cues of an `S_VOBSUB` track (or a `.idx`/`.sub` pair): one subpicture unit per |
| 877 | /// block, which carries its own delay and end after the block's time. The `.idx` text |
| 878 | /// is the palette and canvas. |
| 879 | |
| 880 | |
| 881 | |
| 882 | |
| 883 | |
| 884 | |
| 885 | |
| 886 | |
| 887 | /// [`dvd_cues`] on `(time in microseconds, stated duration, unit)` triples. |
| 888 | |
| 889 | |
| 890 | |
| 891 | |
| 892 | |
| 893 | |
| 894 | |
| 895 | |
| 896 | |
| 897 | |
| 898 | |
| 899 | |
| 900 | |
| 901 | |
| 902 | |
| 903 | |
| 904 | |
| 905 | |
| 906 | |
| 907 | |
| 908 | |
| 909 | |
| 910 | |
| 911 | |
| 912 | |
| 913 | |
| 914 | |
| 915 | |
| 916 | |
| 917 | |
| 918 | |
| 919 | |
| 920 | |
| 921 | |
| 922 | |
| 923 | |
| 924 | /// The cues of an `S_DVBSUB` track (or a transport stream's DVB PID): one display set |
| 925 | /// per block. A set with no regions is the clear that ends the one before it; a set |
| 926 | /// states how long it stays up (`timeout`), cut short by the next set. |
| 927 | |
| 928 | |
| 929 | |
| 930 | |
| 931 | |
| 932 | |
| 933 | |
| 934 | |
| 935 | |
| 936 | |
| 937 | |
| 938 | |
| 939 | |
| 940 | |
| 941 | |
| 942 | |
| 943 | |
| 944 | |
| 945 | |
| 946 | |
| 947 | |
| 948 | |
| 949 | |
| 950 | |
| 951 | |
| 952 | |
| 953 | |
| 954 | |
| 955 | |
| 956 | |
| 957 | |
| 958 | |
| 959 | |
| 960 | |
| 961 | |
| 962 | |
| 963 | |
| 964 | |
| 965 | |
| 966 | |
| 967 | |
| 968 | |
| 969 | /// The canvas of a display set that paints something -- its `PCS` says how big |
| 970 | /// the disc's picture is, and how many objects are composed onto it. |
| 971 | /// |
| 972 | /// `None` when nothing is composed, which is the disc clearing the screen, and |
| 973 | /// `None` for bytes that are not a display set at all. |
| 974 | |
| 975 | |
| 976 | |
| 977 | |
| 978 | |
| 979 | |
| 980 | |
| 981 | |
| 982 | |
| 983 | |
| 984 | |
| 985 | |
| 986 | /// When a cue goes away: its `BlockDuration`, or -- for the muxer that writes |
| 987 | /// none, and for the PGS block that writes a zero, which says the same thing -- |
| 988 | /// when the next one arrives, and [`NO_DURATION_US`] for the last. |
| 989 | |
| 990 | |
| 991 | |
| 992 | |
| 993 | |
| 994 | |
| 995 | |
| 996 | |
| 997 | |
| 998 | |
| 999 | |
| 1000 | |
| 1001 | |
| 1002 | |
| 1003 | |
| 1004 | /// The cues of a Matroska text track whose blocks are one cue body each: the |
| 1005 | /// timing is the block's, and `body` resolves the markup of one block's text. |
| 1006 | |
| 1007 | |
| 1008 | |
| 1009 | |
| 1010 | |
| 1011 | |
| 1012 | |
| 1013 | |
| 1014 | |
| 1015 | |
| 1016 | |
| 1017 | |
| 1018 | |
| 1019 | |
| 1020 | |
| 1021 | |
| 1022 | |
| 1023 | |
| 1024 | /// The text of one WebVTT block with its markup resolved: the WebVTT parser |
| 1025 | /// reads a one-cue file built around it, the same way [`srt_body`] does for an |
| 1026 | /// SRT block. The block's own timing wins, so the timing line here is a |
| 1027 | /// placeholder that is thrown away. |
| 1028 | |
| 1029 | |
| 1030 | |
| 1031 | |
| 1032 | |
| 1033 | |
| 1034 | |
| 1035 | |
| 1036 | |
| 1037 | |
| 1038 | |
| 1039 | |
| 1040 | |
| 1041 | |
| 1042 | |
| 1043 | |
| 1044 | |
| 1045 | /// The text of one `S_TEXT/UTF8` block with its markup resolved: through the |
| 1046 | /// SRT parser, around a timing line this then throws away, because SRT markup |
| 1047 | /// is exactly what such a block holds and a second implementation of it here |
| 1048 | /// would be a second set of bugs. |
| 1049 | |
| 1050 | |
| 1051 | |
| 1052 | |
| 1053 | |
| 1054 | |
| 1055 | |
| 1056 | |
| 1057 | |
| 1058 | |
| 1059 | |
| 1060 | |
| 1061 | |
| 1062 | |
| 1063 | /// The cues of an `S_TEXT/ASS` track: the script header out of `CodecPrivate` |
| 1064 | /// with every block put back as a `Dialogue` line under it, parsed once as the |
| 1065 | /// `.ass` file it came from. |
| 1066 | |
| 1067 | |
| 1068 | |
| 1069 | |
| 1070 | |
| 1071 | |
| 1072 | |
| 1073 | |
| 1074 | |
| 1075 | |
| 1076 | |
| 1077 | |
| 1078 | |
| 1079 | |
| 1080 | |
| 1081 | |
| 1082 | |
| 1083 | |
| 1084 | |
| 1085 | |
| 1086 | |
| 1087 | |
| 1088 | |
| 1089 | |
| 1090 | |
| 1091 | |
| 1092 | |
| 1093 | |
| 1094 | |
| 1095 | |
| 1096 | |
| 1097 | |
| 1098 | |
| 1099 | |
| 1100 | |
| 1101 | |
| 1102 | |
| 1103 | |
| 1104 | |
| 1105 | |
| 1106 | |
| 1107 | |
| 1108 | |
| 1109 | |
| 1110 | |
| 1111 | |
| 1112 | |
| 1113 | |
| 1114 | |
| 1115 | |
| 1116 | |
| 1117 | |
| 1118 | |
| 1119 | |
| 1120 | |
| 1121 | |
| 1122 | /// Microseconds as ASS writes a time: `H:MM:SS.cc`. |
| 1123 | |
| 1124 | |
| 1125 | |
| 1126 | |
| 1127 | |
| 1128 | |
| 1129 | |
| 1130 | |
| 1131 | |
| 1132 | |
| 1133 | |
| 1134 | /// A standalone subtitle file, by extension: the formats this engine reads at |
| 1135 | /// all. Anything else is refused by name, as an unknown media file is. |
| 1136 | |
| 1137 | |
| 1138 | |
| 1139 | |
| 1140 | /// The cues of a VobSub pair: `name.idx` (palette, canvas) beside `name.sub` (the |
| 1141 | /// subpicture units in an MPEG program stream). Either file may be the one named. |
| 1142 | |
| 1143 | |
| 1144 | |
| 1145 | |
| 1146 | |
| 1147 | |
| 1148 | |
| 1149 | |
| 1150 | |
| 1151 | |
| 1152 | |
| 1153 | |
| 1154 | |
| 1155 | |
| 1156 | |
| 1157 | |
| 1158 | |
| 1159 | |
| 1160 | |
| 1161 | |
| 1162 | |
| 1163 | |
| 1164 | /// The lines of a text subtitle file that were not imported, each with its |
| 1165 | /// line number and why (`line 34: end before start`). Empty for a file that |
| 1166 | /// read whole, and for an ASS script, whose cues have no such lines to skip. |
| 1167 | |
| 1168 | |
| 1169 | |
| 1170 | |
| 1171 | /// The cues of a text subtitle file, and the timing lines that were not made |
| 1172 | /// into one. See [`timing_lines`] for why the file is read twice. |
| 1173 | |
| 1174 | |
| 1175 | |
| 1176 | |
| 1177 | |
| 1178 | |
| 1179 | |
| 1180 | |
| 1181 | |
| 1182 | |
| 1183 | |
| 1184 | |
| 1185 | |
| 1186 | |
| 1187 | |
| 1188 | |
| 1189 | |
| 1190 | |
| 1191 | |
| 1192 | |
| 1193 | |
| 1194 | |
| 1195 | |
| 1196 | |
| 1197 | |
| 1198 | |
| 1199 | |
| 1200 | |
| 1201 | |
| 1202 | |
| 1203 | |
| 1204 | |
| 1205 | |
| 1206 | |
| 1207 | |
| 1208 | |
| 1209 | |
| 1210 | |
| 1211 | |
| 1212 | |
| 1213 | |
| 1214 | |
| 1215 | |
| 1216 | |
| 1217 | |
| 1218 | |
| 1219 | |
| 1220 | |
| 1221 | |
| 1222 | |
| 1223 | |
| 1224 | |
| 1225 | |
| 1226 | |
| 1227 | |
| 1228 | |
| 1229 | |
| 1230 | |
| 1231 | |
| 1232 | |
| 1233 | |
| 1234 | |
| 1235 | |
| 1236 | |
| 1237 | |
| 1238 | |
| 1239 | |
| 1240 | |
| 1241 | |
| 1242 | |
| 1243 | |
| 1244 | |
| 1245 | |
| 1246 | |
| 1247 | |
| 1248 | |
| 1249 | |
| 1250 | |
| 1251 | |
| 1252 | |
| 1253 | |
| 1254 | |
| 1255 | |
| 1256 | |
| 1257 | |
| 1258 | |
| 1259 | |
| 1260 | |
| 1261 | /// The byte a `<br>` line break is marked with on its way through the parser, |
| 1262 | /// which drops the tag and the break with it. A control character, so no cue's |
| 1263 | /// own text carries one; `cue_of` turns it back into a newline. |
| 1264 | const BREAK_MARK: u8 = 0x01; |
| 1265 | |
| 1266 | /// The file's bytes with each `<br>`, `<br/>` or `<br />` replaced by |
| 1267 | /// [`BREAK_MARK`]. A byte-level pass, so a timing line is untouched and its |
| 1268 | /// line number still counts. |
| 1269 | |
| 1270 | |
| 1271 | |
| 1272 | |
| 1273 | |
| 1274 | |
| 1275 | |
| 1276 | |
| 1277 | |
| 1278 | |
| 1279 | |
| 1280 | |
| 1281 | |
| 1282 | |
| 1283 | |
| 1284 | |
| 1285 | |
| 1286 | |
| 1287 | |
| 1288 | |
| 1289 | |
| 1290 | |
| 1291 | |
| 1292 | |
| 1293 | |
| 1294 | /// One timing line of a text subtitle file, `start --> end`: where it is, and |
| 1295 | /// either the span it gives or why it gives none. |
| 1296 | |
| 1297 | |
| 1298 | |
| 1299 | |
| 1300 | |
| 1301 | |
| 1302 | |
| 1303 | |
| 1304 | |
| 1305 | |
| 1306 | /// Every timing line of an SRT or WebVTT text, and every cue block that has |
| 1307 | /// none, in file order. The parser reads the same lines itself, but drops a cue |
| 1308 | /// it cannot time without a word and keeps one that runs backwards, so the reply |
| 1309 | /// needs them read again here. |
| 1310 | /// |
| 1311 | /// A line counts when its left side is a time-like run (a digit, then a `:`), |
| 1312 | /// so a cue whose words happen to hold an arrow is not one. A time-like pair |
| 1313 | /// with a wrong arrow (`->`) is named too, and so is a block that opens like a |
| 1314 | /// cue (see below) and holds no timing line at all. |
| 1315 | |
| 1316 | |
| 1317 | |
| 1318 | |
| 1319 | |
| 1320 | |
| 1321 | |
| 1322 | |
| 1323 | |
| 1324 | |
| 1325 | |
| 1326 | |
| 1327 | |
| 1328 | |
| 1329 | |
| 1330 | |
| 1331 | |
| 1332 | |
| 1333 | |
| 1334 | |
| 1335 | |
| 1336 | |
| 1337 | |
| 1338 | |
| 1339 | |
| 1340 | |
| 1341 | |
| 1342 | |
| 1343 | |
| 1344 | |
| 1345 | |
| 1346 | |
| 1347 | |
| 1348 | |
| 1349 | |
| 1350 | |
| 1351 | |
| 1352 | |
| 1353 | |
| 1354 | |
| 1355 | |
| 1356 | |
| 1357 | |
| 1358 | /// The timing line on one line of text, when it is one: `start --> end`, with |
| 1359 | /// a time-like start. `None` for any other line. |
| 1360 | |
| 1361 | |
| 1362 | |
| 1363 | |
| 1364 | |
| 1365 | |
| 1366 | |
| 1367 | |
| 1368 | |
| 1369 | |
| 1370 | |
| 1371 | |
| 1372 | |
| 1373 | |
| 1374 | |
| 1375 | |
| 1376 | |
| 1377 | |
| 1378 | |
| 1379 | |
| 1380 | |
| 1381 | /// Whether a line without `-->` reads as a timing line with a wrong arrow: a |
| 1382 | /// time-like run, then one or more dashes and a `>`, then a time-like run |
| 1383 | /// (`00:00:02,000 -> 00:00:03,000`). |
| 1384 | |
| 1385 | |
| 1386 | |
| 1387 | |
| 1388 | |
| 1389 | |
| 1390 | |
| 1391 | |
| 1392 | |
| 1393 | |
| 1394 | |
| 1395 | |
| 1396 | |
| 1397 | /// A subtitle timestamp, `[H:]MM:SS` then `.` or `,` and up to three digits of |
| 1398 | /// fraction, as microseconds. `None` for anything else, including minutes or |
| 1399 | /// seconds of sixty and more. |
| 1400 | |
| 1401 | |
| 1402 | |
| 1403 | |
| 1404 | |
| 1405 | |
| 1406 | |
| 1407 | |
| 1408 | |
| 1409 | |
| 1410 | |
| 1411 | |
| 1412 | |
| 1413 | |
| 1414 | |
| 1415 | |
| 1416 | |
| 1417 | |
| 1418 | |
| 1419 | |
| 1420 | |
| 1421 | |
| 1422 | |
| 1423 | |
| 1424 | |
| 1425 | /// One cue as a writer states it: whole milliseconds, and lines that are |
| 1426 | /// neither empty nor carry a stray carriage return. Shared by [`write_srt`] and |
| 1427 | /// [`write_vtt`] so the two cannot disagree about which cues exist. |
| 1428 | /// |
| 1429 | /// Picture cues are dropped (a text file cannot carry them), as are cues with |
| 1430 | /// no words and cues whose millisecond span is empty or negative once rounded. |
| 1431 | /// Negative starts are clamped to zero; the result is sorted by start. |
| 1432 | |
| 1433 | |
| 1434 | |
| 1435 | |
| 1436 | |
| 1437 | |
| 1438 | |
| 1439 | |
| 1440 | |
| 1441 | |
| 1442 | |
| 1443 | |
| 1444 | |
| 1445 | |
| 1446 | |
| 1447 | |
| 1448 | |
| 1449 | |
| 1450 | |
| 1451 | |
| 1452 | |
| 1453 | |
| 1454 | |
| 1455 | /// Microseconds to whole milliseconds, rounding half up. The input is never |
| 1456 | /// negative here: [`written_cues`] clamps first. |
| 1457 | |
| 1458 | |
| 1459 | |
| 1460 | |
| 1461 | /// `HH:MM:SS<sep>mmm`, where `sep` is `,` for SRT and `.` for WebVTT. |
| 1462 | |
| 1463 | |
| 1464 | |
| 1465 | |
| 1466 | |
| 1467 | |
| 1468 | |
| 1469 | |
| 1470 | |
| 1471 | |
| 1472 | /// The cues as a SubRip file: numbered from 1, in start order, `HH:MM:SS,mmm` |
| 1473 | /// times, lines as the cue has them. SRT has no escaping, so the text goes out |
| 1474 | /// as it is. Picture cues and empty cues are left out (see [`written_cues`]). |
| 1475 | |
| 1476 | |
| 1477 | |
| 1478 | |
| 1479 | |
| 1480 | |
| 1481 | |
| 1482 | |
| 1483 | |
| 1484 | |
| 1485 | |
| 1486 | |
| 1487 | |
| 1488 | |
| 1489 | |
| 1490 | |
| 1491 | |
| 1492 | |
| 1493 | /// The cues as a WebVTT file: the `WEBVTT` header, then numbered cues in start |
| 1494 | /// order with `HH:MM:SS.mmm` times. Cue text is escaped as WebVTT reads it: |
| 1495 | /// `&` becomes `&`, `<` becomes `<` and `>` becomes `>`. Escaping `>` |
| 1496 | /// is also what keeps a `-->` in the words from reading as a timing line. |
| 1497 | /// Picture cues and empty cues are left out (see [`written_cues`]). |
| 1498 | |
| 1499 | |
| 1500 | |
| 1501 | |
| 1502 | |
| 1503 | |
| 1504 | |
| 1505 | |
| 1506 | |
| 1507 | |
| 1508 | |
| 1509 | |
| 1510 | |
| 1511 | |
| 1512 | |
| 1513 | |
| 1514 | |
| 1515 | |
| 1516 | /// The three characters WebVTT cue text cannot carry as they are. |
| 1517 | |
| 1518 | |
| 1519 | |
| 1520 | |
| 1521 | |
| 1522 | |
| 1523 | /// Save cues to `path`, as SRT for `.srt` and WebVTT for `.vtt` (any case). The |
| 1524 | /// extension is checked before anything is written, so a `.txt` is refused and |
| 1525 | /// leaves nothing behind. |
| 1526 | /// |
| 1527 | /// Written through `<path>.part` and a rename, as [`crate::edith::save`] does: |
| 1528 | /// the bytes are fsynced before the name exists, the directory after, and a |
| 1529 | /// failed write removes the part file. |
| 1530 | |
| 1531 | |
| 1532 | |
| 1533 | |
| 1534 | |
| 1535 | |
| 1536 | |
| 1537 | |
| 1538 | |
| 1539 | |
| 1540 | |
| 1541 | |
| 1542 | |
| 1543 | |
| 1544 | |
| 1545 | |
| 1546 | |
| 1547 | |
| 1548 | |
| 1549 | |
| 1550 | |
| 1551 | |
| 1552 | |
| 1553 | |
| 1554 | |
| 1555 | |
| 1556 | |
| 1557 | |
| 1558 | |
| 1559 | |
| 1560 | |
| 1561 | |
| 1562 | |
| 1563 | |
| 1564 | |
| 1565 | |
| 1566 | /// Group timed words into caption cues. `words` is `(start_us, end_us, word)`, |
| 1567 | /// sorted by start here whatever order it arrives in; words that are empty |
| 1568 | /// after trimming are skipped. |
| 1569 | /// |
| 1570 | /// A cue is closed before a word that would take it past any of these: |
| 1571 | /// - a pause longer than `gap_secs` since the previous word ended; |
| 1572 | /// - `max_secs` from the cue's first word to this word's end; |
| 1573 | /// - two lines of `max_chars` each: the words joined with spaces may not exceed |
| 1574 | /// `2 * max_chars` characters. |
| 1575 | /// |
| 1576 | /// A cue is also closed after a word that ends a sentence (`.`, `!`, `?`, `…`, |
| 1577 | /// optionally followed by closing quotes or brackets). A cue of more than |
| 1578 | /// `max_chars` characters is split over two lines at the word boundary that |
| 1579 | /// makes the longer line shortest, so the lines come out as close to even as the |
| 1580 | /// words allow. Text is the lines joined with `\n`; no picture. |
| 1581 | /// |
| 1582 | /// A single word longer than the limits is still a cue of its own rather than |
| 1583 | /// being dropped or cut. |
| 1584 | |
| 1585 | |
| 1586 | |
| 1587 | |
| 1588 | |
| 1589 | |
| 1590 | |
| 1591 | |
| 1592 | |
| 1593 | |
| 1594 | |
| 1595 | |
| 1596 | |
| 1597 | |
| 1598 | |
| 1599 | |
| 1600 | |
| 1601 | |
| 1602 | |
| 1603 | |
| 1604 | |
| 1605 | |
| 1606 | |
| 1607 | |
| 1608 | |
| 1609 | |
| 1610 | |
| 1611 | |
| 1612 | |
| 1613 | |
| 1614 | |
| 1615 | |
| 1616 | |
| 1617 | |
| 1618 | |
| 1619 | |
| 1620 | |
| 1621 | |
| 1622 | |
| 1623 | |
| 1624 | |
| 1625 | /// One cue out of its words: timed from the first word's start to the last |
| 1626 | /// word's end, text laid out over at most two lines. |
| 1627 | |
| 1628 | |
| 1629 | |
| 1630 | |
| 1631 | |
| 1632 | |
| 1633 | |
| 1634 | |
| 1635 | |
| 1636 | |
| 1637 | |
| 1638 | |
| 1639 | |
| 1640 | |
| 1641 | |
| 1642 | |
| 1643 | |
| 1644 | |
| 1645 | |
| 1646 | |
| 1647 | |
| 1648 | |
| 1649 | |
| 1650 | |
| 1651 | |
| 1652 | |
| 1653 | |
| 1654 | |
| 1655 | |
| 1656 | |
| 1657 | |
| 1658 | |
| 1659 | |
| 1660 | |
| 1661 | |
| 1662 | /// Whether a word closes a sentence: final `.`, `!`, `?` or `…`, looking past |
| 1663 | /// closing quotes and brackets. |
| 1664 | |
| 1665 | |
| 1666 | |
| 1667 | |
| 1668 | |
| 1669 | /// The decoding path checked against a snapshot of the oxideav one it replaced. |
| 1670 | |
| 1671 | |
| 1672 | |
| 1673 | |
| 1674 | |
| 1675 | |
| 1676 | |
| 1677 | |
| 1678 | |
| 1679 | |
| 1680 | |
| 1681 | |
| 1682 | |
| 1683 | |
| 1684 | |
| 1685 | |
| 1686 | |
| 1687 | |
| 1688 | |
| 1689 | |
| 1690 | |
| 1691 | |
| 1692 | |
| 1693 | |
| 1694 | |
| 1695 | |
| 1696 | |
| 1697 | |
| 1698 | |
| 1699 | |
| 1700 | |
| 1701 | |
| 1702 | |
| 1703 | |
| 1704 | |
| 1705 | |
| 1706 | |
| 1707 | |
| 1708 | |
| 1709 | |
| 1710 | |
| 1711 | |
| 1712 | |
| 1713 | |
| 1714 | |
| 1715 | |
| 1716 | |
| 1717 | |
| 1718 | |
| 1719 | |
| 1720 | |
| 1721 | |
| 1722 | |
| 1723 | |
| 1724 | |
| 1725 | |
| 1726 | |
| 1727 | |
| 1728 | |
| 1729 | |
| 1730 | |
| 1731 | |
| 1732 | |
| 1733 | |
| 1734 | |
| 1735 | |
| 1736 | |
| 1737 | |
| 1738 | |
| 1739 | |
| 1740 | |
| 1741 | |
| 1742 | |
| 1743 | |
| 1744 | |
| 1745 | |
| 1746 | |
| 1747 | |
| 1748 | |
| 1749 | |
| 1750 | |
| 1751 | |
| 1752 | |
| 1753 | |
| 1754 | |
| 1755 | |
| 1756 | |
| 1757 | |
| 1758 | |
| 1759 | |
| 1760 | |
| 1761 | |
| 1762 | |
| 1763 | |
| 1764 | |
| 1765 | |
| 1766 | |
| 1767 | |
| 1768 | |
| 1769 | |
| 1770 | |
| 1771 | |
| 1772 | |
| 1773 | |
| 1774 | |
| 1775 | |
| 1776 | |
| 1777 | |
| 1778 | |
| 1779 | |
| 1780 | |
| 1781 | |
| 1782 | |
| 1783 | |
| 1784 | |
| 1785 | |
| 1786 | |
| 1787 | |
| 1788 | |
| 1789 | |
| 1790 | |
| 1791 | |
| 1792 | |
| 1793 | |
| 1794 | |
| 1795 | |
| 1796 | |
| 1797 | |
| 1798 | |
| 1799 | |
| 1800 | |
| 1801 | |
| 1802 | |
| 1803 | |
| 1804 | |
| 1805 | |
| 1806 | |
| 1807 | |
| 1808 | |
| 1809 | |
| 1810 | |
| 1811 | |
| 1812 | |
| 1813 | |
| 1814 | |
| 1815 | |
| 1816 | |
| 1817 | |
| 1818 | |
| 1819 | |
| 1820 | |
| 1821 | |
| 1822 | |
| 1823 | |
| 1824 | |
| 1825 | |
| 1826 | |
| 1827 | |
| 1828 | |
| 1829 | |
| 1830 | |
| 1831 | |
| 1832 | |
| 1833 | |
| 1834 | |
| 1835 | |
| 1836 | |
| 1837 | |
| 1838 | |
| 1839 | |
| 1840 | |
| 1841 | |
| 1842 | |
| 1843 | |
| 1844 | |
| 1845 | |
| 1846 | |
| 1847 | |
| 1848 | |
| 1849 | |
| 1850 | |
| 1851 | |
| 1852 | |
| 1853 | |
| 1854 | |
| 1855 | |
| 1856 | |
| 1857 | |
| 1858 | |
| 1859 | |
| 1860 | |
| 1861 | |
| 1862 | |
| 1863 | |
| 1864 | |
| 1865 | |
| 1866 | |
| 1867 | |
| 1868 | |
| 1869 | |
| 1870 | |
| 1871 | |
| 1872 | |
| 1873 | |
| 1874 | |
| 1875 | |
| 1876 | |
| 1877 | |
| 1878 | |
| 1879 | |
| 1880 | |
| 1881 | |
| 1882 | |
| 1883 | |
| 1884 | |
| 1885 | |
| 1886 | |
| 1887 | |
| 1888 | |
| 1889 | |
| 1890 | |
| 1891 | |
| 1892 | |
| 1893 | |
| 1894 | |
| 1895 | |
| 1896 | |
| 1897 | |
| 1898 | |
| 1899 | |
| 1900 | |
| 1901 | |
| 1902 | |
| 1903 | |
| 1904 | |
| 1905 | |
| 1906 | |
| 1907 | |
| 1908 | |
| 1909 | |
| 1910 | |
| 1911 | |
| 1912 | |
| 1913 | |
| 1914 | |
| 1915 | |
| 1916 | |
| 1917 | |
| 1918 | |
| 1919 | |
| 1920 | |
| 1921 | |
| 1922 | |
| 1923 | |
| 1924 | |
| 1925 | |
| 1926 | |
| 1927 | |
| 1928 | |
| 1929 | |
| 1930 | |
| 1931 | |
| 1932 | |
| 1933 | |
| 1934 | |
| 1935 | |
| 1936 | |
| 1937 | |
| 1938 | |
| 1939 | |
| 1940 | |
| 1941 | |
| 1942 | |
| 1943 | |
| 1944 | |
| 1945 | |
| 1946 | |
| 1947 | |
| 1948 | |
| 1949 | |
| 1950 | |
| 1951 | |
| 1952 | |
| 1953 | |
| 1954 | |
| 1955 | |
| 1956 | |
| 1957 | |
| 1958 | |
| 1959 | |
| 1960 | |
| 1961 | |
| 1962 | |
| 1963 | |
| 1964 | |
| 1965 | |
| 1966 | |
| 1967 | |
| 1968 | |
| 1969 | |
| 1970 | |
| 1971 | |
| 1972 | |
| 1973 | |
| 1974 | |
| 1975 | |
| 1976 | |
| 1977 | |
| 1978 | |
| 1979 | |
| 1980 | |
| 1981 | |
| 1982 | |
| 1983 | |
| 1984 | |
| 1985 | |
| 1986 | |
| 1987 | |
| 1988 | |
| 1989 | |
| 1990 | |
| 1991 | |
| 1992 | |
| 1993 | |
| 1994 | |
| 1995 | |
| 1996 | |
| 1997 | |
| 1998 | |
| 1999 | |
| 2000 | |
| 2001 | |
| 2002 | |
| 2003 | |
| 2004 | |
| 2005 | |
| 2006 | |
| 2007 | |
| 2008 | |
| 2009 | |
| 2010 | |
| 2011 | |
| 2012 | |
| 2013 | |
| 2014 | |
| 2015 | |
| 2016 | |
| 2017 | |
| 2018 | |
| 2019 | |
| 2020 | |
| 2021 | |
| 2022 | |
| 2023 | |
| 2024 | |
| 2025 | |
| 2026 | |
| 2027 | |
| 2028 | |
| 2029 | |
| 2030 | |
| 2031 | |
| 2032 | |
| 2033 | |
| 2034 | |
| 2035 | |
| 2036 | |
| 2037 | |
| 2038 | |
| 2039 | |
| 2040 | |
| 2041 | |
| 2042 | |
| 2043 | |
| 2044 | |
| 2045 | |
| 2046 | |
| 2047 | |
| 2048 | |
| 2049 | |
| 2050 | |
| 2051 | |
| 2052 | |
| 2053 | |
| 2054 | |
| 2055 | |
| 2056 | |
| 2057 | |
| 2058 | |
| 2059 | |
| 2060 | |
| 2061 | |
| 2062 | |
| 2063 | |
| 2064 | |
| 2065 | |
| 2066 | |
| 2067 | |
| 2068 | |
| 2069 | |
| 2070 | |
| 2071 | |
| 2072 | |
| 2073 | |
| 2074 | |
| 2075 | |
| 2076 | |
| 2077 | |
| 2078 | |
| 2079 | |
| 2080 | |
| 2081 | |
| 2082 | |
| 2083 | |
| 2084 | |
| 2085 | |
| 2086 | |
| 2087 | |
| 2088 | |
| 2089 | |
| 2090 | |
| 2091 | |
| 2092 | |
| 2093 | |
| 2094 | |
| 2095 | |
| 2096 | |
| 2097 | |
| 2098 | |
| 2099 | |
| 2100 | |
| 2101 | |
| 2102 | |
| 2103 | |
| 2104 | |
| 2105 | |
| 2106 | |
| 2107 | |
| 2108 | |
| 2109 | |
| 2110 | |
| 2111 | |
| 2112 | |
| 2113 | |
| 2114 | |
| 2115 | |
| 2116 | |
| 2117 | |
| 2118 | |
| 2119 | |
| 2120 | |
| 2121 | |
| 2122 | |
| 2123 | |
| 2124 | |
| 2125 | |
| 2126 | |
| 2127 | |
| 2128 | |
| 2129 | |
| 2130 | |
| 2131 |