edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! What the export card offers and what it writes. |
| 2 | |
| 3 | use crate::*; |
| 4 | |
| 5 | /// The project resolutions the project-resolution list offers, largest area |
| 6 | /// first. A short list of the sizes people name, landscape and the two |
| 7 | /// phone-and-square shapes ([`NEW_SIZES`] offers the same ones on a new |
| 8 | /// project); the media's own is cycled in beside them, which is what makes the |
| 9 | /// trip round come back to where it started. |
| 10 | pub const RESOLUTIONS: = |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | ; |
| 19 | |
| 20 | /// A size's name in the list, plain words: the height for a landscape frame |
| 21 | /// (`1080p`), the two numbers for a tall or square one (`1080×1920`), which a |
| 22 | /// `p` would misname. |
| 23 | pub |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | /// A size's row label in the list: [`size_name`], with the shape said for a |
| 31 | /// tall or square frame -- `1080×1920 (vertical 9:16)`, `1080×1080 (square)`. |
| 32 | pub |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | /// The project frame rates the list offers, slowest first: the rates footage is |
| 42 | /// actually shot and delivered at, the NTSC ones written as the ratios they are |
| 43 | /// (`24000/1001`, not `23.976`) -- the engine conforms the timeline to the very |
| 44 | /// number it is handed, so a rate rounded here would be a rate no timescale can |
| 45 | /// name. The media's own is cycled in beside them |
| 46 | /// ([`frame_rate_ladder`]), which is what keeps the way back on the list. |
| 47 | pub const FRAME_RATES: = |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | ; |
| 57 | |
| 58 | /// The project sound rates the list offers, slowest first. Unlike |
| 59 | /// [`RESOLUTIONS`] and [`FRAME_RATES`] there is no media rate to cycle in |
| 60 | /// beside them: a source's own rate is not a number this list has to name to |
| 61 | /// offer it, since [`Choice::SampleRate`]`(None)` -- "source" -- already means |
| 62 | /// exactly that, whatever the number turns out to be. |
| 63 | pub use SAMPLE_RATES; |
| 64 | |
| 65 | /// The sound-rate list's rows: "source" first -- the derived rate, and the |
| 66 | /// row in force with nothing picked -- then every rate on offer, the one in |
| 67 | /// force marked. The same rows serve [`Pick::SampleRate`] with a session and |
| 68 | /// without one: `current` is [`PlaybackSession::sample_rate`] or |
| 69 | /// [`Player::pending_settings`]`.2`, and `None` means the same thing either |
| 70 | /// way -- nothing picked yet. |
| 71 | pub |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | /// The export card's format rows: the key that picks one, its name, and what it |
| 98 | /// writes -- or, where this program cannot write it, the reason it cannot. A |
| 99 | /// format with no entry at all would read as an oversight, and a menu of three |
| 100 | /// as a claim that nothing else exists -- so the refusals are rows too, dimmed |
| 101 | /// and unclickable. |
| 102 | /// |
| 103 | /// `None` is exactly that kind of row, and there are two left. MP3 stopped |
| 104 | /// being one when `rusty_mp3` gave this project an Apache-2.0 encoder (the LGPL |
| 105 | /// `shine-rs` was the licence question, and it is not the only encoder any |
| 106 | /// more), and HEVC stopped being one when this project gained a pure-Rust |
| 107 | /// H.265 encoder — an *intra-only* one, which the rows say rather than let a |
| 108 | /// user find out from the size of the file. VP9 and VP8 are the ones this program |
| 109 | /// still only *reads*: the plugin decodes them and there is no encoder for |
| 110 | /// either here, so they are rows for the reason the refusals are rows at all — |
| 111 | /// a codec that opens but never comes back out is exactly the gap a user |
| 112 | /// would otherwise go looking for. AAC is not a row at all: it is what both |
| 113 | /// containers' sound *is*, never a file of its own. |
| 114 | /// |
| 115 | /// A codec is one row, and the boxes it can be written into are the row's |
| 116 | /// containers: the same AV1 picture and the same AAC track go into a Matroska |
| 117 | /// file or into an mp4, and which one a user needs is about what has to play |
| 118 | /// the file, not about the encode. So the container is asked *once*, in a row |
| 119 | /// of its own, and only where there is more than one to ask about -- five |
| 120 | /// picture rows to read past were four of them saying the same codec twice. |
| 121 | pub const FORMATS: = |
| 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 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | ; |
| 160 | |
| 161 | /// The boxes one codec may be written into, in the order its container row |
| 162 | /// cycles them. Empty for a codec this program cannot write at all. |
| 163 | /// Not on the export moment any more: the Settings surface is what shows |
| 164 | /// this (`ui::settings_stance`). Kept and named rather than deleted -- the |
| 165 | /// state and its setter are the same ones the moment used to drive. |
| 166 | |
| 167 | pub |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | /// This row's format under the container `current` is already in, or the row's |
| 176 | /// first when it has no such box: an AV1 picked from a WAV lands in Matroska, |
| 177 | /// and picked from an mp4 stays in the mp4. |
| 178 | /// Not on the export moment any more: the Settings surface is what shows |
| 179 | /// this (`ui::settings_stance`). Kept and named rather than deleted -- the |
| 180 | /// state and its setter are the same ones the moment used to drive. |
| 181 | |
| 182 | pub |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | /// The next box for the same codec, wrapping -- what the container row's key |
| 190 | /// does. The format itself for a codec with only one, so the stroke cannot |
| 191 | /// change what it is not offering. |
| 192 | /// Not on the export moment any more: the Settings surface is what shows |
| 193 | /// this (`ui::settings_stance`). Kept and named rather than deleted -- the |
| 194 | /// state and its setter are the same ones the moment used to drive. |
| 195 | |
| 196 | pub |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | /// What one of the colour card's own strokes does. Its keys are card-local -- |
| 205 | /// they mean nothing outside it -- so they are a table here rather than keymap |
| 206 | /// bindings, exactly as the export card's format initials are. Listed in |
| 207 | /// `keymap::FIXED` all the same, which is how the keys menu still says so. |
| 208 | pub |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | /// Why the silence card has nothing to scan on that clip, in its own voice: the |
| 218 | /// lane and index the user picked, the file it is of, and which of the two |
| 219 | /// soundless things it is. One place, because a still and a silent video are |
| 220 | /// the same answer to the same question -- "a box with a larger size than it" |
| 221 | /// is what the *demuxer* would say about a png, and it is not an answer. |
| 222 | /// |
| 223 | /// Costs nothing: the scan reads a file and writes marks, so a refusal here |
| 224 | /// leaves the project (and its undo history) exactly where it was. |
| 225 | pub |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | /// The half of a take whose *sound* the silence card scans: a link is one span |
| 239 | /// on however many lanes, so a card opened on the picture opens on the sound it |
| 240 | /// is grouped with. That is the lane the waveform is drawn on, and so the lane |
| 241 | /// the marks have to land on to be read against it -- and the ranges agree, |
| 242 | /// because a group is one span. |
| 243 | /// |
| 244 | /// The clip itself for one already on an audio lane, for a detached picture, |
| 245 | /// and for a take whose sound is not on any lane: there is nothing better to |
| 246 | /// open on, and the refusal for a source with no audio at all is `scan`'s. |
| 247 | pub |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | /// The member of a caption's group on a media lane of the wanted kind: what a |
| 269 | /// card that is about media opens on when the hand is on the caption pinned to |
| 270 | /// it. `None` for a caption in no group with clips -- there are no pictures or |
| 271 | /// sound behind the words to be reaching at, and the card that opened anyway |
| 272 | /// would be a card of settings nothing plays. |
| 273 | pub |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | pub |
| 293 | |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | /// The band'th control of a grade, to read or to write. The order is |
| 305 | /// [`COLOR_BANDS`]', which is the order the card lists them in. |
| 306 | pub |
| 307 | |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | /// Every fit policy, in the order the list offers them. |
| 316 | pub const FITS: = |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | ; |
| 322 | |
| 323 | /// What the easing list calls one: the words an editor uses for the curve. |
| 324 | pub |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | /// What a person calls one, said as what it does to the picture. |
| 337 | pub |
| 338 | |
| 339 | |
| 340 | |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | /// Every project resolution on offer, largest first: [`RESOLUTIONS`] with the |
| 347 | /// media's own size cycled in at its place by size -- so a project already at a |
| 348 | /// listed size does not see it twice, and the media's own shape, whatever it is, |
| 349 | /// is always on the list. The one order both the stroke and the list use. |
| 350 | pub |
| 351 | |
| 352 | |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | |
| 358 | |
| 359 | |
| 360 | |
| 361 | |
| 362 | |
| 363 | |
| 364 | |
| 365 | |
| 366 | /// The resolution list's rows: every rung of the ladder, the media's own said |
| 367 | /// so, and the one in force marked. A size is named by its height the way the |
| 368 | /// button that opens the list names it, with the full figure beside it. |
| 369 | pub |
| 370 | |
| 371 | |
| 372 | |
| 373 | |
| 374 | |
| 375 | |
| 376 | |
| 377 | |
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | |
| 386 | |
| 387 | |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | /// The resolution list's rows before any file is open: [`RESOLUTIONS`] plain, |
| 393 | /// with nothing marked unless a pick is already held |
| 394 | /// ([`Player::pending_settings`]) -- there is no media size to cycle in |
| 395 | /// beside them yet ([`resolution_choices`]'s `native`). |
| 396 | pub |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 | |
| 404 | |
| 405 | |
| 406 | |
| 407 | |
| 408 | |
| 409 | |
| 410 | |
| 411 | |
| 412 | |
| 413 | |
| 414 | /// [`pending_resolution_choices`]'s sibling for the rate list. |
| 415 | pub |
| 416 | |
| 417 | |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | |
| 425 | |
| 426 | |
| 427 | |
| 428 | |
| 429 | /// Every project frame rate on offer, slowest first: [`FRAME_RATES`] with the |
| 430 | /// media's own cycled in at its place by speed, so a project already cut at a |
| 431 | /// listed rate does not see it twice and the media's own rate -- the one a |
| 432 | /// project moved off it has no other way back to -- is always there. |
| 433 | /// [`resolution_ladder`]'s rule, for the other setting the project has of its |
| 434 | /// own. |
| 435 | pub |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | |
| 442 | |
| 443 | |
| 444 | |
| 445 | |
| 446 | |
| 447 | |
| 448 | |
| 449 | /// The rate list's rows: every rung of the ladder, the media's own said so, and |
| 450 | /// the one in force marked. Named as a person writes a rate ([`fps_label`]), |
| 451 | /// with what it is for beside it -- short, or the row loses its tail to the |
| 452 | /// truncation the resolution list already met. |
| 453 | pub |
| 454 | |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | |
| 460 | |
| 461 | |
| 462 | |
| 463 | |
| 464 | |
| 465 | |
| 466 | |
| 467 | |
| 468 | |
| 469 | |
| 470 | |
| 471 | /// The fit list's rows: all four policies against the canvas they place a |
| 472 | /// picture on, since the word alone ("fill") says nothing about the size it is |
| 473 | /// filling -- which is the very thing the notice says after a stroke. |
| 474 | pub |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | |
| 487 | |
| 488 | |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | /// The sound-rate list's rows: every offered rate, the one in force marked, and |
| 496 | /// what each buys said in the fewest words that fit beside the label (a longer |
| 497 | /// phrase loses its tail to `MENU_W`'s truncation, as the two lists above say). |
| 498 | pub |
| 499 | |
| 500 | |
| 501 | |
| 502 | |
| 503 | |
| 504 | |
| 505 | |
| 506 | |
| 507 | |
| 508 | |
| 509 | |
| 510 | |
| 511 | |
| 512 | |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | |
| 519 | /// The seats in the order every list and chip row shows them: Software first, |
| 520 | /// the GUI's default seat, then the two that may open the GPU encoder. |
| 521 | pub const ENCODER_SEATS: = |
| 522 | ; |
| 523 | |
| 524 | /// How a seat is named where a person reads it: the export sheet's rows, |
| 525 | /// Settings' chips and the notice all say the same word |
| 526 | /// ([`engine::export::EncoderSeat`]), and [`encoder_note`] says what it does. |
| 527 | pub |
| 528 | |
| 529 | |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | /// What a seat does, in the fewest words: the same note beside the export |
| 536 | /// sheet's row and under Settings' chips. |
| 537 | pub |
| 538 | |
| 539 | |
| 540 | |
| 541 | |
| 542 | |
| 543 | |
| 544 | |
| 545 | /// The encoder list's rows: all three seats, the one in force marked, and what |
| 546 | /// each one *does* beside it -- in the fewest words that fit inside `MENU_W`, |
| 547 | /// the truncation every list above already met. Always offered, whatever this |
| 548 | /// machine has: a row that vanished with the plugin would be a setting nobody |
| 549 | /// could find, and the answer to "is there a seat here?" is the planned line |
| 550 | /// under the rows ([`engine::export::planned_video`]), which is measured. |
| 551 | pub |
| 552 | |
| 553 | |
| 554 | |
| 555 | |
| 556 | |
| 557 | |
| 558 | |
| 559 | |
| 560 | |
| 561 | |
| 562 | |
| 563 | |
| 564 | |
| 565 | /// The row under the encoder one where -- and only where -- a person has asked |
| 566 | /// for the GPU on an AV1 export: this project's own driver reset the GPU on the |
| 567 | /// vendored AV1 encoder (2026-08-10), so the pick is theirs to make and the |
| 568 | /// risk is theirs to be told about. `None` for every other pair, which is what |
| 569 | /// keeps this from becoming a row nobody reads. |
| 570 | /// Not on the export moment any more: the Settings surface is what shows |
| 571 | /// this (`ui::settings_stance`). Kept and named rather than deleted -- the |
| 572 | /// state and its setter are the same ones the moment used to drive. |
| 573 | |
| 574 | pub |
| 575 | |
| 576 | |
| 577 | |
| 578 | |
| 579 | /// How a rendition is named where a person reads it: the panel button, the |
| 580 | /// notice and the list row all say the same word ([`engine::tonemap::Preset`]). |
| 581 | pub |
| 582 | |
| 583 | |
| 584 | |
| 585 | |
| 586 | |
| 587 | |
| 588 | |
| 589 | /// The HDR list's rows: all three renditions, the one in force marked, and what |
| 590 | /// each one *is* beside it -- in the fewest words that fit inside `MENU_W`, the |
| 591 | /// truncation the three lists above already met. Always offered, whatever is on |
| 592 | /// the timeline: a setting that appeared and vanished with the media would be a |
| 593 | /// setting nobody could find, and the row says who it acts on instead. |
| 594 | pub |
| 595 | |
| 596 | |
| 597 | |
| 598 | |
| 599 | |
| 600 | |
| 601 | |
| 602 | |
| 603 | |
| 604 | |
| 605 | |
| 606 | |
| 607 | |
| 608 | |
| 609 | |
| 610 | |
| 611 | |
| 612 | |
| 613 | /// A frame rate as a person writes it: `30`, not `30.000`, and `23.976` for the |
| 614 | /// rate that is a ratio. |
| 615 | /// A rate's row label as a person names it: the number and "fps", and for the |
| 616 | /// NTSC ratios (23.976, 29.97, 59.94) what the rate is for -- "29.97 fps (NTSC |
| 617 | /// video)" -- so the ratio is never a bare number nobody can place. |
| 618 | pub |
| 619 | |
| 620 | |
| 621 | |
| 622 | |
| 623 | |
| 624 | |
| 625 | |
| 626 | |
| 627 | |
| 628 | |
| 629 | pub |
| 630 | |
| 631 | |
| 632 | |
| 633 | |
| 634 | |
| 635 | |
| 636 | |
| 637 | |
| 638 | |
| 639 | /// The budget itself, in Mbps to one decimal: the number the lever reads. |
| 640 | pub |
| 641 | |
| 642 | |
| 643 | |
| 644 | /// How fast this computer last wrote a file, in media seconds per wall second. |
| 645 | /// Kept in memory for this session only. Zero until one export has landed. |
| 646 | static MEASURED_PACE: AtomicU64 = new; |
| 647 | |
| 648 | /// Remembers the pace of a finished export. A cancelled or failed one says |
| 649 | /// nothing about the machine, so the caller passes only the ones that landed. |
| 650 | pub |
| 651 | |
| 652 | |
| 653 | |
| 654 | |
| 655 | |
| 656 | |
| 657 | /// The pace the last finished export measured, if one has: the time estimate |
| 658 | /// never invents one (a guess of "real time" was off by 5x either way). |
| 659 | pub |
| 660 | |
| 661 | |
| 662 | |
| 663 | |
| 664 | |
| 665 | |
| 666 | /// How long writing `media_seconds` of film is expected to take at a measured |
| 667 | /// `pace`, in words a person plans around. Never "0 s": a job that rounds to |
| 668 | /// nothing says "about 1 s". `None` pace is "estimating…", not a number. |
| 669 | pub |
| 670 | |
| 671 | |
| 672 | |
| 673 | |
| 674 | |
| 675 | |
| 676 | |
| 677 | |
| 678 | |
| 679 | |
| 680 | |
| 681 | |
| 682 | |
| 683 | |
| 684 | /// What a name that is a source of the project says, under the field and on the |
| 685 | /// Export button. |
| 686 | pub const SOURCE_NAME_TAKEN: &str = "A source file already has this name."; |
| 687 | |
| 688 | /// Whether `target` is one of the project's own source files, by name or by |
| 689 | /// what it resolves to on disk. Writing an export over a source would destroy |
| 690 | /// the footage the timeline plays from, so the sheet refuses that outright |
| 691 | /// rather than asking to replace it. |
| 692 | pub |
| 693 | |
| 694 | |
| 695 | |
| 696 | |
| 697 | |
| 698 | |
| 699 | |
| 700 | /// The row a format is picked by, which is what a refusal calls it: the codec, |
| 701 | /// since the container is a row of its own now -- `AV1`, not the `mkv` such a |
| 702 | /// file is named with. |
| 703 | pub |
| 704 | |
| 705 | |
| 706 | |
| 707 | |
| 708 | |
| 709 | |
| 710 | /// The file name a typed stem lands as under a format: `stem.ext`, or the bare folder name for a |
| 711 | /// numbered run, which is written into a folder named as the stem. |
| 712 | pub |
| 713 | |
| 714 | |
| 715 | |
| 716 | |
| 717 | |
| 718 | |
| 719 | |
| 720 | /// The destination under a format: `take.export.mp4` becomes `take.export.wav`. |
| 721 | /// The stem is untouched, so a name typed into the save dialog survives a |
| 722 | /// change of mind about the format -- only the extension is the format's to say. |
| 723 | pub |
| 724 | |
| 725 | |
| 726 | |
| 727 | |
| 728 | |
| 729 | |
| 730 | |
| 731 | |
| 732 | |
| 733 | |
| 734 | /// The moment's one number as the engine takes it. The budget is always |
| 735 | /// explicit now -- the lever opens on the engine's own automatic figure |
| 736 | /// ([`auto_bps`]) rather than on nothing, so there is no "Auto" left to send |
| 737 | /// as `None` -- and the engine clamps it to `MIN_BITRATE..MAX_EXPLICIT_BITRATE` |
| 738 | /// exactly where [`BPS_MIN`]/[`BPS_MAX`] do, so neither can disagree about the |
| 739 | /// edges. |
| 740 | /// |
| 741 | /// The bitrate travels even for an audio format, where the engine ignores it: |
| 742 | /// one settings value, and a row the moment does not show cannot have been |
| 743 | /// changed. |
| 744 | pub |
| 745 | |
| 746 | |
| 747 | |
| 748 | |
| 749 | |
| 750 | |
| 751 | |
| 752 | |
| 753 | |
| 754 | |
| 755 | |
| 756 | |
| 757 | |
| 758 | |
| 759 | |
| 760 | |
| 761 | |
| 762 | |
| 763 | |
| 764 | |
| 765 | |
| 766 | |
| 767 | |
| 768 | |
| 769 | |
| 770 | |
| 771 | |
| 772 | |
| 773 | |
| 774 | |
| 775 | |
| 776 | |
| 777 | |
| 778 | |
| 779 | |
| 780 | |
| 781 | |
| 782 | |
| 783 | |
| 784 | /// The same settings with the budget taken out -- what the seat probe is asked |
| 785 | /// and keyed on ([`crate::Player::cache_export_seat`]). A bitrate does not |
| 786 | /// decide whether this machine has a VA-API seat or whether the picture's |
| 787 | /// packets can be copied; leaving it in the key meant every wheel notch on the |
| 788 | /// budget row invalidated the answer and opened a real VA-API encoder to ask it |
| 789 | /// again -- measured at ten opens for ten notches, 5-32 ms of GPU work each, |
| 790 | /// against the player's own decoder, which is the "freezes a little" this row |
| 791 | /// was reported for. |
| 792 | pub |
| 793 | |
| 794 | |
| 795 | |
| 796 | |
| 797 | |
| 798 | |
| 799 | /// The budget's bounds, the engine's own (`engine::export`'s `MIN_BITRATE` |
| 800 | /// and `MAX_EXPLICIT_BITRATE`): a number outside them would be written as a |
| 801 | /// different one, so the lever and the field clamp to exactly these. The floor |
| 802 | /// is 100 kbps, not a megabit: a sub-Mbps delivery is an export too, and at a |
| 803 | /// megabit this row could not say `0.6` at all. |
| 804 | pub const BPS_MIN: u64 = 100_000; |
| 805 | pub const BPS_MAX: u64 = 50_000_000; |
| 806 | |
| 807 | /// A wheel notch, and a notch with shift held: 0.1 and 1 Mbps. Five hundred |
| 808 | /// tenths is not a way across this range, and a tenth is the smallest step |
| 809 | /// the row's own readout can show. |
| 810 | pub const BPS_FINE: u64 = 100_000; |
| 811 | pub const BPS_COARSE: u64 = 1_000_000; |
| 812 | |
| 813 | /// The engine's automatic figure for a picture of this size and rate |
| 814 | /// (`engine::export`'s `BITS_PER_PIXEL` rule and the range it clamps the |
| 815 | /// derived number into), which is what the lever opens on before anybody has |
| 816 | /// chosen: a budget row reading 0 Mbps -- the old `custom_mbps: 0` default -- |
| 817 | /// was a promise to write an empty file. |
| 818 | const BITS_PER_PIXEL: f64 = 0.1; |
| 819 | const BPS_AUTO_MAX: u64 = 20_000_000; |
| 820 | |
| 821 | pub |
| 822 | |
| 823 | |
| 824 | |
| 825 | |
| 826 | /// What was typed into the budget field, as a rate. Four ways to say one: |
| 827 | /// `850k` and `6.5M` are rates in their own units, a bare `6.5` is Mbps (the |
| 828 | /// unit the row reads in), and `1.2G` is a *file size* -- the one thing a |
| 829 | /// person actually wants to hit -- converted through the exported range and |
| 830 | /// the sound's own rate into the picture rate that lands there. |
| 831 | /// |
| 832 | /// Clamped to the engine's bounds rather than refused: the moment shows the |
| 833 | /// parsed number immediately, so a clamp is visible in the same keystroke. |
| 834 | /// `None` is only ever "that is not a number". |
| 835 | pub |
| 836 | |
| 837 | |
| 838 | |
| 839 | |
| 840 | |
| 841 | |
| 842 | |
| 843 | |
| 844 | |
| 845 | |
| 846 | |
| 847 | |
| 848 | |
| 849 | |
| 850 | |
| 851 | |
| 852 | |
| 853 | |
| 854 | |
| 855 | |
| 856 | |
| 857 | |
| 858 | |
| 859 | |
| 860 | |
| 861 | |
| 862 | /// The faintest line on the moment: what the export resolved to on its own -- |
| 863 | /// the codec, the sound, whether it is the whole film or the marked span, and |
| 864 | /// which seat writes the picture. A readout, never a control: everything in it |
| 865 | /// The span an export writes, in the words row 3 says it in: the marked |
| 866 | /// range where there is one, the whole timeline otherwise -- and "sound only" |
| 867 | /// for a file that carries no picture at all. |
| 868 | /// How long a marked span is, said so a sliver cannot pass for a range: a |
| 869 | /// single frame is "1 frame", under a second is frames, then seconds, then |
| 870 | /// minutes and seconds. |
| 871 | pub |
| 872 | |
| 873 | |
| 874 | |
| 875 | |
| 876 | |
| 877 | |
| 878 | |
| 879 | |
| 880 | |
| 881 | /// A point on the timeline in the same plain words as [`span_word`]: "2 s", |
| 882 | /// "1.5 s", "1 min 5 s" -- a timecode is for the transport, not a summary. |
| 883 | pub |
| 884 | |
| 885 | |
| 886 | |
| 887 | |
| 888 | |
| 889 | |
| 890 | |
| 891 | |
| 892 | |
| 893 | /// The seat a window opens a project with. `Auto` can resolve to VA-API |
| 894 | /// encode, which has crashed this machine's GPU, so the GUI starts on |
| 895 | /// software -- also for a project saved with `Auto`, which is what every |
| 896 | /// project saved before this carries. `Hardware` is only ever a pick. |
| 897 | pub |
| 898 | |
| 899 | |
| 900 | |
| 901 | |
| 902 | |
| 903 | |
| 904 | /// A clip's share of the lane. A timeline with no length reads as one full-width |
| 905 | /// box rather than as NaN, which gpui would carry into layout. |
| 906 | /// Why this timeline cannot be written in `format`, if it cannot. |
| 907 | /// |
| 908 | /// An audio-only timeline is one the picture formats refuse: every frame of it |
| 909 | /// is a gap, so a Matroska or WebM file would be a black picture over the sound. |
| 910 | /// The engine refuses those too (`export::start`); this is what greys the row |
| 911 | /// before a destination has been picked. |
| 912 | /// |
| 913 | /// An mp4 of it is not refused: the engine writes it as the sound alone (AAC in |
| 914 | /// an mp4, `export::run_aac`), so the mp4 rows stay open. |
| 915 | /// |
| 916 | /// It is the *only* reason left. A second audio lane, a speeded clip, a source |
| 917 | /// no mp4 sample table holds: each of those used to grey the MP4 row, because |
| 918 | /// the mp4 path could only *copy* an AAC track. It re-encodes where a copy |
| 919 | /// cannot say what the timeline says (`export::copy_audio`), so none of them is |
| 920 | /// a refusal any more -- and every video format carries the sound, so there is |
| 921 | /// nothing here that is one format's alone. |
| 922 | pub |
| 923 | |
| 924 | |
| 925 | |
| 926 | |
| 927 | |
| 928 | |
| 929 | |
| 930 | |
| 931 | |
| 932 | |
| 933 | |
| 934 | |
| 935 | |
| 936 | |
| 937 | |
| 938 | |
| 939 | |
| 940 | // --------------------------------------------------------------------------- |
| 941 | // The export sheet (DESIGN §9): the model behind the centred sheet, kept as |
| 942 | // plain values and functions so every behaviour on it is a test and none of |
| 943 | // them needs a window. |
| 944 | // --------------------------------------------------------------------------- |
| 945 | |
| 946 | use ; |
| 947 | use export_presets as presets; |
| 948 | use HashMap; |
| 949 | |
| 950 | /// The sheet's open/closed state for the "More settings" disclosure, in the |
| 951 | /// same `folds` file every other fold lives in. |
| 952 | pub const EXPORT_MORE_FOLD: &str = "export-more"; |
| 953 | |
| 954 | /// Which of the two destination fields is being typed into. |
| 955 | |
| 956 | pub |
| 957 | |
| 958 | |
| 959 | |
| 960 | |
| 961 | /// What a finished export left behind, for the sheet's "done" face. |
| 962 | |
| 963 | pub |
| 964 | |
| 965 | |
| 966 | |
| 967 | |
| 968 | |
| 969 | /// A one-second trial write, run when the sheet opens so the time estimate is |
| 970 | /// a measurement of this machine and this format rather than a guess. |
| 971 | pub |
| 972 | |
| 973 | |
| 974 | |
| 975 | |
| 976 | |
| 977 | |
| 978 | |
| 979 | /// Everything the sheet keeps beside the settings the player already holds |
| 980 | /// (`format`, `audio_kbps`, `custom_bps`, the encoder seat). |
| 981 | |
| 982 | pub |
| 983 | |
| 984 | |
| 985 | |
| 986 | |
| 987 | |
| 988 | |
| 989 | |
| 990 | |
| 991 | |
| 992 | |
| 993 | |
| 994 | |
| 995 | |
| 996 | |
| 997 | |
| 998 | |
| 999 | |
| 1000 | |
| 1001 | |
| 1002 | |
| 1003 | |
| 1004 | |
| 1005 | |
| 1006 | |
| 1007 | |
| 1008 | |
| 1009 | |
| 1010 | |
| 1011 | |
| 1012 | |
| 1013 | |
| 1014 | |
| 1015 | |
| 1016 | |
| 1017 | |
| 1018 | |
| 1019 | |
| 1020 | |
| 1021 | |
| 1022 | |
| 1023 | |
| 1024 | |
| 1025 | |
| 1026 | /// The settings a preset can change, as the player holds them. |
| 1027 | |
| 1028 | pub |
| 1029 | |
| 1030 | |
| 1031 | |
| 1032 | |
| 1033 | |
| 1034 | |
| 1035 | |
| 1036 | |
| 1037 | |
| 1038 | |
| 1039 | |
| 1040 | |
| 1041 | |
| 1042 | |
| 1043 | |
| 1044 | |
| 1045 | |
| 1046 | |
| 1047 | |
| 1048 | |
| 1049 | |
| 1050 | |
| 1051 | |
| 1052 | |
| 1053 | |
| 1054 | |
| 1055 | |
| 1056 | /// `base` with a preset laid over it by the engine's own rule |
| 1057 | /// ([`presets::apply`]): the GUI holds no copy of the table. |
| 1058 | pub |
| 1059 | |
| 1060 | |
| 1061 | |
| 1062 | |
| 1063 | |
| 1064 | |
| 1065 | |
| 1066 | |
| 1067 | |
| 1068 | |
| 1069 | |
| 1070 | |
| 1071 | |
| 1072 | /// The sound rates the engine writes are [`AUDIO_KBPS`]; a preset that asks for |
| 1073 | /// more (AAC 384) gets the top of the list, which is what the engine clamps it to. |
| 1074 | pub |
| 1075 | |
| 1076 | |
| 1077 | |
| 1078 | |
| 1079 | |
| 1080 | |
| 1081 | |
| 1082 | |
| 1083 | /// Whether laying `preset` over `picked` would change nothing. |
| 1084 | pub |
| 1085 | |
| 1086 | |
| 1087 | |
| 1088 | /// The preset the settings are exactly, preferring `prefer` -- or `None`, |
| 1089 | /// which the sheet calls Custom. |
| 1090 | pub |
| 1091 | |
| 1092 | |
| 1093 | |
| 1094 | |
| 1095 | |
| 1096 | |
| 1097 | |
| 1098 | |
| 1099 | |
| 1100 | |
| 1101 | /// The codec in the words a person uses, and the key a measured pace is kept |
| 1102 | /// under (every file of a codec is written at about the same pace). |
| 1103 | pub |
| 1104 | |
| 1105 | |
| 1106 | |
| 1107 | |
| 1108 | |
| 1109 | |
| 1110 | |
| 1111 | |
| 1112 | |
| 1113 | |
| 1114 | |
| 1115 | |
| 1116 | |
| 1117 | |
| 1118 | |
| 1119 | |
| 1120 | |
| 1121 | /// Every file the sheet's format list offers: the format, its name and a |
| 1122 | /// plain-words reason to choose it. Video first, then sound alone. |
| 1123 | pub const SHEET_FORMATS: = |
| 1124 | |
| 1125 | |
| 1126 | |
| 1127 | |
| 1128 | |
| 1129 | |
| 1130 | |
| 1131 | |
| 1132 | |
| 1133 | |
| 1134 | |
| 1135 | |
| 1136 | |
| 1137 | |
| 1138 | |
| 1139 | ; |
| 1140 | |
| 1141 | /// A format's name as the sheet's list writes it. |
| 1142 | pub |
| 1143 | |
| 1144 | |
| 1145 | |
| 1146 | |
| 1147 | |
| 1148 | |
| 1149 | /// What a preset tile says it makes: the canvas and codec for a picture, the |
| 1150 | /// file and rate for sound. `project` is the size a preset with none keeps. |
| 1151 | pub |
| 1152 | |
| 1153 | |
| 1154 | |
| 1155 | |
| 1156 | |
| 1157 | |
| 1158 | |
| 1159 | |
| 1160 | |
| 1161 | |
| 1162 | |
| 1163 | |
| 1164 | |
| 1165 | |
| 1166 | |
| 1167 | |
| 1168 | |
| 1169 | |
| 1170 | |
| 1171 | /// The two radio rows of the range: the whole timeline and the marks, each |
| 1172 | /// with its duration, and why the marks are off when they are. |
| 1173 | |
| 1174 | pub |
| 1175 | |
| 1176 | |
| 1177 | |
| 1178 | |
| 1179 | |
| 1180 | /// `valid` is the marked span as the export would really use it |
| 1181 | /// ([`Player::export_range`]); `raw` is whether any marks are set at all, so |
| 1182 | /// a stale pair is told apart from none. |
| 1183 | pub |
| 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 | /// How big the file may come out, in bytes: a single figure where the bits are |
| 1209 | /// fixed by the settings, a span where a quality-driven encoder decides. |
| 1210 | |
| 1211 | pub |
| 1212 | |
| 1213 | |
| 1214 | |
| 1215 | |
| 1216 | /// What a file of `seconds` is expected to weigh. `video_fixed` is false for |
| 1217 | /// an encoder that works to a quality and not to the budget (the GPU's AV1), |
| 1218 | /// which makes the picture's part a span. Sound formats follow their own maths: |
| 1219 | /// PCM is arithmetic, FLAC a typical 50-75 % of it, Vorbis is quality coded. |
| 1220 | pub |
| 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 | /// A byte count as a person reads it: KB under a megabyte, one decimal under |
| 1259 | /// ten, whole megabytes, then gigabytes with two decimals. |
| 1260 | pub |
| 1261 | |
| 1262 | |
| 1263 | |
| 1264 | |
| 1265 | |
| 1266 | |
| 1267 | |
| 1268 | |
| 1269 | |
| 1270 | /// The estimate as a sentence part: "about 38 MB" when it is tight, a span |
| 1271 | /// ("about 20 to 60 MB") when it cannot be known closer. |
| 1272 | pub |
| 1273 | |
| 1274 | |
| 1275 | |
| 1276 | |
| 1277 | |
| 1278 | |
| 1279 | |
| 1280 | |
| 1281 | |
| 1282 | |
| 1283 | |
| 1284 | |
| 1285 | |
| 1286 | |
| 1287 | |
| 1288 | /// What the warnings look at. |
| 1289 | pub |
| 1290 | |
| 1291 | |
| 1292 | |
| 1293 | |
| 1294 | |
| 1295 | |
| 1296 | |
| 1297 | |
| 1298 | |
| 1299 | |
| 1300 | |
| 1301 | |
| 1302 | /// A picture rate below this many bits per pixel per frame looks blocky. |
| 1303 | const LOW_BITS_PER_PIXEL: f64 = 0.03; |
| 1304 | |
| 1305 | /// The things worth saying before the button is pressed, in plain words. |
| 1306 | pub |
| 1307 | |
| 1308 | |
| 1309 | |
| 1310 | |
| 1311 | |
| 1312 | |
| 1313 | |
| 1314 | |
| 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 | /// The container a format is written into, as a person names the file kind. |
| 1344 | pub |
| 1345 | |
| 1346 | |
| 1347 | |
| 1348 | |
| 1349 | |
| 1350 | |
| 1351 | |
| 1352 | |
| 1353 | |
| 1354 | |
| 1355 | |
| 1356 | |
| 1357 | |
| 1358 | |
| 1359 | |
| 1360 | |
| 1361 | /// The sound codec a format writes beside (or instead of) its picture. |
| 1362 | pub |
| 1363 | |
| 1364 | |
| 1365 | |
| 1366 | |
| 1367 | |
| 1368 | |
| 1369 | |
| 1370 | |
| 1371 | |
| 1372 | |
| 1373 | /// Every (container, codec) pair the export writes, in the order the two |
| 1374 | /// Details lists show them. The format is the engine's one value for the pair. |
| 1375 | pub const COMBOS: = |
| 1376 | |
| 1377 | |
| 1378 | |
| 1379 | |
| 1380 | |
| 1381 | |
| 1382 | |
| 1383 | |
| 1384 | |
| 1385 | |
| 1386 | |
| 1387 | |
| 1388 | |
| 1389 | |
| 1390 | |
| 1391 | |
| 1392 | ; |
| 1393 | |
| 1394 | /// The format for picking `container`, keeping the codec in force where that |
| 1395 | /// container has it (MP4 to MKV keeps AV1), else the container's first. |
| 1396 | pub |
| 1397 | |
| 1398 | |
| 1399 | |
| 1400 | |
| 1401 | |
| 1402 | |
| 1403 | |
| 1404 | |
| 1405 | /// What a seat is, in a plain half line: the Details list's note. |
| 1406 | pub |
| 1407 | |
| 1408 | |
| 1409 | |
| 1410 | |
| 1411 | |
| 1412 | |
| 1413 | |
| 1414 | /// What the summary reads off the settings. |
| 1415 | pub |
| 1416 | |
| 1417 | |
| 1418 | |
| 1419 | |
| 1420 | |
| 1421 | |
| 1422 | |
| 1423 | |
| 1424 | |
| 1425 | |
| 1426 | |
| 1427 | |
| 1428 | |
| 1429 | |
| 1430 | |
| 1431 | |
| 1432 | |
| 1433 | /// The three summary lines, each with its fixed label, read off the current |
| 1434 | /// settings and short enough not to wrap in the dock: |
| 1435 | /// `Video H.264 . 1920x1080 . 25 fps . 12 Mb/s`, |
| 1436 | /// `Audio AAC stereo . 320 kb/s`, |
| 1437 | /// `File MP4 . Software . ~3.1 MB . ~1 s`. |
| 1438 | /// `time` is the export-time words ("" for none). |
| 1439 | pub |
| 1440 | |
| 1441 | |
| 1442 | |
| 1443 | |
| 1444 | |
| 1445 | |
| 1446 | |
| 1447 | |
| 1448 | |
| 1449 | |
| 1450 | |
| 1451 | |
| 1452 | |
| 1453 | |
| 1454 | |
| 1455 | |
| 1456 | |
| 1457 | |
| 1458 | |
| 1459 | |
| 1460 | |
| 1461 | |
| 1462 | |
| 1463 | |
| 1464 | |
| 1465 | |
| 1466 | |
| 1467 | |
| 1468 | |
| 1469 | |
| 1470 | |
| 1471 | |
| 1472 | |
| 1473 | |
| 1474 | |
| 1475 | |
| 1476 | |
| 1477 | |
| 1478 | |
| 1479 | |
| 1480 | |
| 1481 | |
| 1482 | |
| 1483 | |
| 1484 | |
| 1485 | |
| 1486 | |
| 1487 | |
| 1488 | |
| 1489 | |
| 1490 | |
| 1491 | |
| 1492 | |
| 1493 | |
| 1494 | |
| 1495 | |
| 1496 | |
| 1497 | |
| 1498 | |
| 1499 | |
| 1500 | |
| 1501 | |
| 1502 | |
| 1503 | |
| 1504 | |
| 1505 | |
| 1506 | |
| 1507 | |
| 1508 | |
| 1509 | |
| 1510 | |
| 1511 | /// The HDR choice as a person names it. |
| 1512 | pub |
| 1513 | |
| 1514 | |
| 1515 | |
| 1516 | |
| 1517 | |
| 1518 | |
| 1519 | |
| 1520 | /// The three encoding speeds as the Details row names them. |
| 1521 | pub const HEVC_SPEEDS: = ; |
| 1522 | |
| 1523 | pub |
| 1524 | |
| 1525 | |
| 1526 | |
| 1527 | |
| 1528 | |
| 1529 | |
| 1530 | |
| 1531 | /// What a speed costs, in plain words: the line under the row. |
| 1532 | pub |
| 1533 | |
| 1534 | |
| 1535 | |
| 1536 | |
| 1537 | |
| 1538 | |
| 1539 | |
| 1540 | |
| 1541 | |
| 1542 | |
| 1543 | |
| 1544 | |
| 1545 | |
| 1546 | |
| 1547 | |
| 1548 | /// The HDR row's value in full words. |
| 1549 | pub |
| 1550 | |
| 1551 | |
| 1552 | |
| 1553 | |
| 1554 | |
| 1555 | |
| 1556 | |
| 1557 | /// The ProRes profile in a half line: what it is for. |
| 1558 | pub |
| 1559 | |
| 1560 | |
| 1561 | |
| 1562 | |
| 1563 | |
| 1564 | |
| 1565 | |
| 1566 | |
| 1567 | |
| 1568 | |
| 1569 | /// The encoder seat in one short word for the summary's File line. |
| 1570 | pub |
| 1571 | |
| 1572 | |
| 1573 | |
| 1574 | |
| 1575 | |
| 1576 | |
| 1577 | |
| 1578 | /// The export time in the few words the File line has room for. |
| 1579 | pub |
| 1580 | |
| 1581 | |
| 1582 | |
| 1583 | |
| 1584 | |
| 1585 | |
| 1586 | |
| 1587 | /// The id of the UI's own first preset: H.264 MP4 at the project's size and rate. |
| 1588 | pub const MATCH_PROJECT: &str = "match_project"; |
| 1589 | |
| 1590 | /// What a preset row says it makes, in one line: "1080p · H.264 · 8 Mb/s" for |
| 1591 | /// a picture (the project's size when the preset keeps it), the file and rate |
| 1592 | /// for sound. |
| 1593 | pub |
| 1594 | |
| 1595 | |
| 1596 | |
| 1597 | |
| 1598 | |
| 1599 | |
| 1600 | |
| 1601 | |
| 1602 | |
| 1603 | |
| 1604 | |
| 1605 | |
| 1606 | |
| 1607 | |
| 1608 | |
| 1609 | |
| 1610 | |
| 1611 | |
| 1612 | /// Whether a scrolled body has content under its bottom edge: `offset_y` is |
| 1613 | /// gpui's (zero at the top, negative going down), `max_y` the furthest it |
| 1614 | /// goes. Half a pixel of slack so a body scrolled to its end reads as ended. |
| 1615 | pub |
| 1616 | |
| 1617 | |
| 1618 | |
| 1619 | /// The path with a number in its name until nothing is there: "Keep both". |
| 1620 | pub |
| 1621 | |
| 1622 | |
| 1623 | |
| 1624 | |
| 1625 | |
| 1626 | |
| 1627 | |
| 1628 | |
| 1629 | |
| 1630 | |
| 1631 | |
| 1632 | |
| 1633 | |
| 1634 | |
| 1635 | |
| 1636 | |
| 1637 | |
| 1638 | /// The three answers to "that file already exists". |
| 1639 | |
| 1640 | pub |
| 1641 | |
| 1642 | |
| 1643 | |
| 1644 | |
| 1645 | |
| 1646 | /// The folder field's text as a directory: `~` is home, and it has to exist. |
| 1647 | pub |
| 1648 | |
| 1649 | |
| 1650 | |
| 1651 | |
| 1652 | |
| 1653 | |
| 1654 | |
| 1655 | |
| 1656 | |
| 1657 | |
| 1658 | |
| 1659 | |
| 1660 | /// The name field's text as a file name stem: no folders in it, not empty. |
| 1661 | pub |
| 1662 | |
| 1663 | |
| 1664 | |
| 1665 | |
| 1666 | |
| 1667 | |
| 1668 | |
| 1669 | |
| 1670 | /// Opens or closes a fold in the folds set, returning whether it is now open. |
| 1671 | pub |
| 1672 | |
| 1673 | |
| 1674 | |
| 1675 | |
| 1676 | |
| 1677 | |
| 1678 | |
| 1679 | |
| 1680 | |
| 1681 | /// The loudness targets the sheet offers beside "Off": name, LUFS, ceiling. |
| 1682 | pub const LOUDNESS_CHOICES: = |
| 1683 | |
| 1684 | |
| 1685 | |
| 1686 | ; |
| 1687 | |
| 1688 | /// What a loudness target is for, in a plain half line; the LUFS figure is the detail, not the name. |
| 1689 | pub |
| 1690 | |
| 1691 | |
| 1692 | |
| 1693 | |
| 1694 | |
| 1695 | |
| 1696 | |
| 1697 | /// An audio-rate refusal from the engine, said as the sound row's plain caption. |
| 1698 | pub |
| 1699 | |
| 1700 | |
| 1701 | |
| 1702 | |
| 1703 | |
| 1704 | |
| 1705 | |
| 1706 | |
| 1707 | |
| 1708 | |
| 1709 | /// A failed export in plain words, from the raw error and the folder it was |
| 1710 | /// writing to. The raw text stays for the tooltip; the sheet reads this. |
| 1711 | pub |
| 1712 | |
| 1713 | |
| 1714 | |
| 1715 | |
| 1716 | |
| 1717 | |
| 1718 | |
| 1719 | |
| 1720 | |
| 1721 | |
| 1722 | |
| 1723 | |
| 1724 | |
| 1725 | |
| 1726 | /// The folder field's text: the destination's directory, `~` for home. |
| 1727 | pub |
| 1728 | |
| 1729 | |
| 1730 | |
| 1731 | |
| 1732 | |
| 1733 | |
| 1734 | |
| 1735 | /// The time part of the summary. A measured pace prices it ("about 1 min 40 s |
| 1736 | /// to export"); with none there is no time at all, rather than a guess or a |
| 1737 | /// word that waits on a measurement that may never come. |
| 1738 | pub |
| 1739 | |
| 1740 | |
| 1741 | |
| 1742 | |
| 1743 | |
| 1744 | |
| 1745 | |
| 1746 | |
| 1747 | /// The settings of the sheet's one-second trial write. Always the software |
| 1748 | /// seat, whatever the sheet's encoder says: a GPU encode once took this |
| 1749 | /// machine down, and a trial nobody asked for must never open one. The range |
| 1750 | /// is the first `frames` frames only. |
| 1751 | pub |
| 1752 | |
| 1753 | |
| 1754 | |
| 1755 | |
| 1756 | |
| 1757 | |
| 1758 | |
| 1759 | |
| 1760 | |
| 1761 | |
| 1762 | |
| 1763 | |
| 1764 | |
| 1765 | |
| 1766 | |
| 1767 | /// Where the trial write goes: the system's temporary folder, never the |
| 1768 | /// user's export folder. Deleted as soon as it lands or is cancelled. |
| 1769 | pub |
| 1770 | |
| 1771 | |
| 1772 | |
| 1773 | /// The Details rows that open a list ([`crate::Pick::Export`]). |
| 1774 | |
| 1775 | pub |
| 1776 | |
| 1777 | |
| 1778 | |
| 1779 | |
| 1780 | |
| 1781 | |
| 1782 | |
| 1783 | |
| 1784 | |
| 1785 | |
| 1786 | |
| 1787 | |
| 1788 | |
| 1789 | |
| 1790 | |
| 1791 | |
| 1792 | |
| 1793 | |
| 1794 | /// One answer from those lists. A pair is picked as the engine's one [`Format`]. |
| 1795 | |
| 1796 | pub |
| 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 | /// The widths a GIF is offered at, in pixels. |
| 1823 | pub const GIF_WIDTHS: = ; |
| 1824 | /// The frame rates a GIF is offered at. |
| 1825 | pub const GIF_FPS: = ; |
| 1826 | |
| 1827 | /// The bitrates the Details list offers, in Mb/s. |
| 1828 | pub const BITRATE_STEPS: = ; |
| 1829 | |
| 1830 | /// The preset box's text: its name, or "Custom" once a detail moved. |
| 1831 | pub |
| 1832 | |
| 1833 | |
| 1834 | |
| 1835 | |
| 1836 | |
| 1837 | |
| 1838 | |
| 1839 | // --------------------------------------------------------------------------- |
| 1840 | // What the Export tab remembers on this computer. |
| 1841 | // --------------------------------------------------------------------------- |
| 1842 | |
| 1843 | /// Every format the file can name. Kept beside [`format_key`], whose match is |
| 1844 | /// exhaustive, so a new format cannot be written without a name. |
| 1845 | const ALL_FORMATS: = |
| 1846 | |
| 1847 | |
| 1848 | |
| 1849 | |
| 1850 | |
| 1851 | |
| 1852 | |
| 1853 | |
| 1854 | |
| 1855 | |
| 1856 | |
| 1857 | |
| 1858 | |
| 1859 | |
| 1860 | |
| 1861 | |
| 1862 | ; |
| 1863 | |
| 1864 | /// The name a format is saved under. Stable words, not the labels the page |
| 1865 | /// shows -- a label may be reworded, and a saved file must keep reading. |
| 1866 | |
| 1867 | |
| 1868 | |
| 1869 | |
| 1870 | |
| 1871 | |
| 1872 | |
| 1873 | |
| 1874 | |
| 1875 | |
| 1876 | |
| 1877 | |
| 1878 | |
| 1879 | |
| 1880 | |
| 1881 | |
| 1882 | |
| 1883 | |
| 1884 | |
| 1885 | |
| 1886 | |
| 1887 | /// Whether a format writes pictures and no sound, and no encoder runs: a PNG, a run of them, or a |
| 1888 | /// GIF. Asked wherever a video format and a sound-only one would be told apart. |
| 1889 | pub |
| 1890 | |
| 1891 | |
| 1892 | |
| 1893 | |
| 1894 | |
| 1895 | |
| 1896 | |
| 1897 | |
| 1898 | |
| 1899 | |
| 1900 | |
| 1901 | |
| 1902 | |
| 1903 | |
| 1904 | |
| 1905 | |
| 1906 | |
| 1907 | |
| 1908 | |
| 1909 | |
| 1910 | |
| 1911 | |
| 1912 | /// The export choices this computer keeps between launches. The encoder is |
| 1913 | /// not among them: it is the project's, saved in its `.edith`. |
| 1914 | |
| 1915 | pub |
| 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 | /// Beside the keybindings, like the theme and the proxy switches. |
| 1945 | |
| 1946 | |
| 1947 | |
| 1948 | |
| 1949 | /// What the last session left, or the defaults: missing or garbled is not |
| 1950 | /// worth a message, since a preference file is not the user's work. |
| 1951 | pub |
| 1952 | |
| 1953 | |
| 1954 | |
| 1955 | |
| 1956 | |
| 1957 | |
| 1958 | /// Line one is the format's name, line two the audio kbps (the file's first |
| 1959 | /// shape, still read), then `key value` lines. Each line is read on its own: |
| 1960 | /// one that does not parse leaves that value at its default. |
| 1961 | pub |
| 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 | pub |
| 2039 | |
| 2040 | |
| 2041 | |
| 2042 | |
| 2043 | |
| 2044 | |
| 2045 | |
| 2046 | |
| 2047 | |
| 2048 | |
| 2049 | |
| 2050 | |
| 2051 | |
| 2052 | |
| 2053 | |
| 2054 | |
| 2055 | |
| 2056 | |
| 2057 | /// Writes the choices whole, the way the proxy switches' files are. |
| 2058 | pub |
| 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 |