edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiB7f487c1Tahinli3 months ago659 commits
| 1 | //! What the export card offers and what it writes. |
| 2 | |
| 3 | use crate::*; |
| 4 | |
| 5 | /// The project resolutions [`Player::cycle_resolution`] offers, largest first. |
| 6 | /// A short list of the sizes people name; the media's own is cycled in beside |
| 7 | /// them, which is what makes the trip round come back to where it started. |
| 8 | pub const RESOLUTIONS: = |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | ; |
| 15 | |
| 16 | /// The project frame rates the list offers, slowest first: the rates footage is |
| 17 | /// actually shot and delivered at, the NTSC ones written as the ratios they are |
| 18 | /// (`24000/1001`, not `23.976`) -- the engine conforms the timeline to the very |
| 19 | /// number it is handed, so a rate rounded here would be a rate no timescale can |
| 20 | /// name. The media's own is cycled in beside them |
| 21 | /// ([`frame_rate_ladder`]), which is what keeps the way back on the list. |
| 22 | pub const FRAME_RATES: = |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | ; |
| 32 | |
| 33 | /// The project sound rates the list offers, slowest first. Unlike |
| 34 | /// [`RESOLUTIONS`] and [`FRAME_RATES`] there is no media rate to cycle in |
| 35 | /// beside them: a source's own rate is not a number this list has to name to |
| 36 | /// offer it, since [`Choice::SampleRate`]`(None)` -- "source" -- already means |
| 37 | /// exactly that, whatever the number turns out to be. |
| 38 | pub const SAMPLE_RATES: = ; |
| 39 | |
| 40 | /// The sound-rate list's rows: "source" first -- the derived rate, and the |
| 41 | /// row in force with nothing picked -- then every rate on offer, the one in |
| 42 | /// force marked. The same rows serve [`Pick::SampleRate`] with a session and |
| 43 | /// without one: `current` is [`PlaybackSession::sample_rate`] or |
| 44 | /// [`Player::pending_settings`]`.2`, and `None` means the same thing either |
| 45 | /// way -- nothing picked yet. |
| 46 | pub |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | /// What the export card offers, top to bottom. Bitrate is the only thing the |
| 70 | /// encoder actually takes: the codec and the container are what this program |
| 71 | /// can write and nothing else, so the card states them rather than offering |
| 72 | /// them. |
| 73 | |
| 74 | pub |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 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 | /// The primary pane's one row: the format-and-quality bundles most exports |
| 120 | /// actually are, named the way a person asks for one rather than by codec and |
| 121 | /// megabits apart. Every bundle is still exactly a [`Format`] and a |
| 122 | /// [`Quality`] the Advanced pane's own rows already know how to set -- this |
| 123 | /// is a shortcut to the pair, not a third setting kept beside them, so a |
| 124 | /// bundle picked here and a codec picked below never disagree about what is |
| 125 | /// in force. `Custom` sets nothing; it only opens the Advanced pane, for a |
| 126 | /// combination none of the bundles name. |
| 127 | |
| 128 | pub |
| 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 | /// The export card's format rows: the key that picks one, its name, and what it |
| 211 | /// writes -- or, where this program cannot write it, the reason it cannot. A |
| 212 | /// format with no entry at all would read as an oversight, and a menu of three |
| 213 | /// as a claim that nothing else exists -- so the refusals are rows too, dimmed |
| 214 | /// and unclickable. |
| 215 | /// |
| 216 | /// `None` is exactly that kind of row, and there are two left. MP3 stopped |
| 217 | /// being one when `rusty_mp3` gave this project an Apache-2.0 encoder (the LGPL |
| 218 | /// `shine-rs` was the licence question, and it is not the only encoder any |
| 219 | /// more), and HEVC stopped being one when OxideAV's pure-Rust H.265 gave it an |
| 220 | /// encoder — an *intra-only* one, which the rows say rather than let a user |
| 221 | /// find out from the size of the file. VP9 is the one this program still only |
| 222 | /// *reads*: the plugin decodes it and there is no encoder for it here, so it is |
| 223 | /// a row for the reason the refusals are rows at all — a codec that opens but |
| 224 | /// never comes back out is exactly the gap a user would otherwise go looking |
| 225 | /// for. AAC is not a row at all: it is what both containers' sound *is*, never a |
| 226 | /// file of its own. |
| 227 | /// |
| 228 | /// A codec is one row, and the boxes it can be written into are the row's |
| 229 | /// containers: the same AV1 picture and the same AAC track go into a Matroska |
| 230 | /// file or into an mp4, and which one a user needs is about what has to play |
| 231 | /// the file, not about the encode. So the container is asked *once*, in a row |
| 232 | /// of its own, and only where there is more than one to ask about -- five |
| 233 | /// picture rows to read past were four of them saying the same codec twice. |
| 234 | pub const FORMATS: = |
| 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 | /// The codec row a key picks, landed in the container already chosen: pressing |
| 266 | /// `a` after an mp4 gives AV1 *in mp4*, because a box decided once is not a |
| 267 | /// question again. A letter of the row's own name, spelled out in the table |
| 268 | /// rather than taken from the initial (`MP4` and `MP3` share one). Never a |
| 269 | /// digit -- those are the bitrate field's. `None` for every other stroke, the rows |
| 270 | /// that cannot be picked included. |
| 271 | pub |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | /// The boxes one codec may be written into, in the order its container row |
| 279 | /// cycles them. Empty for a codec this program cannot write at all. |
| 280 | pub |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | /// This row's format under the container `current` is already in, or the row's |
| 289 | /// first when it has no such box: an AV1 picked from a WAV lands in Matroska, |
| 290 | /// and picked from an mp4 stays in the mp4. |
| 291 | pub |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | /// The next box for the same codec, wrapping -- what the container row's key |
| 299 | /// does. The format itself for a codec with only one, so the stroke cannot |
| 300 | /// change what it is not offering. |
| 301 | pub |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | |
| 309 | /// The next rate the Sound row offers, wrapping -- what its key does, and what |
| 310 | /// the row itself names so the stroke is never a guess. [`next_container`]'s |
| 311 | /// shape, for the same reason: one place decides what "next" means. |
| 312 | pub |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | /// Why the quality rows say nothing about this format, or `None` where they |
| 318 | /// decide the picture. Only a picture encoder is given a bitrate here: the two |
| 319 | /// lossless audio formats have none to give and MP3 is written at one fixed |
| 320 | /// figure, so a live row over either would be a control that changes nothing. |
| 321 | pub |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | /// What one of the colour card's own strokes does. Its keys are card-local -- |
| 338 | /// they mean nothing outside it -- so they are a table here rather than keymap |
| 339 | /// bindings, exactly as the export card's format initials are. Listed in |
| 340 | /// `keymap::FIXED` all the same, which is how the keys menu still says so. |
| 341 | pub |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | /// Why the silence card has nothing to scan on that clip, in its own voice: the |
| 351 | /// lane and index the user picked, the file it is of, and which of the two |
| 352 | /// soundless things it is. One place, because a still and a silent video are |
| 353 | /// the same answer to the same question -- "a box with a larger size than it" |
| 354 | /// is what the *demuxer* would say about a png, and it is not an answer. |
| 355 | /// |
| 356 | /// Costs nothing: the scan reads a file and writes marks, so a refusal here |
| 357 | /// leaves the project (and its undo history) exactly where it was. |
| 358 | pub |
| 359 | |
| 360 | |
| 361 | |
| 362 | |
| 363 | |
| 364 | |
| 365 | |
| 366 | |
| 367 | |
| 368 | |
| 369 | |
| 370 | |
| 371 | /// The half of a take whose *sound* the silence card scans: a link is one span |
| 372 | /// on however many lanes, so a card opened on the picture opens on the sound it |
| 373 | /// is grouped with. That is the lane the waveform is drawn on, and so the lane |
| 374 | /// the marks have to land on to be read against it -- and the ranges agree, |
| 375 | /// because a group is one span. |
| 376 | /// |
| 377 | /// The clip itself for one already on an audio lane, for a detached picture, |
| 378 | /// and for a take whose sound is not on any lane: there is nothing better to |
| 379 | /// open on, and the refusal for a source with no audio at all is `scan`'s. |
| 380 | pub |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | |
| 386 | |
| 387 | |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | |
| 393 | |
| 394 | |
| 395 | |
| 396 | |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | /// The member of a caption's group on a media lane of the wanted kind: what a |
| 402 | /// card that is about media opens on when the hand is on the caption pinned to |
| 403 | /// it. `None` for a caption in no group with clips -- there are no pictures or |
| 404 | /// sound behind the words to be reaching at, and the card that opened anyway |
| 405 | /// would be a card of settings nothing plays. |
| 406 | pub |
| 407 | |
| 408 | |
| 409 | |
| 410 | |
| 411 | |
| 412 | |
| 413 | |
| 414 | |
| 415 | |
| 416 | |
| 417 | |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | |
| 425 | pub |
| 426 | |
| 427 | |
| 428 | |
| 429 | |
| 430 | |
| 431 | |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | /// The band'th control of a grade, to read or to write. The order is |
| 438 | /// [`COLOR_BANDS`]', which is the order the card lists them in. |
| 439 | pub |
| 440 | |
| 441 | |
| 442 | |
| 443 | |
| 444 | |
| 445 | |
| 446 | |
| 447 | |
| 448 | /// The line under the rows: what the picked format really writes, in the terms |
| 449 | /// a file is judged by afterwards. |
| 450 | /// The next policy round the cycle, in the order the action's label reads. |
| 451 | /// Every fit policy, in the order the list offers them -- which is the order |
| 452 | /// [`next_fit`] steps through them, pinned by the test below: a list and a |
| 453 | /// stroke that disagreed about what comes next would be two settings. |
| 454 | pub const FITS: = |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | ; |
| 460 | |
| 461 | pub |
| 462 | |
| 463 | |
| 464 | |
| 465 | |
| 466 | |
| 467 | |
| 468 | |
| 469 | |
| 470 | /// What a person calls one, said as what it does to the picture. |
| 471 | pub |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | |
| 480 | /// Every project resolution on offer, largest first: [`RESOLUTIONS`] with the |
| 481 | /// media's own size cycled in at its place by size -- so a project already at a |
| 482 | /// listed size does not see it twice, and the media's own shape, whatever it is, |
| 483 | /// is always on the list. The one order both the stroke and the list use. |
| 484 | pub |
| 485 | |
| 486 | |
| 487 | |
| 488 | |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | |
| 496 | |
| 497 | |
| 498 | |
| 499 | |
| 500 | /// The resolution list's rows: every rung of the ladder, the media's own said |
| 501 | /// so, and the one in force marked. A size is named by its height the way the |
| 502 | /// button that opens the list names it, with the full figure beside it. |
| 503 | pub |
| 504 | |
| 505 | |
| 506 | |
| 507 | |
| 508 | |
| 509 | |
| 510 | |
| 511 | |
| 512 | |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | |
| 519 | |
| 520 | |
| 521 | |
| 522 | |
| 523 | /// The resolution list's rows before any file is open: [`RESOLUTIONS`] plain, |
| 524 | /// with nothing marked unless a pick is already held |
| 525 | /// ([`Player::pending_settings`]) -- there is no media size to cycle in |
| 526 | /// beside them yet ([`resolution_choices`]'s `native`). |
| 527 | pub |
| 528 | |
| 529 | |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | |
| 538 | |
| 539 | |
| 540 | |
| 541 | /// [`pending_resolution_choices`]'s sibling for the rate list. |
| 542 | pub |
| 543 | |
| 544 | |
| 545 | |
| 546 | |
| 547 | |
| 548 | |
| 549 | |
| 550 | |
| 551 | |
| 552 | |
| 553 | |
| 554 | |
| 555 | |
| 556 | |
| 557 | |
| 558 | |
| 559 | |
| 560 | /// Every project frame rate on offer, slowest first: [`FRAME_RATES`] with the |
| 561 | /// media's own cycled in at its place by speed, so a project already cut at a |
| 562 | /// listed rate does not see it twice and the media's own rate -- the one a |
| 563 | /// project moved off it has no other way back to -- is always there. |
| 564 | /// [`resolution_ladder`]'s rule, for the other setting the project has of its |
| 565 | /// own. |
| 566 | pub |
| 567 | |
| 568 | |
| 569 | |
| 570 | |
| 571 | |
| 572 | |
| 573 | |
| 574 | |
| 575 | |
| 576 | |
| 577 | |
| 578 | |
| 579 | |
| 580 | /// The rate list's rows: every rung of the ladder, the media's own said so, and |
| 581 | /// the one in force marked. Named as a person writes a rate ([`fps_label`]), |
| 582 | /// with what it is for beside it -- short, or the row loses its tail to the |
| 583 | /// truncation the resolution list already met. |
| 584 | pub |
| 585 | |
| 586 | |
| 587 | |
| 588 | |
| 589 | |
| 590 | |
| 591 | |
| 592 | |
| 593 | |
| 594 | |
| 595 | |
| 596 | |
| 597 | |
| 598 | |
| 599 | |
| 600 | |
| 601 | |
| 602 | |
| 603 | |
| 604 | |
| 605 | |
| 606 | |
| 607 | /// The fit list's rows: all four policies against the canvas they place a |
| 608 | /// picture on, since the word alone ("fill") says nothing about the size it is |
| 609 | /// filling -- which is the very thing the notice says after a stroke. |
| 610 | pub |
| 611 | |
| 612 | |
| 613 | |
| 614 | |
| 615 | |
| 616 | |
| 617 | |
| 618 | |
| 619 | |
| 620 | |
| 621 | |
| 622 | |
| 623 | |
| 624 | |
| 625 | |
| 626 | /// The sound-rate list's rows: every offered rate, the one in force marked, and |
| 627 | /// what each buys said in the fewest words that fit beside the label (a longer |
| 628 | /// phrase loses its tail to `MENU_W`'s truncation, as the two lists above say). |
| 629 | pub |
| 630 | |
| 631 | |
| 632 | |
| 633 | |
| 634 | |
| 635 | |
| 636 | |
| 637 | |
| 638 | |
| 639 | |
| 640 | |
| 641 | |
| 642 | |
| 643 | |
| 644 | |
| 645 | |
| 646 | |
| 647 | |
| 648 | |
| 649 | |
| 650 | /// How a seat is named where a person reads it: the card row, the notice and |
| 651 | /// the list row all say the same word ([`engine::export::EncoderSeat`]). |
| 652 | pub |
| 653 | |
| 654 | |
| 655 | |
| 656 | |
| 657 | |
| 658 | |
| 659 | |
| 660 | /// The encoder list's rows: all three seats, the one in force marked, and what |
| 661 | /// each one *does* beside it -- in the fewest words that fit inside `MENU_W`, |
| 662 | /// the truncation every list above already met. Always offered, whatever this |
| 663 | /// machine has: a row that vanished with the plugin would be a setting nobody |
| 664 | /// could find, and the answer to "is there a seat here?" is the planned line |
| 665 | /// under the rows ([`engine::export::planned_video`]), which is measured. |
| 666 | pub |
| 667 | |
| 668 | |
| 669 | |
| 670 | |
| 671 | |
| 672 | |
| 673 | |
| 674 | |
| 675 | |
| 676 | |
| 677 | |
| 678 | |
| 679 | |
| 680 | |
| 681 | |
| 682 | |
| 683 | |
| 684 | |
| 685 | /// The row under the encoder one where -- and only where -- a person has asked |
| 686 | /// for the GPU on an AV1 export: this project's own driver reset the GPU on the |
| 687 | /// vendored AV1 encoder (2026-08-10), so the pick is theirs to make and the |
| 688 | /// risk is theirs to be told about. `None` for every other pair, which is what |
| 689 | /// keeps this from becoming a row nobody reads. |
| 690 | pub |
| 691 | |
| 692 | |
| 693 | |
| 694 | |
| 695 | |
| 696 | /// How a rendition is named where a person reads it: the panel button, the |
| 697 | /// notice and the list row all say the same word ([`engine::tonemap::Preset`]). |
| 698 | pub |
| 699 | |
| 700 | |
| 701 | |
| 702 | |
| 703 | |
| 704 | |
| 705 | |
| 706 | /// The HDR list's rows: all three renditions, the one in force marked, and what |
| 707 | /// each one *is* beside it -- in the fewest words that fit inside `MENU_W`, the |
| 708 | /// truncation the three lists above already met. Always offered, whatever is on |
| 709 | /// the timeline: a setting that appeared and vanished with the media would be a |
| 710 | /// setting nobody could find, and the row says who it acts on instead. |
| 711 | pub |
| 712 | |
| 713 | |
| 714 | |
| 715 | |
| 716 | |
| 717 | |
| 718 | |
| 719 | |
| 720 | |
| 721 | |
| 722 | |
| 723 | |
| 724 | |
| 725 | |
| 726 | |
| 727 | |
| 728 | |
| 729 | |
| 730 | /// The next project resolution after `current`, over [`RESOLUTIONS`] with the |
| 731 | /// media's own size cycled in at its place by size -- so the trip round always |
| 732 | /// comes back to the media, whatever odd shape it is, and a project already at a |
| 733 | /// listed size does not see it twice. |
| 734 | pub |
| 735 | |
| 736 | |
| 737 | |
| 738 | |
| 739 | |
| 740 | |
| 741 | |
| 742 | /// The first of the two lines the card keeps above its button: what will be |
| 743 | /// *inside* the file. [`format_line`]'s codec and box, then the project's own |
| 744 | /// picture size and rate -- which is what a video export is written at however |
| 745 | /// many sizes and rates the media on the timeline are -- and last what the |
| 746 | /// sound will be, or that there is none. Every field here is one `ffprobe` |
| 747 | /// reads back off the finished file, so the line is checkable rather than a |
| 748 | /// promise. |
| 749 | pub |
| 750 | |
| 751 | |
| 752 | |
| 753 | |
| 754 | |
| 755 | |
| 756 | |
| 757 | |
| 758 | |
| 759 | /// The second: where it lands, roughly how big, and what will encode the |
| 760 | /// picture -- the seat as the probe found it (`…` until it lands, never a |
| 761 | /// guess), which is what the running export then names on its progress line. |
| 762 | pub |
| 763 | |
| 764 | |
| 765 | |
| 766 | |
| 767 | |
| 768 | |
| 769 | |
| 770 | |
| 771 | |
| 772 | /// A frame rate as a person writes it: `30`, not `30.000`, and `23.976` for the |
| 773 | /// rate that is a ratio. |
| 774 | pub |
| 775 | |
| 776 | |
| 777 | |
| 778 | |
| 779 | |
| 780 | |
| 781 | |
| 782 | |
| 783 | |
| 784 | /// About how big a *chosen* bitrate makes the file: the picture's bits over the |
| 785 | /// timeline's length, in bytes -- the unit the line is written in is |
| 786 | /// [`size_label`]'s to pick. `None` for `Auto`, whose figure is the encoder's to |
| 787 | /// decide, and for a format with no bitrate at all -- a number nobody picked is |
| 788 | /// not an estimate. The sound and the container's own overhead are not in it, |
| 789 | /// which is why the card says "≈". |
| 790 | pub |
| 791 | |
| 792 | |
| 793 | |
| 794 | |
| 795 | /// A size in the largest unit that can state it, [`rate_scale`]'s rule: |
| 796 | /// megabytes for an export of any length, kilobytes below the one a whole |
| 797 | /// megabyte rounds away. A three second clip at the floor bitrate really is |
| 798 | /// 375 kB, and "≈ 0 MB" would be this line saying the file it is about to write |
| 799 | /// is empty -- the one thing the size field is there to deny. Never "0 kB" |
| 800 | /// either: an estimate that exists is at least a kilobyte of file. |
| 801 | pub |
| 802 | |
| 803 | |
| 804 | |
| 805 | |
| 806 | |
| 807 | |
| 808 | /// What is in the file and what box it is in, which is the head of the summary. |
| 809 | /// Terse on purpose: the fields after it (size, rate, sound) are what the line |
| 810 | /// is *for*, and a head that spent its width on prose used to push the whole |
| 811 | /// summary onto a second line -- what each codec means is on its row. |
| 812 | pub |
| 813 | |
| 814 | |
| 815 | |
| 816 | |
| 817 | |
| 818 | |
| 819 | |
| 820 | |
| 821 | |
| 822 | |
| 823 | |
| 824 | |
| 825 | |
| 826 | |
| 827 | |
| 828 | /// The row a format is picked by, which is what a refusal calls it: the codec, |
| 829 | /// since the container is a row of its own now -- `AV1`, not the `mkv` such a |
| 830 | /// file is named with. |
| 831 | pub |
| 832 | |
| 833 | |
| 834 | |
| 835 | |
| 836 | |
| 837 | |
| 838 | /// The destination under a format: `take.export.mp4` becomes `take.export.wav`. |
| 839 | /// The stem is untouched, so a name typed into the save dialog survives a |
| 840 | /// change of mind about the format -- only the extension is the format's to say. |
| 841 | pub |
| 842 | |
| 843 | |
| 844 | |
| 845 | |
| 846 | |
| 847 | /// The card's rows as the engine takes them. `Auto` leaves the bitrate to the |
| 848 | /// exporter, which derives it from the picture; the fixed rows are figures that |
| 849 | /// hold from 720p to 1080p, and a typed one is passed exactly as typed -- the |
| 850 | /// engine clamps every explicit bitrate to 1..50 Mbps (`MAX_EXPLICIT_BITRATE`), so this |
| 851 | /// must not clamp it a second time and disagree about where the edge is. |
| 852 | /// |
| 853 | /// The bitrate travels even for an audio format, where the engine ignores it: |
| 854 | /// one settings value, and a row the card has dimmed cannot have been changed. |
| 855 | pub |
| 856 | |
| 857 | |
| 858 | |
| 859 | |
| 860 | |
| 861 | |
| 862 | |
| 863 | |
| 864 | |
| 865 | |
| 866 | |
| 867 | |
| 868 | |
| 869 | |
| 870 | |
| 871 | |
| 872 | |
| 873 | |
| 874 | |
| 875 | |
| 876 | |
| 877 | |
| 878 | |
| 879 | |
| 880 | |
| 881 | |
| 882 | |
| 883 | |
| 884 | |
| 885 | |
| 886 | |
| 887 | |
| 888 | |
| 889 | |
| 890 | |
| 891 | |
| 892 | |
| 893 | |
| 894 | |
| 895 | |
| 896 | /// What the engine will code an explicit bitrate at, in whole Mbps: outside |
| 897 | /// this it clamps (`export.rs` `MIN_BITRATE`/`MAX_EXPLICIT_BITRATE`), so a |
| 898 | /// number typed past either end would be written as a different one. The field |
| 899 | /// refuses it instead of clamping quietly -- a card that changes the user's |
| 900 | /// number without saying so is the one thing a field like this must never do. |
| 901 | /// |
| 902 | /// The ceiling was 20, which was never a limit of any encoder here: it was the |
| 903 | /// top of the range the exporter *derives* an automatic bitrate in, borrowed as |
| 904 | /// the cap on a typed one. A 1080p master or a 4K edit wants more than that, so |
| 905 | /// the asked-for rate has its own ceiling now and this is it. |
| 906 | pub const MBPS_MIN: u32 = 1; |
| 907 | pub const MBPS_MAX: u32 = 50; |
| 908 | |
| 909 | /// How many digits the field takes. Two reach the ceiling; the third is there so |
| 910 | /// a number *past* it can be typed whole and refused in its own words, rather |
| 911 | /// than being dropped keystroke by keystroke. |
| 912 | pub const MBPS_DIGITS: usize = 3; |
| 913 | |
| 914 | /// A number being typed into a card row: the digits so far and, once a commit |
| 915 | /// has been refused, why. Text-field semantics on a card that has no text field |
| 916 | /// -- typing, backspace, arrows that step, enter that commits and escape that |
| 917 | /// gives up -- held as state and driven by the root's key handler, since |
| 918 | /// nothing in these cards takes gpui focus. |
| 919 | |
| 920 | pub |
| 921 | |
| 922 | |
| 923 | |
| 924 | |
| 925 | |
| 926 | |
| 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 | |
| 970 | |
| 971 | |
| 972 | |
| 973 | |
| 974 | |
| 975 | |
| 976 | |
| 977 | |
| 978 | |
| 979 | |
| 980 | |
| 981 | |
| 982 | |
| 983 | |
| 984 | |
| 985 | |
| 986 | |
| 987 | |
| 988 | |
| 989 | |
| 990 | |
| 991 | |
| 992 | |
| 993 | |
| 994 | |
| 995 | |
| 996 | |
| 997 | |
| 998 | |
| 999 | |
| 1000 | |
| 1001 | |
| 1002 | |
| 1003 | |
| 1004 | /// A typed bitrate as the card takes it, or the reason it is not one. The words |
| 1005 | /// are the row's: they are what the field shows in place of its hint. |
| 1006 | pub |
| 1007 | |
| 1008 | |
| 1009 | |
| 1010 | |
| 1011 | |
| 1012 | |
| 1013 | |
| 1014 | |
| 1015 | /// Whether a stroke gets out of a running export. `ctrl+escape` does -- a chord |
| 1016 | /// and not the bare key, which used to end an hour of encoding on the stroke a |
| 1017 | /// hand reaches for to shut a menu it has already shut. Bare escape does nothing |
| 1018 | /// at all here: the progress card is not dismissable, so there is nothing left |
| 1019 | /// for it to mean. Whatever the keymap has on cancel works too, so rebinding it |
| 1020 | /// adds a way rather than replacing this one -- and that binding is what the |
| 1021 | /// card shows. |
| 1022 | pub |
| 1023 | |
| 1024 | |
| 1025 | |
| 1026 | /// A clip's share of the lane. A timeline with no length reads as one full-width |
| 1027 | /// box rather than as NaN, which gpui would carry into layout. |
| 1028 | /// Why this timeline cannot be written in `format`, if it cannot. |
| 1029 | /// |
| 1030 | /// An audio-only timeline is the one both picture formats refuse: every frame of |
| 1031 | /// it is a gap, so the file would be a black picture over the sound. The engine |
| 1032 | /// refuses it too (`export::start`); this is what greys the row before a |
| 1033 | /// destination has been picked. |
| 1034 | /// |
| 1035 | /// It is the *only* reason left. A second audio lane, a speeded clip, a source |
| 1036 | /// no mp4 sample table holds: each of those used to grey the MP4 row, because |
| 1037 | /// the mp4 path could only *copy* an AAC track. It re-encodes where a copy |
| 1038 | /// cannot say what the timeline says (`export::copy_audio`), so none of them is |
| 1039 | /// a refusal any more -- and every video format carries the sound, so there is |
| 1040 | /// nothing here that is one format's alone. |
| 1041 | pub |
| 1042 | |
| 1043 | |
| 1044 | |
| 1045 | |
| 1046 | |
| 1047 | |
| 1048 | |
| 1049 | |
| 1050 | |
| 1051 | |
| 1052 | |
| 1053 | |
| 1054 | |
| 1055 | |
| 1056 |