edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! How much timeline is on the bed, and how a time is written. |
| 2 | |
| 3 | use crate::*; |
| 4 | |
| 5 | /// A span of seconds as a person reads it: one decimal above a second, two |
| 6 | /// below -- [`scaled`]'s rule, for its reason. The tightest zoom is |
| 7 | /// [`ZOOM_MIN_FRAMES`] across the bed, which on the 240 fps slow-motion a phone |
| 8 | /// writes is 0.03s, and a single frame of quiet at 60 fps is 0.02s: one decimal |
| 9 | /// prints both as "0.0s", a pill and a notice saying the thing they are about |
| 10 | /// has no length at all. |
| 11 | pub |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | /// The mapping the whole panel is drawn and clicked through: `pps` pixels to a |
| 19 | /// second of timeline, `start` the moment at the bed's left edge. Absolute -- |
| 20 | /// how wide a clip is drawn depends on how long the clip is and on nothing |
| 21 | /// else, so adding a second clip does not redraw the first one narrower and |
| 22 | /// zooming out always makes every box smaller. |
| 23 | /// |
| 24 | /// The one place seconds become pixels: every box, the playhead, a seek and a |
| 25 | /// trim all go through it, so none of them can drift away from the others when |
| 26 | /// the view moves. What clamps it -- the stops, the scroll, the fit -- needs the |
| 27 | /// bed it is drawn on and lives on [`View`]. |
| 28 | |
| 29 | pub |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 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 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | /// A [`Scale`] against the bed it is drawn on and the timeline it is drawn |
| 96 | /// from. The bed's width is what turns a scale into "how much is on screen", |
| 97 | /// and that is all the stops, the scroll clamp and the fit are made of. |
| 98 | /// |
| 99 | /// Built per use out of [`Player::view`] and thrown away again -- the state is |
| 100 | /// the `Scale`, and this is what a bed of `bed` px showing `duration` seconds |
| 101 | /// at `fps` may do to it. So no call site can measure a moment against a bed or |
| 102 | /// a duration that another one did not. |
| 103 | |
| 104 | pub |
| 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 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | /// NLE timecode: `HH:MM:SS:FF`, the frame counted inside its own second. |
| 273 | pub |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | /// NLE timecode for a *duration* given as a frame count: the same |
| 288 | /// `HH:MM:SS:FF` shape as [`timecode`], but built from the count directly |
| 289 | /// rather than a float number of seconds. `timecode` truncates `(t - secs) * |
| 290 | /// fps`, which loses a whole frame to float error on a duration derived from |
| 291 | /// dividing a frame count by `fps` first (346 frames at 30 fps printed |
| 292 | /// `00:00:11:15`, one short of the true `:16`); integer frame math has no |
| 293 | /// such rounding to lose. |
| 294 | pub |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | /// Wall clock for a progress line: `M:SS`, minutes past the hour included |
| 309 | /// rather than an hours field nobody reads on an export. |
| 310 | pub |
| 311 | |
| 312 | |
| 313 |