├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── default_config.json ├── media └── demo.gif └── src ├── backends ├── audio_to_grid.rs ├── crossterm │ └── mod.rs ├── mod.rs ├── termion │ ├── bars.rs │ ├── events.rs │ └── mod.rs └── wgpu │ ├── mesh.rs │ ├── mod.rs │ ├── shader.wgsl │ └── state.rs ├── config.rs └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "ab_glyph_rasterizer" 7 | version = "0.1.5" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" 10 | 11 | [[package]] 12 | name = "ahash" 13 | version = "0.7.6" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 16 | dependencies = [ 17 | "getrandom", 18 | "once_cell", 19 | "version_check", 20 | ] 21 | 22 | [[package]] 23 | name = "aho-corasick" 24 | version = "0.7.18" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" 27 | dependencies = [ 28 | "memchr", 29 | ] 30 | 31 | [[package]] 32 | name = "alsa" 33 | version = "0.5.0" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "75c4da790adcb2ce5e758c064b4f3ec17a30349f9961d3e5e6c9688b052a9e18" 36 | dependencies = [ 37 | "alsa-sys", 38 | "bitflags", 39 | "libc", 40 | "nix 0.20.0", 41 | ] 42 | 43 | [[package]] 44 | name = "alsa-sys" 45 | version = "0.3.1" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" 48 | dependencies = [ 49 | "libc", 50 | "pkg-config", 51 | ] 52 | 53 | [[package]] 54 | name = "andrew" 55 | version = "0.3.1" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" 58 | dependencies = [ 59 | "bitflags", 60 | "rusttype", 61 | "walkdir", 62 | "xdg", 63 | "xml-rs", 64 | ] 65 | 66 | [[package]] 67 | name = "ansi_term" 68 | version = "0.12.1" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 71 | dependencies = [ 72 | "winapi", 73 | ] 74 | 75 | [[package]] 76 | name = "apodize" 77 | version = "1.0.0" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "fca387cdc0a1f9c7a7c26556d584aa2d07fc529843082e4861003cde4ab914ed" 80 | 81 | [[package]] 82 | name = "arrayvec" 83 | version = "0.7.2" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" 86 | 87 | [[package]] 88 | name = "ash" 89 | version = "0.33.3+1.2.191" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "cc4f1d82f164f838ae413296d1131aa6fa79b917d25bebaa7033d25620c09219" 92 | dependencies = [ 93 | "libloading 0.7.3", 94 | ] 95 | 96 | [[package]] 97 | name = "atty" 98 | version = "0.2.14" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 101 | dependencies = [ 102 | "hermit-abi", 103 | "libc", 104 | "winapi", 105 | ] 106 | 107 | [[package]] 108 | name = "audioviz" 109 | version = "0.4.4" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "3fd8193e0039f8cf9a9ada3c2c8124b052837303d0313a374366c1e33eeefcb9" 112 | dependencies = [ 113 | "apodize", 114 | "cpal", 115 | "rustfft", 116 | "serde", 117 | "splines", 118 | ] 119 | 120 | [[package]] 121 | name = "autocfg" 122 | version = "1.0.1" 123 | source = "registry+https://github.com/rust-lang/crates.io-index" 124 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 125 | 126 | [[package]] 127 | name = "bindgen" 128 | version = "0.56.0" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "2da379dbebc0b76ef63ca68d8fc6e71c0f13e59432e0987e508c1820e6ab5239" 131 | dependencies = [ 132 | "bitflags", 133 | "cexpr", 134 | "clang-sys", 135 | "lazy_static", 136 | "lazycell", 137 | "peeking_take_while", 138 | "proc-macro2", 139 | "quote", 140 | "regex", 141 | "rustc-hash", 142 | "shlex", 143 | ] 144 | 145 | [[package]] 146 | name = "bit-set" 147 | version = "0.5.2" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" 150 | dependencies = [ 151 | "bit-vec", 152 | ] 153 | 154 | [[package]] 155 | name = "bit-vec" 156 | version = "0.6.3" 157 | source = "registry+https://github.com/rust-lang/crates.io-index" 158 | checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" 159 | 160 | [[package]] 161 | name = "bitflags" 162 | version = "1.3.2" 163 | source = "registry+https://github.com/rust-lang/crates.io-index" 164 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 165 | 166 | [[package]] 167 | name = "block" 168 | version = "0.1.6" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" 171 | 172 | [[package]] 173 | name = "bumpalo" 174 | version = "3.9.1" 175 | source = "registry+https://github.com/rust-lang/crates.io-index" 176 | checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" 177 | 178 | [[package]] 179 | name = "bytemuck" 180 | version = "1.7.3" 181 | source = "registry+https://github.com/rust-lang/crates.io-index" 182 | checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f" 183 | dependencies = [ 184 | "bytemuck_derive", 185 | ] 186 | 187 | [[package]] 188 | name = "bytemuck_derive" 189 | version = "1.0.1" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" 192 | dependencies = [ 193 | "proc-macro2", 194 | "quote", 195 | "syn", 196 | ] 197 | 198 | [[package]] 199 | name = "byteorder" 200 | version = "1.4.3" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 203 | 204 | [[package]] 205 | name = "bytes" 206 | version = "1.1.0" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 209 | 210 | [[package]] 211 | name = "calloop" 212 | version = "0.6.5" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" 215 | dependencies = [ 216 | "log", 217 | "nix 0.18.0", 218 | ] 219 | 220 | [[package]] 221 | name = "cc" 222 | version = "1.0.72" 223 | source = "registry+https://github.com/rust-lang/crates.io-index" 224 | checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" 225 | dependencies = [ 226 | "jobserver", 227 | ] 228 | 229 | [[package]] 230 | name = "cesu8" 231 | version = "1.1.0" 232 | source = "registry+https://github.com/rust-lang/crates.io-index" 233 | checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" 234 | 235 | [[package]] 236 | name = "cexpr" 237 | version = "0.4.0" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" 240 | dependencies = [ 241 | "nom 5.1.2", 242 | ] 243 | 244 | [[package]] 245 | name = "cfg-if" 246 | version = "0.1.10" 247 | source = "registry+https://github.com/rust-lang/crates.io-index" 248 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 249 | 250 | [[package]] 251 | name = "cfg-if" 252 | version = "1.0.0" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 255 | 256 | [[package]] 257 | name = "cfg_aliases" 258 | version = "0.1.1" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" 261 | 262 | [[package]] 263 | name = "clang-sys" 264 | version = "1.3.0" 265 | source = "registry+https://github.com/rust-lang/crates.io-index" 266 | checksum = "fa66045b9cb23c2e9c1520732030608b02ee07e5cfaa5a521ec15ded7fa24c90" 267 | dependencies = [ 268 | "glob", 269 | "libc", 270 | "libloading 0.7.3", 271 | ] 272 | 273 | [[package]] 274 | name = "clap" 275 | version = "2.34.0" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" 278 | dependencies = [ 279 | "ansi_term", 280 | "atty", 281 | "bitflags", 282 | "strsim 0.8.0", 283 | "textwrap", 284 | "unicode-width", 285 | "vec_map", 286 | ] 287 | 288 | [[package]] 289 | name = "cocoa" 290 | version = "0.24.0" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" 293 | dependencies = [ 294 | "bitflags", 295 | "block", 296 | "cocoa-foundation", 297 | "core-foundation 0.9.2", 298 | "core-graphics 0.22.3", 299 | "foreign-types", 300 | "libc", 301 | "objc", 302 | ] 303 | 304 | [[package]] 305 | name = "cocoa-foundation" 306 | version = "0.1.0" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" 309 | dependencies = [ 310 | "bitflags", 311 | "block", 312 | "core-foundation 0.9.2", 313 | "core-graphics-types", 314 | "foreign-types", 315 | "libc", 316 | "objc", 317 | ] 318 | 319 | [[package]] 320 | name = "codespan-reporting" 321 | version = "0.11.1" 322 | source = "registry+https://github.com/rust-lang/crates.io-index" 323 | checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" 324 | dependencies = [ 325 | "termcolor", 326 | "unicode-width", 327 | ] 328 | 329 | [[package]] 330 | name = "combine" 331 | version = "4.6.3" 332 | source = "registry+https://github.com/rust-lang/crates.io-index" 333 | checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062" 334 | dependencies = [ 335 | "bytes", 336 | "memchr", 337 | ] 338 | 339 | [[package]] 340 | name = "copyless" 341 | version = "0.1.5" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" 344 | 345 | [[package]] 346 | name = "core-foundation" 347 | version = "0.7.0" 348 | source = "registry+https://github.com/rust-lang/crates.io-index" 349 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 350 | dependencies = [ 351 | "core-foundation-sys 0.7.0", 352 | "libc", 353 | ] 354 | 355 | [[package]] 356 | name = "core-foundation" 357 | version = "0.9.2" 358 | source = "registry+https://github.com/rust-lang/crates.io-index" 359 | checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" 360 | dependencies = [ 361 | "core-foundation-sys 0.8.3", 362 | "libc", 363 | ] 364 | 365 | [[package]] 366 | name = "core-foundation-sys" 367 | version = "0.7.0" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 370 | 371 | [[package]] 372 | name = "core-foundation-sys" 373 | version = "0.8.3" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" 376 | 377 | [[package]] 378 | name = "core-graphics" 379 | version = "0.19.2" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" 382 | dependencies = [ 383 | "bitflags", 384 | "core-foundation 0.7.0", 385 | "foreign-types", 386 | "libc", 387 | ] 388 | 389 | [[package]] 390 | name = "core-graphics" 391 | version = "0.22.3" 392 | source = "registry+https://github.com/rust-lang/crates.io-index" 393 | checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" 394 | dependencies = [ 395 | "bitflags", 396 | "core-foundation 0.9.2", 397 | "core-graphics-types", 398 | "foreign-types", 399 | "libc", 400 | ] 401 | 402 | [[package]] 403 | name = "core-graphics-types" 404 | version = "0.1.1" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" 407 | dependencies = [ 408 | "bitflags", 409 | "core-foundation 0.9.2", 410 | "foreign-types", 411 | "libc", 412 | ] 413 | 414 | [[package]] 415 | name = "core-video-sys" 416 | version = "0.1.4" 417 | source = "registry+https://github.com/rust-lang/crates.io-index" 418 | checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" 419 | dependencies = [ 420 | "cfg-if 0.1.10", 421 | "core-foundation-sys 0.7.0", 422 | "core-graphics 0.19.2", 423 | "libc", 424 | "objc", 425 | ] 426 | 427 | [[package]] 428 | name = "coreaudio-rs" 429 | version = "0.10.0" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "11894b20ebfe1ff903cbdc52259693389eea03b94918a2def2c30c3bf227ad88" 432 | dependencies = [ 433 | "bitflags", 434 | "coreaudio-sys", 435 | ] 436 | 437 | [[package]] 438 | name = "coreaudio-sys" 439 | version = "0.2.8" 440 | source = "registry+https://github.com/rust-lang/crates.io-index" 441 | checksum = "2b7e3347be6a09b46aba228d6608386739fb70beff4f61e07422da87b0bb31fa" 442 | dependencies = [ 443 | "bindgen", 444 | ] 445 | 446 | [[package]] 447 | name = "cpal" 448 | version = "0.13.4" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "98f45f0a21f617cd2c788889ef710b63f075c949259593ea09c826f1e47a2418" 451 | dependencies = [ 452 | "alsa", 453 | "core-foundation-sys 0.8.3", 454 | "coreaudio-rs", 455 | "jni", 456 | "js-sys", 457 | "lazy_static", 458 | "libc", 459 | "mach", 460 | "ndk 0.3.0", 461 | "ndk-glue 0.3.0", 462 | "nix 0.20.0", 463 | "oboe", 464 | "parking_lot", 465 | "stdweb", 466 | "thiserror", 467 | "web-sys", 468 | "winapi", 469 | ] 470 | 471 | [[package]] 472 | name = "crav" 473 | version = "0.1.0" 474 | dependencies = [ 475 | "audioviz", 476 | "bytemuck", 477 | "clap", 478 | "cpal", 479 | "crossterm", 480 | "env_logger", 481 | "gag", 482 | "pollster", 483 | "serde", 484 | "serde_json", 485 | "splines", 486 | "termion", 487 | "wgpu", 488 | "winit", 489 | "winit_input_helper", 490 | ] 491 | 492 | [[package]] 493 | name = "crossbeam" 494 | version = "0.8.1" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" 497 | dependencies = [ 498 | "cfg-if 1.0.0", 499 | "crossbeam-channel", 500 | "crossbeam-deque", 501 | "crossbeam-epoch", 502 | "crossbeam-queue", 503 | "crossbeam-utils", 504 | ] 505 | 506 | [[package]] 507 | name = "crossbeam-channel" 508 | version = "0.5.2" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" 511 | dependencies = [ 512 | "cfg-if 1.0.0", 513 | "crossbeam-utils", 514 | ] 515 | 516 | [[package]] 517 | name = "crossbeam-deque" 518 | version = "0.8.1" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" 521 | dependencies = [ 522 | "cfg-if 1.0.0", 523 | "crossbeam-epoch", 524 | "crossbeam-utils", 525 | ] 526 | 527 | [[package]] 528 | name = "crossbeam-epoch" 529 | version = "0.9.6" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" 532 | dependencies = [ 533 | "cfg-if 1.0.0", 534 | "crossbeam-utils", 535 | "lazy_static", 536 | "memoffset", 537 | "scopeguard", 538 | ] 539 | 540 | [[package]] 541 | name = "crossbeam-queue" 542 | version = "0.3.3" 543 | source = "registry+https://github.com/rust-lang/crates.io-index" 544 | checksum = "b979d76c9fcb84dffc80a73f7290da0f83e4c95773494674cb44b76d13a7a110" 545 | dependencies = [ 546 | "cfg-if 1.0.0", 547 | "crossbeam-utils", 548 | ] 549 | 550 | [[package]] 551 | name = "crossbeam-utils" 552 | version = "0.8.6" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" 555 | dependencies = [ 556 | "cfg-if 1.0.0", 557 | "lazy_static", 558 | ] 559 | 560 | [[package]] 561 | name = "crossterm" 562 | version = "0.22.1" 563 | source = "registry+https://github.com/rust-lang/crates.io-index" 564 | checksum = "c85525306c4291d1b73ce93c8acf9c339f9b213aef6c1d85c3830cbf1c16325c" 565 | dependencies = [ 566 | "bitflags", 567 | "crossterm_winapi", 568 | "libc", 569 | "mio", 570 | "parking_lot", 571 | "signal-hook", 572 | "signal-hook-mio", 573 | "winapi", 574 | ] 575 | 576 | [[package]] 577 | name = "crossterm_winapi" 578 | version = "0.9.0" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | checksum = "2ae1b35a484aa10e07fe0638d02301c5ad24de82d310ccbd2f3693da5f09bf1c" 581 | dependencies = [ 582 | "winapi", 583 | ] 584 | 585 | [[package]] 586 | name = "cty" 587 | version = "0.2.2" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" 590 | 591 | [[package]] 592 | name = "d3d12" 593 | version = "0.4.1" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" 596 | dependencies = [ 597 | "bitflags", 598 | "libloading 0.7.3", 599 | "winapi", 600 | ] 601 | 602 | [[package]] 603 | name = "darling" 604 | version = "0.10.2" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" 607 | dependencies = [ 608 | "darling_core 0.10.2", 609 | "darling_macro 0.10.2", 610 | ] 611 | 612 | [[package]] 613 | name = "darling" 614 | version = "0.13.1" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" 617 | dependencies = [ 618 | "darling_core 0.13.1", 619 | "darling_macro 0.13.1", 620 | ] 621 | 622 | [[package]] 623 | name = "darling_core" 624 | version = "0.10.2" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" 627 | dependencies = [ 628 | "fnv", 629 | "ident_case", 630 | "proc-macro2", 631 | "quote", 632 | "strsim 0.9.3", 633 | "syn", 634 | ] 635 | 636 | [[package]] 637 | name = "darling_core" 638 | version = "0.13.1" 639 | source = "registry+https://github.com/rust-lang/crates.io-index" 640 | checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" 641 | dependencies = [ 642 | "fnv", 643 | "ident_case", 644 | "proc-macro2", 645 | "quote", 646 | "strsim 0.10.0", 647 | "syn", 648 | ] 649 | 650 | [[package]] 651 | name = "darling_macro" 652 | version = "0.10.2" 653 | source = "registry+https://github.com/rust-lang/crates.io-index" 654 | checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" 655 | dependencies = [ 656 | "darling_core 0.10.2", 657 | "quote", 658 | "syn", 659 | ] 660 | 661 | [[package]] 662 | name = "darling_macro" 663 | version = "0.13.1" 664 | source = "registry+https://github.com/rust-lang/crates.io-index" 665 | checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" 666 | dependencies = [ 667 | "darling_core 0.13.1", 668 | "quote", 669 | "syn", 670 | ] 671 | 672 | [[package]] 673 | name = "dirs" 674 | version = "3.0.2" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" 677 | dependencies = [ 678 | "dirs-sys", 679 | ] 680 | 681 | [[package]] 682 | name = "dirs-sys" 683 | version = "0.3.6" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" 686 | dependencies = [ 687 | "libc", 688 | "redox_users", 689 | "winapi", 690 | ] 691 | 692 | [[package]] 693 | name = "dispatch" 694 | version = "0.2.0" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" 697 | 698 | [[package]] 699 | name = "dlib" 700 | version = "0.4.2" 701 | source = "registry+https://github.com/rust-lang/crates.io-index" 702 | checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" 703 | dependencies = [ 704 | "libloading 0.6.7", 705 | ] 706 | 707 | [[package]] 708 | name = "dlib" 709 | version = "0.5.0" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" 712 | dependencies = [ 713 | "libloading 0.7.3", 714 | ] 715 | 716 | [[package]] 717 | name = "downcast-rs" 718 | version = "1.2.0" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" 721 | 722 | [[package]] 723 | name = "env_logger" 724 | version = "0.9.0" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" 727 | dependencies = [ 728 | "atty", 729 | "humantime", 730 | "log", 731 | "regex", 732 | "termcolor", 733 | ] 734 | 735 | [[package]] 736 | name = "fastrand" 737 | version = "1.7.0" 738 | source = "registry+https://github.com/rust-lang/crates.io-index" 739 | checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" 740 | dependencies = [ 741 | "instant", 742 | ] 743 | 744 | [[package]] 745 | name = "filedescriptor" 746 | version = "0.8.2" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "7199d965852c3bac31f779ef99cbb4537f80e952e2d6aa0ffeb30cce00f4f46e" 749 | dependencies = [ 750 | "libc", 751 | "thiserror", 752 | "winapi", 753 | ] 754 | 755 | [[package]] 756 | name = "fnv" 757 | version = "1.0.7" 758 | source = "registry+https://github.com/rust-lang/crates.io-index" 759 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 760 | 761 | [[package]] 762 | name = "foreign-types" 763 | version = "0.3.2" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 766 | dependencies = [ 767 | "foreign-types-shared", 768 | ] 769 | 770 | [[package]] 771 | name = "foreign-types-shared" 772 | version = "0.1.1" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 775 | 776 | [[package]] 777 | name = "fxhash" 778 | version = "0.2.1" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" 781 | dependencies = [ 782 | "byteorder", 783 | ] 784 | 785 | [[package]] 786 | name = "gag" 787 | version = "1.0.0" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | checksum = "a713bee13966e9fbffdf7193af71d54a6b35a0bb34997cd6c9519ebeb5005972" 790 | dependencies = [ 791 | "filedescriptor", 792 | "tempfile", 793 | ] 794 | 795 | [[package]] 796 | name = "getrandom" 797 | version = "0.2.4" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" 800 | dependencies = [ 801 | "cfg-if 1.0.0", 802 | "libc", 803 | "wasi", 804 | ] 805 | 806 | [[package]] 807 | name = "glob" 808 | version = "0.3.0" 809 | source = "registry+https://github.com/rust-lang/crates.io-index" 810 | checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" 811 | 812 | [[package]] 813 | name = "glow" 814 | version = "0.11.2" 815 | source = "registry+https://github.com/rust-lang/crates.io-index" 816 | checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" 817 | dependencies = [ 818 | "js-sys", 819 | "slotmap", 820 | "wasm-bindgen", 821 | "web-sys", 822 | ] 823 | 824 | [[package]] 825 | name = "gpu-alloc" 826 | version = "0.5.3" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d" 829 | dependencies = [ 830 | "bitflags", 831 | "gpu-alloc-types", 832 | ] 833 | 834 | [[package]] 835 | name = "gpu-alloc-types" 836 | version = "0.2.0" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" 839 | dependencies = [ 840 | "bitflags", 841 | ] 842 | 843 | [[package]] 844 | name = "gpu-descriptor" 845 | version = "0.2.2" 846 | source = "registry+https://github.com/rust-lang/crates.io-index" 847 | checksum = "a538f217be4d405ff4719a283ca68323cc2384003eca5baaa87501e821c81dda" 848 | dependencies = [ 849 | "bitflags", 850 | "gpu-descriptor-types", 851 | "hashbrown", 852 | ] 853 | 854 | [[package]] 855 | name = "gpu-descriptor-types" 856 | version = "0.1.1" 857 | source = "registry+https://github.com/rust-lang/crates.io-index" 858 | checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" 859 | dependencies = [ 860 | "bitflags", 861 | ] 862 | 863 | [[package]] 864 | name = "hashbrown" 865 | version = "0.11.2" 866 | source = "registry+https://github.com/rust-lang/crates.io-index" 867 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 868 | dependencies = [ 869 | "ahash", 870 | ] 871 | 872 | [[package]] 873 | name = "hermit-abi" 874 | version = "0.1.19" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 877 | dependencies = [ 878 | "libc", 879 | ] 880 | 881 | [[package]] 882 | name = "hexf-parse" 883 | version = "0.2.1" 884 | source = "registry+https://github.com/rust-lang/crates.io-index" 885 | checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" 886 | 887 | [[package]] 888 | name = "humantime" 889 | version = "2.1.0" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 892 | 893 | [[package]] 894 | name = "ident_case" 895 | version = "1.0.1" 896 | source = "registry+https://github.com/rust-lang/crates.io-index" 897 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 898 | 899 | [[package]] 900 | name = "indexmap" 901 | version = "1.8.0" 902 | source = "registry+https://github.com/rust-lang/crates.io-index" 903 | checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" 904 | dependencies = [ 905 | "autocfg", 906 | "hashbrown", 907 | ] 908 | 909 | [[package]] 910 | name = "inplace_it" 911 | version = "0.3.3" 912 | source = "registry+https://github.com/rust-lang/crates.io-index" 913 | checksum = "90953f308a79fe6d62a4643e51f848fbfddcd05975a38e69fdf4ab86a7baf7ca" 914 | 915 | [[package]] 916 | name = "instant" 917 | version = "0.1.12" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 920 | dependencies = [ 921 | "cfg-if 1.0.0", 922 | "js-sys", 923 | "wasm-bindgen", 924 | "web-sys", 925 | ] 926 | 927 | [[package]] 928 | name = "itoa" 929 | version = "1.0.1" 930 | source = "registry+https://github.com/rust-lang/crates.io-index" 931 | checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" 932 | 933 | [[package]] 934 | name = "jni" 935 | version = "0.19.0" 936 | source = "registry+https://github.com/rust-lang/crates.io-index" 937 | checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" 938 | dependencies = [ 939 | "cesu8", 940 | "combine", 941 | "jni-sys", 942 | "log", 943 | "thiserror", 944 | "walkdir", 945 | ] 946 | 947 | [[package]] 948 | name = "jni-sys" 949 | version = "0.3.0" 950 | source = "registry+https://github.com/rust-lang/crates.io-index" 951 | checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" 952 | 953 | [[package]] 954 | name = "jobserver" 955 | version = "0.1.24" 956 | source = "registry+https://github.com/rust-lang/crates.io-index" 957 | checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" 958 | dependencies = [ 959 | "libc", 960 | ] 961 | 962 | [[package]] 963 | name = "js-sys" 964 | version = "0.3.56" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" 967 | dependencies = [ 968 | "wasm-bindgen", 969 | ] 970 | 971 | [[package]] 972 | name = "khronos-egl" 973 | version = "4.1.0" 974 | source = "registry+https://github.com/rust-lang/crates.io-index" 975 | checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" 976 | dependencies = [ 977 | "libc", 978 | "libloading 0.7.3", 979 | ] 980 | 981 | [[package]] 982 | name = "lazy_static" 983 | version = "1.4.0" 984 | source = "registry+https://github.com/rust-lang/crates.io-index" 985 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 986 | 987 | [[package]] 988 | name = "lazycell" 989 | version = "1.3.0" 990 | source = "registry+https://github.com/rust-lang/crates.io-index" 991 | checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" 992 | 993 | [[package]] 994 | name = "libc" 995 | version = "0.2.113" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9" 998 | 999 | [[package]] 1000 | name = "libloading" 1001 | version = "0.6.7" 1002 | source = "registry+https://github.com/rust-lang/crates.io-index" 1003 | checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" 1004 | dependencies = [ 1005 | "cfg-if 1.0.0", 1006 | "winapi", 1007 | ] 1008 | 1009 | [[package]] 1010 | name = "libloading" 1011 | version = "0.7.3" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" 1014 | dependencies = [ 1015 | "cfg-if 1.0.0", 1016 | "winapi", 1017 | ] 1018 | 1019 | [[package]] 1020 | name = "lock_api" 1021 | version = "0.4.5" 1022 | source = "registry+https://github.com/rust-lang/crates.io-index" 1023 | checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" 1024 | dependencies = [ 1025 | "scopeguard", 1026 | ] 1027 | 1028 | [[package]] 1029 | name = "log" 1030 | version = "0.4.14" 1031 | source = "registry+https://github.com/rust-lang/crates.io-index" 1032 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 1033 | dependencies = [ 1034 | "cfg-if 1.0.0", 1035 | ] 1036 | 1037 | [[package]] 1038 | name = "mach" 1039 | version = "0.3.2" 1040 | source = "registry+https://github.com/rust-lang/crates.io-index" 1041 | checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" 1042 | dependencies = [ 1043 | "libc", 1044 | ] 1045 | 1046 | [[package]] 1047 | name = "malloc_buf" 1048 | version = "0.0.6" 1049 | source = "registry+https://github.com/rust-lang/crates.io-index" 1050 | checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" 1051 | dependencies = [ 1052 | "libc", 1053 | ] 1054 | 1055 | [[package]] 1056 | name = "memchr" 1057 | version = "2.4.1" 1058 | source = "registry+https://github.com/rust-lang/crates.io-index" 1059 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 1060 | 1061 | [[package]] 1062 | name = "memmap2" 1063 | version = "0.1.0" 1064 | source = "registry+https://github.com/rust-lang/crates.io-index" 1065 | checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" 1066 | dependencies = [ 1067 | "libc", 1068 | ] 1069 | 1070 | [[package]] 1071 | name = "memoffset" 1072 | version = "0.6.5" 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" 1074 | checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" 1075 | dependencies = [ 1076 | "autocfg", 1077 | ] 1078 | 1079 | [[package]] 1080 | name = "metal" 1081 | version = "0.23.1" 1082 | source = "registry+https://github.com/rust-lang/crates.io-index" 1083 | checksum = "e0514f491f4cc03632ab399ee01e2c1c1b12d3e1cf2d667c1ff5f87d6dcd2084" 1084 | dependencies = [ 1085 | "bitflags", 1086 | "block", 1087 | "core-graphics-types", 1088 | "foreign-types", 1089 | "log", 1090 | "objc", 1091 | ] 1092 | 1093 | [[package]] 1094 | name = "minimal-lexical" 1095 | version = "0.2.1" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" 1098 | 1099 | [[package]] 1100 | name = "mio" 1101 | version = "0.7.14" 1102 | source = "registry+https://github.com/rust-lang/crates.io-index" 1103 | checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" 1104 | dependencies = [ 1105 | "libc", 1106 | "log", 1107 | "miow", 1108 | "ntapi", 1109 | "winapi", 1110 | ] 1111 | 1112 | [[package]] 1113 | name = "mio-misc" 1114 | version = "1.2.2" 1115 | source = "registry+https://github.com/rust-lang/crates.io-index" 1116 | checksum = "b47412f3a52115b936ff2a229b803498c7b4d332adeb87c2f1498c9da54c398c" 1117 | dependencies = [ 1118 | "crossbeam", 1119 | "crossbeam-queue", 1120 | "log", 1121 | "mio", 1122 | ] 1123 | 1124 | [[package]] 1125 | name = "miow" 1126 | version = "0.3.7" 1127 | source = "registry+https://github.com/rust-lang/crates.io-index" 1128 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 1129 | dependencies = [ 1130 | "winapi", 1131 | ] 1132 | 1133 | [[package]] 1134 | name = "naga" 1135 | version = "0.7.3" 1136 | source = "registry+https://github.com/rust-lang/crates.io-index" 1137 | checksum = "806f448a7ce662ca79ef5484ef8f451a9b7c51b8166c95f5a667228b3825a6ca" 1138 | dependencies = [ 1139 | "bit-set", 1140 | "bitflags", 1141 | "codespan-reporting", 1142 | "fxhash", 1143 | "hexf-parse", 1144 | "indexmap", 1145 | "log", 1146 | "num-traits", 1147 | "spirv", 1148 | "thiserror", 1149 | ] 1150 | 1151 | [[package]] 1152 | name = "ndk" 1153 | version = "0.3.0" 1154 | source = "registry+https://github.com/rust-lang/crates.io-index" 1155 | checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" 1156 | dependencies = [ 1157 | "jni-sys", 1158 | "ndk-sys 0.2.2", 1159 | "num_enum", 1160 | "thiserror", 1161 | ] 1162 | 1163 | [[package]] 1164 | name = "ndk" 1165 | version = "0.6.0" 1166 | source = "registry+https://github.com/rust-lang/crates.io-index" 1167 | checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" 1168 | dependencies = [ 1169 | "bitflags", 1170 | "jni-sys", 1171 | "ndk-sys 0.3.0", 1172 | "num_enum", 1173 | "thiserror", 1174 | ] 1175 | 1176 | [[package]] 1177 | name = "ndk-glue" 1178 | version = "0.3.0" 1179 | source = "registry+https://github.com/rust-lang/crates.io-index" 1180 | checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" 1181 | dependencies = [ 1182 | "lazy_static", 1183 | "libc", 1184 | "log", 1185 | "ndk 0.3.0", 1186 | "ndk-macro 0.2.0", 1187 | "ndk-sys 0.2.2", 1188 | ] 1189 | 1190 | [[package]] 1191 | name = "ndk-glue" 1192 | version = "0.6.0" 1193 | source = "registry+https://github.com/rust-lang/crates.io-index" 1194 | checksum = "04c0d14b0858eb9962a5dac30b809b19f19da7e4547d64af2b0bb051d2e55d79" 1195 | dependencies = [ 1196 | "lazy_static", 1197 | "libc", 1198 | "log", 1199 | "ndk 0.6.0", 1200 | "ndk-macro 0.3.0", 1201 | "ndk-sys 0.3.0", 1202 | ] 1203 | 1204 | [[package]] 1205 | name = "ndk-macro" 1206 | version = "0.2.0" 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" 1208 | checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" 1209 | dependencies = [ 1210 | "darling 0.10.2", 1211 | "proc-macro-crate 0.1.5", 1212 | "proc-macro2", 1213 | "quote", 1214 | "syn", 1215 | ] 1216 | 1217 | [[package]] 1218 | name = "ndk-macro" 1219 | version = "0.3.0" 1220 | source = "registry+https://github.com/rust-lang/crates.io-index" 1221 | checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" 1222 | dependencies = [ 1223 | "darling 0.13.1", 1224 | "proc-macro-crate 1.1.0", 1225 | "proc-macro2", 1226 | "quote", 1227 | "syn", 1228 | ] 1229 | 1230 | [[package]] 1231 | name = "ndk-sys" 1232 | version = "0.2.2" 1233 | source = "registry+https://github.com/rust-lang/crates.io-index" 1234 | checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" 1235 | 1236 | [[package]] 1237 | name = "ndk-sys" 1238 | version = "0.3.0" 1239 | source = "registry+https://github.com/rust-lang/crates.io-index" 1240 | checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" 1241 | dependencies = [ 1242 | "jni-sys", 1243 | ] 1244 | 1245 | [[package]] 1246 | name = "nix" 1247 | version = "0.18.0" 1248 | source = "registry+https://github.com/rust-lang/crates.io-index" 1249 | checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" 1250 | dependencies = [ 1251 | "bitflags", 1252 | "cc", 1253 | "cfg-if 0.1.10", 1254 | "libc", 1255 | ] 1256 | 1257 | [[package]] 1258 | name = "nix" 1259 | version = "0.20.0" 1260 | source = "registry+https://github.com/rust-lang/crates.io-index" 1261 | checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" 1262 | dependencies = [ 1263 | "bitflags", 1264 | "cc", 1265 | "cfg-if 1.0.0", 1266 | "libc", 1267 | ] 1268 | 1269 | [[package]] 1270 | name = "nom" 1271 | version = "5.1.2" 1272 | source = "registry+https://github.com/rust-lang/crates.io-index" 1273 | checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" 1274 | dependencies = [ 1275 | "memchr", 1276 | "version_check", 1277 | ] 1278 | 1279 | [[package]] 1280 | name = "nom" 1281 | version = "7.1.0" 1282 | source = "registry+https://github.com/rust-lang/crates.io-index" 1283 | checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" 1284 | dependencies = [ 1285 | "memchr", 1286 | "minimal-lexical", 1287 | "version_check", 1288 | ] 1289 | 1290 | [[package]] 1291 | name = "ntapi" 1292 | version = "0.3.6" 1293 | source = "registry+https://github.com/rust-lang/crates.io-index" 1294 | checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" 1295 | dependencies = [ 1296 | "winapi", 1297 | ] 1298 | 1299 | [[package]] 1300 | name = "num-complex" 1301 | version = "0.4.0" 1302 | source = "registry+https://github.com/rust-lang/crates.io-index" 1303 | checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" 1304 | dependencies = [ 1305 | "num-traits", 1306 | ] 1307 | 1308 | [[package]] 1309 | name = "num-derive" 1310 | version = "0.3.3" 1311 | source = "registry+https://github.com/rust-lang/crates.io-index" 1312 | checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" 1313 | dependencies = [ 1314 | "proc-macro2", 1315 | "quote", 1316 | "syn", 1317 | ] 1318 | 1319 | [[package]] 1320 | name = "num-integer" 1321 | version = "0.1.44" 1322 | source = "registry+https://github.com/rust-lang/crates.io-index" 1323 | checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" 1324 | dependencies = [ 1325 | "autocfg", 1326 | "num-traits", 1327 | ] 1328 | 1329 | [[package]] 1330 | name = "num-traits" 1331 | version = "0.2.14" 1332 | source = "registry+https://github.com/rust-lang/crates.io-index" 1333 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" 1334 | dependencies = [ 1335 | "autocfg", 1336 | ] 1337 | 1338 | [[package]] 1339 | name = "num_enum" 1340 | version = "0.5.6" 1341 | source = "registry+https://github.com/rust-lang/crates.io-index" 1342 | checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad" 1343 | dependencies = [ 1344 | "num_enum_derive", 1345 | ] 1346 | 1347 | [[package]] 1348 | name = "num_enum_derive" 1349 | version = "0.5.6" 1350 | source = "registry+https://github.com/rust-lang/crates.io-index" 1351 | checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21" 1352 | dependencies = [ 1353 | "proc-macro-crate 1.1.0", 1354 | "proc-macro2", 1355 | "quote", 1356 | "syn", 1357 | ] 1358 | 1359 | [[package]] 1360 | name = "numtoa" 1361 | version = "0.1.0" 1362 | source = "registry+https://github.com/rust-lang/crates.io-index" 1363 | checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" 1364 | 1365 | [[package]] 1366 | name = "objc" 1367 | version = "0.2.7" 1368 | source = "registry+https://github.com/rust-lang/crates.io-index" 1369 | checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" 1370 | dependencies = [ 1371 | "malloc_buf", 1372 | "objc_exception", 1373 | ] 1374 | 1375 | [[package]] 1376 | name = "objc_exception" 1377 | version = "0.1.2" 1378 | source = "registry+https://github.com/rust-lang/crates.io-index" 1379 | checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" 1380 | dependencies = [ 1381 | "cc", 1382 | ] 1383 | 1384 | [[package]] 1385 | name = "oboe" 1386 | version = "0.4.5" 1387 | source = "registry+https://github.com/rust-lang/crates.io-index" 1388 | checksum = "2463c8f2e19b4e0d0710a21f8e4011501ff28db1c95d7a5482a553b2100502d2" 1389 | dependencies = [ 1390 | "jni", 1391 | "ndk 0.6.0", 1392 | "ndk-glue 0.6.0", 1393 | "num-derive", 1394 | "num-traits", 1395 | "oboe-sys", 1396 | ] 1397 | 1398 | [[package]] 1399 | name = "oboe-sys" 1400 | version = "0.4.5" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "3370abb7372ed744232c12954d920d1a40f1c4686de9e79e800021ef492294bd" 1403 | dependencies = [ 1404 | "cc", 1405 | ] 1406 | 1407 | [[package]] 1408 | name = "once_cell" 1409 | version = "1.9.0" 1410 | source = "registry+https://github.com/rust-lang/crates.io-index" 1411 | checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" 1412 | 1413 | [[package]] 1414 | name = "owned_ttf_parser" 1415 | version = "0.6.0" 1416 | source = "registry+https://github.com/rust-lang/crates.io-index" 1417 | checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" 1418 | dependencies = [ 1419 | "ttf-parser", 1420 | ] 1421 | 1422 | [[package]] 1423 | name = "parking_lot" 1424 | version = "0.11.2" 1425 | source = "registry+https://github.com/rust-lang/crates.io-index" 1426 | checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" 1427 | dependencies = [ 1428 | "instant", 1429 | "lock_api", 1430 | "parking_lot_core", 1431 | ] 1432 | 1433 | [[package]] 1434 | name = "parking_lot_core" 1435 | version = "0.8.5" 1436 | source = "registry+https://github.com/rust-lang/crates.io-index" 1437 | checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" 1438 | dependencies = [ 1439 | "cfg-if 1.0.0", 1440 | "instant", 1441 | "libc", 1442 | "redox_syscall", 1443 | "smallvec", 1444 | "winapi", 1445 | ] 1446 | 1447 | [[package]] 1448 | name = "peeking_take_while" 1449 | version = "0.1.2" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" 1452 | 1453 | [[package]] 1454 | name = "percent-encoding" 1455 | version = "2.1.0" 1456 | source = "registry+https://github.com/rust-lang/crates.io-index" 1457 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 1458 | 1459 | [[package]] 1460 | name = "pkg-config" 1461 | version = "0.3.24" 1462 | source = "registry+https://github.com/rust-lang/crates.io-index" 1463 | checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" 1464 | 1465 | [[package]] 1466 | name = "pollster" 1467 | version = "0.2.5" 1468 | source = "registry+https://github.com/rust-lang/crates.io-index" 1469 | checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7" 1470 | 1471 | [[package]] 1472 | name = "primal-check" 1473 | version = "0.3.1" 1474 | source = "registry+https://github.com/rust-lang/crates.io-index" 1475 | checksum = "01419cee72c1a1ca944554e23d83e483e1bccf378753344e881de28b5487511d" 1476 | dependencies = [ 1477 | "num-integer", 1478 | ] 1479 | 1480 | [[package]] 1481 | name = "proc-macro-crate" 1482 | version = "0.1.5" 1483 | source = "registry+https://github.com/rust-lang/crates.io-index" 1484 | checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" 1485 | dependencies = [ 1486 | "toml", 1487 | ] 1488 | 1489 | [[package]] 1490 | name = "proc-macro-crate" 1491 | version = "1.1.0" 1492 | source = "registry+https://github.com/rust-lang/crates.io-index" 1493 | checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" 1494 | dependencies = [ 1495 | "thiserror", 1496 | "toml", 1497 | ] 1498 | 1499 | [[package]] 1500 | name = "proc-macro2" 1501 | version = "1.0.36" 1502 | source = "registry+https://github.com/rust-lang/crates.io-index" 1503 | checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" 1504 | dependencies = [ 1505 | "unicode-xid", 1506 | ] 1507 | 1508 | [[package]] 1509 | name = "profiling" 1510 | version = "1.0.5" 1511 | source = "registry+https://github.com/rust-lang/crates.io-index" 1512 | checksum = "9145ac0af1d93c638c98c40cf7d25665f427b2a44ad0a99b1dccf3e2f25bb987" 1513 | 1514 | [[package]] 1515 | name = "quote" 1516 | version = "1.0.15" 1517 | source = "registry+https://github.com/rust-lang/crates.io-index" 1518 | checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" 1519 | dependencies = [ 1520 | "proc-macro2", 1521 | ] 1522 | 1523 | [[package]] 1524 | name = "range-alloc" 1525 | version = "0.1.2" 1526 | source = "registry+https://github.com/rust-lang/crates.io-index" 1527 | checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6" 1528 | 1529 | [[package]] 1530 | name = "raw-window-handle" 1531 | version = "0.3.4" 1532 | source = "registry+https://github.com/rust-lang/crates.io-index" 1533 | checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" 1534 | dependencies = [ 1535 | "libc", 1536 | "raw-window-handle 0.4.2", 1537 | ] 1538 | 1539 | [[package]] 1540 | name = "raw-window-handle" 1541 | version = "0.4.2" 1542 | source = "registry+https://github.com/rust-lang/crates.io-index" 1543 | checksum = "fba75eee94a9d5273a68c9e1e105d9cffe1ef700532325788389e5a83e2522b7" 1544 | dependencies = [ 1545 | "cty", 1546 | ] 1547 | 1548 | [[package]] 1549 | name = "redox_syscall" 1550 | version = "0.2.10" 1551 | source = "registry+https://github.com/rust-lang/crates.io-index" 1552 | checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" 1553 | dependencies = [ 1554 | "bitflags", 1555 | ] 1556 | 1557 | [[package]] 1558 | name = "redox_termios" 1559 | version = "0.1.2" 1560 | source = "registry+https://github.com/rust-lang/crates.io-index" 1561 | checksum = "8440d8acb4fd3d277125b4bd01a6f38aee8d814b3b5fc09b3f2b825d37d3fe8f" 1562 | dependencies = [ 1563 | "redox_syscall", 1564 | ] 1565 | 1566 | [[package]] 1567 | name = "redox_users" 1568 | version = "0.4.0" 1569 | source = "registry+https://github.com/rust-lang/crates.io-index" 1570 | checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" 1571 | dependencies = [ 1572 | "getrandom", 1573 | "redox_syscall", 1574 | ] 1575 | 1576 | [[package]] 1577 | name = "regex" 1578 | version = "1.5.4" 1579 | source = "registry+https://github.com/rust-lang/crates.io-index" 1580 | checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" 1581 | dependencies = [ 1582 | "aho-corasick", 1583 | "memchr", 1584 | "regex-syntax", 1585 | ] 1586 | 1587 | [[package]] 1588 | name = "regex-syntax" 1589 | version = "0.6.25" 1590 | source = "registry+https://github.com/rust-lang/crates.io-index" 1591 | checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" 1592 | 1593 | [[package]] 1594 | name = "remove_dir_all" 1595 | version = "0.5.3" 1596 | source = "registry+https://github.com/rust-lang/crates.io-index" 1597 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 1598 | dependencies = [ 1599 | "winapi", 1600 | ] 1601 | 1602 | [[package]] 1603 | name = "renderdoc-sys" 1604 | version = "0.7.1" 1605 | source = "registry+https://github.com/rust-lang/crates.io-index" 1606 | checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" 1607 | 1608 | [[package]] 1609 | name = "rustc-hash" 1610 | version = "1.1.0" 1611 | source = "registry+https://github.com/rust-lang/crates.io-index" 1612 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 1613 | 1614 | [[package]] 1615 | name = "rustfft" 1616 | version = "6.0.1" 1617 | source = "registry+https://github.com/rust-lang/crates.io-index" 1618 | checksum = "b1d089e5c57521629a59f5f39bca7434849ff89bd6873b521afe389c1c602543" 1619 | dependencies = [ 1620 | "num-complex", 1621 | "num-integer", 1622 | "num-traits", 1623 | "primal-check", 1624 | "strength_reduce", 1625 | "transpose", 1626 | ] 1627 | 1628 | [[package]] 1629 | name = "rusttype" 1630 | version = "0.9.2" 1631 | source = "registry+https://github.com/rust-lang/crates.io-index" 1632 | checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" 1633 | dependencies = [ 1634 | "ab_glyph_rasterizer", 1635 | "owned_ttf_parser", 1636 | ] 1637 | 1638 | [[package]] 1639 | name = "ryu" 1640 | version = "1.0.9" 1641 | source = "registry+https://github.com/rust-lang/crates.io-index" 1642 | checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" 1643 | 1644 | [[package]] 1645 | name = "same-file" 1646 | version = "1.0.6" 1647 | source = "registry+https://github.com/rust-lang/crates.io-index" 1648 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1649 | dependencies = [ 1650 | "winapi-util", 1651 | ] 1652 | 1653 | [[package]] 1654 | name = "scoped-tls" 1655 | version = "1.0.0" 1656 | source = "registry+https://github.com/rust-lang/crates.io-index" 1657 | checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" 1658 | 1659 | [[package]] 1660 | name = "scopeguard" 1661 | version = "1.1.0" 1662 | source = "registry+https://github.com/rust-lang/crates.io-index" 1663 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1664 | 1665 | [[package]] 1666 | name = "serde" 1667 | version = "1.0.134" 1668 | source = "registry+https://github.com/rust-lang/crates.io-index" 1669 | checksum = "96b3c34c1690edf8174f5b289a336ab03f568a4460d8c6df75f2f3a692b3bc6a" 1670 | dependencies = [ 1671 | "serde_derive", 1672 | ] 1673 | 1674 | [[package]] 1675 | name = "serde_derive" 1676 | version = "1.0.134" 1677 | source = "registry+https://github.com/rust-lang/crates.io-index" 1678 | checksum = "784ed1fbfa13fe191077537b0d70ec8ad1e903cfe04831da608aa36457cb653d" 1679 | dependencies = [ 1680 | "proc-macro2", 1681 | "quote", 1682 | "syn", 1683 | ] 1684 | 1685 | [[package]] 1686 | name = "serde_json" 1687 | version = "1.0.76" 1688 | source = "registry+https://github.com/rust-lang/crates.io-index" 1689 | checksum = "edde269018d33d7146dd074e5f7da6fef9b0a957507454c867caa0852c560a9a" 1690 | dependencies = [ 1691 | "itoa", 1692 | "ryu", 1693 | "serde", 1694 | ] 1695 | 1696 | [[package]] 1697 | name = "shlex" 1698 | version = "0.1.1" 1699 | source = "registry+https://github.com/rust-lang/crates.io-index" 1700 | checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" 1701 | 1702 | [[package]] 1703 | name = "signal-hook" 1704 | version = "0.3.13" 1705 | source = "registry+https://github.com/rust-lang/crates.io-index" 1706 | checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" 1707 | dependencies = [ 1708 | "libc", 1709 | "signal-hook-registry", 1710 | ] 1711 | 1712 | [[package]] 1713 | name = "signal-hook-mio" 1714 | version = "0.2.1" 1715 | source = "registry+https://github.com/rust-lang/crates.io-index" 1716 | checksum = "29fd5867f1c4f2c5be079aee7a2adf1152ebb04a4bc4d341f504b7dece607ed4" 1717 | dependencies = [ 1718 | "libc", 1719 | "mio", 1720 | "signal-hook", 1721 | ] 1722 | 1723 | [[package]] 1724 | name = "signal-hook-registry" 1725 | version = "1.4.0" 1726 | source = "registry+https://github.com/rust-lang/crates.io-index" 1727 | checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" 1728 | dependencies = [ 1729 | "libc", 1730 | ] 1731 | 1732 | [[package]] 1733 | name = "slotmap" 1734 | version = "1.0.6" 1735 | source = "registry+https://github.com/rust-lang/crates.io-index" 1736 | checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" 1737 | dependencies = [ 1738 | "version_check", 1739 | ] 1740 | 1741 | [[package]] 1742 | name = "smallvec" 1743 | version = "1.8.0" 1744 | source = "registry+https://github.com/rust-lang/crates.io-index" 1745 | checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" 1746 | 1747 | [[package]] 1748 | name = "smithay-client-toolkit" 1749 | version = "0.12.3" 1750 | source = "registry+https://github.com/rust-lang/crates.io-index" 1751 | checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" 1752 | dependencies = [ 1753 | "andrew", 1754 | "bitflags", 1755 | "calloop", 1756 | "dlib 0.4.2", 1757 | "lazy_static", 1758 | "log", 1759 | "memmap2", 1760 | "nix 0.18.0", 1761 | "wayland-client", 1762 | "wayland-cursor", 1763 | "wayland-protocols", 1764 | ] 1765 | 1766 | [[package]] 1767 | name = "spirv" 1768 | version = "0.2.0+1.5.4" 1769 | source = "registry+https://github.com/rust-lang/crates.io-index" 1770 | checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" 1771 | dependencies = [ 1772 | "bitflags", 1773 | "num-traits", 1774 | ] 1775 | 1776 | [[package]] 1777 | name = "splines" 1778 | version = "4.0.3" 1779 | source = "registry+https://github.com/rust-lang/crates.io-index" 1780 | checksum = "c94307351d02448532cdf65ea95bfdd529183d360a60fb8c8bdca6c90af55542" 1781 | 1782 | [[package]] 1783 | name = "stdweb" 1784 | version = "0.1.3" 1785 | source = "registry+https://github.com/rust-lang/crates.io-index" 1786 | checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" 1787 | 1788 | [[package]] 1789 | name = "strength_reduce" 1790 | version = "0.2.3" 1791 | source = "registry+https://github.com/rust-lang/crates.io-index" 1792 | checksum = "a3ff2f71c82567c565ba4b3009a9350a96a7269eaa4001ebedae926230bc2254" 1793 | 1794 | [[package]] 1795 | name = "strsim" 1796 | version = "0.8.0" 1797 | source = "registry+https://github.com/rust-lang/crates.io-index" 1798 | checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 1799 | 1800 | [[package]] 1801 | name = "strsim" 1802 | version = "0.9.3" 1803 | source = "registry+https://github.com/rust-lang/crates.io-index" 1804 | checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" 1805 | 1806 | [[package]] 1807 | name = "strsim" 1808 | version = "0.10.0" 1809 | source = "registry+https://github.com/rust-lang/crates.io-index" 1810 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 1811 | 1812 | [[package]] 1813 | name = "syn" 1814 | version = "1.0.86" 1815 | source = "registry+https://github.com/rust-lang/crates.io-index" 1816 | checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" 1817 | dependencies = [ 1818 | "proc-macro2", 1819 | "quote", 1820 | "unicode-xid", 1821 | ] 1822 | 1823 | [[package]] 1824 | name = "tempfile" 1825 | version = "3.3.0" 1826 | source = "registry+https://github.com/rust-lang/crates.io-index" 1827 | checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" 1828 | dependencies = [ 1829 | "cfg-if 1.0.0", 1830 | "fastrand", 1831 | "libc", 1832 | "redox_syscall", 1833 | "remove_dir_all", 1834 | "winapi", 1835 | ] 1836 | 1837 | [[package]] 1838 | name = "termcolor" 1839 | version = "1.1.2" 1840 | source = "registry+https://github.com/rust-lang/crates.io-index" 1841 | checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" 1842 | dependencies = [ 1843 | "winapi-util", 1844 | ] 1845 | 1846 | [[package]] 1847 | name = "termion" 1848 | version = "1.5.6" 1849 | source = "registry+https://github.com/rust-lang/crates.io-index" 1850 | checksum = "077185e2eac69c3f8379a4298e1e07cd36beb962290d4a51199acf0fdc10607e" 1851 | dependencies = [ 1852 | "libc", 1853 | "numtoa", 1854 | "redox_syscall", 1855 | "redox_termios", 1856 | ] 1857 | 1858 | [[package]] 1859 | name = "textwrap" 1860 | version = "0.11.0" 1861 | source = "registry+https://github.com/rust-lang/crates.io-index" 1862 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 1863 | dependencies = [ 1864 | "unicode-width", 1865 | ] 1866 | 1867 | [[package]] 1868 | name = "thiserror" 1869 | version = "1.0.30" 1870 | source = "registry+https://github.com/rust-lang/crates.io-index" 1871 | checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" 1872 | dependencies = [ 1873 | "thiserror-impl", 1874 | ] 1875 | 1876 | [[package]] 1877 | name = "thiserror-impl" 1878 | version = "1.0.30" 1879 | source = "registry+https://github.com/rust-lang/crates.io-index" 1880 | checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" 1881 | dependencies = [ 1882 | "proc-macro2", 1883 | "quote", 1884 | "syn", 1885 | ] 1886 | 1887 | [[package]] 1888 | name = "toml" 1889 | version = "0.5.8" 1890 | source = "registry+https://github.com/rust-lang/crates.io-index" 1891 | checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" 1892 | dependencies = [ 1893 | "serde", 1894 | ] 1895 | 1896 | [[package]] 1897 | name = "transpose" 1898 | version = "0.2.1" 1899 | source = "registry+https://github.com/rust-lang/crates.io-index" 1900 | checksum = "95f9c900aa98b6ea43aee227fd680550cdec726526aab8ac801549eadb25e39f" 1901 | dependencies = [ 1902 | "num-integer", 1903 | "strength_reduce", 1904 | ] 1905 | 1906 | [[package]] 1907 | name = "ttf-parser" 1908 | version = "0.6.2" 1909 | source = "registry+https://github.com/rust-lang/crates.io-index" 1910 | checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" 1911 | 1912 | [[package]] 1913 | name = "unicode-width" 1914 | version = "0.1.9" 1915 | source = "registry+https://github.com/rust-lang/crates.io-index" 1916 | checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" 1917 | 1918 | [[package]] 1919 | name = "unicode-xid" 1920 | version = "0.2.2" 1921 | source = "registry+https://github.com/rust-lang/crates.io-index" 1922 | checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" 1923 | 1924 | [[package]] 1925 | name = "vec_map" 1926 | version = "0.8.2" 1927 | source = "registry+https://github.com/rust-lang/crates.io-index" 1928 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" 1929 | 1930 | [[package]] 1931 | name = "version_check" 1932 | version = "0.9.4" 1933 | source = "registry+https://github.com/rust-lang/crates.io-index" 1934 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1935 | 1936 | [[package]] 1937 | name = "walkdir" 1938 | version = "2.3.2" 1939 | source = "registry+https://github.com/rust-lang/crates.io-index" 1940 | checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" 1941 | dependencies = [ 1942 | "same-file", 1943 | "winapi", 1944 | "winapi-util", 1945 | ] 1946 | 1947 | [[package]] 1948 | name = "wasi" 1949 | version = "0.10.2+wasi-snapshot-preview1" 1950 | source = "registry+https://github.com/rust-lang/crates.io-index" 1951 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 1952 | 1953 | [[package]] 1954 | name = "wasm-bindgen" 1955 | version = "0.2.79" 1956 | source = "registry+https://github.com/rust-lang/crates.io-index" 1957 | checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" 1958 | dependencies = [ 1959 | "cfg-if 1.0.0", 1960 | "wasm-bindgen-macro", 1961 | ] 1962 | 1963 | [[package]] 1964 | name = "wasm-bindgen-backend" 1965 | version = "0.2.79" 1966 | source = "registry+https://github.com/rust-lang/crates.io-index" 1967 | checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" 1968 | dependencies = [ 1969 | "bumpalo", 1970 | "lazy_static", 1971 | "log", 1972 | "proc-macro2", 1973 | "quote", 1974 | "syn", 1975 | "wasm-bindgen-shared", 1976 | ] 1977 | 1978 | [[package]] 1979 | name = "wasm-bindgen-futures" 1980 | version = "0.4.29" 1981 | source = "registry+https://github.com/rust-lang/crates.io-index" 1982 | checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" 1983 | dependencies = [ 1984 | "cfg-if 1.0.0", 1985 | "js-sys", 1986 | "wasm-bindgen", 1987 | "web-sys", 1988 | ] 1989 | 1990 | [[package]] 1991 | name = "wasm-bindgen-macro" 1992 | version = "0.2.79" 1993 | source = "registry+https://github.com/rust-lang/crates.io-index" 1994 | checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" 1995 | dependencies = [ 1996 | "quote", 1997 | "wasm-bindgen-macro-support", 1998 | ] 1999 | 2000 | [[package]] 2001 | name = "wasm-bindgen-macro-support" 2002 | version = "0.2.79" 2003 | source = "registry+https://github.com/rust-lang/crates.io-index" 2004 | checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" 2005 | dependencies = [ 2006 | "proc-macro2", 2007 | "quote", 2008 | "syn", 2009 | "wasm-bindgen-backend", 2010 | "wasm-bindgen-shared", 2011 | ] 2012 | 2013 | [[package]] 2014 | name = "wasm-bindgen-shared" 2015 | version = "0.2.79" 2016 | source = "registry+https://github.com/rust-lang/crates.io-index" 2017 | checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" 2018 | 2019 | [[package]] 2020 | name = "wayland-client" 2021 | version = "0.28.6" 2022 | source = "registry+https://github.com/rust-lang/crates.io-index" 2023 | checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" 2024 | dependencies = [ 2025 | "bitflags", 2026 | "downcast-rs", 2027 | "libc", 2028 | "nix 0.20.0", 2029 | "scoped-tls", 2030 | "wayland-commons", 2031 | "wayland-scanner", 2032 | "wayland-sys", 2033 | ] 2034 | 2035 | [[package]] 2036 | name = "wayland-commons" 2037 | version = "0.28.6" 2038 | source = "registry+https://github.com/rust-lang/crates.io-index" 2039 | checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" 2040 | dependencies = [ 2041 | "nix 0.20.0", 2042 | "once_cell", 2043 | "smallvec", 2044 | "wayland-sys", 2045 | ] 2046 | 2047 | [[package]] 2048 | name = "wayland-cursor" 2049 | version = "0.28.6" 2050 | source = "registry+https://github.com/rust-lang/crates.io-index" 2051 | checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" 2052 | dependencies = [ 2053 | "nix 0.20.0", 2054 | "wayland-client", 2055 | "xcursor", 2056 | ] 2057 | 2058 | [[package]] 2059 | name = "wayland-protocols" 2060 | version = "0.28.6" 2061 | source = "registry+https://github.com/rust-lang/crates.io-index" 2062 | checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" 2063 | dependencies = [ 2064 | "bitflags", 2065 | "wayland-client", 2066 | "wayland-commons", 2067 | "wayland-scanner", 2068 | ] 2069 | 2070 | [[package]] 2071 | name = "wayland-scanner" 2072 | version = "0.28.6" 2073 | source = "registry+https://github.com/rust-lang/crates.io-index" 2074 | checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" 2075 | dependencies = [ 2076 | "proc-macro2", 2077 | "quote", 2078 | "xml-rs", 2079 | ] 2080 | 2081 | [[package]] 2082 | name = "wayland-sys" 2083 | version = "0.28.6" 2084 | source = "registry+https://github.com/rust-lang/crates.io-index" 2085 | checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" 2086 | dependencies = [ 2087 | "dlib 0.5.0", 2088 | "lazy_static", 2089 | "pkg-config", 2090 | ] 2091 | 2092 | [[package]] 2093 | name = "web-sys" 2094 | version = "0.3.56" 2095 | source = "registry+https://github.com/rust-lang/crates.io-index" 2096 | checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" 2097 | dependencies = [ 2098 | "js-sys", 2099 | "wasm-bindgen", 2100 | ] 2101 | 2102 | [[package]] 2103 | name = "wgpu" 2104 | version = "0.11.1" 2105 | source = "registry+https://github.com/rust-lang/crates.io-index" 2106 | checksum = "eae7181fe6ba5f4b632a9079cc9e922a64555156c87def72c063f94b180c7d68" 2107 | dependencies = [ 2108 | "arrayvec", 2109 | "js-sys", 2110 | "log", 2111 | "parking_lot", 2112 | "raw-window-handle 0.3.4", 2113 | "smallvec", 2114 | "wasm-bindgen", 2115 | "wasm-bindgen-futures", 2116 | "web-sys", 2117 | "wgpu-core", 2118 | "wgpu-hal", 2119 | "wgpu-types", 2120 | ] 2121 | 2122 | [[package]] 2123 | name = "wgpu-core" 2124 | version = "0.11.3" 2125 | source = "registry+https://github.com/rust-lang/crates.io-index" 2126 | checksum = "35600627b6c718ad0e23ed75fb6140bfe32cdf21c8f539ce3c9ab8180e2cb38e" 2127 | dependencies = [ 2128 | "arrayvec", 2129 | "bitflags", 2130 | "cfg_aliases", 2131 | "copyless", 2132 | "fxhash", 2133 | "log", 2134 | "naga", 2135 | "parking_lot", 2136 | "profiling", 2137 | "raw-window-handle 0.3.4", 2138 | "smallvec", 2139 | "thiserror", 2140 | "wgpu-hal", 2141 | "wgpu-types", 2142 | ] 2143 | 2144 | [[package]] 2145 | name = "wgpu-hal" 2146 | version = "0.11.5" 2147 | source = "registry+https://github.com/rust-lang/crates.io-index" 2148 | checksum = "af28b29ef0b44cd22dd9895d4349b9d5a687df42f58da234871198637eabe328" 2149 | dependencies = [ 2150 | "arrayvec", 2151 | "ash", 2152 | "bit-set", 2153 | "bitflags", 2154 | "block", 2155 | "core-graphics-types", 2156 | "d3d12", 2157 | "foreign-types", 2158 | "fxhash", 2159 | "glow", 2160 | "gpu-alloc", 2161 | "gpu-descriptor", 2162 | "inplace_it", 2163 | "js-sys", 2164 | "khronos-egl", 2165 | "libloading 0.7.3", 2166 | "log", 2167 | "metal", 2168 | "naga", 2169 | "objc", 2170 | "parking_lot", 2171 | "profiling", 2172 | "range-alloc", 2173 | "raw-window-handle 0.3.4", 2174 | "renderdoc-sys", 2175 | "thiserror", 2176 | "wasm-bindgen", 2177 | "web-sys", 2178 | "wgpu-types", 2179 | "winapi", 2180 | ] 2181 | 2182 | [[package]] 2183 | name = "wgpu-types" 2184 | version = "0.11.0" 2185 | source = "registry+https://github.com/rust-lang/crates.io-index" 2186 | checksum = "e15e44ba88ec415466e18e91881319e7c9e96cb905dc623305168aea65b85ccc" 2187 | dependencies = [ 2188 | "bitflags", 2189 | ] 2190 | 2191 | [[package]] 2192 | name = "winapi" 2193 | version = "0.3.9" 2194 | source = "registry+https://github.com/rust-lang/crates.io-index" 2195 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2196 | dependencies = [ 2197 | "winapi-i686-pc-windows-gnu", 2198 | "winapi-x86_64-pc-windows-gnu", 2199 | ] 2200 | 2201 | [[package]] 2202 | name = "winapi-i686-pc-windows-gnu" 2203 | version = "0.4.0" 2204 | source = "registry+https://github.com/rust-lang/crates.io-index" 2205 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2206 | 2207 | [[package]] 2208 | name = "winapi-util" 2209 | version = "0.1.5" 2210 | source = "registry+https://github.com/rust-lang/crates.io-index" 2211 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2212 | dependencies = [ 2213 | "winapi", 2214 | ] 2215 | 2216 | [[package]] 2217 | name = "winapi-x86_64-pc-windows-gnu" 2218 | version = "0.4.0" 2219 | source = "registry+https://github.com/rust-lang/crates.io-index" 2220 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2221 | 2222 | [[package]] 2223 | name = "winit" 2224 | version = "0.25.0" 2225 | source = "registry+https://github.com/rust-lang/crates.io-index" 2226 | checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" 2227 | dependencies = [ 2228 | "bitflags", 2229 | "cocoa", 2230 | "core-foundation 0.9.2", 2231 | "core-graphics 0.22.3", 2232 | "core-video-sys", 2233 | "dispatch", 2234 | "instant", 2235 | "lazy_static", 2236 | "libc", 2237 | "log", 2238 | "mio", 2239 | "mio-misc", 2240 | "ndk 0.3.0", 2241 | "ndk-glue 0.3.0", 2242 | "ndk-sys 0.2.2", 2243 | "objc", 2244 | "parking_lot", 2245 | "percent-encoding", 2246 | "raw-window-handle 0.3.4", 2247 | "scopeguard", 2248 | "smithay-client-toolkit", 2249 | "wayland-client", 2250 | "winapi", 2251 | "x11-dl", 2252 | ] 2253 | 2254 | [[package]] 2255 | name = "winit_input_helper" 2256 | version = "0.10.0" 2257 | source = "registry+https://github.com/rust-lang/crates.io-index" 2258 | checksum = "8d8af691f04e6d8a892e80a2176221b2c13d5832a8929d8c0fed1e3e3d4fe831" 2259 | dependencies = [ 2260 | "winit", 2261 | ] 2262 | 2263 | [[package]] 2264 | name = "x11-dl" 2265 | version = "2.19.1" 2266 | source = "registry+https://github.com/rust-lang/crates.io-index" 2267 | checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" 2268 | dependencies = [ 2269 | "lazy_static", 2270 | "libc", 2271 | "pkg-config", 2272 | ] 2273 | 2274 | [[package]] 2275 | name = "xcursor" 2276 | version = "0.3.4" 2277 | source = "registry+https://github.com/rust-lang/crates.io-index" 2278 | checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" 2279 | dependencies = [ 2280 | "nom 7.1.0", 2281 | ] 2282 | 2283 | [[package]] 2284 | name = "xdg" 2285 | version = "2.4.0" 2286 | source = "registry+https://github.com/rust-lang/crates.io-index" 2287 | checksum = "3a23fe958c70412687039c86f578938b4a0bb50ec788e96bce4d6ab00ddd5803" 2288 | dependencies = [ 2289 | "dirs", 2290 | ] 2291 | 2292 | [[package]] 2293 | name = "xml-rs" 2294 | version = "0.8.4" 2295 | source = "registry+https://github.com/rust-lang/crates.io-index" 2296 | checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" 2297 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "crav" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | audioviz = { version = "0.4.4", features = ["serde"] } 10 | # audioviz = { path = "../audioviz", features = ["serde"] } 11 | 12 | cpal = "0.13.4" 13 | gag = "1.0.0" 14 | clap = "2.33.3" 15 | serde = { version = "1.0.130", features = ["derive"]} 16 | serde_json = "1.0.68" 17 | 18 | # for interpolation in color gradients 19 | splines = "4.0.3" 20 | 21 | # universal wgpu backend 22 | winit = "0.25" 23 | wgpu = "0.11" 24 | bytemuck = { version = "1.4", features = [ "derive" ] } 25 | pollster = "0.2" 26 | winit_input_helper = "0.10.0" 27 | 28 | env_logger = "0.9" 29 | 30 | # termion backend for unix targets 31 | [target.'cfg(target_family = "unix")'.dependencies] 32 | termion = "1.5.6" 33 | 34 | # crossterm backend for windows targets 35 | [target.'cfg(target_family = "windows")'.dependencies] 36 | crossterm = "0.22.1" 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 BrunoWallner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # crav 2 | Console-based Rust Audio Visualizer 3 | 4 | It can run in the terminal but also has a 3D accelerated backend implemented in wgpu. 5 | 6 | ## demo 7 | ![](/media/demo.gif) 8 | 9 | ## compatibility 10 | The terminal backend is currently only working on unix systems, but the wgpu backend should work fine on Windows too. 11 | 12 | ### tested Terminals 13 | | terminal emulator | state | 14 | | ----------------- | ----------------- | 15 | | gnome-terminal | working, but slow | 16 | | kitty | perfectly working | 17 | | alacritty | working, but weird font | 18 | | tty | working, but limited color and bar height accuracy | 19 | | windows-terminals | not working, but WIP | 20 | 21 | ## Keyboard shortcuts 22 | * `+` increases volume 23 | * `-` decreases volume 24 | * `m` toggles mirroring -------------------------------------------------------------------------------- /default_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "audio": { 3 | "processor": { 4 | "sample_rate": 44100, 5 | "frequency_bounds": [ 6 | 50, 7 | 20000 8 | ], 9 | "resolution": null, 10 | "volume": 15.0, 11 | "volume_normalisation": "Mixture", 12 | "position_normalisation": "Harmonic", 13 | "manual_position_distribution": null, 14 | "interpolation": "Cubic" 15 | }, 16 | "fft_resolution": 2048, 17 | "refresh_rate": 90, 18 | "gravity": 100 19 | }, 20 | "mirror_x_achsis": false, 21 | "fps": 60, 22 | "color": { 23 | "Rgb": [ 24 | 200, 25 | 0, 26 | 0 27 | ] 28 | }, 29 | "width": 1, 30 | "spacing": 0, 31 | "mirror": true, 32 | "visualisation": "Spectrum", 33 | "wgpu": { 34 | "transparent": false, 35 | "fullscreen": false, 36 | "decoration": true 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /media/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BrunoWallner/crav/c1aac3f006063927d9fc5149365d04ca064b5399/media/demo.gif -------------------------------------------------------------------------------- /src/backends/audio_to_grid.rs: -------------------------------------------------------------------------------- 1 | use audioviz::audio_capture::capture::{Capture, CaptureReceiver}; 2 | use crate::config::Config; 3 | use crate::backends::GridPixel; 4 | use audioviz::spectrum::stream::{Stream, StreamController}; 5 | 6 | pub enum ConverterType { 7 | Stream(Stream), 8 | Capture(Capture), 9 | } 10 | 11 | pub struct Converter { 12 | conv_type: ConverterType, 13 | raw_buf: Vec, 14 | show_vec: Vec, 15 | pub raw_receiver: Option, 16 | pub stream_controller: Option, 17 | pub config: Config, 18 | pub resolution: usize, 19 | } 20 | impl Converter { 21 | pub fn from_capture(capture: Capture, config: Config) -> Self { 22 | let raw_receiver = capture.get_receiver().unwrap(); 23 | Self { 24 | conv_type: ConverterType::Capture(capture), 25 | raw_buf: Vec::new(), 26 | show_vec: Vec::new(), 27 | raw_receiver: Some(raw_receiver), 28 | stream_controller: None, 29 | config, 30 | resolution: 0, 31 | } 32 | } 33 | 34 | pub fn from_stream(stream: Stream, config: Config) -> Self { 35 | let stream_controller = stream.get_controller(); 36 | Self { 37 | conv_type: ConverterType::Stream(stream), 38 | raw_buf: Vec::new(), 39 | show_vec: Vec::new(), 40 | raw_receiver: None, 41 | stream_controller: Some(stream_controller), 42 | config, 43 | resolution: 0, 44 | } 45 | } 46 | 47 | fn get_data(&mut self) -> Option> { 48 | if let Some(raw) = &self.raw_receiver { 49 | let mut data: Vec = match raw.receive_data() { 50 | Ok(d) => { 51 | let mut b: Vec = Vec::new(); 52 | 53 | let bufs = d.chunks(1); 54 | for buf in bufs { 55 | let mut max: f32 = 0.0; 56 | for value in buf { 57 | let value = value * 30.0 * self.config.audio.processor.volume; 58 | if value > max { 59 | max = value 60 | } 61 | } 62 | b.push(max) 63 | } 64 | b 65 | }, 66 | Err(_) => Vec::new() 67 | }; 68 | self.raw_buf.append(&mut data); 69 | if self.raw_buf.len() >= self.resolution { 70 | self.show_vec = self.raw_buf[0..self.resolution].to_vec(); 71 | self.raw_buf.drain(..); 72 | } 73 | return Some(self.show_vec.clone()); 74 | } 75 | if let Some(stream) = &self.stream_controller { 76 | let freqs = stream.get_frequencies(); 77 | let data: Vec = freqs 78 | .into_iter() 79 | .map(|x| x.volume) 80 | .collect(); 81 | return Some(data); 82 | } 83 | 84 | None 85 | } 86 | 87 | 88 | pub fn gen_grid(&mut self, x_size: u16, y_size: u16) -> Vec> { 89 | let mut buffer: Vec> = vec![vec![GridPixel::Bar(0); x_size as usize]; y_size as usize]; 90 | 91 | let mut data = self.get_data().unwrap_or(Vec::new()); 92 | 93 | if self.config.mirror { 94 | for i in 0..data.len() { 95 | data.insert(0, data[i*2].clone()); 96 | } 97 | } 98 | 99 | let mut screen_x: usize = 0; 100 | //let mut x: usize = 0; 101 | for x in 0..x_size as usize { 102 | if data.len() > x { 103 | let height: usize = data[x].trunc() as usize; 104 | 105 | // can range from 0 to 1, top of bar for 8 times more precision 106 | let precision_top: f32 = data[x] - height as f32; 107 | let precision_bar: u8 = (precision_top * 8.0) as u8 + 1; 108 | //let precision_bar: u8 = 8; 109 | 110 | if self.config.mirror_x_achsis { 111 | for _ in 0..self.config.width { 112 | for y in 0..height { 113 | if buffer.len() > (y_size as usize / 2 + y + 1) && buffer.len() > (y_size as usize / 2 - y) 114 | && buffer[y].len() > screen_x { 115 | // top mirror 116 | buffer[y_size as usize / 2 + y + 1][screen_x] = GridPixel::Bar(8); 117 | 118 | // bottom mirror 119 | buffer[y_size as usize/ 2 - y][screen_x] = GridPixel::Bar(8); 120 | } 121 | } 122 | 123 | // precision bars 124 | if buffer.len() > (y_size as usize / 2 + height + 1) && buffer.len() > (y_size as usize / 2 - height) 125 | && buffer[height].len() > screen_x { 126 | // top 127 | buffer[y_size as usize / 2 + height + 1][screen_x] = GridPixel::Bar(precision_bar); 128 | 129 | // bottom 130 | buffer[y_size as usize / 2 - height][screen_x] = GridPixel::Bar(precision_bar + 8 ); 131 | } 132 | screen_x += 1; 133 | } 134 | } 135 | else { 136 | for _ in 0..self.config.width { 137 | for y in 0..height { 138 | if buffer.len() > y && buffer[y].len() > screen_x { 139 | buffer[y][screen_x] = GridPixel::Bar(8); 140 | } 141 | } 142 | 143 | // precision top bar 144 | if buffer.len() > height && buffer[height].len() > screen_x { 145 | buffer[height][screen_x] = GridPixel::Bar(precision_bar); 146 | } 147 | screen_x += 1; 148 | } 149 | } 150 | screen_x += self.config.spacing as usize; 151 | } 152 | } 153 | 154 | buffer 155 | } 156 | 157 | pub fn set_resolution(&mut self, resolution: usize) { 158 | self.resolution = resolution; 159 | if let Some(stream) = &self.stream_controller { 160 | stream.set_resolution(resolution); 161 | } 162 | } 163 | } -------------------------------------------------------------------------------- /src/backends/crossterm/mod.rs: -------------------------------------------------------------------------------- 1 | use crate::config::{Config, Color}; 2 | use audioviz::spectrum::stream::StreamController; 3 | 4 | pub fn run(mut _config: &mut Config, _audio_controller: StreamController) { 5 | println!("The Windows terminal is currently not supported, as it does not support ANSI escape codes"); 6 | println!("please use the wgpu backend with the '--backend wgpu' parameter"); 7 | } -------------------------------------------------------------------------------- /src/backends/mod.rs: -------------------------------------------------------------------------------- 1 | use crate::config::Config; 2 | 3 | //use audioviz::spectrum::stream::StreamController; 4 | use audioviz::spectrum::Frequency; 5 | 6 | // IDK how to only use 1 #[cfg] per target_family but this should work at least fine 7 | #[cfg(target_family = "unix")] 8 | mod termion; 9 | #[cfg(target_family = "unix")] 10 | use self::termion as terminal; 11 | 12 | #[cfg(target_family = "windows")] 13 | mod crossterm; 14 | #[cfg(target_family = "windows")] 15 | use self::crossterm as terminal; 16 | 17 | mod wgpu; 18 | pub mod audio_to_grid; 19 | 20 | #[allow(dead_code)] 21 | #[derive(Clone, Copy, Debug)] 22 | pub enum GridPixel { 23 | Bar(u8), 24 | Char(char), 25 | } 26 | 27 | pub enum Backend { 28 | Terminal, 29 | Wgpu, 30 | } 31 | impl Backend { 32 | pub fn run(&self, config: &mut Config, converter: audio_to_grid::Converter) { 33 | match self { 34 | Backend::Terminal => { 35 | terminal::run(config, converter); 36 | } 37 | Backend::Wgpu => { 38 | wgpu::run(config, converter); 39 | } 40 | } 41 | } 42 | } 43 | 44 | pub fn get_bar_number(width: u8, spacing: u8, screen_width: u16) -> usize { 45 | if width == 0 {return 1} 46 | (screen_width / (width + spacing) as u16) as usize 47 | } 48 | -------------------------------------------------------------------------------- /src/backends/termion/bars.rs: -------------------------------------------------------------------------------- 1 | use std::io::{StdoutLock, Write}; 2 | use std::error::Error; 3 | use termion::color; 4 | use crate::config::Color; 5 | use std::io::BufWriter; 6 | use crate::backends::GridPixel; 7 | 8 | use audioviz::spectrum::Frequency; 9 | 10 | fn get_lines(width: u16, height: u16, grid: Vec>, color: Color) -> Vec { 11 | let mut lines: Vec = vec![String::new(); height as usize]; 12 | //let calculated_width: usize = get_bar_number(w, spacing, width) * 2; 13 | 14 | match color { 15 | Color::Rgb(color) => { 16 | lines[0].push_str( &format!("{}", color::Fg(color::Rgb(color[0], color[1], color[2]))) ); 17 | for y in 0..height as usize { 18 | for x in 0..width as usize { 19 | let str = u8_to_string(grid[y][x]); 20 | 21 | lines[y].push_str(str.as_str()); 22 | } 23 | } 24 | } 25 | c => { 26 | for y in 0..height as usize { 27 | let ry: f32 = y as f32 / height as f32; 28 | let color = c.to_rgb(ry); 29 | lines[y].push_str(&format!("{}", color::Fg(color::Rgb(color[0], color[1], color[2])))); 30 | for x in 0..width as usize { 31 | if grid[y].len() > x { 32 | let str = u8_to_string(grid[y][x]); 33 | 34 | lines[y].push_str(str.as_str()); 35 | } 36 | } 37 | } 38 | } 39 | } 40 | lines 41 | } 42 | 43 | fn u8_to_string(pixel: GridPixel) -> String { 44 | let str = match pixel { 45 | GridPixel::Bar(b) => { 46 | let pixel= match b { 47 | // top 48 | 0 => " ", 49 | 8 => "█", 50 | 7 => "▇", 51 | 6 => "▆", 52 | 5 => "▅", 53 | 4 => "▄", 54 | 3 => "▃", 55 | 2 => "▂", 56 | 1 => "▁", 57 | // bottom, not the same precision as top 58 | 16 => "█", 59 | 15 => "█", 60 | 14 => "▀", 61 | 13 => "▀", 62 | 12 => "▀", 63 | 11 => "▔", 64 | 10 => "▔", 65 | 9 => "▔", 66 | _ => " ", 67 | }; 68 | pixel.to_string() 69 | } 70 | GridPixel::Char(f) => { 71 | f.to_string() 72 | } 73 | }; 74 | 75 | str.to_string() 76 | } 77 | 78 | pub fn draw( 79 | grid: Vec>, 80 | screen: &mut BufWriter, 81 | size: [u16; 2], 82 | color: Color, 83 | width: u8, 84 | spacing: u8, 85 | mirror_x_achsis: bool, 86 | ) -> Result<(), Box> { 87 | //let calculated_width: u16 = get_bar_number(width, spacing, size[0]) as u16; 88 | 89 | //let grid = gen_grid(size[0], size[1], &data, width, spacing, mirror_x_achsis); 90 | let lines = get_lines(size[0], size[1], grid, color); 91 | 92 | for y in 0..size[1] as usize { 93 | write!( screen, "{}", termion::cursor::Goto(0, size[1] - y as u16) )?; 94 | let line: &str = &lines[y].clone()[..]; // prevents line overflow not implemented rn 95 | write!( screen, "{}", line)?; 96 | } 97 | 98 | Ok(()) 99 | } -------------------------------------------------------------------------------- /src/backends/termion/events.rs: -------------------------------------------------------------------------------- 1 | use std::io; 2 | use std::sync::mpsc; 3 | use std::thread; 4 | use std::time::Duration; 5 | 6 | use termion::event::Key; 7 | use termion::input::TermRead; 8 | 9 | #[derive(Debug, Clone)] 10 | pub enum Event { 11 | Input(I), 12 | Resize( (u16, u16) ), 13 | Tick, 14 | } 15 | pub struct EventHandler { 16 | rx: mpsc::Receiver>, 17 | pub tick_rate: Duration, 18 | } 19 | impl EventHandler { 20 | pub fn new(tick_rate: Duration) -> Self { 21 | let (tx, rx) = mpsc::channel(); 22 | 23 | let tx_clone = tx.clone(); 24 | thread::spawn(move || { 25 | let stdin = io::stdin(); 26 | for evt in stdin.keys() { 27 | match evt { 28 | Ok(key) => tx_clone.send(Event::Input(key)).unwrap(), 29 | Err(_) => (), 30 | } 31 | } 32 | }); 33 | 34 | let tx_clone = tx.clone(); 35 | thread::spawn(move || { 36 | let mut t_size_old = termion::terminal_size().unwrap(); 37 | loop { 38 | let t_size = termion::terminal_size().unwrap(); 39 | if t_size_old != t_size { 40 | tx_clone.send(Event::Resize( (t_size.0, t_size.1) )).unwrap(); 41 | t_size_old = t_size; 42 | } 43 | tx_clone.send(Event::Tick).unwrap(); 44 | thread::sleep(tick_rate); 45 | } 46 | }); 47 | 48 | EventHandler { rx, tick_rate } 49 | } 50 | 51 | pub fn get(&self) -> Option> { 52 | match self.rx.recv() { 53 | Ok(e) => Some(e), 54 | Err(_) => None, 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /src/backends/termion/mod.rs: -------------------------------------------------------------------------------- 1 | mod bars; 2 | mod events; 3 | 4 | use crate::backends::get_bar_number; 5 | use crate::config::Config; 6 | 7 | use std::{io::BufWriter}; 8 | use std::time::Duration; 9 | use termion::event::Key; 10 | 11 | use termion::raw::IntoRawMode; 12 | use termion::screen::AlternateScreen; 13 | use std::io::{Write, stdout}; 14 | 15 | use audioviz::spectrum::stream::StreamController; 16 | 17 | use crate::backends::audio_to_grid::Converter; 18 | 19 | pub fn run(mut config: &mut Config, mut converter: Converter) { 20 | let raw = stdout().into_raw_mode().unwrap(); 21 | let mut screen = AlternateScreen::from(raw); 22 | write!(screen, "{}", termion::cursor::Hide).unwrap(); 23 | write!(screen, "{}", termion::clear::All).unwrap(); 24 | 25 | let ev = events::EventHandler::new(Duration::from_millis(1000 / config.fps)); 26 | 27 | 28 | let (mut width, mut height) = termion::terminal_size().unwrap(); 29 | 30 | let mut bar_number: usize = get_bar_number(config.width, config.spacing, width); 31 | if config.mirror {bar_number /= 2} 32 | converter.set_resolution(bar_number); 33 | 34 | 'main: loop { 35 | let mut screen = BufWriter::new(screen.lock()); 36 | 37 | let grid = converter.gen_grid(width, height); 38 | bars::draw( 39 | grid, 40 | &mut screen, 41 | [width, height], 42 | config.color.clone(), 43 | config.width, 44 | config.spacing, 45 | config.mirror_x_achsis 46 | ).unwrap(); 47 | 48 | screen.flush().unwrap(); 49 | 50 | match ev.get().unwrap() { 51 | events::Event::Input(input) => match input { 52 | Key::Char('q') => break 'main, 53 | _ => (), 54 | } 55 | events::Event::Resize( (w, h)) => { 56 | width = w; 57 | height = h; 58 | 59 | let mut bar_number: usize = get_bar_number(config.width, config.spacing, w); 60 | if config.mirror {bar_number /= 2} 61 | converter.set_resolution(bar_number); 62 | write!(screen, "{}", termion::clear::All).unwrap(); 63 | } 64 | _ => (), 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /src/backends/wgpu/mesh.rs: -------------------------------------------------------------------------------- 1 | use crate::backends::wgpu::Vertex; 2 | use crate::config::{Config, Color}; 3 | use crate::backends::GridPixel; 4 | 5 | use crate::backends::wgpu::{PIXEL_WIDTH, PIXEL_HEIGHT}; 6 | 7 | use audioviz::spectrum::Frequency; 8 | 9 | pub fn from_buffer( 10 | grid: Vec>, 11 | config: &Config, 12 | window_size: (u32, u32), 13 | mirror_x_achsis: bool, 14 | ) -> (Vec, Vec) { 15 | let (w, h) = ( (window_size.0 / PIXEL_WIDTH as u32) as u16, (window_size.1 / PIXEL_HEIGHT as u32) as u16 ); 16 | let width = 1.0 / w as f32 * 2.0; // * 2.0 because wgpu goes from -1 to 1 17 | 18 | //let w: u16 = get_bar_number(config.width, config.spacing, w) as u16; // calculates width further 19 | 20 | let mut vertices: Vec = Vec::new(); 21 | let mut indices: Vec = Vec::new(); 22 | 23 | if grid.is_empty() { 24 | return (Vec::new(), Vec::new()); 25 | } 26 | 27 | /* 28 | let grid = gen_grid( 29 | w, 30 | h, 31 | &buffer, 32 | config.width, 33 | config.spacing, 34 | mirror_x_achsis 35 | ); 36 | */ 37 | 38 | for y in 0..h as usize { 39 | let color_clone = config.color.clone(); 40 | let color: [f32; 3] = match color_clone { 41 | Color::Rgb(c) => [ 42 | (c[0] as f32 / 255.0).powf(2.2), 43 | (c[1] as f32 / 255.0).powf(2.2), 44 | (c[2] as f32 / 255.0).powf(2.2), 45 | ], 46 | c => { 47 | let c = c.to_rgb(y as f32 / h as f32); 48 | [ 49 | (c[0] as f32 / 255.0).powf(2.2), 50 | (c[1] as f32 / 255.0).powf(2.2), 51 | (c[2] as f32 / 255.0).powf(2.2), 52 | ] 53 | } 54 | }; 55 | 56 | for x in 0..w as usize { 57 | let precision_height: f32 = match grid[y][x] { 58 | GridPixel::Bar(bar_height) => { 59 | //bar_height as f32 * (1.0 / h as f32) / 8.0 * 2.0 60 | let part = match bar_height { 61 | // top 62 | 0 => 0, 63 | 8 => 8, 64 | 7 => 7, 65 | 6 => 6, 66 | 5 => 5, 67 | 4 => 4, 68 | 3 => 3, 69 | 2 => 2, 70 | 1 => 1, 71 | // bottom 72 | 16 => -8, 73 | 15 => -7, 74 | 14 => -6, 75 | 13 => -5, 76 | 12 => -4, 77 | 11 => -3, 78 | 10 => -2, 79 | 9 => -1, 80 | _ => 0, 81 | }; 82 | part as f32 / h as f32 / 4.0 83 | } 84 | GridPixel::Char(_) => 0.0 85 | }; 86 | 87 | //let x = ((x as f32 / w as f32) * (config.spacing + config.width) as f32) 88 | // * 2.0 - 1.0; // because wgpu goes from -1 to 1 89 | 90 | let x = (x as f32 / w as f32) * 2.0 - 1.0; 91 | 92 | let y = y as f32 / h as f32 * 2.0 - 1.0; 93 | 94 | /* 95 | if precision_height < 0.0 { 96 | vertices.push(Vertex { position: [x, y + precision_height, 0.0], color}); 97 | vertices.push(Vertex { position: [x + width, y + precision_height, 0.0], color}); 98 | 99 | vertices.push(Vertex { position: [x, y + (2.0 / h as f32), 0.0], color}); 100 | vertices.push(Vertex { position: [x + width, y+ (2.0 / h as f32), 0.0], color}); 101 | } else { 102 | vertices.push(Vertex { position: [x, y, 0.0], color}); 103 | vertices.push(Vertex { position: [x + width, y, 0.0], color}); 104 | 105 | vertices.push(Vertex { position: [x, y + precision_height, 0.0], color}); 106 | vertices.push(Vertex { position: [x + width, y + precision_height, 0.0], color}); 107 | } 108 | */ 109 | let (y1, y2) = if precision_height >= 0.0 { 110 | let h: f32 = 1.0 / h as f32 * 2.0; 111 | let y_start = y - h; 112 | (y_start, y_start + precision_height) 113 | } else { 114 | (y + precision_height, y) 115 | }; 116 | 117 | vertices.push(Vertex { position: [x, y1, 0.0], color}); 118 | vertices.push(Vertex { position: [x + width, y1, 0.0], color}); 119 | 120 | vertices.push(Vertex { position: [x, y2, 0.0], color}); 121 | vertices.push(Vertex { position: [x + width, y2, 0.0], color}); 122 | 123 | let i = vertices.len() as u32 - 4; 124 | indices.push(i+0); 125 | indices.push(i+3); 126 | indices.push(i+2); 127 | indices.push(i+0); 128 | indices.push(i+1); 129 | indices.push(i+3); 130 | } 131 | } 132 | 133 | return (vertices, indices); 134 | } 135 | -------------------------------------------------------------------------------- /src/backends/wgpu/mod.rs: -------------------------------------------------------------------------------- 1 | mod state; 2 | mod mesh; 3 | 4 | use state::Vertex; 5 | use crate::backends::get_bar_number; 6 | 7 | use crate::config::{Config}; 8 | 9 | use winit::{ 10 | event::*, 11 | event_loop::{ControlFlow, EventLoop}, 12 | window::WindowBuilder, 13 | window::Fullscreen, 14 | }; 15 | //use winit_input_helper::WinitInputHelper; 16 | 17 | //use audioviz::spectrum::stream::StreamController; 18 | 19 | use crate::backends::audio_to_grid::Converter; 20 | 21 | pub const PIXEL_WIDTH: u16 = 9; 22 | pub const PIXEL_HEIGHT: u16 = 18; 23 | 24 | pub fn run(config: &mut Config, converter: Converter) { 25 | let event_loop = EventLoop::new(); 26 | let window = WindowBuilder::new() 27 | .with_transparent(config.wgpu.transparent) 28 | .with_decorations(config.wgpu.decoration) 29 | .with_title("crav") 30 | .build(&event_loop) 31 | .unwrap(); 32 | 33 | if config.wgpu.fullscreen { 34 | window.set_fullscreen(Some(Fullscreen::Borderless(None))); 35 | } 36 | //let a_c = audio_controller.clone(); 37 | 38 | let mut state = pollster::block_on(state::State::new(&window, converter, config.clone() )); 39 | 40 | // let mut input = WinitInputHelper::new(); 41 | let config = config.clone(); 42 | event_loop.run(move |event, _, control_flow| { 43 | /* 44 | if input.update(&event) { 45 | if input.key_pressed(VirtualKeyCode::Plus) || input.key_pressed(VirtualKeyCode::NumpadAdd) { 46 | audio_controller.adjust_volume(1.1); 47 | } 48 | if input.key_pressed(VirtualKeyCode::Minus) || input.key_pressed(VirtualKeyCode::NumpadSubtract) { 49 | audio_controller.adjust_volume(0.9); 50 | } 51 | if input.key_pressed(VirtualKeyCode::M) { 52 | state.config.mirror = !state.config.mirror; 53 | 54 | let screen_width = state.size.width as u16 / PIXEL_WIDTH; 55 | let mut bar_number = get_bar_number(config.width, config.spacing, screen_width) as usize; 56 | if state.config.mirror {bar_number /= 2} 57 | audio_controller.set_resolution(bar_number); 58 | } 59 | } 60 | */ 61 | 62 | 63 | match event { 64 | Event::WindowEvent { 65 | ref event, 66 | window_id, 67 | } if window_id == window.id() => if !state.input(event) { // UPDATED! 68 | match event { 69 | WindowEvent::CloseRequested 70 | | WindowEvent::KeyboardInput { 71 | input: 72 | KeyboardInput { 73 | state: ElementState::Pressed, 74 | virtual_keycode: Some(VirtualKeyCode::Q), 75 | .. 76 | }, 77 | .. 78 | } => *control_flow = ControlFlow::Exit, 79 | WindowEvent::Resized(physical_size) => { 80 | state.resize(*physical_size); 81 | } 82 | WindowEvent::ScaleFactorChanged { new_inner_size, .. } => { 83 | state.resize(**new_inner_size); 84 | } 85 | _ => {} 86 | } 87 | } 88 | winit::event::Event::RedrawRequested(_) => { 89 | state.update(); 90 | match state.render() { 91 | Ok(_) => {} 92 | // Reconfigure the surface if lost 93 | Err(wgpu::SurfaceError::Lost) => state.resize(state.size), 94 | // The system is out of memory, we should probably quit 95 | Err(wgpu::SurfaceError::OutOfMemory) => *control_flow = ControlFlow::Exit, 96 | // All other errors (Outdated, Timeout) should be resolved by the next frame 97 | Err(e) => eprintln!("{:?}", e), 98 | } 99 | } 100 | winit::event::Event::MainEventsCleared => { 101 | // RedrawRequested will only trigger once, unless we manually 102 | // request it. 103 | window.request_redraw(); 104 | } 105 | _ => {} 106 | } 107 | }); 108 | } 109 | -------------------------------------------------------------------------------- /src/backends/wgpu/shader.wgsl: -------------------------------------------------------------------------------- 1 | // Vertex shader 2 | 3 | struct VertexInput { 4 | [[location(0)]] position: vec3; 5 | [[location(1)]] color: vec3; 6 | }; 7 | 8 | struct VertexOutput { 9 | [[builtin(position)]] clip_position: vec4; 10 | [[location(0)]] color: vec3; 11 | }; 12 | 13 | [[stage(vertex)]] 14 | fn main( 15 | model: VertexInput, 16 | ) -> VertexOutput { 17 | var out: VertexOutput; 18 | out.color = model.color; 19 | out.clip_position = vec4(model.position, 1.0); 20 | return out; 21 | } 22 | 23 | // Fragment shader 24 | 25 | [[stage(fragment)]] 26 | fn main(in: VertexOutput) -> [[location(0)]] vec4 { 27 | return vec4(in.color, 1.0); 28 | } 29 | -------------------------------------------------------------------------------- /src/backends/wgpu/state.rs: -------------------------------------------------------------------------------- 1 | use winit::window::Window; 2 | use wgpu::util::DeviceExt; 3 | 4 | use crate::config::Config; 5 | 6 | use crate::backends::wgpu::{PIXEL_WIDTH, PIXEL_HEIGHT, mesh}; 7 | use crate::backends::{get_bar_number}; 8 | 9 | use audioviz::spectrum::stream::StreamController; 10 | 11 | use crate::backends::audio_to_grid::Converter; 12 | 13 | #[repr(C)] 14 | #[derive(Copy, Clone, Debug, bytemuck::Pod, bytemuck::Zeroable)] 15 | pub struct Vertex { 16 | pub position: [f32; 3], 17 | pub color: [f32; 3], 18 | } 19 | impl Vertex { 20 | fn desc<'a>() -> wgpu::VertexBufferLayout<'a> { 21 | wgpu::VertexBufferLayout { 22 | array_stride: std::mem::size_of::() as wgpu::BufferAddress, 23 | step_mode: wgpu::VertexStepMode::Vertex, 24 | attributes: &[ 25 | wgpu::VertexAttribute { 26 | offset: 0, 27 | shader_location: 0, 28 | format: wgpu::VertexFormat::Float32x3, 29 | }, 30 | wgpu::VertexAttribute { 31 | offset: std::mem::size_of::<[f32; 3]>() as wgpu::BufferAddress, 32 | shader_location: 1, 33 | format: wgpu::VertexFormat::Float32x3, 34 | } 35 | ] 36 | } 37 | } 38 | } 39 | 40 | pub struct State { 41 | surface: wgpu::Surface, 42 | device: wgpu::Device, 43 | queue: wgpu::Queue, 44 | surface_config: wgpu::SurfaceConfiguration, 45 | pub size: winit::dpi::PhysicalSize, 46 | render_pipeline: wgpu::RenderPipeline, 47 | vertex_buffer: wgpu::Buffer, 48 | num_indices: u32, 49 | index_buffer: wgpu::Buffer, 50 | pub converter: Converter, 51 | pub config: Config, 52 | } 53 | 54 | impl State { 55 | // Creating some of the wgpu types requires async code 56 | pub async fn new(window: &Window, mut converter: Converter, config: Config) -> Self { 57 | let size = window.inner_size(); 58 | 59 | let screen_width = size.width as u16 / PIXEL_WIDTH; 60 | let mut bar_number = get_bar_number(config.width, config.spacing, screen_width) as usize; 61 | if config.mirror {bar_number /= 2} 62 | converter.set_resolution(bar_number); 63 | 64 | // The instance is a handle to our GPU 65 | // BackendBit::PRIMARY => Vulkan + Metal + DX12 + Browser WebGPU 66 | let instance = wgpu::Instance::new(wgpu::Backends::all()); 67 | let surface = unsafe { instance.create_surface(window) }; 68 | let adapter = instance.request_adapter( 69 | &wgpu::RequestAdapterOptions { 70 | power_preference: wgpu::PowerPreference::default(), 71 | compatible_surface: Some(&surface), 72 | force_fallback_adapter: false, 73 | }, 74 | ).await.unwrap(); 75 | 76 | let (device, queue) = adapter.request_device( 77 | &wgpu::DeviceDescriptor { 78 | features: wgpu::Features::empty(), 79 | limits: wgpu::Limits::default(), 80 | label: None, 81 | }, 82 | None, // Trace path 83 | ).await.unwrap(); 84 | 85 | let surface_config = wgpu::SurfaceConfiguration { 86 | usage: wgpu::TextureUsages::RENDER_ATTACHMENT, 87 | format: surface.get_preferred_format(&adapter).unwrap(), 88 | width: size.width, 89 | height: size.height, 90 | present_mode: wgpu::PresentMode::Fifo, 91 | }; 92 | surface.configure(&device, &surface_config); 93 | 94 | let shader = device.create_shader_module(&wgpu::ShaderModuleDescriptor { 95 | label: Some("Shader"), 96 | //flags: wgpu::ShaderFlags::all(), // very weird behavior, could be the fault of rust nightly but I am not sure 97 | source: wgpu::ShaderSource::Wgsl(include_str!("shader.wgsl").into()), 98 | }); 99 | 100 | let render_pipeline_layout = 101 | device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { 102 | label: Some("Render Pipeline Layout"), 103 | bind_group_layouts: &[], 104 | push_constant_ranges: &[], 105 | }); 106 | 107 | let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { 108 | label: Some("Render Pipeline"), 109 | layout: Some(&render_pipeline_layout), 110 | vertex: wgpu::VertexState { 111 | module: &shader, 112 | entry_point: "main", // 1. 113 | buffers: &[ 114 | Vertex::desc(), 115 | ], 116 | }, 117 | fragment: Some(wgpu::FragmentState { // 3. 118 | module: &shader, 119 | entry_point: "main", 120 | targets: &[wgpu::ColorTargetState { // 4. 121 | format: surface_config.format, 122 | blend: Some(wgpu::BlendState::REPLACE), 123 | write_mask: wgpu::ColorWrites::ALL, 124 | }], 125 | }), 126 | primitive: wgpu::PrimitiveState { 127 | topology: wgpu::PrimitiveTopology::TriangleList, // 1. 128 | strip_index_format: None, 129 | front_face: wgpu::FrontFace::Ccw, // 2. 130 | cull_mode: Some(wgpu::Face::Back), 131 | // Setting this to anything other than Fill requires Features::NON_FILL_POLYGON_MODE 132 | polygon_mode: wgpu::PolygonMode::Fill, 133 | // Requires Features::DEPTH_CLAMPING 134 | clamp_depth: false, 135 | // Requires Features::CONSERVATIVE_RASTERIZATION 136 | conservative: false, 137 | }, 138 | depth_stencil: None, // 1. 139 | multisample: wgpu::MultisampleState { 140 | count: 1, // 2. 141 | mask: !0, // 3. 142 | alpha_to_coverage_enabled: false, // 4. 143 | }, 144 | }); 145 | 146 | let vertex_buffer = device.create_buffer_init( 147 | &wgpu::util::BufferInitDescriptor { 148 | label: Some("Vertex Buffer"), 149 | //contents: bytemuck::cast_slice(&[]), 150 | contents: &[], 151 | usage: wgpu::BufferUsages::VERTEX, 152 | } 153 | ); 154 | 155 | let index_buffer = device.create_buffer_init( 156 | &wgpu::util::BufferInitDescriptor { 157 | label: Some("Index Buffer"), 158 | //contents: bytemuck::cast_slice(INDICES), 159 | contents: &[], 160 | usage: wgpu::BufferUsages::INDEX, 161 | } 162 | ); 163 | 164 | 165 | Self { 166 | surface, 167 | device, 168 | queue, 169 | surface_config, 170 | size, 171 | render_pipeline, 172 | vertex_buffer, 173 | num_indices: 0, 174 | index_buffer, 175 | converter, 176 | config, 177 | } 178 | } 179 | 180 | pub fn resize(&mut self, new_size: winit::dpi::PhysicalSize) { 181 | if new_size.width > 0 && new_size.height > 0 { 182 | self.size = new_size; 183 | self.surface_config.width = new_size.width; 184 | self.surface_config.height = new_size.height; 185 | self.surface.configure(&self.device, &self.surface_config); 186 | 187 | let screen_width = self.size.width as u16 / PIXEL_WIDTH; 188 | let mut bar_number = get_bar_number(self.config.width, self.config.spacing, screen_width) as usize; 189 | if self.config.mirror {bar_number /= 2} 190 | self.converter.set_resolution(bar_number); 191 | } 192 | } 193 | 194 | pub fn input(&mut self, _event: &winit::event::WindowEvent) -> bool { 195 | false 196 | } 197 | 198 | pub fn update(&mut self) { 199 | let (w, h) = ( (self.size.width / PIXEL_WIDTH as u32) as u16, (self.size.height / PIXEL_HEIGHT as u32) as u16 ); 200 | let (vertices, indices) = mesh::from_buffer( 201 | self.converter.gen_grid(w, h), 202 | &self.config, 203 | (self.size.width, self.size.height), 204 | self.config.mirror_x_achsis, 205 | ); 206 | 207 | self.num_indices = indices.len() as u32; 208 | 209 | let vertex_buffer = self.device.create_buffer_init( 210 | &wgpu::util::BufferInitDescriptor { 211 | label: Some("Vertex Buffer"), 212 | contents: bytemuck::cast_slice(&vertices), 213 | usage: wgpu::BufferUsages::VERTEX, 214 | } 215 | ); 216 | let index_buffer = self.device.create_buffer_init( 217 | &wgpu::util::BufferInitDescriptor { 218 | label: Some("Index Buffer"), 219 | contents: bytemuck::cast_slice(&indices), 220 | usage: wgpu::BufferUsages::INDEX, 221 | } 222 | ); 223 | 224 | self.vertex_buffer = vertex_buffer; 225 | self.index_buffer = index_buffer; 226 | } 227 | 228 | pub fn render(&mut self) -> Result<(), wgpu::SurfaceError> { 229 | let output = self.surface.get_current_texture()?; 230 | let view = output.texture.create_view(&wgpu::TextureViewDescriptor::default()); 231 | let mut encoder = self.device.create_command_encoder(&wgpu::CommandEncoderDescriptor { 232 | label: Some("Render Encoder"), 233 | }); 234 | 235 | { 236 | // 1. 237 | let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { 238 | label: Some("Render Pass"), 239 | color_attachments: &[ 240 | // This is what [[location(0)]] in the fragment shader targets 241 | wgpu::RenderPassColorAttachment { 242 | view: &view, 243 | resolve_target: None, 244 | ops: wgpu::Operations { 245 | load: wgpu::LoadOp::Clear( 246 | if self.config.wgpu.transparent { 247 | wgpu::Color::TRANSPARENT 248 | } else { 249 | wgpu::Color::BLACK 250 | } 251 | ), 252 | store: true, 253 | } 254 | } 255 | ], 256 | depth_stencil_attachment: None, 257 | }); 258 | 259 | // NEW! 260 | render_pass.set_pipeline(&self.render_pipeline); 261 | render_pass.set_vertex_buffer(0, self.vertex_buffer.slice(..)); 262 | render_pass.set_index_buffer(self.index_buffer.slice(..), wgpu::IndexFormat::Uint32); // 1. 263 | render_pass.draw_indexed(0..self.num_indices, 0, 0..1); // 2. 264 | } 265 | 266 | // submit will accept anything that implements IntoIter 267 | self.queue.submit(std::iter::once(encoder.finish())); 268 | output.present(); 269 | 270 | Ok(()) 271 | } 272 | } -------------------------------------------------------------------------------- /src/config.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | use splines::{Interpolation, Key, Spline}; // for interpolation in color gradients 3 | 4 | #[derive(Serialize, Deserialize, Debug, Clone)] 5 | pub enum Visualisation { 6 | Spectrum, 7 | Scope 8 | } 9 | 10 | #[derive(Serialize, Deserialize, Debug, Clone)] 11 | pub struct Config { 12 | pub audio: audioviz::spectrum::config::StreamConfig, 13 | pub mirror_x_achsis: bool, 14 | pub fps: u64, 15 | pub color: Color, 16 | pub width: u8, 17 | pub spacing: u8, 18 | pub mirror: bool, 19 | pub visualisation: Visualisation, 20 | pub wgpu: WgpuConfig, 21 | } 22 | impl Default for Config { 23 | fn default() -> Self { 24 | Config { 25 | audio: audioviz::spectrum::config::StreamConfig { 26 | gravity: Some(100.0), 27 | ..Default::default() 28 | }, 29 | mirror_x_achsis: true, 30 | fps: 60, 31 | color: Color::Gradient(vec![[155, 0, 255], [0, 30, 255], [0, 255, 60]]), 32 | width: 1, 33 | spacing: 0, 34 | mirror: true, 35 | visualisation: Visualisation::Spectrum, 36 | wgpu: WgpuConfig::default(), 37 | } 38 | } 39 | } 40 | 41 | #[derive(Serialize, Deserialize, Debug, Clone)] 42 | pub enum Color { 43 | Gradient(Vec<[u8; 3]>), 44 | Rgb([u8; 3]), 45 | } 46 | impl Color { 47 | pub fn to_rgb(&self, relative_y: f32) -> [u8; 3] { 48 | match self { 49 | // It may be unclean to recreate the spline everytime, but I want to avoid to rewrite too much for 50 | // every backend, and the performance penalty is not too big. (0µs, 0% cpu usage difference) 51 | Color::Gradient(g) => { 52 | let mut r_points: Vec> = Vec::new(); 53 | let mut g_points: Vec> = Vec::new(); 54 | let mut b_points: Vec> = Vec::new(); 55 | 56 | let step: f32 = 1.0_f32 / g.len() as f32; 57 | for (i, color) in g.iter().enumerate() { 58 | r_points.push(Key::new( 59 | (i as f32 + (step * 1.5)) * step, 60 | color[0] as f32, 61 | Interpolation::Linear, 62 | )); 63 | g_points.push(Key::new( 64 | (i as f32 + (step * 1.5)) * step, 65 | color[1] as f32, 66 | Interpolation::Linear, 67 | )); 68 | b_points.push(Key::new( 69 | (i as f32 + (step * 1.5)) * step, 70 | color[2] as f32, 71 | Interpolation::Linear, 72 | )); 73 | } 74 | let r_spline = Spline::from_vec(r_points); 75 | let g_spline = Spline::from_vec(g_points); 76 | let b_spline = Spline::from_vec(b_points); 77 | 78 | [ 79 | r_spline.clamped_sample(relative_y).unwrap_or(0.0) as u8, 80 | g_spline.clamped_sample(relative_y).unwrap_or(0.0) as u8, 81 | b_spline.clamped_sample(relative_y).unwrap_or(0.0) as u8, 82 | ] 83 | } 84 | Color::Rgb(c) => *c, 85 | } 86 | } 87 | } 88 | 89 | #[derive(Serialize, Deserialize, Debug, Clone)] 90 | pub struct WgpuConfig { 91 | pub transparent: bool, 92 | pub fullscreen: bool, 93 | pub decoration: bool, 94 | } 95 | impl Default for WgpuConfig { 96 | fn default() -> Self { 97 | WgpuConfig { 98 | transparent: false, 99 | fullscreen: false, 100 | decoration: true, 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use std::error::Error; 2 | mod backends; 3 | mod config; 4 | 5 | use audioviz::audio_capture::{config::Config as CaptureConfig, capture::Capture}; 6 | use audioviz::spectrum::stream::{Stream, StreamController}; 7 | 8 | #[allow(unused_imports)] 9 | use gag::Gag; 10 | 11 | use clap::{Arg, App, AppSettings}; 12 | use std::fs; 13 | 14 | use backends::audio_to_grid::Converter; 15 | 16 | 17 | fn main() -> Result<(), Box> { 18 | env_logger::init(); 19 | 20 | let matches = App::new("audiovis") 21 | .version("0.1.0") 22 | .author("Luca Biendl ") 23 | .about("tool to visualize audio") 24 | .setting(AppSettings::ColorAlways) 25 | .setting(AppSettings::ColoredHelp) 26 | 27 | 28 | .arg(Arg::with_name("backend") 29 | .short("b") 30 | .long("backend") 31 | .takes_value(true) 32 | .help("can be Termion or Wgpu")) 33 | 34 | .arg(Arg::with_name("config") 35 | .short("c") 36 | .long("config") 37 | .takes_value(true) 38 | .help("path of config")) 39 | 40 | .arg(Arg::with_name("print_config") 41 | .short("p") 42 | .long("print-config") 43 | .takes_value(false) 44 | .help("prints default config to './default_config.json'")) 45 | 46 | .get_matches(); 47 | 48 | let backend: backends::Backend = match matches.value_of("backend") { 49 | Some(b) => match b.to_lowercase().as_str() { 50 | "terminal" | "t" | "term" => backends::Backend::Terminal, 51 | "wgpu" | "w" => backends::Backend::Wgpu, 52 | _ => panic!("invalid backend") 53 | } 54 | None => backends::Backend::Terminal, 55 | }; 56 | 57 | if matches.is_present("print_config") { 58 | let config = config::Config::default(); 59 | let c_str = serde_json::to_string_pretty(&config).unwrap(); 60 | println!("{}", c_str); 61 | fs::write("./default_config.json", c_str.as_bytes()).unwrap(); 62 | std::process::exit(0); 63 | } 64 | 65 | //let mut config = config::Config::default(); 66 | 67 | let mut config: config::Config = match matches.value_of("config") { 68 | Some(p) => { 69 | let c_str = match fs::read(p) { 70 | Ok(c) => c, 71 | Err(e) => { 72 | println!("{}", e); 73 | std::process::exit(1); 74 | } 75 | }; 76 | match serde_json::from_slice(&c_str[..]) { 77 | Ok(c) => c, 78 | Err(e) => { 79 | println!("invalid config: {}", e); 80 | std::process::exit(1); 81 | } 82 | } 83 | } 84 | None => { 85 | config::Config { 86 | audio: audioviz::spectrum::config::StreamConfig { 87 | processor: audioviz::spectrum::config::ProcessorConfig { 88 | volume: 4.0, 89 | ..Default::default() 90 | }, 91 | gravity: Some(35.0), 92 | ..Default::default() 93 | }, 94 | ..Default::default() 95 | } 96 | } 97 | }; 98 | 99 | /* 100 | let audio_capture_config = CaptureConfig { 101 | latency: Some(1000), 102 | ..Default::default() 103 | }; 104 | let capture = Capture::init(audio_capture_config) 105 | .unwrap(); 106 | let audio = Stream::init_with_capture(&capture, config.audio.clone()); 107 | let audio_controller: StreamController = audio.get_controller(); 108 | */ 109 | let audio_capture_config = CaptureConfig::default(); 110 | let capture = Capture::init(audio_capture_config).unwrap(); 111 | let converter: Converter = match config.visualisation { 112 | config::Visualisation::Spectrum => { 113 | let stream = Stream::init_with_capture(&capture, config.audio.clone()); 114 | 115 | Converter::from_stream(stream, config.clone()) 116 | }, 117 | config::Visualisation::Scope => { 118 | Converter::from_capture(capture, config.clone()) 119 | } 120 | }; 121 | 122 | 123 | backend.run(&mut config, converter); 124 | Ok(()) 125 | } 126 | --------------------------------------------------------------------------------