Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add gRPC API, prost build and UI refactor

+10426 -268
+439 -20
gpui/Cargo.lock
··· 430 430 ] 431 431 432 432 [[package]] 433 + name = "async-stream" 434 + version = "0.3.6" 435 + source = "registry+https://github.com/rust-lang/crates.io-index" 436 + checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" 437 + dependencies = [ 438 + "async-stream-impl", 439 + "futures-core", 440 + "pin-project-lite", 441 + ] 442 + 443 + [[package]] 444 + name = "async-stream-impl" 445 + version = "0.3.6" 446 + source = "registry+https://github.com/rust-lang/crates.io-index" 447 + checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" 448 + dependencies = [ 449 + "proc-macro2", 450 + "quote", 451 + "syn 2.0.117", 452 + ] 453 + 454 + [[package]] 433 455 name = "async-task" 434 456 version = "4.7.1" 435 457 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 521 543 ] 522 544 523 545 [[package]] 546 + name = "axum" 547 + version = "0.7.9" 548 + source = "registry+https://github.com/rust-lang/crates.io-index" 549 + checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" 550 + dependencies = [ 551 + "async-trait", 552 + "axum-core", 553 + "bytes", 554 + "futures-util", 555 + "http", 556 + "http-body", 557 + "http-body-util", 558 + "itoa", 559 + "matchit", 560 + "memchr", 561 + "mime", 562 + "percent-encoding", 563 + "pin-project-lite", 564 + "rustversion", 565 + "serde", 566 + "sync_wrapper", 567 + "tower 0.5.3", 568 + "tower-layer", 569 + "tower-service", 570 + ] 571 + 572 + [[package]] 573 + name = "axum-core" 574 + version = "0.4.5" 575 + source = "registry+https://github.com/rust-lang/crates.io-index" 576 + checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" 577 + dependencies = [ 578 + "async-trait", 579 + "bytes", 580 + "futures-util", 581 + "http", 582 + "http-body", 583 + "http-body-util", 584 + "mime", 585 + "pin-project-lite", 586 + "rustversion", 587 + "sync_wrapper", 588 + "tower-layer", 589 + "tower-service", 590 + ] 591 + 592 + [[package]] 524 593 name = "base64" 525 594 version = "0.22.1" 526 595 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 794 863 checksum = "eadd868a2ce9ca38de7eeafdcec9c7065ef89b42b32f0839278d55f35c54d1ff" 795 864 dependencies = [ 796 865 "heck 0.4.1", 797 - "indexmap", 866 + "indexmap 2.14.0", 798 867 "log", 799 868 "proc-macro2", 800 869 "quote", ··· 1676 1745 checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" 1677 1746 1678 1747 [[package]] 1748 + name = "fixedbitset" 1749 + version = "0.5.7" 1750 + source = "registry+https://github.com/rust-lang/crates.io-index" 1751 + checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" 1752 + 1753 + [[package]] 1679 1754 name = "flate2" 1680 1755 version = "1.1.9" 1681 1756 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2203 2278 source = "registry+https://github.com/rust-lang/crates.io-index" 2204 2279 checksum = "ae39dc6d3d201be97e4bc08d96dbef2bc5b5c3d5734e05786e8cc3043342351c" 2205 2280 dependencies = [ 2206 - "indexmap", 2281 + "indexmap 2.14.0", 2207 2282 "rustc-hash 2.1.2", 2208 2283 ] 2209 2284 ··· 2366 2441 "futures-core", 2367 2442 "futures-sink", 2368 2443 "http", 2369 - "indexmap", 2444 + "indexmap 2.14.0", 2370 2445 "slab", 2371 2446 "tokio", 2372 2447 "tokio-util", ··· 2384 2459 "num-traits", 2385 2460 "zerocopy", 2386 2461 ] 2462 + 2463 + [[package]] 2464 + name = "hashbrown" 2465 + version = "0.12.3" 2466 + source = "registry+https://github.com/rust-lang/crates.io-index" 2467 + checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 2387 2468 2388 2469 [[package]] 2389 2470 name = "hashbrown" ··· 2514 2595 checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" 2515 2596 2516 2597 [[package]] 2598 + name = "httpdate" 2599 + version = "1.0.3" 2600 + source = "registry+https://github.com/rust-lang/crates.io-index" 2601 + checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 2602 + 2603 + [[package]] 2517 2604 name = "hyper" 2518 2605 version = "1.9.0" 2519 2606 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2527 2614 "http", 2528 2615 "http-body", 2529 2616 "httparse", 2617 + "httpdate", 2530 2618 "itoa", 2531 2619 "pin-project-lite", 2532 2620 "smallvec", ··· 2548 2636 "tokio", 2549 2637 "tokio-rustls", 2550 2638 "tower-service", 2639 + "webpki-roots", 2640 + ] 2641 + 2642 + [[package]] 2643 + name = "hyper-timeout" 2644 + version = "0.5.2" 2645 + source = "registry+https://github.com/rust-lang/crates.io-index" 2646 + checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" 2647 + dependencies = [ 2648 + "hyper", 2649 + "hyper-util", 2650 + "pin-project-lite", 2651 + "tokio", 2652 + "tower-service", 2551 2653 ] 2552 2654 2553 2655 [[package]] ··· 2556 2658 source = "registry+https://github.com/rust-lang/crates.io-index" 2557 2659 checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" 2558 2660 dependencies = [ 2661 + "base64", 2559 2662 "bytes", 2560 2663 "futures-channel", 2561 2664 "futures-util", 2562 2665 "http", 2563 2666 "http-body", 2564 2667 "hyper", 2668 + "ipnet", 2565 2669 "libc", 2670 + "percent-encoding", 2566 2671 "pin-project-lite", 2567 - "socket2", 2672 + "socket2 0.6.3", 2568 2673 "tokio", 2569 2674 "tower-service", 2570 2675 "tracing", ··· 2727 2832 2728 2833 [[package]] 2729 2834 name = "indexmap" 2835 + version = "1.9.3" 2836 + source = "registry+https://github.com/rust-lang/crates.io-index" 2837 + checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 2838 + dependencies = [ 2839 + "autocfg", 2840 + "hashbrown 0.12.3", 2841 + ] 2842 + 2843 + [[package]] 2844 + name = "indexmap" 2730 2845 version = "2.14.0" 2731 2846 source = "registry+https://github.com/rust-lang/crates.io-index" 2732 2847 checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" ··· 2793 2908 version = "2.12.0" 2794 2909 source = "registry+https://github.com/rust-lang/crates.io-index" 2795 2910 checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" 2911 + 2912 + [[package]] 2913 + name = "iri-string" 2914 + version = "0.7.12" 2915 + source = "registry+https://github.com/rust-lang/crates.io-index" 2916 + checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" 2917 + dependencies = [ 2918 + "memchr", 2919 + "serde", 2920 + ] 2796 2921 2797 2922 [[package]] 2798 2923 name = "is-docker" ··· 3119 3244 ] 3120 3245 3121 3246 [[package]] 3247 + name = "matchit" 3248 + version = "0.7.3" 3249 + source = "registry+https://github.com/rust-lang/crates.io-index" 3250 + checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" 3251 + 3252 + [[package]] 3122 3253 name = "maybe-rayon" 3123 3254 version = "0.1.1" 3124 3255 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3237 3368 ] 3238 3369 3239 3370 [[package]] 3371 + name = "multimap" 3372 + version = "0.10.1" 3373 + source = "registry+https://github.com/rust-lang/crates.io-index" 3374 + checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" 3375 + 3376 + [[package]] 3240 3377 name = "naga" 3241 3378 version = "25.0.1" 3242 3379 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3250 3387 "half", 3251 3388 "hashbrown 0.15.5", 3252 3389 "hexf-parse", 3253 - "indexmap", 3390 + "indexmap 2.14.0", 3254 3391 "log", 3255 3392 "num-traits", 3256 3393 "once_cell", ··· 3754 3891 checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" 3755 3892 3756 3893 [[package]] 3894 + name = "petgraph" 3895 + version = "0.7.1" 3896 + source = "registry+https://github.com/rust-lang/crates.io-index" 3897 + checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" 3898 + dependencies = [ 3899 + "fixedbitset", 3900 + "indexmap 2.14.0", 3901 + ] 3902 + 3903 + [[package]] 3757 3904 name = "pico-args" 3758 3905 version = "0.5.0" 3759 3906 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3980 4127 ] 3981 4128 3982 4129 [[package]] 4130 + name = "prost" 4131 + version = "0.13.5" 4132 + source = "registry+https://github.com/rust-lang/crates.io-index" 4133 + checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" 4134 + dependencies = [ 4135 + "bytes", 4136 + "prost-derive", 4137 + ] 4138 + 4139 + [[package]] 4140 + name = "prost-build" 4141 + version = "0.13.5" 4142 + source = "registry+https://github.com/rust-lang/crates.io-index" 4143 + checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" 4144 + dependencies = [ 4145 + "heck 0.5.0", 4146 + "itertools 0.14.0", 4147 + "log", 4148 + "multimap", 4149 + "once_cell", 4150 + "petgraph", 4151 + "prettyplease", 4152 + "prost", 4153 + "prost-types", 4154 + "regex", 4155 + "syn 2.0.117", 4156 + "tempfile", 4157 + ] 4158 + 4159 + [[package]] 4160 + name = "prost-derive" 4161 + version = "0.13.5" 4162 + source = "registry+https://github.com/rust-lang/crates.io-index" 4163 + checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" 4164 + dependencies = [ 4165 + "anyhow", 4166 + "itertools 0.14.0", 4167 + "proc-macro2", 4168 + "quote", 4169 + "syn 2.0.117", 4170 + ] 4171 + 4172 + [[package]] 4173 + name = "prost-types" 4174 + version = "0.13.5" 4175 + source = "registry+https://github.com/rust-lang/crates.io-index" 4176 + checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" 4177 + dependencies = [ 4178 + "prost", 4179 + ] 4180 + 4181 + [[package]] 3983 4182 name = "psm" 3984 4183 version = "0.1.31" 3985 4184 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4041 4240 "quinn-udp", 4042 4241 "rustc-hash 2.1.2", 4043 4242 "rustls", 4044 - "socket2", 4243 + "socket2 0.6.3", 4045 4244 "thiserror 2.0.18", 4046 4245 "tokio", 4047 4246 "tracing", ··· 4078 4277 "cfg_aliases", 4079 4278 "libc", 4080 4279 "once_cell", 4081 - "socket2", 4280 + "socket2 0.6.3", 4082 4281 "tracing", 4083 4282 "windows-sys 0.59.0", 4084 4283 ] ··· 4355 4554 checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" 4356 4555 4357 4556 [[package]] 4557 + name = "reqwest" 4558 + version = "0.12.28" 4559 + source = "registry+https://github.com/rust-lang/crates.io-index" 4560 + checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" 4561 + dependencies = [ 4562 + "base64", 4563 + "bytes", 4564 + "futures-core", 4565 + "http", 4566 + "http-body", 4567 + "http-body-util", 4568 + "hyper", 4569 + "hyper-rustls", 4570 + "hyper-util", 4571 + "js-sys", 4572 + "log", 4573 + "percent-encoding", 4574 + "pin-project-lite", 4575 + "quinn", 4576 + "rustls", 4577 + "rustls-pki-types", 4578 + "serde", 4579 + "serde_json", 4580 + "serde_urlencoded", 4581 + "sync_wrapper", 4582 + "tokio", 4583 + "tokio-rustls", 4584 + "tower 0.5.3", 4585 + "tower-http 0.6.8", 4586 + "tower-service", 4587 + "url", 4588 + "wasm-bindgen", 4589 + "wasm-bindgen-futures", 4590 + "web-sys", 4591 + "webpki-roots", 4592 + ] 4593 + 4594 + [[package]] 4358 4595 name = "resvg" 4359 4596 version = "0.45.1" 4360 4597 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4399 4636 "env_logger", 4400 4637 "gpui", 4401 4638 "log", 4639 + "prost", 4640 + "reqwest", 4402 4641 "rust-embed", 4403 4642 "serde", 4643 + "tokio", 4644 + "tonic", 4645 + "tonic-build", 4646 + "tonic-reflection", 4647 + "tonic-web", 4404 4648 ] 4405 4649 4406 4650 [[package]] ··· 4619 4863 checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" 4620 4864 dependencies = [ 4621 4865 "dyn-clone", 4622 - "indexmap", 4866 + "indexmap 2.14.0", 4623 4867 "ref-cast", 4624 4868 "schemars_derive", 4625 4869 "serde", ··· 4770 5014 source = "registry+https://github.com/rust-lang/crates.io-index" 4771 5015 checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" 4772 5016 dependencies = [ 4773 - "indexmap", 5017 + "indexmap 2.14.0", 4774 5018 "itoa", 4775 5019 "memchr", 4776 5020 "serde", ··· 4784 5028 source = "registry+https://github.com/rust-lang/crates.io-index" 4785 5029 checksum = "0e033097bf0d2b59a62b42c18ebbb797503839b26afdda2c4e1415cb6c813540" 4786 5030 dependencies = [ 4787 - "indexmap", 5031 + "indexmap 2.14.0", 4788 5032 "itoa", 4789 5033 "memchr", 4790 5034 "ryu", ··· 4948 5192 version = "0.2.2" 4949 5193 source = "registry+https://github.com/rust-lang/crates.io-index" 4950 5194 checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" 5195 + 5196 + [[package]] 5197 + name = "socket2" 5198 + version = "0.5.10" 5199 + source = "registry+https://github.com/rust-lang/crates.io-index" 5200 + checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" 5201 + dependencies = [ 5202 + "libc", 5203 + "windows-sys 0.52.0", 5204 + ] 4951 5205 4952 5206 [[package]] 4953 5207 name = "socket2" ··· 5458 5712 "bytes", 5459 5713 "libc", 5460 5714 "mio", 5715 + "parking_lot", 5461 5716 "pin-project-lite", 5462 - "socket2", 5717 + "signal-hook-registry", 5718 + "socket2 0.6.3", 5719 + "tokio-macros", 5463 5720 "windows-sys 0.61.2", 5464 5721 ] 5465 5722 5466 5723 [[package]] 5724 + name = "tokio-macros" 5725 + version = "2.7.0" 5726 + source = "registry+https://github.com/rust-lang/crates.io-index" 5727 + checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" 5728 + dependencies = [ 5729 + "proc-macro2", 5730 + "quote", 5731 + "syn 2.0.117", 5732 + ] 5733 + 5734 + [[package]] 5467 5735 name = "tokio-rustls" 5468 5736 version = "0.26.4" 5469 5737 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 5482 5750 "either", 5483 5751 "futures-util", 5484 5752 "thiserror 1.0.69", 5753 + "tokio", 5754 + ] 5755 + 5756 + [[package]] 5757 + name = "tokio-stream" 5758 + version = "0.1.18" 5759 + source = "registry+https://github.com/rust-lang/crates.io-index" 5760 + checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" 5761 + dependencies = [ 5762 + "futures-core", 5763 + "pin-project-lite", 5485 5764 "tokio", 5486 5765 ] 5487 5766 ··· 5516 5795 source = "registry+https://github.com/rust-lang/crates.io-index" 5517 5796 checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" 5518 5797 dependencies = [ 5519 - "indexmap", 5798 + "indexmap 2.14.0", 5520 5799 "serde_core", 5521 5800 "serde_spanned 1.1.1", 5522 5801 "toml_datetime 0.7.5+spec-1.1.0", ··· 5558 5837 source = "registry+https://github.com/rust-lang/crates.io-index" 5559 5838 checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" 5560 5839 dependencies = [ 5561 - "indexmap", 5840 + "indexmap 2.14.0", 5562 5841 "serde", 5563 5842 "serde_spanned 0.6.9", 5564 5843 "toml_datetime 0.6.11", ··· 5572 5851 source = "registry+https://github.com/rust-lang/crates.io-index" 5573 5852 checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" 5574 5853 dependencies = [ 5575 - "indexmap", 5854 + "indexmap 2.14.0", 5576 5855 "toml_datetime 1.1.1+spec-1.1.0", 5577 5856 "toml_parser", 5578 5857 "winnow 1.0.2", ··· 5600 5879 checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" 5601 5880 5602 5881 [[package]] 5882 + name = "tonic" 5883 + version = "0.12.3" 5884 + source = "registry+https://github.com/rust-lang/crates.io-index" 5885 + checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" 5886 + dependencies = [ 5887 + "async-stream", 5888 + "async-trait", 5889 + "axum", 5890 + "base64", 5891 + "bytes", 5892 + "h2", 5893 + "http", 5894 + "http-body", 5895 + "http-body-util", 5896 + "hyper", 5897 + "hyper-timeout", 5898 + "hyper-util", 5899 + "percent-encoding", 5900 + "pin-project", 5901 + "prost", 5902 + "socket2 0.5.10", 5903 + "tokio", 5904 + "tokio-stream", 5905 + "tower 0.4.13", 5906 + "tower-layer", 5907 + "tower-service", 5908 + "tracing", 5909 + ] 5910 + 5911 + [[package]] 5912 + name = "tonic-build" 5913 + version = "0.12.3" 5914 + source = "registry+https://github.com/rust-lang/crates.io-index" 5915 + checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" 5916 + dependencies = [ 5917 + "prettyplease", 5918 + "proc-macro2", 5919 + "prost-build", 5920 + "prost-types", 5921 + "quote", 5922 + "syn 2.0.117", 5923 + ] 5924 + 5925 + [[package]] 5926 + name = "tonic-reflection" 5927 + version = "0.12.3" 5928 + source = "registry+https://github.com/rust-lang/crates.io-index" 5929 + checksum = "878d81f52e7fcfd80026b7fdb6a9b578b3c3653ba987f87f0dce4b64043cba27" 5930 + dependencies = [ 5931 + "prost", 5932 + "prost-types", 5933 + "tokio", 5934 + "tokio-stream", 5935 + "tonic", 5936 + ] 5937 + 5938 + [[package]] 5939 + name = "tonic-web" 5940 + version = "0.12.3" 5941 + source = "registry+https://github.com/rust-lang/crates.io-index" 5942 + checksum = "5299dd20801ad736dccb4a5ea0da7376e59cd98f213bf1c3d478cf53f4834b58" 5943 + dependencies = [ 5944 + "base64", 5945 + "bytes", 5946 + "http", 5947 + "http-body", 5948 + "http-body-util", 5949 + "pin-project", 5950 + "tokio-stream", 5951 + "tonic", 5952 + "tower-http 0.5.2", 5953 + "tower-layer", 5954 + "tower-service", 5955 + "tracing", 5956 + ] 5957 + 5958 + [[package]] 5959 + name = "tower" 5960 + version = "0.4.13" 5961 + source = "registry+https://github.com/rust-lang/crates.io-index" 5962 + checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 5963 + dependencies = [ 5964 + "futures-core", 5965 + "futures-util", 5966 + "indexmap 1.9.3", 5967 + "pin-project", 5968 + "pin-project-lite", 5969 + "rand 0.8.6", 5970 + "slab", 5971 + "tokio", 5972 + "tokio-util", 5973 + "tower-layer", 5974 + "tower-service", 5975 + "tracing", 5976 + ] 5977 + 5978 + [[package]] 5603 5979 name = "tower" 5604 5980 version = "0.5.3" 5605 5981 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 5615 5991 ] 5616 5992 5617 5993 [[package]] 5994 + name = "tower-http" 5995 + version = "0.5.2" 5996 + source = "registry+https://github.com/rust-lang/crates.io-index" 5997 + checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" 5998 + dependencies = [ 5999 + "bitflags 2.11.1", 6000 + "bytes", 6001 + "http", 6002 + "http-body", 6003 + "http-body-util", 6004 + "pin-project-lite", 6005 + "tower-layer", 6006 + "tower-service", 6007 + ] 6008 + 6009 + [[package]] 6010 + name = "tower-http" 6011 + version = "0.6.8" 6012 + source = "registry+https://github.com/rust-lang/crates.io-index" 6013 + checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" 6014 + dependencies = [ 6015 + "bitflags 2.11.1", 6016 + "bytes", 6017 + "futures-util", 6018 + "http", 6019 + "http-body", 6020 + "iri-string", 6021 + "pin-project-lite", 6022 + "tower 0.5.3", 6023 + "tower-layer", 6024 + "tower-service", 6025 + ] 6026 + 6027 + [[package]] 5618 6028 name = "tower-layer" 5619 6029 version = "0.3.3" 5620 6030 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 6062 6472 checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" 6063 6473 dependencies = [ 6064 6474 "anyhow", 6065 - "indexmap", 6475 + "indexmap 2.14.0", 6066 6476 "wasm-encoder", 6067 6477 "wasmparser", 6068 6478 ] ··· 6088 6498 dependencies = [ 6089 6499 "bitflags 2.11.1", 6090 6500 "hashbrown 0.15.5", 6091 - "indexmap", 6501 + "indexmap 2.14.0", 6092 6502 "semver", 6093 6503 ] 6094 6504 ··· 6210 6620 ] 6211 6621 6212 6622 [[package]] 6623 + name = "webpki-roots" 6624 + version = "1.0.7" 6625 + source = "registry+https://github.com/rust-lang/crates.io-index" 6626 + checksum = "52f5ee44c96cf55f1b349600768e3ece3a8f26010c05265ab73f945bb1a2eb9d" 6627 + dependencies = [ 6628 + "rustls-pki-types", 6629 + ] 6630 + 6631 + [[package]] 6213 6632 name = "weezl" 6214 6633 version = "0.1.12" 6215 6634 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 6771 7190 dependencies = [ 6772 7191 "anyhow", 6773 7192 "heck 0.5.0", 6774 - "indexmap", 7193 + "indexmap 2.14.0", 6775 7194 "prettyplease", 6776 7195 "syn 2.0.117", 6777 7196 "wasm-metadata", ··· 6802 7221 dependencies = [ 6803 7222 "anyhow", 6804 7223 "bitflags 2.11.1", 6805 - "indexmap", 7224 + "indexmap 2.14.0", 6806 7225 "log", 6807 7226 "serde", 6808 7227 "serde_derive", ··· 6821 7240 dependencies = [ 6822 7241 "anyhow", 6823 7242 "id-arena", 6824 - "indexmap", 7243 + "indexmap 2.14.0", 6825 7244 "log", 6826 7245 "semver", 6827 7246 "serde", ··· 7132 7551 "tokio-rustls", 7133 7552 "tokio-socks", 7134 7553 "tokio-util", 7135 - "tower", 7554 + "tower 0.5.3", 7136 7555 "tower-service", 7137 7556 "url", 7138 7557 "wasm-bindgen",
+12
gpui/Cargo.toml
··· 14 14 serde = { version = "1.0", features = ["derive"] } 15 15 env_logger = "0.11" 16 16 log = "0.4" 17 + prost = "0.13.2" 18 + reqwest = { version = "0.12.5", features = [ 19 + "rustls-tls", 20 + "json", 21 + ], default-features = false } 22 + tokio = { version = "1.36.0", features = ["full"] } 23 + tonic = "0.12.3" 24 + tonic-reflection = "0.12.3" 25 + tonic-web = "0.12.3" 26 + 27 + [build-dependencies] 28 + tonic-build = "0.12.3"
+19
gpui/build.rs
··· 1 + fn main() -> Result<(), Box<dyn std::error::Error>> { 2 + tonic_build::configure() 3 + .out_dir("src/api") 4 + .file_descriptor_set_path("src/api/rockbox_descriptor.bin") 5 + .compile_protos( 6 + &[ 7 + "proto/rockbox/v1alpha1/browse.proto", 8 + "proto/rockbox/v1alpha1/library.proto", 9 + "proto/rockbox/v1alpha1/metadata.proto", 10 + "proto/rockbox/v1alpha1/playback.proto", 11 + "proto/rockbox/v1alpha1/playlist.proto", 12 + "proto/rockbox/v1alpha1/settings.proto", 13 + "proto/rockbox/v1alpha1/sound.proto", 14 + "proto/rockbox/v1alpha1/system.proto", 15 + ], 16 + &["proto"], 17 + )?; 18 + Ok(()) 19 + }
+9250
gpui/src/api/rockbox.v1alpha1.rs
··· 1 + // This file is @generated by prost-build. 2 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3 + pub struct RockboxBrowseRequest {} 4 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 5 + pub struct RockboxBrowseResponse {} 6 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7 + pub struct TreeGetContextRequest {} 8 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 9 + pub struct TreeGetContextResponse {} 10 + #[derive(Clone, PartialEq, ::prost::Message)] 11 + pub struct TreeGetEntriesRequest { 12 + #[prost(string, optional, tag = "1")] 13 + pub path: ::core::option::Option<::prost::alloc::string::String>, 14 + } 15 + #[derive(Clone, PartialEq, ::prost::Message)] 16 + pub struct Entry { 17 + #[prost(string, tag = "1")] 18 + pub name: ::prost::alloc::string::String, 19 + #[prost(int32, tag = "2")] 20 + pub attr: i32, 21 + #[prost(uint32, tag = "3")] 22 + pub time_write: u32, 23 + #[prost(int32, tag = "4")] 24 + pub customaction: i32, 25 + } 26 + #[derive(Clone, PartialEq, ::prost::Message)] 27 + pub struct TreeGetEntriesResponse { 28 + #[prost(message, repeated, tag = "1")] 29 + pub entries: ::prost::alloc::vec::Vec<Entry>, 30 + } 31 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 32 + pub struct TreeGetEntryAtRequest {} 33 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 34 + pub struct TreeGetEntryAtResponse {} 35 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 36 + pub struct BrowseId3Request {} 37 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 38 + pub struct BrowseId3Response {} 39 + /// Generated client implementations. 40 + pub mod browse_service_client { 41 + #![allow( 42 + unused_variables, 43 + dead_code, 44 + missing_docs, 45 + clippy::wildcard_imports, 46 + clippy::let_unit_value, 47 + )] 48 + use tonic::codegen::*; 49 + use tonic::codegen::http::Uri; 50 + #[derive(Debug, Clone)] 51 + pub struct BrowseServiceClient<T> { 52 + inner: tonic::client::Grpc<T>, 53 + } 54 + impl BrowseServiceClient<tonic::transport::Channel> { 55 + /// Attempt to create a new client by connecting to a given endpoint. 56 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 57 + where 58 + D: TryInto<tonic::transport::Endpoint>, 59 + D::Error: Into<StdError>, 60 + { 61 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 62 + Ok(Self::new(conn)) 63 + } 64 + } 65 + impl<T> BrowseServiceClient<T> 66 + where 67 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 68 + T::Error: Into<StdError>, 69 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 70 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 71 + { 72 + pub fn new(inner: T) -> Self { 73 + let inner = tonic::client::Grpc::new(inner); 74 + Self { inner } 75 + } 76 + pub fn with_origin(inner: T, origin: Uri) -> Self { 77 + let inner = tonic::client::Grpc::with_origin(inner, origin); 78 + Self { inner } 79 + } 80 + pub fn with_interceptor<F>( 81 + inner: T, 82 + interceptor: F, 83 + ) -> BrowseServiceClient<InterceptedService<T, F>> 84 + where 85 + F: tonic::service::Interceptor, 86 + T::ResponseBody: Default, 87 + T: tonic::codegen::Service< 88 + http::Request<tonic::body::BoxBody>, 89 + Response = http::Response< 90 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 91 + >, 92 + >, 93 + <T as tonic::codegen::Service< 94 + http::Request<tonic::body::BoxBody>, 95 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 96 + { 97 + BrowseServiceClient::new(InterceptedService::new(inner, interceptor)) 98 + } 99 + /// Compress requests with the given encoding. 100 + /// 101 + /// This requires the server to support it otherwise it might respond with an 102 + /// error. 103 + #[must_use] 104 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 105 + self.inner = self.inner.send_compressed(encoding); 106 + self 107 + } 108 + /// Enable decompressing responses. 109 + #[must_use] 110 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 111 + self.inner = self.inner.accept_compressed(encoding); 112 + self 113 + } 114 + /// Limits the maximum size of a decoded message. 115 + /// 116 + /// Default: `4MB` 117 + #[must_use] 118 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 119 + self.inner = self.inner.max_decoding_message_size(limit); 120 + self 121 + } 122 + /// Limits the maximum size of an encoded message. 123 + /// 124 + /// Default: `usize::MAX` 125 + #[must_use] 126 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 127 + self.inner = self.inner.max_encoding_message_size(limit); 128 + self 129 + } 130 + pub async fn tree_get_entries( 131 + &mut self, 132 + request: impl tonic::IntoRequest<super::TreeGetEntriesRequest>, 133 + ) -> std::result::Result< 134 + tonic::Response<super::TreeGetEntriesResponse>, 135 + tonic::Status, 136 + > { 137 + self.inner 138 + .ready() 139 + .await 140 + .map_err(|e| { 141 + tonic::Status::unknown( 142 + format!("Service was not ready: {}", e.into()), 143 + ) 144 + })?; 145 + let codec = tonic::codec::ProstCodec::default(); 146 + let path = http::uri::PathAndQuery::from_static( 147 + "/rockbox.v1alpha1.BrowseService/TreeGetEntries", 148 + ); 149 + let mut req = request.into_request(); 150 + req.extensions_mut() 151 + .insert( 152 + GrpcMethod::new("rockbox.v1alpha1.BrowseService", "TreeGetEntries"), 153 + ); 154 + self.inner.unary(req, path, codec).await 155 + } 156 + } 157 + } 158 + /// Generated server implementations. 159 + pub mod browse_service_server { 160 + #![allow( 161 + unused_variables, 162 + dead_code, 163 + missing_docs, 164 + clippy::wildcard_imports, 165 + clippy::let_unit_value, 166 + )] 167 + use tonic::codegen::*; 168 + /// Generated trait containing gRPC methods that should be implemented for use with BrowseServiceServer. 169 + #[async_trait] 170 + pub trait BrowseService: std::marker::Send + std::marker::Sync + 'static { 171 + async fn tree_get_entries( 172 + &self, 173 + request: tonic::Request<super::TreeGetEntriesRequest>, 174 + ) -> std::result::Result< 175 + tonic::Response<super::TreeGetEntriesResponse>, 176 + tonic::Status, 177 + >; 178 + } 179 + #[derive(Debug)] 180 + pub struct BrowseServiceServer<T> { 181 + inner: Arc<T>, 182 + accept_compression_encodings: EnabledCompressionEncodings, 183 + send_compression_encodings: EnabledCompressionEncodings, 184 + max_decoding_message_size: Option<usize>, 185 + max_encoding_message_size: Option<usize>, 186 + } 187 + impl<T> BrowseServiceServer<T> { 188 + pub fn new(inner: T) -> Self { 189 + Self::from_arc(Arc::new(inner)) 190 + } 191 + pub fn from_arc(inner: Arc<T>) -> Self { 192 + Self { 193 + inner, 194 + accept_compression_encodings: Default::default(), 195 + send_compression_encodings: Default::default(), 196 + max_decoding_message_size: None, 197 + max_encoding_message_size: None, 198 + } 199 + } 200 + pub fn with_interceptor<F>( 201 + inner: T, 202 + interceptor: F, 203 + ) -> InterceptedService<Self, F> 204 + where 205 + F: tonic::service::Interceptor, 206 + { 207 + InterceptedService::new(Self::new(inner), interceptor) 208 + } 209 + /// Enable decompressing requests with the given encoding. 210 + #[must_use] 211 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 212 + self.accept_compression_encodings.enable(encoding); 213 + self 214 + } 215 + /// Compress responses with the given encoding, if the client supports it. 216 + #[must_use] 217 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 218 + self.send_compression_encodings.enable(encoding); 219 + self 220 + } 221 + /// Limits the maximum size of a decoded message. 222 + /// 223 + /// Default: `4MB` 224 + #[must_use] 225 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 226 + self.max_decoding_message_size = Some(limit); 227 + self 228 + } 229 + /// Limits the maximum size of an encoded message. 230 + /// 231 + /// Default: `usize::MAX` 232 + #[must_use] 233 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 234 + self.max_encoding_message_size = Some(limit); 235 + self 236 + } 237 + } 238 + impl<T, B> tonic::codegen::Service<http::Request<B>> for BrowseServiceServer<T> 239 + where 240 + T: BrowseService, 241 + B: Body + std::marker::Send + 'static, 242 + B::Error: Into<StdError> + std::marker::Send + 'static, 243 + { 244 + type Response = http::Response<tonic::body::BoxBody>; 245 + type Error = std::convert::Infallible; 246 + type Future = BoxFuture<Self::Response, Self::Error>; 247 + fn poll_ready( 248 + &mut self, 249 + _cx: &mut Context<'_>, 250 + ) -> Poll<std::result::Result<(), Self::Error>> { 251 + Poll::Ready(Ok(())) 252 + } 253 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 254 + match req.uri().path() { 255 + "/rockbox.v1alpha1.BrowseService/TreeGetEntries" => { 256 + #[allow(non_camel_case_types)] 257 + struct TreeGetEntriesSvc<T: BrowseService>(pub Arc<T>); 258 + impl< 259 + T: BrowseService, 260 + > tonic::server::UnaryService<super::TreeGetEntriesRequest> 261 + for TreeGetEntriesSvc<T> { 262 + type Response = super::TreeGetEntriesResponse; 263 + type Future = BoxFuture< 264 + tonic::Response<Self::Response>, 265 + tonic::Status, 266 + >; 267 + fn call( 268 + &mut self, 269 + request: tonic::Request<super::TreeGetEntriesRequest>, 270 + ) -> Self::Future { 271 + let inner = Arc::clone(&self.0); 272 + let fut = async move { 273 + <T as BrowseService>::tree_get_entries(&inner, request) 274 + .await 275 + }; 276 + Box::pin(fut) 277 + } 278 + } 279 + let accept_compression_encodings = self.accept_compression_encodings; 280 + let send_compression_encodings = self.send_compression_encodings; 281 + let max_decoding_message_size = self.max_decoding_message_size; 282 + let max_encoding_message_size = self.max_encoding_message_size; 283 + let inner = self.inner.clone(); 284 + let fut = async move { 285 + let method = TreeGetEntriesSvc(inner); 286 + let codec = tonic::codec::ProstCodec::default(); 287 + let mut grpc = tonic::server::Grpc::new(codec) 288 + .apply_compression_config( 289 + accept_compression_encodings, 290 + send_compression_encodings, 291 + ) 292 + .apply_max_message_size_config( 293 + max_decoding_message_size, 294 + max_encoding_message_size, 295 + ); 296 + let res = grpc.unary(method, req).await; 297 + Ok(res) 298 + }; 299 + Box::pin(fut) 300 + } 301 + _ => { 302 + Box::pin(async move { 303 + let mut response = http::Response::new(empty_body()); 304 + let headers = response.headers_mut(); 305 + headers 306 + .insert( 307 + tonic::Status::GRPC_STATUS, 308 + (tonic::Code::Unimplemented as i32).into(), 309 + ); 310 + headers 311 + .insert( 312 + http::header::CONTENT_TYPE, 313 + tonic::metadata::GRPC_CONTENT_TYPE, 314 + ); 315 + Ok(response) 316 + }) 317 + } 318 + } 319 + } 320 + } 321 + impl<T> Clone for BrowseServiceServer<T> { 322 + fn clone(&self) -> Self { 323 + let inner = self.inner.clone(); 324 + Self { 325 + inner, 326 + accept_compression_encodings: self.accept_compression_encodings, 327 + send_compression_encodings: self.send_compression_encodings, 328 + max_decoding_message_size: self.max_decoding_message_size, 329 + max_encoding_message_size: self.max_encoding_message_size, 330 + } 331 + } 332 + } 333 + /// Generated gRPC service name 334 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.BrowseService"; 335 + impl<T> tonic::server::NamedService for BrowseServiceServer<T> { 336 + const NAME: &'static str = SERVICE_NAME; 337 + } 338 + } 339 + #[derive(Clone, PartialEq, ::prost::Message)] 340 + pub struct Track { 341 + #[prost(string, tag = "1")] 342 + pub id: ::prost::alloc::string::String, 343 + #[prost(string, tag = "2")] 344 + pub path: ::prost::alloc::string::String, 345 + #[prost(string, tag = "3")] 346 + pub title: ::prost::alloc::string::String, 347 + #[prost(string, tag = "4")] 348 + pub artist: ::prost::alloc::string::String, 349 + #[prost(string, tag = "5")] 350 + pub album: ::prost::alloc::string::String, 351 + #[prost(string, tag = "6")] 352 + pub album_artist: ::prost::alloc::string::String, 353 + #[prost(uint32, tag = "7")] 354 + pub bitrate: u32, 355 + #[prost(string, tag = "8")] 356 + pub composer: ::prost::alloc::string::String, 357 + #[prost(uint32, tag = "9")] 358 + pub disc_number: u32, 359 + #[prost(uint32, tag = "10")] 360 + pub filesize: u32, 361 + #[prost(uint32, tag = "11")] 362 + pub frequency: u32, 363 + #[prost(uint32, tag = "12")] 364 + pub length: u32, 365 + #[prost(uint32, tag = "13")] 366 + pub track_number: u32, 367 + #[prost(uint32, tag = "14")] 368 + pub year: u32, 369 + #[prost(string, tag = "15")] 370 + pub year_string: ::prost::alloc::string::String, 371 + #[prost(string, tag = "16")] 372 + pub genre: ::prost::alloc::string::String, 373 + #[prost(string, tag = "17")] 374 + pub md5: ::prost::alloc::string::String, 375 + #[prost(string, optional, tag = "18")] 376 + pub album_art: ::core::option::Option<::prost::alloc::string::String>, 377 + #[prost(string, optional, tag = "19")] 378 + pub artist_id: ::core::option::Option<::prost::alloc::string::String>, 379 + #[prost(string, optional, tag = "20")] 380 + pub album_id: ::core::option::Option<::prost::alloc::string::String>, 381 + #[prost(string, optional, tag = "21")] 382 + pub genre_id: ::core::option::Option<::prost::alloc::string::String>, 383 + #[prost(string, tag = "22")] 384 + pub created_at: ::prost::alloc::string::String, 385 + #[prost(string, tag = "23")] 386 + pub updated_at: ::prost::alloc::string::String, 387 + } 388 + #[derive(Clone, PartialEq, ::prost::Message)] 389 + pub struct Artist { 390 + #[prost(string, tag = "1")] 391 + pub id: ::prost::alloc::string::String, 392 + #[prost(string, tag = "2")] 393 + pub name: ::prost::alloc::string::String, 394 + #[prost(string, optional, tag = "3")] 395 + pub bio: ::core::option::Option<::prost::alloc::string::String>, 396 + #[prost(string, optional, tag = "4")] 397 + pub image: ::core::option::Option<::prost::alloc::string::String>, 398 + #[prost(message, repeated, tag = "5")] 399 + pub albums: ::prost::alloc::vec::Vec<Album>, 400 + #[prost(message, repeated, tag = "6")] 401 + pub tracks: ::prost::alloc::vec::Vec<Track>, 402 + #[prost(string, optional, tag = "7")] 403 + pub genres: ::core::option::Option<::prost::alloc::string::String>, 404 + } 405 + #[derive(Clone, PartialEq, ::prost::Message)] 406 + pub struct Album { 407 + #[prost(string, tag = "1")] 408 + pub id: ::prost::alloc::string::String, 409 + #[prost(string, tag = "2")] 410 + pub title: ::prost::alloc::string::String, 411 + #[prost(string, tag = "3")] 412 + pub artist: ::prost::alloc::string::String, 413 + #[prost(uint32, tag = "4")] 414 + pub year: u32, 415 + #[prost(string, tag = "5")] 416 + pub year_string: ::prost::alloc::string::String, 417 + #[prost(string, optional, tag = "6")] 418 + pub album_art: ::core::option::Option<::prost::alloc::string::String>, 419 + #[prost(string, tag = "7")] 420 + pub md5: ::prost::alloc::string::String, 421 + #[prost(string, tag = "8")] 422 + pub artist_id: ::prost::alloc::string::String, 423 + #[prost(string, optional, tag = "9")] 424 + pub label: ::core::option::Option<::prost::alloc::string::String>, 425 + #[prost(string, optional, tag = "10")] 426 + pub copyright_message: ::core::option::Option<::prost::alloc::string::String>, 427 + #[prost(message, repeated, tag = "11")] 428 + pub tracks: ::prost::alloc::vec::Vec<Track>, 429 + } 430 + #[derive(Clone, PartialEq, ::prost::Message)] 431 + pub struct GetAlbumRequest { 432 + #[prost(string, tag = "1")] 433 + pub id: ::prost::alloc::string::String, 434 + } 435 + #[derive(Clone, PartialEq, ::prost::Message)] 436 + pub struct GetAlbumResponse { 437 + #[prost(message, optional, tag = "1")] 438 + pub album: ::core::option::Option<Album>, 439 + } 440 + #[derive(Clone, PartialEq, ::prost::Message)] 441 + pub struct GetArtistRequest { 442 + #[prost(string, tag = "1")] 443 + pub id: ::prost::alloc::string::String, 444 + } 445 + #[derive(Clone, PartialEq, ::prost::Message)] 446 + pub struct GetArtistResponse { 447 + #[prost(message, optional, tag = "1")] 448 + pub artist: ::core::option::Option<Artist>, 449 + } 450 + #[derive(Clone, PartialEq, ::prost::Message)] 451 + pub struct GetTrackRequest { 452 + #[prost(string, tag = "1")] 453 + pub id: ::prost::alloc::string::String, 454 + } 455 + #[derive(Clone, PartialEq, ::prost::Message)] 456 + pub struct GetTrackResponse { 457 + #[prost(message, optional, tag = "1")] 458 + pub track: ::core::option::Option<Track>, 459 + } 460 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 461 + pub struct GetAlbumsRequest {} 462 + #[derive(Clone, PartialEq, ::prost::Message)] 463 + pub struct GetAlbumsResponse { 464 + #[prost(message, repeated, tag = "1")] 465 + pub albums: ::prost::alloc::vec::Vec<Album>, 466 + } 467 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 468 + pub struct GetArtistsRequest {} 469 + #[derive(Clone, PartialEq, ::prost::Message)] 470 + pub struct GetArtistsResponse { 471 + #[prost(message, repeated, tag = "1")] 472 + pub artists: ::prost::alloc::vec::Vec<Artist>, 473 + } 474 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 475 + pub struct GetTracksRequest {} 476 + #[derive(Clone, PartialEq, ::prost::Message)] 477 + pub struct GetTracksResponse { 478 + #[prost(message, repeated, tag = "1")] 479 + pub tracks: ::prost::alloc::vec::Vec<Track>, 480 + } 481 + #[derive(Clone, PartialEq, ::prost::Message)] 482 + pub struct LikeTrackRequest { 483 + #[prost(string, tag = "1")] 484 + pub id: ::prost::alloc::string::String, 485 + } 486 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 487 + pub struct LikeTrackResponse {} 488 + #[derive(Clone, PartialEq, ::prost::Message)] 489 + pub struct LikeAlbumRequest { 490 + #[prost(string, tag = "1")] 491 + pub id: ::prost::alloc::string::String, 492 + } 493 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 494 + pub struct LikeAlbumResponse {} 495 + #[derive(Clone, PartialEq, ::prost::Message)] 496 + pub struct UnlikeTrackRequest { 497 + #[prost(string, tag = "1")] 498 + pub id: ::prost::alloc::string::String, 499 + } 500 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 501 + pub struct UnlikeTrackResponse {} 502 + #[derive(Clone, PartialEq, ::prost::Message)] 503 + pub struct UnlikeAlbumRequest { 504 + #[prost(string, tag = "1")] 505 + pub id: ::prost::alloc::string::String, 506 + } 507 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 508 + pub struct UnlikeAlbumResponse {} 509 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 510 + pub struct GetLikedTracksRequest {} 511 + #[derive(Clone, PartialEq, ::prost::Message)] 512 + pub struct GetLikedTracksResponse { 513 + #[prost(message, repeated, tag = "1")] 514 + pub tracks: ::prost::alloc::vec::Vec<Track>, 515 + } 516 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 517 + pub struct GetLikedAlbumsRequest {} 518 + #[derive(Clone, PartialEq, ::prost::Message)] 519 + pub struct GetLikedAlbumsResponse { 520 + #[prost(message, repeated, tag = "1")] 521 + pub albums: ::prost::alloc::vec::Vec<Album>, 522 + } 523 + #[derive(Clone, PartialEq, ::prost::Message)] 524 + pub struct ScanLibraryRequest { 525 + #[prost(string, optional, tag = "1")] 526 + pub path: ::core::option::Option<::prost::alloc::string::String>, 527 + #[prost(bool, optional, tag = "2")] 528 + pub rebuild_index: ::core::option::Option<bool>, 529 + } 530 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 531 + pub struct ScanLibraryResponse {} 532 + #[derive(Clone, PartialEq, ::prost::Message)] 533 + pub struct SearchRequest { 534 + #[prost(string, tag = "1")] 535 + pub term: ::prost::alloc::string::String, 536 + } 537 + #[derive(Clone, PartialEq, ::prost::Message)] 538 + pub struct SearchResponse { 539 + #[prost(message, repeated, tag = "1")] 540 + pub tracks: ::prost::alloc::vec::Vec<Track>, 541 + #[prost(message, repeated, tag = "2")] 542 + pub albums: ::prost::alloc::vec::Vec<Album>, 543 + #[prost(message, repeated, tag = "3")] 544 + pub artists: ::prost::alloc::vec::Vec<Artist>, 545 + } 546 + /// Generated client implementations. 547 + pub mod library_service_client { 548 + #![allow( 549 + unused_variables, 550 + dead_code, 551 + missing_docs, 552 + clippy::wildcard_imports, 553 + clippy::let_unit_value, 554 + )] 555 + use tonic::codegen::*; 556 + use tonic::codegen::http::Uri; 557 + #[derive(Debug, Clone)] 558 + pub struct LibraryServiceClient<T> { 559 + inner: tonic::client::Grpc<T>, 560 + } 561 + impl LibraryServiceClient<tonic::transport::Channel> { 562 + /// Attempt to create a new client by connecting to a given endpoint. 563 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 564 + where 565 + D: TryInto<tonic::transport::Endpoint>, 566 + D::Error: Into<StdError>, 567 + { 568 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 569 + Ok(Self::new(conn)) 570 + } 571 + } 572 + impl<T> LibraryServiceClient<T> 573 + where 574 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 575 + T::Error: Into<StdError>, 576 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 577 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 578 + { 579 + pub fn new(inner: T) -> Self { 580 + let inner = tonic::client::Grpc::new(inner); 581 + Self { inner } 582 + } 583 + pub fn with_origin(inner: T, origin: Uri) -> Self { 584 + let inner = tonic::client::Grpc::with_origin(inner, origin); 585 + Self { inner } 586 + } 587 + pub fn with_interceptor<F>( 588 + inner: T, 589 + interceptor: F, 590 + ) -> LibraryServiceClient<InterceptedService<T, F>> 591 + where 592 + F: tonic::service::Interceptor, 593 + T::ResponseBody: Default, 594 + T: tonic::codegen::Service< 595 + http::Request<tonic::body::BoxBody>, 596 + Response = http::Response< 597 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 598 + >, 599 + >, 600 + <T as tonic::codegen::Service< 601 + http::Request<tonic::body::BoxBody>, 602 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 603 + { 604 + LibraryServiceClient::new(InterceptedService::new(inner, interceptor)) 605 + } 606 + /// Compress requests with the given encoding. 607 + /// 608 + /// This requires the server to support it otherwise it might respond with an 609 + /// error. 610 + #[must_use] 611 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 612 + self.inner = self.inner.send_compressed(encoding); 613 + self 614 + } 615 + /// Enable decompressing responses. 616 + #[must_use] 617 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 618 + self.inner = self.inner.accept_compressed(encoding); 619 + self 620 + } 621 + /// Limits the maximum size of a decoded message. 622 + /// 623 + /// Default: `4MB` 624 + #[must_use] 625 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 626 + self.inner = self.inner.max_decoding_message_size(limit); 627 + self 628 + } 629 + /// Limits the maximum size of an encoded message. 630 + /// 631 + /// Default: `usize::MAX` 632 + #[must_use] 633 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 634 + self.inner = self.inner.max_encoding_message_size(limit); 635 + self 636 + } 637 + pub async fn get_albums( 638 + &mut self, 639 + request: impl tonic::IntoRequest<super::GetAlbumsRequest>, 640 + ) -> std::result::Result< 641 + tonic::Response<super::GetAlbumsResponse>, 642 + tonic::Status, 643 + > { 644 + self.inner 645 + .ready() 646 + .await 647 + .map_err(|e| { 648 + tonic::Status::unknown( 649 + format!("Service was not ready: {}", e.into()), 650 + ) 651 + })?; 652 + let codec = tonic::codec::ProstCodec::default(); 653 + let path = http::uri::PathAndQuery::from_static( 654 + "/rockbox.v1alpha1.LibraryService/GetAlbums", 655 + ); 656 + let mut req = request.into_request(); 657 + req.extensions_mut() 658 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetAlbums")); 659 + self.inner.unary(req, path, codec).await 660 + } 661 + pub async fn get_artists( 662 + &mut self, 663 + request: impl tonic::IntoRequest<super::GetArtistsRequest>, 664 + ) -> std::result::Result< 665 + tonic::Response<super::GetArtistsResponse>, 666 + tonic::Status, 667 + > { 668 + self.inner 669 + .ready() 670 + .await 671 + .map_err(|e| { 672 + tonic::Status::unknown( 673 + format!("Service was not ready: {}", e.into()), 674 + ) 675 + })?; 676 + let codec = tonic::codec::ProstCodec::default(); 677 + let path = http::uri::PathAndQuery::from_static( 678 + "/rockbox.v1alpha1.LibraryService/GetArtists", 679 + ); 680 + let mut req = request.into_request(); 681 + req.extensions_mut() 682 + .insert( 683 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetArtists"), 684 + ); 685 + self.inner.unary(req, path, codec).await 686 + } 687 + pub async fn get_tracks( 688 + &mut self, 689 + request: impl tonic::IntoRequest<super::GetTracksRequest>, 690 + ) -> std::result::Result< 691 + tonic::Response<super::GetTracksResponse>, 692 + tonic::Status, 693 + > { 694 + self.inner 695 + .ready() 696 + .await 697 + .map_err(|e| { 698 + tonic::Status::unknown( 699 + format!("Service was not ready: {}", e.into()), 700 + ) 701 + })?; 702 + let codec = tonic::codec::ProstCodec::default(); 703 + let path = http::uri::PathAndQuery::from_static( 704 + "/rockbox.v1alpha1.LibraryService/GetTracks", 705 + ); 706 + let mut req = request.into_request(); 707 + req.extensions_mut() 708 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetTracks")); 709 + self.inner.unary(req, path, codec).await 710 + } 711 + pub async fn get_album( 712 + &mut self, 713 + request: impl tonic::IntoRequest<super::GetAlbumRequest>, 714 + ) -> std::result::Result< 715 + tonic::Response<super::GetAlbumResponse>, 716 + tonic::Status, 717 + > { 718 + self.inner 719 + .ready() 720 + .await 721 + .map_err(|e| { 722 + tonic::Status::unknown( 723 + format!("Service was not ready: {}", e.into()), 724 + ) 725 + })?; 726 + let codec = tonic::codec::ProstCodec::default(); 727 + let path = http::uri::PathAndQuery::from_static( 728 + "/rockbox.v1alpha1.LibraryService/GetAlbum", 729 + ); 730 + let mut req = request.into_request(); 731 + req.extensions_mut() 732 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetAlbum")); 733 + self.inner.unary(req, path, codec).await 734 + } 735 + pub async fn get_artist( 736 + &mut self, 737 + request: impl tonic::IntoRequest<super::GetArtistRequest>, 738 + ) -> std::result::Result< 739 + tonic::Response<super::GetArtistResponse>, 740 + tonic::Status, 741 + > { 742 + self.inner 743 + .ready() 744 + .await 745 + .map_err(|e| { 746 + tonic::Status::unknown( 747 + format!("Service was not ready: {}", e.into()), 748 + ) 749 + })?; 750 + let codec = tonic::codec::ProstCodec::default(); 751 + let path = http::uri::PathAndQuery::from_static( 752 + "/rockbox.v1alpha1.LibraryService/GetArtist", 753 + ); 754 + let mut req = request.into_request(); 755 + req.extensions_mut() 756 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetArtist")); 757 + self.inner.unary(req, path, codec).await 758 + } 759 + pub async fn get_track( 760 + &mut self, 761 + request: impl tonic::IntoRequest<super::GetTrackRequest>, 762 + ) -> std::result::Result< 763 + tonic::Response<super::GetTrackResponse>, 764 + tonic::Status, 765 + > { 766 + self.inner 767 + .ready() 768 + .await 769 + .map_err(|e| { 770 + tonic::Status::unknown( 771 + format!("Service was not ready: {}", e.into()), 772 + ) 773 + })?; 774 + let codec = tonic::codec::ProstCodec::default(); 775 + let path = http::uri::PathAndQuery::from_static( 776 + "/rockbox.v1alpha1.LibraryService/GetTrack", 777 + ); 778 + let mut req = request.into_request(); 779 + req.extensions_mut() 780 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetTrack")); 781 + self.inner.unary(req, path, codec).await 782 + } 783 + pub async fn like_track( 784 + &mut self, 785 + request: impl tonic::IntoRequest<super::LikeTrackRequest>, 786 + ) -> std::result::Result< 787 + tonic::Response<super::LikeTrackResponse>, 788 + tonic::Status, 789 + > { 790 + self.inner 791 + .ready() 792 + .await 793 + .map_err(|e| { 794 + tonic::Status::unknown( 795 + format!("Service was not ready: {}", e.into()), 796 + ) 797 + })?; 798 + let codec = tonic::codec::ProstCodec::default(); 799 + let path = http::uri::PathAndQuery::from_static( 800 + "/rockbox.v1alpha1.LibraryService/LikeTrack", 801 + ); 802 + let mut req = request.into_request(); 803 + req.extensions_mut() 804 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "LikeTrack")); 805 + self.inner.unary(req, path, codec).await 806 + } 807 + pub async fn unlike_track( 808 + &mut self, 809 + request: impl tonic::IntoRequest<super::UnlikeTrackRequest>, 810 + ) -> std::result::Result< 811 + tonic::Response<super::UnlikeTrackResponse>, 812 + tonic::Status, 813 + > { 814 + self.inner 815 + .ready() 816 + .await 817 + .map_err(|e| { 818 + tonic::Status::unknown( 819 + format!("Service was not ready: {}", e.into()), 820 + ) 821 + })?; 822 + let codec = tonic::codec::ProstCodec::default(); 823 + let path = http::uri::PathAndQuery::from_static( 824 + "/rockbox.v1alpha1.LibraryService/UnlikeTrack", 825 + ); 826 + let mut req = request.into_request(); 827 + req.extensions_mut() 828 + .insert( 829 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "UnlikeTrack"), 830 + ); 831 + self.inner.unary(req, path, codec).await 832 + } 833 + pub async fn like_album( 834 + &mut self, 835 + request: impl tonic::IntoRequest<super::LikeAlbumRequest>, 836 + ) -> std::result::Result< 837 + tonic::Response<super::LikeAlbumResponse>, 838 + tonic::Status, 839 + > { 840 + self.inner 841 + .ready() 842 + .await 843 + .map_err(|e| { 844 + tonic::Status::unknown( 845 + format!("Service was not ready: {}", e.into()), 846 + ) 847 + })?; 848 + let codec = tonic::codec::ProstCodec::default(); 849 + let path = http::uri::PathAndQuery::from_static( 850 + "/rockbox.v1alpha1.LibraryService/LikeAlbum", 851 + ); 852 + let mut req = request.into_request(); 853 + req.extensions_mut() 854 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "LikeAlbum")); 855 + self.inner.unary(req, path, codec).await 856 + } 857 + pub async fn unlike_album( 858 + &mut self, 859 + request: impl tonic::IntoRequest<super::UnlikeAlbumRequest>, 860 + ) -> std::result::Result< 861 + tonic::Response<super::UnlikeAlbumResponse>, 862 + tonic::Status, 863 + > { 864 + self.inner 865 + .ready() 866 + .await 867 + .map_err(|e| { 868 + tonic::Status::unknown( 869 + format!("Service was not ready: {}", e.into()), 870 + ) 871 + })?; 872 + let codec = tonic::codec::ProstCodec::default(); 873 + let path = http::uri::PathAndQuery::from_static( 874 + "/rockbox.v1alpha1.LibraryService/UnlikeAlbum", 875 + ); 876 + let mut req = request.into_request(); 877 + req.extensions_mut() 878 + .insert( 879 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "UnlikeAlbum"), 880 + ); 881 + self.inner.unary(req, path, codec).await 882 + } 883 + pub async fn get_liked_tracks( 884 + &mut self, 885 + request: impl tonic::IntoRequest<super::GetLikedTracksRequest>, 886 + ) -> std::result::Result< 887 + tonic::Response<super::GetLikedTracksResponse>, 888 + tonic::Status, 889 + > { 890 + self.inner 891 + .ready() 892 + .await 893 + .map_err(|e| { 894 + tonic::Status::unknown( 895 + format!("Service was not ready: {}", e.into()), 896 + ) 897 + })?; 898 + let codec = tonic::codec::ProstCodec::default(); 899 + let path = http::uri::PathAndQuery::from_static( 900 + "/rockbox.v1alpha1.LibraryService/GetLikedTracks", 901 + ); 902 + let mut req = request.into_request(); 903 + req.extensions_mut() 904 + .insert( 905 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetLikedTracks"), 906 + ); 907 + self.inner.unary(req, path, codec).await 908 + } 909 + pub async fn get_liked_albums( 910 + &mut self, 911 + request: impl tonic::IntoRequest<super::GetLikedAlbumsRequest>, 912 + ) -> std::result::Result< 913 + tonic::Response<super::GetLikedAlbumsResponse>, 914 + tonic::Status, 915 + > { 916 + self.inner 917 + .ready() 918 + .await 919 + .map_err(|e| { 920 + tonic::Status::unknown( 921 + format!("Service was not ready: {}", e.into()), 922 + ) 923 + })?; 924 + let codec = tonic::codec::ProstCodec::default(); 925 + let path = http::uri::PathAndQuery::from_static( 926 + "/rockbox.v1alpha1.LibraryService/GetLikedAlbums", 927 + ); 928 + let mut req = request.into_request(); 929 + req.extensions_mut() 930 + .insert( 931 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetLikedAlbums"), 932 + ); 933 + self.inner.unary(req, path, codec).await 934 + } 935 + pub async fn scan_library( 936 + &mut self, 937 + request: impl tonic::IntoRequest<super::ScanLibraryRequest>, 938 + ) -> std::result::Result< 939 + tonic::Response<super::ScanLibraryResponse>, 940 + tonic::Status, 941 + > { 942 + self.inner 943 + .ready() 944 + .await 945 + .map_err(|e| { 946 + tonic::Status::unknown( 947 + format!("Service was not ready: {}", e.into()), 948 + ) 949 + })?; 950 + let codec = tonic::codec::ProstCodec::default(); 951 + let path = http::uri::PathAndQuery::from_static( 952 + "/rockbox.v1alpha1.LibraryService/ScanLibrary", 953 + ); 954 + let mut req = request.into_request(); 955 + req.extensions_mut() 956 + .insert( 957 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "ScanLibrary"), 958 + ); 959 + self.inner.unary(req, path, codec).await 960 + } 961 + pub async fn search( 962 + &mut self, 963 + request: impl tonic::IntoRequest<super::SearchRequest>, 964 + ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status> { 965 + self.inner 966 + .ready() 967 + .await 968 + .map_err(|e| { 969 + tonic::Status::unknown( 970 + format!("Service was not ready: {}", e.into()), 971 + ) 972 + })?; 973 + let codec = tonic::codec::ProstCodec::default(); 974 + let path = http::uri::PathAndQuery::from_static( 975 + "/rockbox.v1alpha1.LibraryService/Search", 976 + ); 977 + let mut req = request.into_request(); 978 + req.extensions_mut() 979 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "Search")); 980 + self.inner.unary(req, path, codec).await 981 + } 982 + } 983 + } 984 + /// Generated server implementations. 985 + pub mod library_service_server { 986 + #![allow( 987 + unused_variables, 988 + dead_code, 989 + missing_docs, 990 + clippy::wildcard_imports, 991 + clippy::let_unit_value, 992 + )] 993 + use tonic::codegen::*; 994 + /// Generated trait containing gRPC methods that should be implemented for use with LibraryServiceServer. 995 + #[async_trait] 996 + pub trait LibraryService: std::marker::Send + std::marker::Sync + 'static { 997 + async fn get_albums( 998 + &self, 999 + request: tonic::Request<super::GetAlbumsRequest>, 1000 + ) -> std::result::Result< 1001 + tonic::Response<super::GetAlbumsResponse>, 1002 + tonic::Status, 1003 + >; 1004 + async fn get_artists( 1005 + &self, 1006 + request: tonic::Request<super::GetArtistsRequest>, 1007 + ) -> std::result::Result< 1008 + tonic::Response<super::GetArtistsResponse>, 1009 + tonic::Status, 1010 + >; 1011 + async fn get_tracks( 1012 + &self, 1013 + request: tonic::Request<super::GetTracksRequest>, 1014 + ) -> std::result::Result< 1015 + tonic::Response<super::GetTracksResponse>, 1016 + tonic::Status, 1017 + >; 1018 + async fn get_album( 1019 + &self, 1020 + request: tonic::Request<super::GetAlbumRequest>, 1021 + ) -> std::result::Result< 1022 + tonic::Response<super::GetAlbumResponse>, 1023 + tonic::Status, 1024 + >; 1025 + async fn get_artist( 1026 + &self, 1027 + request: tonic::Request<super::GetArtistRequest>, 1028 + ) -> std::result::Result< 1029 + tonic::Response<super::GetArtistResponse>, 1030 + tonic::Status, 1031 + >; 1032 + async fn get_track( 1033 + &self, 1034 + request: tonic::Request<super::GetTrackRequest>, 1035 + ) -> std::result::Result< 1036 + tonic::Response<super::GetTrackResponse>, 1037 + tonic::Status, 1038 + >; 1039 + async fn like_track( 1040 + &self, 1041 + request: tonic::Request<super::LikeTrackRequest>, 1042 + ) -> std::result::Result< 1043 + tonic::Response<super::LikeTrackResponse>, 1044 + tonic::Status, 1045 + >; 1046 + async fn unlike_track( 1047 + &self, 1048 + request: tonic::Request<super::UnlikeTrackRequest>, 1049 + ) -> std::result::Result< 1050 + tonic::Response<super::UnlikeTrackResponse>, 1051 + tonic::Status, 1052 + >; 1053 + async fn like_album( 1054 + &self, 1055 + request: tonic::Request<super::LikeAlbumRequest>, 1056 + ) -> std::result::Result< 1057 + tonic::Response<super::LikeAlbumResponse>, 1058 + tonic::Status, 1059 + >; 1060 + async fn unlike_album( 1061 + &self, 1062 + request: tonic::Request<super::UnlikeAlbumRequest>, 1063 + ) -> std::result::Result< 1064 + tonic::Response<super::UnlikeAlbumResponse>, 1065 + tonic::Status, 1066 + >; 1067 + async fn get_liked_tracks( 1068 + &self, 1069 + request: tonic::Request<super::GetLikedTracksRequest>, 1070 + ) -> std::result::Result< 1071 + tonic::Response<super::GetLikedTracksResponse>, 1072 + tonic::Status, 1073 + >; 1074 + async fn get_liked_albums( 1075 + &self, 1076 + request: tonic::Request<super::GetLikedAlbumsRequest>, 1077 + ) -> std::result::Result< 1078 + tonic::Response<super::GetLikedAlbumsResponse>, 1079 + tonic::Status, 1080 + >; 1081 + async fn scan_library( 1082 + &self, 1083 + request: tonic::Request<super::ScanLibraryRequest>, 1084 + ) -> std::result::Result< 1085 + tonic::Response<super::ScanLibraryResponse>, 1086 + tonic::Status, 1087 + >; 1088 + async fn search( 1089 + &self, 1090 + request: tonic::Request<super::SearchRequest>, 1091 + ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status>; 1092 + } 1093 + #[derive(Debug)] 1094 + pub struct LibraryServiceServer<T> { 1095 + inner: Arc<T>, 1096 + accept_compression_encodings: EnabledCompressionEncodings, 1097 + send_compression_encodings: EnabledCompressionEncodings, 1098 + max_decoding_message_size: Option<usize>, 1099 + max_encoding_message_size: Option<usize>, 1100 + } 1101 + impl<T> LibraryServiceServer<T> { 1102 + pub fn new(inner: T) -> Self { 1103 + Self::from_arc(Arc::new(inner)) 1104 + } 1105 + pub fn from_arc(inner: Arc<T>) -> Self { 1106 + Self { 1107 + inner, 1108 + accept_compression_encodings: Default::default(), 1109 + send_compression_encodings: Default::default(), 1110 + max_decoding_message_size: None, 1111 + max_encoding_message_size: None, 1112 + } 1113 + } 1114 + pub fn with_interceptor<F>( 1115 + inner: T, 1116 + interceptor: F, 1117 + ) -> InterceptedService<Self, F> 1118 + where 1119 + F: tonic::service::Interceptor, 1120 + { 1121 + InterceptedService::new(Self::new(inner), interceptor) 1122 + } 1123 + /// Enable decompressing requests with the given encoding. 1124 + #[must_use] 1125 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 1126 + self.accept_compression_encodings.enable(encoding); 1127 + self 1128 + } 1129 + /// Compress responses with the given encoding, if the client supports it. 1130 + #[must_use] 1131 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 1132 + self.send_compression_encodings.enable(encoding); 1133 + self 1134 + } 1135 + /// Limits the maximum size of a decoded message. 1136 + /// 1137 + /// Default: `4MB` 1138 + #[must_use] 1139 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 1140 + self.max_decoding_message_size = Some(limit); 1141 + self 1142 + } 1143 + /// Limits the maximum size of an encoded message. 1144 + /// 1145 + /// Default: `usize::MAX` 1146 + #[must_use] 1147 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 1148 + self.max_encoding_message_size = Some(limit); 1149 + self 1150 + } 1151 + } 1152 + impl<T, B> tonic::codegen::Service<http::Request<B>> for LibraryServiceServer<T> 1153 + where 1154 + T: LibraryService, 1155 + B: Body + std::marker::Send + 'static, 1156 + B::Error: Into<StdError> + std::marker::Send + 'static, 1157 + { 1158 + type Response = http::Response<tonic::body::BoxBody>; 1159 + type Error = std::convert::Infallible; 1160 + type Future = BoxFuture<Self::Response, Self::Error>; 1161 + fn poll_ready( 1162 + &mut self, 1163 + _cx: &mut Context<'_>, 1164 + ) -> Poll<std::result::Result<(), Self::Error>> { 1165 + Poll::Ready(Ok(())) 1166 + } 1167 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 1168 + match req.uri().path() { 1169 + "/rockbox.v1alpha1.LibraryService/GetAlbums" => { 1170 + #[allow(non_camel_case_types)] 1171 + struct GetAlbumsSvc<T: LibraryService>(pub Arc<T>); 1172 + impl< 1173 + T: LibraryService, 1174 + > tonic::server::UnaryService<super::GetAlbumsRequest> 1175 + for GetAlbumsSvc<T> { 1176 + type Response = super::GetAlbumsResponse; 1177 + type Future = BoxFuture< 1178 + tonic::Response<Self::Response>, 1179 + tonic::Status, 1180 + >; 1181 + fn call( 1182 + &mut self, 1183 + request: tonic::Request<super::GetAlbumsRequest>, 1184 + ) -> Self::Future { 1185 + let inner = Arc::clone(&self.0); 1186 + let fut = async move { 1187 + <T as LibraryService>::get_albums(&inner, request).await 1188 + }; 1189 + Box::pin(fut) 1190 + } 1191 + } 1192 + let accept_compression_encodings = self.accept_compression_encodings; 1193 + let send_compression_encodings = self.send_compression_encodings; 1194 + let max_decoding_message_size = self.max_decoding_message_size; 1195 + let max_encoding_message_size = self.max_encoding_message_size; 1196 + let inner = self.inner.clone(); 1197 + let fut = async move { 1198 + let method = GetAlbumsSvc(inner); 1199 + let codec = tonic::codec::ProstCodec::default(); 1200 + let mut grpc = tonic::server::Grpc::new(codec) 1201 + .apply_compression_config( 1202 + accept_compression_encodings, 1203 + send_compression_encodings, 1204 + ) 1205 + .apply_max_message_size_config( 1206 + max_decoding_message_size, 1207 + max_encoding_message_size, 1208 + ); 1209 + let res = grpc.unary(method, req).await; 1210 + Ok(res) 1211 + }; 1212 + Box::pin(fut) 1213 + } 1214 + "/rockbox.v1alpha1.LibraryService/GetArtists" => { 1215 + #[allow(non_camel_case_types)] 1216 + struct GetArtistsSvc<T: LibraryService>(pub Arc<T>); 1217 + impl< 1218 + T: LibraryService, 1219 + > tonic::server::UnaryService<super::GetArtistsRequest> 1220 + for GetArtistsSvc<T> { 1221 + type Response = super::GetArtistsResponse; 1222 + type Future = BoxFuture< 1223 + tonic::Response<Self::Response>, 1224 + tonic::Status, 1225 + >; 1226 + fn call( 1227 + &mut self, 1228 + request: tonic::Request<super::GetArtistsRequest>, 1229 + ) -> Self::Future { 1230 + let inner = Arc::clone(&self.0); 1231 + let fut = async move { 1232 + <T as LibraryService>::get_artists(&inner, request).await 1233 + }; 1234 + Box::pin(fut) 1235 + } 1236 + } 1237 + let accept_compression_encodings = self.accept_compression_encodings; 1238 + let send_compression_encodings = self.send_compression_encodings; 1239 + let max_decoding_message_size = self.max_decoding_message_size; 1240 + let max_encoding_message_size = self.max_encoding_message_size; 1241 + let inner = self.inner.clone(); 1242 + let fut = async move { 1243 + let method = GetArtistsSvc(inner); 1244 + let codec = tonic::codec::ProstCodec::default(); 1245 + let mut grpc = tonic::server::Grpc::new(codec) 1246 + .apply_compression_config( 1247 + accept_compression_encodings, 1248 + send_compression_encodings, 1249 + ) 1250 + .apply_max_message_size_config( 1251 + max_decoding_message_size, 1252 + max_encoding_message_size, 1253 + ); 1254 + let res = grpc.unary(method, req).await; 1255 + Ok(res) 1256 + }; 1257 + Box::pin(fut) 1258 + } 1259 + "/rockbox.v1alpha1.LibraryService/GetTracks" => { 1260 + #[allow(non_camel_case_types)] 1261 + struct GetTracksSvc<T: LibraryService>(pub Arc<T>); 1262 + impl< 1263 + T: LibraryService, 1264 + > tonic::server::UnaryService<super::GetTracksRequest> 1265 + for GetTracksSvc<T> { 1266 + type Response = super::GetTracksResponse; 1267 + type Future = BoxFuture< 1268 + tonic::Response<Self::Response>, 1269 + tonic::Status, 1270 + >; 1271 + fn call( 1272 + &mut self, 1273 + request: tonic::Request<super::GetTracksRequest>, 1274 + ) -> Self::Future { 1275 + let inner = Arc::clone(&self.0); 1276 + let fut = async move { 1277 + <T as LibraryService>::get_tracks(&inner, request).await 1278 + }; 1279 + Box::pin(fut) 1280 + } 1281 + } 1282 + let accept_compression_encodings = self.accept_compression_encodings; 1283 + let send_compression_encodings = self.send_compression_encodings; 1284 + let max_decoding_message_size = self.max_decoding_message_size; 1285 + let max_encoding_message_size = self.max_encoding_message_size; 1286 + let inner = self.inner.clone(); 1287 + let fut = async move { 1288 + let method = GetTracksSvc(inner); 1289 + let codec = tonic::codec::ProstCodec::default(); 1290 + let mut grpc = tonic::server::Grpc::new(codec) 1291 + .apply_compression_config( 1292 + accept_compression_encodings, 1293 + send_compression_encodings, 1294 + ) 1295 + .apply_max_message_size_config( 1296 + max_decoding_message_size, 1297 + max_encoding_message_size, 1298 + ); 1299 + let res = grpc.unary(method, req).await; 1300 + Ok(res) 1301 + }; 1302 + Box::pin(fut) 1303 + } 1304 + "/rockbox.v1alpha1.LibraryService/GetAlbum" => { 1305 + #[allow(non_camel_case_types)] 1306 + struct GetAlbumSvc<T: LibraryService>(pub Arc<T>); 1307 + impl< 1308 + T: LibraryService, 1309 + > tonic::server::UnaryService<super::GetAlbumRequest> 1310 + for GetAlbumSvc<T> { 1311 + type Response = super::GetAlbumResponse; 1312 + type Future = BoxFuture< 1313 + tonic::Response<Self::Response>, 1314 + tonic::Status, 1315 + >; 1316 + fn call( 1317 + &mut self, 1318 + request: tonic::Request<super::GetAlbumRequest>, 1319 + ) -> Self::Future { 1320 + let inner = Arc::clone(&self.0); 1321 + let fut = async move { 1322 + <T as LibraryService>::get_album(&inner, request).await 1323 + }; 1324 + Box::pin(fut) 1325 + } 1326 + } 1327 + let accept_compression_encodings = self.accept_compression_encodings; 1328 + let send_compression_encodings = self.send_compression_encodings; 1329 + let max_decoding_message_size = self.max_decoding_message_size; 1330 + let max_encoding_message_size = self.max_encoding_message_size; 1331 + let inner = self.inner.clone(); 1332 + let fut = async move { 1333 + let method = GetAlbumSvc(inner); 1334 + let codec = tonic::codec::ProstCodec::default(); 1335 + let mut grpc = tonic::server::Grpc::new(codec) 1336 + .apply_compression_config( 1337 + accept_compression_encodings, 1338 + send_compression_encodings, 1339 + ) 1340 + .apply_max_message_size_config( 1341 + max_decoding_message_size, 1342 + max_encoding_message_size, 1343 + ); 1344 + let res = grpc.unary(method, req).await; 1345 + Ok(res) 1346 + }; 1347 + Box::pin(fut) 1348 + } 1349 + "/rockbox.v1alpha1.LibraryService/GetArtist" => { 1350 + #[allow(non_camel_case_types)] 1351 + struct GetArtistSvc<T: LibraryService>(pub Arc<T>); 1352 + impl< 1353 + T: LibraryService, 1354 + > tonic::server::UnaryService<super::GetArtistRequest> 1355 + for GetArtistSvc<T> { 1356 + type Response = super::GetArtistResponse; 1357 + type Future = BoxFuture< 1358 + tonic::Response<Self::Response>, 1359 + tonic::Status, 1360 + >; 1361 + fn call( 1362 + &mut self, 1363 + request: tonic::Request<super::GetArtistRequest>, 1364 + ) -> Self::Future { 1365 + let inner = Arc::clone(&self.0); 1366 + let fut = async move { 1367 + <T as LibraryService>::get_artist(&inner, request).await 1368 + }; 1369 + Box::pin(fut) 1370 + } 1371 + } 1372 + let accept_compression_encodings = self.accept_compression_encodings; 1373 + let send_compression_encodings = self.send_compression_encodings; 1374 + let max_decoding_message_size = self.max_decoding_message_size; 1375 + let max_encoding_message_size = self.max_encoding_message_size; 1376 + let inner = self.inner.clone(); 1377 + let fut = async move { 1378 + let method = GetArtistSvc(inner); 1379 + let codec = tonic::codec::ProstCodec::default(); 1380 + let mut grpc = tonic::server::Grpc::new(codec) 1381 + .apply_compression_config( 1382 + accept_compression_encodings, 1383 + send_compression_encodings, 1384 + ) 1385 + .apply_max_message_size_config( 1386 + max_decoding_message_size, 1387 + max_encoding_message_size, 1388 + ); 1389 + let res = grpc.unary(method, req).await; 1390 + Ok(res) 1391 + }; 1392 + Box::pin(fut) 1393 + } 1394 + "/rockbox.v1alpha1.LibraryService/GetTrack" => { 1395 + #[allow(non_camel_case_types)] 1396 + struct GetTrackSvc<T: LibraryService>(pub Arc<T>); 1397 + impl< 1398 + T: LibraryService, 1399 + > tonic::server::UnaryService<super::GetTrackRequest> 1400 + for GetTrackSvc<T> { 1401 + type Response = super::GetTrackResponse; 1402 + type Future = BoxFuture< 1403 + tonic::Response<Self::Response>, 1404 + tonic::Status, 1405 + >; 1406 + fn call( 1407 + &mut self, 1408 + request: tonic::Request<super::GetTrackRequest>, 1409 + ) -> Self::Future { 1410 + let inner = Arc::clone(&self.0); 1411 + let fut = async move { 1412 + <T as LibraryService>::get_track(&inner, request).await 1413 + }; 1414 + Box::pin(fut) 1415 + } 1416 + } 1417 + let accept_compression_encodings = self.accept_compression_encodings; 1418 + let send_compression_encodings = self.send_compression_encodings; 1419 + let max_decoding_message_size = self.max_decoding_message_size; 1420 + let max_encoding_message_size = self.max_encoding_message_size; 1421 + let inner = self.inner.clone(); 1422 + let fut = async move { 1423 + let method = GetTrackSvc(inner); 1424 + let codec = tonic::codec::ProstCodec::default(); 1425 + let mut grpc = tonic::server::Grpc::new(codec) 1426 + .apply_compression_config( 1427 + accept_compression_encodings, 1428 + send_compression_encodings, 1429 + ) 1430 + .apply_max_message_size_config( 1431 + max_decoding_message_size, 1432 + max_encoding_message_size, 1433 + ); 1434 + let res = grpc.unary(method, req).await; 1435 + Ok(res) 1436 + }; 1437 + Box::pin(fut) 1438 + } 1439 + "/rockbox.v1alpha1.LibraryService/LikeTrack" => { 1440 + #[allow(non_camel_case_types)] 1441 + struct LikeTrackSvc<T: LibraryService>(pub Arc<T>); 1442 + impl< 1443 + T: LibraryService, 1444 + > tonic::server::UnaryService<super::LikeTrackRequest> 1445 + for LikeTrackSvc<T> { 1446 + type Response = super::LikeTrackResponse; 1447 + type Future = BoxFuture< 1448 + tonic::Response<Self::Response>, 1449 + tonic::Status, 1450 + >; 1451 + fn call( 1452 + &mut self, 1453 + request: tonic::Request<super::LikeTrackRequest>, 1454 + ) -> Self::Future { 1455 + let inner = Arc::clone(&self.0); 1456 + let fut = async move { 1457 + <T as LibraryService>::like_track(&inner, request).await 1458 + }; 1459 + Box::pin(fut) 1460 + } 1461 + } 1462 + let accept_compression_encodings = self.accept_compression_encodings; 1463 + let send_compression_encodings = self.send_compression_encodings; 1464 + let max_decoding_message_size = self.max_decoding_message_size; 1465 + let max_encoding_message_size = self.max_encoding_message_size; 1466 + let inner = self.inner.clone(); 1467 + let fut = async move { 1468 + let method = LikeTrackSvc(inner); 1469 + let codec = tonic::codec::ProstCodec::default(); 1470 + let mut grpc = tonic::server::Grpc::new(codec) 1471 + .apply_compression_config( 1472 + accept_compression_encodings, 1473 + send_compression_encodings, 1474 + ) 1475 + .apply_max_message_size_config( 1476 + max_decoding_message_size, 1477 + max_encoding_message_size, 1478 + ); 1479 + let res = grpc.unary(method, req).await; 1480 + Ok(res) 1481 + }; 1482 + Box::pin(fut) 1483 + } 1484 + "/rockbox.v1alpha1.LibraryService/UnlikeTrack" => { 1485 + #[allow(non_camel_case_types)] 1486 + struct UnlikeTrackSvc<T: LibraryService>(pub Arc<T>); 1487 + impl< 1488 + T: LibraryService, 1489 + > tonic::server::UnaryService<super::UnlikeTrackRequest> 1490 + for UnlikeTrackSvc<T> { 1491 + type Response = super::UnlikeTrackResponse; 1492 + type Future = BoxFuture< 1493 + tonic::Response<Self::Response>, 1494 + tonic::Status, 1495 + >; 1496 + fn call( 1497 + &mut self, 1498 + request: tonic::Request<super::UnlikeTrackRequest>, 1499 + ) -> Self::Future { 1500 + let inner = Arc::clone(&self.0); 1501 + let fut = async move { 1502 + <T as LibraryService>::unlike_track(&inner, request).await 1503 + }; 1504 + Box::pin(fut) 1505 + } 1506 + } 1507 + let accept_compression_encodings = self.accept_compression_encodings; 1508 + let send_compression_encodings = self.send_compression_encodings; 1509 + let max_decoding_message_size = self.max_decoding_message_size; 1510 + let max_encoding_message_size = self.max_encoding_message_size; 1511 + let inner = self.inner.clone(); 1512 + let fut = async move { 1513 + let method = UnlikeTrackSvc(inner); 1514 + let codec = tonic::codec::ProstCodec::default(); 1515 + let mut grpc = tonic::server::Grpc::new(codec) 1516 + .apply_compression_config( 1517 + accept_compression_encodings, 1518 + send_compression_encodings, 1519 + ) 1520 + .apply_max_message_size_config( 1521 + max_decoding_message_size, 1522 + max_encoding_message_size, 1523 + ); 1524 + let res = grpc.unary(method, req).await; 1525 + Ok(res) 1526 + }; 1527 + Box::pin(fut) 1528 + } 1529 + "/rockbox.v1alpha1.LibraryService/LikeAlbum" => { 1530 + #[allow(non_camel_case_types)] 1531 + struct LikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1532 + impl< 1533 + T: LibraryService, 1534 + > tonic::server::UnaryService<super::LikeAlbumRequest> 1535 + for LikeAlbumSvc<T> { 1536 + type Response = super::LikeAlbumResponse; 1537 + type Future = BoxFuture< 1538 + tonic::Response<Self::Response>, 1539 + tonic::Status, 1540 + >; 1541 + fn call( 1542 + &mut self, 1543 + request: tonic::Request<super::LikeAlbumRequest>, 1544 + ) -> Self::Future { 1545 + let inner = Arc::clone(&self.0); 1546 + let fut = async move { 1547 + <T as LibraryService>::like_album(&inner, request).await 1548 + }; 1549 + Box::pin(fut) 1550 + } 1551 + } 1552 + let accept_compression_encodings = self.accept_compression_encodings; 1553 + let send_compression_encodings = self.send_compression_encodings; 1554 + let max_decoding_message_size = self.max_decoding_message_size; 1555 + let max_encoding_message_size = self.max_encoding_message_size; 1556 + let inner = self.inner.clone(); 1557 + let fut = async move { 1558 + let method = LikeAlbumSvc(inner); 1559 + let codec = tonic::codec::ProstCodec::default(); 1560 + let mut grpc = tonic::server::Grpc::new(codec) 1561 + .apply_compression_config( 1562 + accept_compression_encodings, 1563 + send_compression_encodings, 1564 + ) 1565 + .apply_max_message_size_config( 1566 + max_decoding_message_size, 1567 + max_encoding_message_size, 1568 + ); 1569 + let res = grpc.unary(method, req).await; 1570 + Ok(res) 1571 + }; 1572 + Box::pin(fut) 1573 + } 1574 + "/rockbox.v1alpha1.LibraryService/UnlikeAlbum" => { 1575 + #[allow(non_camel_case_types)] 1576 + struct UnlikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1577 + impl< 1578 + T: LibraryService, 1579 + > tonic::server::UnaryService<super::UnlikeAlbumRequest> 1580 + for UnlikeAlbumSvc<T> { 1581 + type Response = super::UnlikeAlbumResponse; 1582 + type Future = BoxFuture< 1583 + tonic::Response<Self::Response>, 1584 + tonic::Status, 1585 + >; 1586 + fn call( 1587 + &mut self, 1588 + request: tonic::Request<super::UnlikeAlbumRequest>, 1589 + ) -> Self::Future { 1590 + let inner = Arc::clone(&self.0); 1591 + let fut = async move { 1592 + <T as LibraryService>::unlike_album(&inner, request).await 1593 + }; 1594 + Box::pin(fut) 1595 + } 1596 + } 1597 + let accept_compression_encodings = self.accept_compression_encodings; 1598 + let send_compression_encodings = self.send_compression_encodings; 1599 + let max_decoding_message_size = self.max_decoding_message_size; 1600 + let max_encoding_message_size = self.max_encoding_message_size; 1601 + let inner = self.inner.clone(); 1602 + let fut = async move { 1603 + let method = UnlikeAlbumSvc(inner); 1604 + let codec = tonic::codec::ProstCodec::default(); 1605 + let mut grpc = tonic::server::Grpc::new(codec) 1606 + .apply_compression_config( 1607 + accept_compression_encodings, 1608 + send_compression_encodings, 1609 + ) 1610 + .apply_max_message_size_config( 1611 + max_decoding_message_size, 1612 + max_encoding_message_size, 1613 + ); 1614 + let res = grpc.unary(method, req).await; 1615 + Ok(res) 1616 + }; 1617 + Box::pin(fut) 1618 + } 1619 + "/rockbox.v1alpha1.LibraryService/GetLikedTracks" => { 1620 + #[allow(non_camel_case_types)] 1621 + struct GetLikedTracksSvc<T: LibraryService>(pub Arc<T>); 1622 + impl< 1623 + T: LibraryService, 1624 + > tonic::server::UnaryService<super::GetLikedTracksRequest> 1625 + for GetLikedTracksSvc<T> { 1626 + type Response = super::GetLikedTracksResponse; 1627 + type Future = BoxFuture< 1628 + tonic::Response<Self::Response>, 1629 + tonic::Status, 1630 + >; 1631 + fn call( 1632 + &mut self, 1633 + request: tonic::Request<super::GetLikedTracksRequest>, 1634 + ) -> Self::Future { 1635 + let inner = Arc::clone(&self.0); 1636 + let fut = async move { 1637 + <T as LibraryService>::get_liked_tracks(&inner, request) 1638 + .await 1639 + }; 1640 + Box::pin(fut) 1641 + } 1642 + } 1643 + let accept_compression_encodings = self.accept_compression_encodings; 1644 + let send_compression_encodings = self.send_compression_encodings; 1645 + let max_decoding_message_size = self.max_decoding_message_size; 1646 + let max_encoding_message_size = self.max_encoding_message_size; 1647 + let inner = self.inner.clone(); 1648 + let fut = async move { 1649 + let method = GetLikedTracksSvc(inner); 1650 + let codec = tonic::codec::ProstCodec::default(); 1651 + let mut grpc = tonic::server::Grpc::new(codec) 1652 + .apply_compression_config( 1653 + accept_compression_encodings, 1654 + send_compression_encodings, 1655 + ) 1656 + .apply_max_message_size_config( 1657 + max_decoding_message_size, 1658 + max_encoding_message_size, 1659 + ); 1660 + let res = grpc.unary(method, req).await; 1661 + Ok(res) 1662 + }; 1663 + Box::pin(fut) 1664 + } 1665 + "/rockbox.v1alpha1.LibraryService/GetLikedAlbums" => { 1666 + #[allow(non_camel_case_types)] 1667 + struct GetLikedAlbumsSvc<T: LibraryService>(pub Arc<T>); 1668 + impl< 1669 + T: LibraryService, 1670 + > tonic::server::UnaryService<super::GetLikedAlbumsRequest> 1671 + for GetLikedAlbumsSvc<T> { 1672 + type Response = super::GetLikedAlbumsResponse; 1673 + type Future = BoxFuture< 1674 + tonic::Response<Self::Response>, 1675 + tonic::Status, 1676 + >; 1677 + fn call( 1678 + &mut self, 1679 + request: tonic::Request<super::GetLikedAlbumsRequest>, 1680 + ) -> Self::Future { 1681 + let inner = Arc::clone(&self.0); 1682 + let fut = async move { 1683 + <T as LibraryService>::get_liked_albums(&inner, request) 1684 + .await 1685 + }; 1686 + Box::pin(fut) 1687 + } 1688 + } 1689 + let accept_compression_encodings = self.accept_compression_encodings; 1690 + let send_compression_encodings = self.send_compression_encodings; 1691 + let max_decoding_message_size = self.max_decoding_message_size; 1692 + let max_encoding_message_size = self.max_encoding_message_size; 1693 + let inner = self.inner.clone(); 1694 + let fut = async move { 1695 + let method = GetLikedAlbumsSvc(inner); 1696 + let codec = tonic::codec::ProstCodec::default(); 1697 + let mut grpc = tonic::server::Grpc::new(codec) 1698 + .apply_compression_config( 1699 + accept_compression_encodings, 1700 + send_compression_encodings, 1701 + ) 1702 + .apply_max_message_size_config( 1703 + max_decoding_message_size, 1704 + max_encoding_message_size, 1705 + ); 1706 + let res = grpc.unary(method, req).await; 1707 + Ok(res) 1708 + }; 1709 + Box::pin(fut) 1710 + } 1711 + "/rockbox.v1alpha1.LibraryService/ScanLibrary" => { 1712 + #[allow(non_camel_case_types)] 1713 + struct ScanLibrarySvc<T: LibraryService>(pub Arc<T>); 1714 + impl< 1715 + T: LibraryService, 1716 + > tonic::server::UnaryService<super::ScanLibraryRequest> 1717 + for ScanLibrarySvc<T> { 1718 + type Response = super::ScanLibraryResponse; 1719 + type Future = BoxFuture< 1720 + tonic::Response<Self::Response>, 1721 + tonic::Status, 1722 + >; 1723 + fn call( 1724 + &mut self, 1725 + request: tonic::Request<super::ScanLibraryRequest>, 1726 + ) -> Self::Future { 1727 + let inner = Arc::clone(&self.0); 1728 + let fut = async move { 1729 + <T as LibraryService>::scan_library(&inner, request).await 1730 + }; 1731 + Box::pin(fut) 1732 + } 1733 + } 1734 + let accept_compression_encodings = self.accept_compression_encodings; 1735 + let send_compression_encodings = self.send_compression_encodings; 1736 + let max_decoding_message_size = self.max_decoding_message_size; 1737 + let max_encoding_message_size = self.max_encoding_message_size; 1738 + let inner = self.inner.clone(); 1739 + let fut = async move { 1740 + let method = ScanLibrarySvc(inner); 1741 + let codec = tonic::codec::ProstCodec::default(); 1742 + let mut grpc = tonic::server::Grpc::new(codec) 1743 + .apply_compression_config( 1744 + accept_compression_encodings, 1745 + send_compression_encodings, 1746 + ) 1747 + .apply_max_message_size_config( 1748 + max_decoding_message_size, 1749 + max_encoding_message_size, 1750 + ); 1751 + let res = grpc.unary(method, req).await; 1752 + Ok(res) 1753 + }; 1754 + Box::pin(fut) 1755 + } 1756 + "/rockbox.v1alpha1.LibraryService/Search" => { 1757 + #[allow(non_camel_case_types)] 1758 + struct SearchSvc<T: LibraryService>(pub Arc<T>); 1759 + impl< 1760 + T: LibraryService, 1761 + > tonic::server::UnaryService<super::SearchRequest> 1762 + for SearchSvc<T> { 1763 + type Response = super::SearchResponse; 1764 + type Future = BoxFuture< 1765 + tonic::Response<Self::Response>, 1766 + tonic::Status, 1767 + >; 1768 + fn call( 1769 + &mut self, 1770 + request: tonic::Request<super::SearchRequest>, 1771 + ) -> Self::Future { 1772 + let inner = Arc::clone(&self.0); 1773 + let fut = async move { 1774 + <T as LibraryService>::search(&inner, request).await 1775 + }; 1776 + Box::pin(fut) 1777 + } 1778 + } 1779 + let accept_compression_encodings = self.accept_compression_encodings; 1780 + let send_compression_encodings = self.send_compression_encodings; 1781 + let max_decoding_message_size = self.max_decoding_message_size; 1782 + let max_encoding_message_size = self.max_encoding_message_size; 1783 + let inner = self.inner.clone(); 1784 + let fut = async move { 1785 + let method = SearchSvc(inner); 1786 + let codec = tonic::codec::ProstCodec::default(); 1787 + let mut grpc = tonic::server::Grpc::new(codec) 1788 + .apply_compression_config( 1789 + accept_compression_encodings, 1790 + send_compression_encodings, 1791 + ) 1792 + .apply_max_message_size_config( 1793 + max_decoding_message_size, 1794 + max_encoding_message_size, 1795 + ); 1796 + let res = grpc.unary(method, req).await; 1797 + Ok(res) 1798 + }; 1799 + Box::pin(fut) 1800 + } 1801 + _ => { 1802 + Box::pin(async move { 1803 + let mut response = http::Response::new(empty_body()); 1804 + let headers = response.headers_mut(); 1805 + headers 1806 + .insert( 1807 + tonic::Status::GRPC_STATUS, 1808 + (tonic::Code::Unimplemented as i32).into(), 1809 + ); 1810 + headers 1811 + .insert( 1812 + http::header::CONTENT_TYPE, 1813 + tonic::metadata::GRPC_CONTENT_TYPE, 1814 + ); 1815 + Ok(response) 1816 + }) 1817 + } 1818 + } 1819 + } 1820 + } 1821 + impl<T> Clone for LibraryServiceServer<T> { 1822 + fn clone(&self) -> Self { 1823 + let inner = self.inner.clone(); 1824 + Self { 1825 + inner, 1826 + accept_compression_encodings: self.accept_compression_encodings, 1827 + send_compression_encodings: self.send_compression_encodings, 1828 + max_decoding_message_size: self.max_decoding_message_size, 1829 + max_encoding_message_size: self.max_encoding_message_size, 1830 + } 1831 + } 1832 + } 1833 + /// Generated gRPC service name 1834 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.LibraryService"; 1835 + impl<T> tonic::server::NamedService for LibraryServiceServer<T> { 1836 + const NAME: &'static str = SERVICE_NAME; 1837 + } 1838 + } 1839 + /// Generated client implementations. 1840 + pub mod metadata_service_client { 1841 + #![allow( 1842 + unused_variables, 1843 + dead_code, 1844 + missing_docs, 1845 + clippy::wildcard_imports, 1846 + clippy::let_unit_value, 1847 + )] 1848 + use tonic::codegen::*; 1849 + use tonic::codegen::http::Uri; 1850 + #[derive(Debug, Clone)] 1851 + pub struct MetadataServiceClient<T> { 1852 + inner: tonic::client::Grpc<T>, 1853 + } 1854 + impl MetadataServiceClient<tonic::transport::Channel> { 1855 + /// Attempt to create a new client by connecting to a given endpoint. 1856 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 1857 + where 1858 + D: TryInto<tonic::transport::Endpoint>, 1859 + D::Error: Into<StdError>, 1860 + { 1861 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 1862 + Ok(Self::new(conn)) 1863 + } 1864 + } 1865 + impl<T> MetadataServiceClient<T> 1866 + where 1867 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 1868 + T::Error: Into<StdError>, 1869 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 1870 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 1871 + { 1872 + pub fn new(inner: T) -> Self { 1873 + let inner = tonic::client::Grpc::new(inner); 1874 + Self { inner } 1875 + } 1876 + pub fn with_origin(inner: T, origin: Uri) -> Self { 1877 + let inner = tonic::client::Grpc::with_origin(inner, origin); 1878 + Self { inner } 1879 + } 1880 + pub fn with_interceptor<F>( 1881 + inner: T, 1882 + interceptor: F, 1883 + ) -> MetadataServiceClient<InterceptedService<T, F>> 1884 + where 1885 + F: tonic::service::Interceptor, 1886 + T::ResponseBody: Default, 1887 + T: tonic::codegen::Service< 1888 + http::Request<tonic::body::BoxBody>, 1889 + Response = http::Response< 1890 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 1891 + >, 1892 + >, 1893 + <T as tonic::codegen::Service< 1894 + http::Request<tonic::body::BoxBody>, 1895 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 1896 + { 1897 + MetadataServiceClient::new(InterceptedService::new(inner, interceptor)) 1898 + } 1899 + /// Compress requests with the given encoding. 1900 + /// 1901 + /// This requires the server to support it otherwise it might respond with an 1902 + /// error. 1903 + #[must_use] 1904 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 1905 + self.inner = self.inner.send_compressed(encoding); 1906 + self 1907 + } 1908 + /// Enable decompressing responses. 1909 + #[must_use] 1910 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 1911 + self.inner = self.inner.accept_compressed(encoding); 1912 + self 1913 + } 1914 + /// Limits the maximum size of a decoded message. 1915 + /// 1916 + /// Default: `4MB` 1917 + #[must_use] 1918 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 1919 + self.inner = self.inner.max_decoding_message_size(limit); 1920 + self 1921 + } 1922 + /// Limits the maximum size of an encoded message. 1923 + /// 1924 + /// Default: `usize::MAX` 1925 + #[must_use] 1926 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 1927 + self.inner = self.inner.max_encoding_message_size(limit); 1928 + self 1929 + } 1930 + } 1931 + } 1932 + /// Generated server implementations. 1933 + pub mod metadata_service_server { 1934 + #![allow( 1935 + unused_variables, 1936 + dead_code, 1937 + missing_docs, 1938 + clippy::wildcard_imports, 1939 + clippy::let_unit_value, 1940 + )] 1941 + use tonic::codegen::*; 1942 + /// Generated trait containing gRPC methods that should be implemented for use with MetadataServiceServer. 1943 + #[async_trait] 1944 + pub trait MetadataService: std::marker::Send + std::marker::Sync + 'static {} 1945 + #[derive(Debug)] 1946 + pub struct MetadataServiceServer<T> { 1947 + inner: Arc<T>, 1948 + accept_compression_encodings: EnabledCompressionEncodings, 1949 + send_compression_encodings: EnabledCompressionEncodings, 1950 + max_decoding_message_size: Option<usize>, 1951 + max_encoding_message_size: Option<usize>, 1952 + } 1953 + impl<T> MetadataServiceServer<T> { 1954 + pub fn new(inner: T) -> Self { 1955 + Self::from_arc(Arc::new(inner)) 1956 + } 1957 + pub fn from_arc(inner: Arc<T>) -> Self { 1958 + Self { 1959 + inner, 1960 + accept_compression_encodings: Default::default(), 1961 + send_compression_encodings: Default::default(), 1962 + max_decoding_message_size: None, 1963 + max_encoding_message_size: None, 1964 + } 1965 + } 1966 + pub fn with_interceptor<F>( 1967 + inner: T, 1968 + interceptor: F, 1969 + ) -> InterceptedService<Self, F> 1970 + where 1971 + F: tonic::service::Interceptor, 1972 + { 1973 + InterceptedService::new(Self::new(inner), interceptor) 1974 + } 1975 + /// Enable decompressing requests with the given encoding. 1976 + #[must_use] 1977 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 1978 + self.accept_compression_encodings.enable(encoding); 1979 + self 1980 + } 1981 + /// Compress responses with the given encoding, if the client supports it. 1982 + #[must_use] 1983 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 1984 + self.send_compression_encodings.enable(encoding); 1985 + self 1986 + } 1987 + /// Limits the maximum size of a decoded message. 1988 + /// 1989 + /// Default: `4MB` 1990 + #[must_use] 1991 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 1992 + self.max_decoding_message_size = Some(limit); 1993 + self 1994 + } 1995 + /// Limits the maximum size of an encoded message. 1996 + /// 1997 + /// Default: `usize::MAX` 1998 + #[must_use] 1999 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 2000 + self.max_encoding_message_size = Some(limit); 2001 + self 2002 + } 2003 + } 2004 + impl<T, B> tonic::codegen::Service<http::Request<B>> for MetadataServiceServer<T> 2005 + where 2006 + T: MetadataService, 2007 + B: Body + std::marker::Send + 'static, 2008 + B::Error: Into<StdError> + std::marker::Send + 'static, 2009 + { 2010 + type Response = http::Response<tonic::body::BoxBody>; 2011 + type Error = std::convert::Infallible; 2012 + type Future = BoxFuture<Self::Response, Self::Error>; 2013 + fn poll_ready( 2014 + &mut self, 2015 + _cx: &mut Context<'_>, 2016 + ) -> Poll<std::result::Result<(), Self::Error>> { 2017 + Poll::Ready(Ok(())) 2018 + } 2019 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 2020 + match req.uri().path() { 2021 + _ => { 2022 + Box::pin(async move { 2023 + let mut response = http::Response::new(empty_body()); 2024 + let headers = response.headers_mut(); 2025 + headers 2026 + .insert( 2027 + tonic::Status::GRPC_STATUS, 2028 + (tonic::Code::Unimplemented as i32).into(), 2029 + ); 2030 + headers 2031 + .insert( 2032 + http::header::CONTENT_TYPE, 2033 + tonic::metadata::GRPC_CONTENT_TYPE, 2034 + ); 2035 + Ok(response) 2036 + }) 2037 + } 2038 + } 2039 + } 2040 + } 2041 + impl<T> Clone for MetadataServiceServer<T> { 2042 + fn clone(&self) -> Self { 2043 + let inner = self.inner.clone(); 2044 + Self { 2045 + inner, 2046 + accept_compression_encodings: self.accept_compression_encodings, 2047 + send_compression_encodings: self.send_compression_encodings, 2048 + max_decoding_message_size: self.max_decoding_message_size, 2049 + max_encoding_message_size: self.max_encoding_message_size, 2050 + } 2051 + } 2052 + } 2053 + /// Generated gRPC service name 2054 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.MetadataService"; 2055 + impl<T> tonic::server::NamedService for MetadataServiceServer<T> { 2056 + const NAME: &'static str = SERVICE_NAME; 2057 + } 2058 + } 2059 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2060 + pub struct PlayRequest { 2061 + #[prost(int64, tag = "1")] 2062 + pub elapsed: i64, 2063 + #[prost(int64, tag = "2")] 2064 + pub offset: i64, 2065 + } 2066 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2067 + pub struct PlayResponse {} 2068 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2069 + pub struct PlayOrPauseRequest {} 2070 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2071 + pub struct PlayOrPauseResponse {} 2072 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2073 + pub struct PauseRequest {} 2074 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2075 + pub struct PauseResponse {} 2076 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2077 + pub struct ResumeRequest {} 2078 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2079 + pub struct ResumeResponse {} 2080 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2081 + pub struct NextRequest {} 2082 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2083 + pub struct NextResponse {} 2084 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2085 + pub struct PreviousRequest {} 2086 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2087 + pub struct PreviousResponse {} 2088 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2089 + pub struct FastForwardRewindRequest { 2090 + #[prost(int32, tag = "1")] 2091 + pub new_time: i32, 2092 + } 2093 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2094 + pub struct FastForwardRewindResponse {} 2095 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2096 + pub struct StatusRequest {} 2097 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2098 + pub struct StreamStatusRequest {} 2099 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2100 + pub struct StatusResponse { 2101 + #[prost(int32, tag = "1")] 2102 + pub status: i32, 2103 + } 2104 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2105 + pub struct CurrentTrackRequest {} 2106 + #[derive(Clone, PartialEq, ::prost::Message)] 2107 + pub struct CurrentTrackResponse { 2108 + #[prost(string, tag = "1")] 2109 + pub title: ::prost::alloc::string::String, 2110 + #[prost(string, tag = "2")] 2111 + pub artist: ::prost::alloc::string::String, 2112 + #[prost(string, tag = "3")] 2113 + pub album: ::prost::alloc::string::String, 2114 + #[prost(string, tag = "4")] 2115 + pub genre: ::prost::alloc::string::String, 2116 + #[prost(string, tag = "5")] 2117 + pub disc: ::prost::alloc::string::String, 2118 + #[prost(string, tag = "6")] 2119 + pub track_string: ::prost::alloc::string::String, 2120 + #[prost(string, tag = "7")] 2121 + pub year_string: ::prost::alloc::string::String, 2122 + #[prost(string, tag = "8")] 2123 + pub composer: ::prost::alloc::string::String, 2124 + #[prost(string, tag = "9")] 2125 + pub comment: ::prost::alloc::string::String, 2126 + #[prost(string, tag = "10")] 2127 + pub album_artist: ::prost::alloc::string::String, 2128 + #[prost(string, tag = "11")] 2129 + pub grouping: ::prost::alloc::string::String, 2130 + #[prost(int32, tag = "12")] 2131 + pub discnum: i32, 2132 + #[prost(int32, tag = "13")] 2133 + pub tracknum: i32, 2134 + #[prost(int32, tag = "14")] 2135 + pub layer: i32, 2136 + #[prost(int32, tag = "15")] 2137 + pub year: i32, 2138 + #[prost(uint32, tag = "16")] 2139 + pub bitrate: u32, 2140 + #[prost(uint64, tag = "17")] 2141 + pub frequency: u64, 2142 + #[prost(uint64, tag = "18")] 2143 + pub filesize: u64, 2144 + #[prost(uint64, tag = "19")] 2145 + pub length: u64, 2146 + #[prost(uint64, tag = "20")] 2147 + pub elapsed: u64, 2148 + #[prost(string, tag = "21")] 2149 + pub path: ::prost::alloc::string::String, 2150 + #[prost(string, optional, tag = "22")] 2151 + pub album_art: ::core::option::Option<::prost::alloc::string::String>, 2152 + #[prost(string, tag = "23")] 2153 + pub album_id: ::prost::alloc::string::String, 2154 + #[prost(string, tag = "24")] 2155 + pub artist_id: ::prost::alloc::string::String, 2156 + #[prost(string, tag = "25")] 2157 + pub id: ::prost::alloc::string::String, 2158 + } 2159 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2160 + pub struct StreamCurrentTrackRequest {} 2161 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2162 + pub struct NextTrackRequest {} 2163 + #[derive(Clone, PartialEq, ::prost::Message)] 2164 + pub struct NextTrackResponse { 2165 + #[prost(string, tag = "1")] 2166 + pub title: ::prost::alloc::string::String, 2167 + #[prost(string, tag = "2")] 2168 + pub artist: ::prost::alloc::string::String, 2169 + #[prost(string, tag = "3")] 2170 + pub album: ::prost::alloc::string::String, 2171 + #[prost(string, tag = "4")] 2172 + pub genre: ::prost::alloc::string::String, 2173 + #[prost(string, tag = "5")] 2174 + pub disc: ::prost::alloc::string::String, 2175 + #[prost(string, tag = "6")] 2176 + pub track_string: ::prost::alloc::string::String, 2177 + #[prost(string, tag = "7")] 2178 + pub year_string: ::prost::alloc::string::String, 2179 + #[prost(string, tag = "8")] 2180 + pub composer: ::prost::alloc::string::String, 2181 + #[prost(string, tag = "9")] 2182 + pub comment: ::prost::alloc::string::String, 2183 + #[prost(string, tag = "10")] 2184 + pub album_artist: ::prost::alloc::string::String, 2185 + #[prost(string, tag = "11")] 2186 + pub grouping: ::prost::alloc::string::String, 2187 + #[prost(int32, tag = "12")] 2188 + pub discnum: i32, 2189 + #[prost(int32, tag = "13")] 2190 + pub tracknum: i32, 2191 + #[prost(int32, tag = "14")] 2192 + pub layer: i32, 2193 + #[prost(int32, tag = "15")] 2194 + pub year: i32, 2195 + #[prost(uint32, tag = "16")] 2196 + pub bitrate: u32, 2197 + #[prost(uint64, tag = "17")] 2198 + pub frequency: u64, 2199 + #[prost(uint64, tag = "18")] 2200 + pub filesize: u64, 2201 + #[prost(uint64, tag = "19")] 2202 + pub length: u64, 2203 + #[prost(uint64, tag = "20")] 2204 + pub elapsed: u64, 2205 + #[prost(string, tag = "21")] 2206 + pub path: ::prost::alloc::string::String, 2207 + } 2208 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2209 + pub struct FlushAndReloadTracksRequest {} 2210 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2211 + pub struct FlushAndReloadTracksResponse {} 2212 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2213 + pub struct GetFilePositionRequest {} 2214 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2215 + pub struct GetFilePositionResponse { 2216 + #[prost(int32, tag = "1")] 2217 + pub position: i32, 2218 + } 2219 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2220 + pub struct HardStopRequest {} 2221 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2222 + pub struct HardStopResponse {} 2223 + #[derive(Clone, PartialEq, ::prost::Message)] 2224 + pub struct PlayAlbumRequest { 2225 + #[prost(string, tag = "1")] 2226 + pub album_id: ::prost::alloc::string::String, 2227 + #[prost(bool, optional, tag = "2")] 2228 + pub shuffle: ::core::option::Option<bool>, 2229 + #[prost(int32, optional, tag = "3")] 2230 + pub position: ::core::option::Option<i32>, 2231 + } 2232 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2233 + pub struct PlayAlbumResponse {} 2234 + #[derive(Clone, PartialEq, ::prost::Message)] 2235 + pub struct PlayArtistTracksRequest { 2236 + #[prost(string, tag = "1")] 2237 + pub artist_id: ::prost::alloc::string::String, 2238 + #[prost(bool, optional, tag = "2")] 2239 + pub shuffle: ::core::option::Option<bool>, 2240 + #[prost(int32, optional, tag = "3")] 2241 + pub position: ::core::option::Option<i32>, 2242 + } 2243 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2244 + pub struct PlayArtistTracksResponse {} 2245 + #[derive(Clone, PartialEq, ::prost::Message)] 2246 + pub struct PlayPlaylistRequest { 2247 + #[prost(string, tag = "1")] 2248 + pub playlist_id: ::prost::alloc::string::String, 2249 + #[prost(bool, optional, tag = "2")] 2250 + pub shuffle: ::core::option::Option<bool>, 2251 + } 2252 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2253 + pub struct PlayPlaylistResponse {} 2254 + #[derive(Clone, PartialEq, ::prost::Message)] 2255 + pub struct PlayDirectoryRequest { 2256 + #[prost(string, tag = "1")] 2257 + pub path: ::prost::alloc::string::String, 2258 + #[prost(bool, optional, tag = "2")] 2259 + pub shuffle: ::core::option::Option<bool>, 2260 + #[prost(bool, optional, tag = "3")] 2261 + pub recurse: ::core::option::Option<bool>, 2262 + #[prost(int32, optional, tag = "4")] 2263 + pub position: ::core::option::Option<i32>, 2264 + } 2265 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2266 + pub struct PlayMusicDirectoryRequest { 2267 + #[prost(bool, optional, tag = "1")] 2268 + pub shuffle: ::core::option::Option<bool>, 2269 + #[prost(bool, optional, tag = "2")] 2270 + pub recurse: ::core::option::Option<bool>, 2271 + #[prost(int32, optional, tag = "3")] 2272 + pub position: ::core::option::Option<i32>, 2273 + } 2274 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2275 + pub struct PlayDirectoryResponse {} 2276 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2277 + pub struct PlayMusicDirectoryResponse {} 2278 + #[derive(Clone, PartialEq, ::prost::Message)] 2279 + pub struct PlayTrackRequest { 2280 + #[prost(string, tag = "1")] 2281 + pub path: ::prost::alloc::string::String, 2282 + } 2283 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2284 + pub struct PlayTrackResponse {} 2285 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2286 + pub struct PlayLikedTracksRequest { 2287 + #[prost(bool, optional, tag = "1")] 2288 + pub shuffle: ::core::option::Option<bool>, 2289 + #[prost(int32, optional, tag = "2")] 2290 + pub position: ::core::option::Option<i32>, 2291 + } 2292 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2293 + pub struct PlayLikedTracksResponse {} 2294 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2295 + pub struct PlayAllTracksRequest { 2296 + #[prost(bool, optional, tag = "1")] 2297 + pub shuffle: ::core::option::Option<bool>, 2298 + #[prost(int32, optional, tag = "2")] 2299 + pub position: ::core::option::Option<i32>, 2300 + } 2301 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2302 + pub struct PlayAllTracksResponse {} 2303 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2304 + pub struct StreamPlaylistRequest {} 2305 + #[derive(Clone, PartialEq, ::prost::Message)] 2306 + pub struct PlaylistResponse { 2307 + #[prost(int32, tag = "1")] 2308 + pub index: i32, 2309 + #[prost(int32, tag = "2")] 2310 + pub amount: i32, 2311 + #[prost(message, repeated, tag = "3")] 2312 + pub tracks: ::prost::alloc::vec::Vec<CurrentTrackResponse>, 2313 + } 2314 + /// Generated client implementations. 2315 + pub mod playback_service_client { 2316 + #![allow( 2317 + unused_variables, 2318 + dead_code, 2319 + missing_docs, 2320 + clippy::wildcard_imports, 2321 + clippy::let_unit_value, 2322 + )] 2323 + use tonic::codegen::*; 2324 + use tonic::codegen::http::Uri; 2325 + #[derive(Debug, Clone)] 2326 + pub struct PlaybackServiceClient<T> { 2327 + inner: tonic::client::Grpc<T>, 2328 + } 2329 + impl PlaybackServiceClient<tonic::transport::Channel> { 2330 + /// Attempt to create a new client by connecting to a given endpoint. 2331 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 2332 + where 2333 + D: TryInto<tonic::transport::Endpoint>, 2334 + D::Error: Into<StdError>, 2335 + { 2336 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 2337 + Ok(Self::new(conn)) 2338 + } 2339 + } 2340 + impl<T> PlaybackServiceClient<T> 2341 + where 2342 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 2343 + T::Error: Into<StdError>, 2344 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 2345 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 2346 + { 2347 + pub fn new(inner: T) -> Self { 2348 + let inner = tonic::client::Grpc::new(inner); 2349 + Self { inner } 2350 + } 2351 + pub fn with_origin(inner: T, origin: Uri) -> Self { 2352 + let inner = tonic::client::Grpc::with_origin(inner, origin); 2353 + Self { inner } 2354 + } 2355 + pub fn with_interceptor<F>( 2356 + inner: T, 2357 + interceptor: F, 2358 + ) -> PlaybackServiceClient<InterceptedService<T, F>> 2359 + where 2360 + F: tonic::service::Interceptor, 2361 + T::ResponseBody: Default, 2362 + T: tonic::codegen::Service< 2363 + http::Request<tonic::body::BoxBody>, 2364 + Response = http::Response< 2365 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 2366 + >, 2367 + >, 2368 + <T as tonic::codegen::Service< 2369 + http::Request<tonic::body::BoxBody>, 2370 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 2371 + { 2372 + PlaybackServiceClient::new(InterceptedService::new(inner, interceptor)) 2373 + } 2374 + /// Compress requests with the given encoding. 2375 + /// 2376 + /// This requires the server to support it otherwise it might respond with an 2377 + /// error. 2378 + #[must_use] 2379 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 2380 + self.inner = self.inner.send_compressed(encoding); 2381 + self 2382 + } 2383 + /// Enable decompressing responses. 2384 + #[must_use] 2385 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 2386 + self.inner = self.inner.accept_compressed(encoding); 2387 + self 2388 + } 2389 + /// Limits the maximum size of a decoded message. 2390 + /// 2391 + /// Default: `4MB` 2392 + #[must_use] 2393 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 2394 + self.inner = self.inner.max_decoding_message_size(limit); 2395 + self 2396 + } 2397 + /// Limits the maximum size of an encoded message. 2398 + /// 2399 + /// Default: `usize::MAX` 2400 + #[must_use] 2401 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 2402 + self.inner = self.inner.max_encoding_message_size(limit); 2403 + self 2404 + } 2405 + pub async fn play( 2406 + &mut self, 2407 + request: impl tonic::IntoRequest<super::PlayRequest>, 2408 + ) -> std::result::Result<tonic::Response<super::PlayResponse>, tonic::Status> { 2409 + self.inner 2410 + .ready() 2411 + .await 2412 + .map_err(|e| { 2413 + tonic::Status::unknown( 2414 + format!("Service was not ready: {}", e.into()), 2415 + ) 2416 + })?; 2417 + let codec = tonic::codec::ProstCodec::default(); 2418 + let path = http::uri::PathAndQuery::from_static( 2419 + "/rockbox.v1alpha1.PlaybackService/Play", 2420 + ); 2421 + let mut req = request.into_request(); 2422 + req.extensions_mut() 2423 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Play")); 2424 + self.inner.unary(req, path, codec).await 2425 + } 2426 + pub async fn pause( 2427 + &mut self, 2428 + request: impl tonic::IntoRequest<super::PauseRequest>, 2429 + ) -> std::result::Result<tonic::Response<super::PauseResponse>, tonic::Status> { 2430 + self.inner 2431 + .ready() 2432 + .await 2433 + .map_err(|e| { 2434 + tonic::Status::unknown( 2435 + format!("Service was not ready: {}", e.into()), 2436 + ) 2437 + })?; 2438 + let codec = tonic::codec::ProstCodec::default(); 2439 + let path = http::uri::PathAndQuery::from_static( 2440 + "/rockbox.v1alpha1.PlaybackService/Pause", 2441 + ); 2442 + let mut req = request.into_request(); 2443 + req.extensions_mut() 2444 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Pause")); 2445 + self.inner.unary(req, path, codec).await 2446 + } 2447 + pub async fn play_or_pause( 2448 + &mut self, 2449 + request: impl tonic::IntoRequest<super::PlayOrPauseRequest>, 2450 + ) -> std::result::Result< 2451 + tonic::Response<super::PlayOrPauseResponse>, 2452 + tonic::Status, 2453 + > { 2454 + self.inner 2455 + .ready() 2456 + .await 2457 + .map_err(|e| { 2458 + tonic::Status::unknown( 2459 + format!("Service was not ready: {}", e.into()), 2460 + ) 2461 + })?; 2462 + let codec = tonic::codec::ProstCodec::default(); 2463 + let path = http::uri::PathAndQuery::from_static( 2464 + "/rockbox.v1alpha1.PlaybackService/PlayOrPause", 2465 + ); 2466 + let mut req = request.into_request(); 2467 + req.extensions_mut() 2468 + .insert( 2469 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayOrPause"), 2470 + ); 2471 + self.inner.unary(req, path, codec).await 2472 + } 2473 + pub async fn resume( 2474 + &mut self, 2475 + request: impl tonic::IntoRequest<super::ResumeRequest>, 2476 + ) -> std::result::Result<tonic::Response<super::ResumeResponse>, tonic::Status> { 2477 + self.inner 2478 + .ready() 2479 + .await 2480 + .map_err(|e| { 2481 + tonic::Status::unknown( 2482 + format!("Service was not ready: {}", e.into()), 2483 + ) 2484 + })?; 2485 + let codec = tonic::codec::ProstCodec::default(); 2486 + let path = http::uri::PathAndQuery::from_static( 2487 + "/rockbox.v1alpha1.PlaybackService/Resume", 2488 + ); 2489 + let mut req = request.into_request(); 2490 + req.extensions_mut() 2491 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Resume")); 2492 + self.inner.unary(req, path, codec).await 2493 + } 2494 + pub async fn next( 2495 + &mut self, 2496 + request: impl tonic::IntoRequest<super::NextRequest>, 2497 + ) -> std::result::Result<tonic::Response<super::NextResponse>, tonic::Status> { 2498 + self.inner 2499 + .ready() 2500 + .await 2501 + .map_err(|e| { 2502 + tonic::Status::unknown( 2503 + format!("Service was not ready: {}", e.into()), 2504 + ) 2505 + })?; 2506 + let codec = tonic::codec::ProstCodec::default(); 2507 + let path = http::uri::PathAndQuery::from_static( 2508 + "/rockbox.v1alpha1.PlaybackService/Next", 2509 + ); 2510 + let mut req = request.into_request(); 2511 + req.extensions_mut() 2512 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Next")); 2513 + self.inner.unary(req, path, codec).await 2514 + } 2515 + pub async fn previous( 2516 + &mut self, 2517 + request: impl tonic::IntoRequest<super::PreviousRequest>, 2518 + ) -> std::result::Result< 2519 + tonic::Response<super::PreviousResponse>, 2520 + tonic::Status, 2521 + > { 2522 + self.inner 2523 + .ready() 2524 + .await 2525 + .map_err(|e| { 2526 + tonic::Status::unknown( 2527 + format!("Service was not ready: {}", e.into()), 2528 + ) 2529 + })?; 2530 + let codec = tonic::codec::ProstCodec::default(); 2531 + let path = http::uri::PathAndQuery::from_static( 2532 + "/rockbox.v1alpha1.PlaybackService/Previous", 2533 + ); 2534 + let mut req = request.into_request(); 2535 + req.extensions_mut() 2536 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Previous")); 2537 + self.inner.unary(req, path, codec).await 2538 + } 2539 + pub async fn fast_forward_rewind( 2540 + &mut self, 2541 + request: impl tonic::IntoRequest<super::FastForwardRewindRequest>, 2542 + ) -> std::result::Result< 2543 + tonic::Response<super::FastForwardRewindResponse>, 2544 + tonic::Status, 2545 + > { 2546 + self.inner 2547 + .ready() 2548 + .await 2549 + .map_err(|e| { 2550 + tonic::Status::unknown( 2551 + format!("Service was not ready: {}", e.into()), 2552 + ) 2553 + })?; 2554 + let codec = tonic::codec::ProstCodec::default(); 2555 + let path = http::uri::PathAndQuery::from_static( 2556 + "/rockbox.v1alpha1.PlaybackService/FastForwardRewind", 2557 + ); 2558 + let mut req = request.into_request(); 2559 + req.extensions_mut() 2560 + .insert( 2561 + GrpcMethod::new( 2562 + "rockbox.v1alpha1.PlaybackService", 2563 + "FastForwardRewind", 2564 + ), 2565 + ); 2566 + self.inner.unary(req, path, codec).await 2567 + } 2568 + pub async fn status( 2569 + &mut self, 2570 + request: impl tonic::IntoRequest<super::StatusRequest>, 2571 + ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status> { 2572 + self.inner 2573 + .ready() 2574 + .await 2575 + .map_err(|e| { 2576 + tonic::Status::unknown( 2577 + format!("Service was not ready: {}", e.into()), 2578 + ) 2579 + })?; 2580 + let codec = tonic::codec::ProstCodec::default(); 2581 + let path = http::uri::PathAndQuery::from_static( 2582 + "/rockbox.v1alpha1.PlaybackService/Status", 2583 + ); 2584 + let mut req = request.into_request(); 2585 + req.extensions_mut() 2586 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Status")); 2587 + self.inner.unary(req, path, codec).await 2588 + } 2589 + pub async fn current_track( 2590 + &mut self, 2591 + request: impl tonic::IntoRequest<super::CurrentTrackRequest>, 2592 + ) -> std::result::Result< 2593 + tonic::Response<super::CurrentTrackResponse>, 2594 + tonic::Status, 2595 + > { 2596 + self.inner 2597 + .ready() 2598 + .await 2599 + .map_err(|e| { 2600 + tonic::Status::unknown( 2601 + format!("Service was not ready: {}", e.into()), 2602 + ) 2603 + })?; 2604 + let codec = tonic::codec::ProstCodec::default(); 2605 + let path = http::uri::PathAndQuery::from_static( 2606 + "/rockbox.v1alpha1.PlaybackService/CurrentTrack", 2607 + ); 2608 + let mut req = request.into_request(); 2609 + req.extensions_mut() 2610 + .insert( 2611 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "CurrentTrack"), 2612 + ); 2613 + self.inner.unary(req, path, codec).await 2614 + } 2615 + pub async fn next_track( 2616 + &mut self, 2617 + request: impl tonic::IntoRequest<super::NextTrackRequest>, 2618 + ) -> std::result::Result< 2619 + tonic::Response<super::NextTrackResponse>, 2620 + tonic::Status, 2621 + > { 2622 + self.inner 2623 + .ready() 2624 + .await 2625 + .map_err(|e| { 2626 + tonic::Status::unknown( 2627 + format!("Service was not ready: {}", e.into()), 2628 + ) 2629 + })?; 2630 + let codec = tonic::codec::ProstCodec::default(); 2631 + let path = http::uri::PathAndQuery::from_static( 2632 + "/rockbox.v1alpha1.PlaybackService/NextTrack", 2633 + ); 2634 + let mut req = request.into_request(); 2635 + req.extensions_mut() 2636 + .insert( 2637 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "NextTrack"), 2638 + ); 2639 + self.inner.unary(req, path, codec).await 2640 + } 2641 + pub async fn flush_and_reload_tracks( 2642 + &mut self, 2643 + request: impl tonic::IntoRequest<super::FlushAndReloadTracksRequest>, 2644 + ) -> std::result::Result< 2645 + tonic::Response<super::FlushAndReloadTracksResponse>, 2646 + tonic::Status, 2647 + > { 2648 + self.inner 2649 + .ready() 2650 + .await 2651 + .map_err(|e| { 2652 + tonic::Status::unknown( 2653 + format!("Service was not ready: {}", e.into()), 2654 + ) 2655 + })?; 2656 + let codec = tonic::codec::ProstCodec::default(); 2657 + let path = http::uri::PathAndQuery::from_static( 2658 + "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks", 2659 + ); 2660 + let mut req = request.into_request(); 2661 + req.extensions_mut() 2662 + .insert( 2663 + GrpcMethod::new( 2664 + "rockbox.v1alpha1.PlaybackService", 2665 + "FlushAndReloadTracks", 2666 + ), 2667 + ); 2668 + self.inner.unary(req, path, codec).await 2669 + } 2670 + pub async fn get_file_position( 2671 + &mut self, 2672 + request: impl tonic::IntoRequest<super::GetFilePositionRequest>, 2673 + ) -> std::result::Result< 2674 + tonic::Response<super::GetFilePositionResponse>, 2675 + tonic::Status, 2676 + > { 2677 + self.inner 2678 + .ready() 2679 + .await 2680 + .map_err(|e| { 2681 + tonic::Status::unknown( 2682 + format!("Service was not ready: {}", e.into()), 2683 + ) 2684 + })?; 2685 + let codec = tonic::codec::ProstCodec::default(); 2686 + let path = http::uri::PathAndQuery::from_static( 2687 + "/rockbox.v1alpha1.PlaybackService/GetFilePosition", 2688 + ); 2689 + let mut req = request.into_request(); 2690 + req.extensions_mut() 2691 + .insert( 2692 + GrpcMethod::new( 2693 + "rockbox.v1alpha1.PlaybackService", 2694 + "GetFilePosition", 2695 + ), 2696 + ); 2697 + self.inner.unary(req, path, codec).await 2698 + } 2699 + pub async fn hard_stop( 2700 + &mut self, 2701 + request: impl tonic::IntoRequest<super::HardStopRequest>, 2702 + ) -> std::result::Result< 2703 + tonic::Response<super::HardStopResponse>, 2704 + tonic::Status, 2705 + > { 2706 + self.inner 2707 + .ready() 2708 + .await 2709 + .map_err(|e| { 2710 + tonic::Status::unknown( 2711 + format!("Service was not ready: {}", e.into()), 2712 + ) 2713 + })?; 2714 + let codec = tonic::codec::ProstCodec::default(); 2715 + let path = http::uri::PathAndQuery::from_static( 2716 + "/rockbox.v1alpha1.PlaybackService/HardStop", 2717 + ); 2718 + let mut req = request.into_request(); 2719 + req.extensions_mut() 2720 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "HardStop")); 2721 + self.inner.unary(req, path, codec).await 2722 + } 2723 + pub async fn play_album( 2724 + &mut self, 2725 + request: impl tonic::IntoRequest<super::PlayAlbumRequest>, 2726 + ) -> std::result::Result< 2727 + tonic::Response<super::PlayAlbumResponse>, 2728 + tonic::Status, 2729 + > { 2730 + self.inner 2731 + .ready() 2732 + .await 2733 + .map_err(|e| { 2734 + tonic::Status::unknown( 2735 + format!("Service was not ready: {}", e.into()), 2736 + ) 2737 + })?; 2738 + let codec = tonic::codec::ProstCodec::default(); 2739 + let path = http::uri::PathAndQuery::from_static( 2740 + "/rockbox.v1alpha1.PlaybackService/PlayAlbum", 2741 + ); 2742 + let mut req = request.into_request(); 2743 + req.extensions_mut() 2744 + .insert( 2745 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayAlbum"), 2746 + ); 2747 + self.inner.unary(req, path, codec).await 2748 + } 2749 + pub async fn play_artist_tracks( 2750 + &mut self, 2751 + request: impl tonic::IntoRequest<super::PlayArtistTracksRequest>, 2752 + ) -> std::result::Result< 2753 + tonic::Response<super::PlayArtistTracksResponse>, 2754 + tonic::Status, 2755 + > { 2756 + self.inner 2757 + .ready() 2758 + .await 2759 + .map_err(|e| { 2760 + tonic::Status::unknown( 2761 + format!("Service was not ready: {}", e.into()), 2762 + ) 2763 + })?; 2764 + let codec = tonic::codec::ProstCodec::default(); 2765 + let path = http::uri::PathAndQuery::from_static( 2766 + "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks", 2767 + ); 2768 + let mut req = request.into_request(); 2769 + req.extensions_mut() 2770 + .insert( 2771 + GrpcMethod::new( 2772 + "rockbox.v1alpha1.PlaybackService", 2773 + "PlayArtistTracks", 2774 + ), 2775 + ); 2776 + self.inner.unary(req, path, codec).await 2777 + } 2778 + pub async fn play_playlist( 2779 + &mut self, 2780 + request: impl tonic::IntoRequest<super::PlayPlaylistRequest>, 2781 + ) -> std::result::Result< 2782 + tonic::Response<super::PlayPlaylistResponse>, 2783 + tonic::Status, 2784 + > { 2785 + self.inner 2786 + .ready() 2787 + .await 2788 + .map_err(|e| { 2789 + tonic::Status::unknown( 2790 + format!("Service was not ready: {}", e.into()), 2791 + ) 2792 + })?; 2793 + let codec = tonic::codec::ProstCodec::default(); 2794 + let path = http::uri::PathAndQuery::from_static( 2795 + "/rockbox.v1alpha1.PlaybackService/PlayPlaylist", 2796 + ); 2797 + let mut req = request.into_request(); 2798 + req.extensions_mut() 2799 + .insert( 2800 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayPlaylist"), 2801 + ); 2802 + self.inner.unary(req, path, codec).await 2803 + } 2804 + pub async fn play_directory( 2805 + &mut self, 2806 + request: impl tonic::IntoRequest<super::PlayDirectoryRequest>, 2807 + ) -> std::result::Result< 2808 + tonic::Response<super::PlayDirectoryResponse>, 2809 + tonic::Status, 2810 + > { 2811 + self.inner 2812 + .ready() 2813 + .await 2814 + .map_err(|e| { 2815 + tonic::Status::unknown( 2816 + format!("Service was not ready: {}", e.into()), 2817 + ) 2818 + })?; 2819 + let codec = tonic::codec::ProstCodec::default(); 2820 + let path = http::uri::PathAndQuery::from_static( 2821 + "/rockbox.v1alpha1.PlaybackService/PlayDirectory", 2822 + ); 2823 + let mut req = request.into_request(); 2824 + req.extensions_mut() 2825 + .insert( 2826 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayDirectory"), 2827 + ); 2828 + self.inner.unary(req, path, codec).await 2829 + } 2830 + pub async fn play_music_directory( 2831 + &mut self, 2832 + request: impl tonic::IntoRequest<super::PlayMusicDirectoryRequest>, 2833 + ) -> std::result::Result< 2834 + tonic::Response<super::PlayMusicDirectoryResponse>, 2835 + tonic::Status, 2836 + > { 2837 + self.inner 2838 + .ready() 2839 + .await 2840 + .map_err(|e| { 2841 + tonic::Status::unknown( 2842 + format!("Service was not ready: {}", e.into()), 2843 + ) 2844 + })?; 2845 + let codec = tonic::codec::ProstCodec::default(); 2846 + let path = http::uri::PathAndQuery::from_static( 2847 + "/rockbox.v1alpha1.PlaybackService/PlayMusicDirectory", 2848 + ); 2849 + let mut req = request.into_request(); 2850 + req.extensions_mut() 2851 + .insert( 2852 + GrpcMethod::new( 2853 + "rockbox.v1alpha1.PlaybackService", 2854 + "PlayMusicDirectory", 2855 + ), 2856 + ); 2857 + self.inner.unary(req, path, codec).await 2858 + } 2859 + pub async fn play_track( 2860 + &mut self, 2861 + request: impl tonic::IntoRequest<super::PlayTrackRequest>, 2862 + ) -> std::result::Result< 2863 + tonic::Response<super::PlayTrackResponse>, 2864 + tonic::Status, 2865 + > { 2866 + self.inner 2867 + .ready() 2868 + .await 2869 + .map_err(|e| { 2870 + tonic::Status::unknown( 2871 + format!("Service was not ready: {}", e.into()), 2872 + ) 2873 + })?; 2874 + let codec = tonic::codec::ProstCodec::default(); 2875 + let path = http::uri::PathAndQuery::from_static( 2876 + "/rockbox.v1alpha1.PlaybackService/PlayTrack", 2877 + ); 2878 + let mut req = request.into_request(); 2879 + req.extensions_mut() 2880 + .insert( 2881 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayTrack"), 2882 + ); 2883 + self.inner.unary(req, path, codec).await 2884 + } 2885 + pub async fn play_liked_tracks( 2886 + &mut self, 2887 + request: impl tonic::IntoRequest<super::PlayLikedTracksRequest>, 2888 + ) -> std::result::Result< 2889 + tonic::Response<super::PlayLikedTracksResponse>, 2890 + tonic::Status, 2891 + > { 2892 + self.inner 2893 + .ready() 2894 + .await 2895 + .map_err(|e| { 2896 + tonic::Status::unknown( 2897 + format!("Service was not ready: {}", e.into()), 2898 + ) 2899 + })?; 2900 + let codec = tonic::codec::ProstCodec::default(); 2901 + let path = http::uri::PathAndQuery::from_static( 2902 + "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks", 2903 + ); 2904 + let mut req = request.into_request(); 2905 + req.extensions_mut() 2906 + .insert( 2907 + GrpcMethod::new( 2908 + "rockbox.v1alpha1.PlaybackService", 2909 + "PlayLikedTracks", 2910 + ), 2911 + ); 2912 + self.inner.unary(req, path, codec).await 2913 + } 2914 + pub async fn play_all_tracks( 2915 + &mut self, 2916 + request: impl tonic::IntoRequest<super::PlayAllTracksRequest>, 2917 + ) -> std::result::Result< 2918 + tonic::Response<super::PlayAllTracksResponse>, 2919 + tonic::Status, 2920 + > { 2921 + self.inner 2922 + .ready() 2923 + .await 2924 + .map_err(|e| { 2925 + tonic::Status::unknown( 2926 + format!("Service was not ready: {}", e.into()), 2927 + ) 2928 + })?; 2929 + let codec = tonic::codec::ProstCodec::default(); 2930 + let path = http::uri::PathAndQuery::from_static( 2931 + "/rockbox.v1alpha1.PlaybackService/PlayAllTracks", 2932 + ); 2933 + let mut req = request.into_request(); 2934 + req.extensions_mut() 2935 + .insert( 2936 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayAllTracks"), 2937 + ); 2938 + self.inner.unary(req, path, codec).await 2939 + } 2940 + pub async fn stream_current_track( 2941 + &mut self, 2942 + request: impl tonic::IntoRequest<super::StreamCurrentTrackRequest>, 2943 + ) -> std::result::Result< 2944 + tonic::Response<tonic::codec::Streaming<super::CurrentTrackResponse>>, 2945 + tonic::Status, 2946 + > { 2947 + self.inner 2948 + .ready() 2949 + .await 2950 + .map_err(|e| { 2951 + tonic::Status::unknown( 2952 + format!("Service was not ready: {}", e.into()), 2953 + ) 2954 + })?; 2955 + let codec = tonic::codec::ProstCodec::default(); 2956 + let path = http::uri::PathAndQuery::from_static( 2957 + "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack", 2958 + ); 2959 + let mut req = request.into_request(); 2960 + req.extensions_mut() 2961 + .insert( 2962 + GrpcMethod::new( 2963 + "rockbox.v1alpha1.PlaybackService", 2964 + "StreamCurrentTrack", 2965 + ), 2966 + ); 2967 + self.inner.server_streaming(req, path, codec).await 2968 + } 2969 + pub async fn stream_status( 2970 + &mut self, 2971 + request: impl tonic::IntoRequest<super::StreamStatusRequest>, 2972 + ) -> std::result::Result< 2973 + tonic::Response<tonic::codec::Streaming<super::StatusResponse>>, 2974 + tonic::Status, 2975 + > { 2976 + self.inner 2977 + .ready() 2978 + .await 2979 + .map_err(|e| { 2980 + tonic::Status::unknown( 2981 + format!("Service was not ready: {}", e.into()), 2982 + ) 2983 + })?; 2984 + let codec = tonic::codec::ProstCodec::default(); 2985 + let path = http::uri::PathAndQuery::from_static( 2986 + "/rockbox.v1alpha1.PlaybackService/StreamStatus", 2987 + ); 2988 + let mut req = request.into_request(); 2989 + req.extensions_mut() 2990 + .insert( 2991 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "StreamStatus"), 2992 + ); 2993 + self.inner.server_streaming(req, path, codec).await 2994 + } 2995 + pub async fn stream_playlist( 2996 + &mut self, 2997 + request: impl tonic::IntoRequest<super::StreamPlaylistRequest>, 2998 + ) -> std::result::Result< 2999 + tonic::Response<tonic::codec::Streaming<super::PlaylistResponse>>, 3000 + tonic::Status, 3001 + > { 3002 + self.inner 3003 + .ready() 3004 + .await 3005 + .map_err(|e| { 3006 + tonic::Status::unknown( 3007 + format!("Service was not ready: {}", e.into()), 3008 + ) 3009 + })?; 3010 + let codec = tonic::codec::ProstCodec::default(); 3011 + let path = http::uri::PathAndQuery::from_static( 3012 + "/rockbox.v1alpha1.PlaybackService/StreamPlaylist", 3013 + ); 3014 + let mut req = request.into_request(); 3015 + req.extensions_mut() 3016 + .insert( 3017 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "StreamPlaylist"), 3018 + ); 3019 + self.inner.server_streaming(req, path, codec).await 3020 + } 3021 + } 3022 + } 3023 + /// Generated server implementations. 3024 + pub mod playback_service_server { 3025 + #![allow( 3026 + unused_variables, 3027 + dead_code, 3028 + missing_docs, 3029 + clippy::wildcard_imports, 3030 + clippy::let_unit_value, 3031 + )] 3032 + use tonic::codegen::*; 3033 + /// Generated trait containing gRPC methods that should be implemented for use with PlaybackServiceServer. 3034 + #[async_trait] 3035 + pub trait PlaybackService: std::marker::Send + std::marker::Sync + 'static { 3036 + async fn play( 3037 + &self, 3038 + request: tonic::Request<super::PlayRequest>, 3039 + ) -> std::result::Result<tonic::Response<super::PlayResponse>, tonic::Status>; 3040 + async fn pause( 3041 + &self, 3042 + request: tonic::Request<super::PauseRequest>, 3043 + ) -> std::result::Result<tonic::Response<super::PauseResponse>, tonic::Status>; 3044 + async fn play_or_pause( 3045 + &self, 3046 + request: tonic::Request<super::PlayOrPauseRequest>, 3047 + ) -> std::result::Result< 3048 + tonic::Response<super::PlayOrPauseResponse>, 3049 + tonic::Status, 3050 + >; 3051 + async fn resume( 3052 + &self, 3053 + request: tonic::Request<super::ResumeRequest>, 3054 + ) -> std::result::Result<tonic::Response<super::ResumeResponse>, tonic::Status>; 3055 + async fn next( 3056 + &self, 3057 + request: tonic::Request<super::NextRequest>, 3058 + ) -> std::result::Result<tonic::Response<super::NextResponse>, tonic::Status>; 3059 + async fn previous( 3060 + &self, 3061 + request: tonic::Request<super::PreviousRequest>, 3062 + ) -> std::result::Result< 3063 + tonic::Response<super::PreviousResponse>, 3064 + tonic::Status, 3065 + >; 3066 + async fn fast_forward_rewind( 3067 + &self, 3068 + request: tonic::Request<super::FastForwardRewindRequest>, 3069 + ) -> std::result::Result< 3070 + tonic::Response<super::FastForwardRewindResponse>, 3071 + tonic::Status, 3072 + >; 3073 + async fn status( 3074 + &self, 3075 + request: tonic::Request<super::StatusRequest>, 3076 + ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status>; 3077 + async fn current_track( 3078 + &self, 3079 + request: tonic::Request<super::CurrentTrackRequest>, 3080 + ) -> std::result::Result< 3081 + tonic::Response<super::CurrentTrackResponse>, 3082 + tonic::Status, 3083 + >; 3084 + async fn next_track( 3085 + &self, 3086 + request: tonic::Request<super::NextTrackRequest>, 3087 + ) -> std::result::Result< 3088 + tonic::Response<super::NextTrackResponse>, 3089 + tonic::Status, 3090 + >; 3091 + async fn flush_and_reload_tracks( 3092 + &self, 3093 + request: tonic::Request<super::FlushAndReloadTracksRequest>, 3094 + ) -> std::result::Result< 3095 + tonic::Response<super::FlushAndReloadTracksResponse>, 3096 + tonic::Status, 3097 + >; 3098 + async fn get_file_position( 3099 + &self, 3100 + request: tonic::Request<super::GetFilePositionRequest>, 3101 + ) -> std::result::Result< 3102 + tonic::Response<super::GetFilePositionResponse>, 3103 + tonic::Status, 3104 + >; 3105 + async fn hard_stop( 3106 + &self, 3107 + request: tonic::Request<super::HardStopRequest>, 3108 + ) -> std::result::Result< 3109 + tonic::Response<super::HardStopResponse>, 3110 + tonic::Status, 3111 + >; 3112 + async fn play_album( 3113 + &self, 3114 + request: tonic::Request<super::PlayAlbumRequest>, 3115 + ) -> std::result::Result< 3116 + tonic::Response<super::PlayAlbumResponse>, 3117 + tonic::Status, 3118 + >; 3119 + async fn play_artist_tracks( 3120 + &self, 3121 + request: tonic::Request<super::PlayArtistTracksRequest>, 3122 + ) -> std::result::Result< 3123 + tonic::Response<super::PlayArtistTracksResponse>, 3124 + tonic::Status, 3125 + >; 3126 + async fn play_playlist( 3127 + &self, 3128 + request: tonic::Request<super::PlayPlaylistRequest>, 3129 + ) -> std::result::Result< 3130 + tonic::Response<super::PlayPlaylistResponse>, 3131 + tonic::Status, 3132 + >; 3133 + async fn play_directory( 3134 + &self, 3135 + request: tonic::Request<super::PlayDirectoryRequest>, 3136 + ) -> std::result::Result< 3137 + tonic::Response<super::PlayDirectoryResponse>, 3138 + tonic::Status, 3139 + >; 3140 + async fn play_music_directory( 3141 + &self, 3142 + request: tonic::Request<super::PlayMusicDirectoryRequest>, 3143 + ) -> std::result::Result< 3144 + tonic::Response<super::PlayMusicDirectoryResponse>, 3145 + tonic::Status, 3146 + >; 3147 + async fn play_track( 3148 + &self, 3149 + request: tonic::Request<super::PlayTrackRequest>, 3150 + ) -> std::result::Result< 3151 + tonic::Response<super::PlayTrackResponse>, 3152 + tonic::Status, 3153 + >; 3154 + async fn play_liked_tracks( 3155 + &self, 3156 + request: tonic::Request<super::PlayLikedTracksRequest>, 3157 + ) -> std::result::Result< 3158 + tonic::Response<super::PlayLikedTracksResponse>, 3159 + tonic::Status, 3160 + >; 3161 + async fn play_all_tracks( 3162 + &self, 3163 + request: tonic::Request<super::PlayAllTracksRequest>, 3164 + ) -> std::result::Result< 3165 + tonic::Response<super::PlayAllTracksResponse>, 3166 + tonic::Status, 3167 + >; 3168 + /// Server streaming response type for the StreamCurrentTrack method. 3169 + type StreamCurrentTrackStream: tonic::codegen::tokio_stream::Stream< 3170 + Item = std::result::Result<super::CurrentTrackResponse, tonic::Status>, 3171 + > 3172 + + std::marker::Send 3173 + + 'static; 3174 + async fn stream_current_track( 3175 + &self, 3176 + request: tonic::Request<super::StreamCurrentTrackRequest>, 3177 + ) -> std::result::Result< 3178 + tonic::Response<Self::StreamCurrentTrackStream>, 3179 + tonic::Status, 3180 + >; 3181 + /// Server streaming response type for the StreamStatus method. 3182 + type StreamStatusStream: tonic::codegen::tokio_stream::Stream< 3183 + Item = std::result::Result<super::StatusResponse, tonic::Status>, 3184 + > 3185 + + std::marker::Send 3186 + + 'static; 3187 + async fn stream_status( 3188 + &self, 3189 + request: tonic::Request<super::StreamStatusRequest>, 3190 + ) -> std::result::Result< 3191 + tonic::Response<Self::StreamStatusStream>, 3192 + tonic::Status, 3193 + >; 3194 + /// Server streaming response type for the StreamPlaylist method. 3195 + type StreamPlaylistStream: tonic::codegen::tokio_stream::Stream< 3196 + Item = std::result::Result<super::PlaylistResponse, tonic::Status>, 3197 + > 3198 + + std::marker::Send 3199 + + 'static; 3200 + async fn stream_playlist( 3201 + &self, 3202 + request: tonic::Request<super::StreamPlaylistRequest>, 3203 + ) -> std::result::Result< 3204 + tonic::Response<Self::StreamPlaylistStream>, 3205 + tonic::Status, 3206 + >; 3207 + } 3208 + #[derive(Debug)] 3209 + pub struct PlaybackServiceServer<T> { 3210 + inner: Arc<T>, 3211 + accept_compression_encodings: EnabledCompressionEncodings, 3212 + send_compression_encodings: EnabledCompressionEncodings, 3213 + max_decoding_message_size: Option<usize>, 3214 + max_encoding_message_size: Option<usize>, 3215 + } 3216 + impl<T> PlaybackServiceServer<T> { 3217 + pub fn new(inner: T) -> Self { 3218 + Self::from_arc(Arc::new(inner)) 3219 + } 3220 + pub fn from_arc(inner: Arc<T>) -> Self { 3221 + Self { 3222 + inner, 3223 + accept_compression_encodings: Default::default(), 3224 + send_compression_encodings: Default::default(), 3225 + max_decoding_message_size: None, 3226 + max_encoding_message_size: None, 3227 + } 3228 + } 3229 + pub fn with_interceptor<F>( 3230 + inner: T, 3231 + interceptor: F, 3232 + ) -> InterceptedService<Self, F> 3233 + where 3234 + F: tonic::service::Interceptor, 3235 + { 3236 + InterceptedService::new(Self::new(inner), interceptor) 3237 + } 3238 + /// Enable decompressing requests with the given encoding. 3239 + #[must_use] 3240 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 3241 + self.accept_compression_encodings.enable(encoding); 3242 + self 3243 + } 3244 + /// Compress responses with the given encoding, if the client supports it. 3245 + #[must_use] 3246 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 3247 + self.send_compression_encodings.enable(encoding); 3248 + self 3249 + } 3250 + /// Limits the maximum size of a decoded message. 3251 + /// 3252 + /// Default: `4MB` 3253 + #[must_use] 3254 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 3255 + self.max_decoding_message_size = Some(limit); 3256 + self 3257 + } 3258 + /// Limits the maximum size of an encoded message. 3259 + /// 3260 + /// Default: `usize::MAX` 3261 + #[must_use] 3262 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 3263 + self.max_encoding_message_size = Some(limit); 3264 + self 3265 + } 3266 + } 3267 + impl<T, B> tonic::codegen::Service<http::Request<B>> for PlaybackServiceServer<T> 3268 + where 3269 + T: PlaybackService, 3270 + B: Body + std::marker::Send + 'static, 3271 + B::Error: Into<StdError> + std::marker::Send + 'static, 3272 + { 3273 + type Response = http::Response<tonic::body::BoxBody>; 3274 + type Error = std::convert::Infallible; 3275 + type Future = BoxFuture<Self::Response, Self::Error>; 3276 + fn poll_ready( 3277 + &mut self, 3278 + _cx: &mut Context<'_>, 3279 + ) -> Poll<std::result::Result<(), Self::Error>> { 3280 + Poll::Ready(Ok(())) 3281 + } 3282 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 3283 + match req.uri().path() { 3284 + "/rockbox.v1alpha1.PlaybackService/Play" => { 3285 + #[allow(non_camel_case_types)] 3286 + struct PlaySvc<T: PlaybackService>(pub Arc<T>); 3287 + impl< 3288 + T: PlaybackService, 3289 + > tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> { 3290 + type Response = super::PlayResponse; 3291 + type Future = BoxFuture< 3292 + tonic::Response<Self::Response>, 3293 + tonic::Status, 3294 + >; 3295 + fn call( 3296 + &mut self, 3297 + request: tonic::Request<super::PlayRequest>, 3298 + ) -> Self::Future { 3299 + let inner = Arc::clone(&self.0); 3300 + let fut = async move { 3301 + <T as PlaybackService>::play(&inner, request).await 3302 + }; 3303 + Box::pin(fut) 3304 + } 3305 + } 3306 + let accept_compression_encodings = self.accept_compression_encodings; 3307 + let send_compression_encodings = self.send_compression_encodings; 3308 + let max_decoding_message_size = self.max_decoding_message_size; 3309 + let max_encoding_message_size = self.max_encoding_message_size; 3310 + let inner = self.inner.clone(); 3311 + let fut = async move { 3312 + let method = PlaySvc(inner); 3313 + let codec = tonic::codec::ProstCodec::default(); 3314 + let mut grpc = tonic::server::Grpc::new(codec) 3315 + .apply_compression_config( 3316 + accept_compression_encodings, 3317 + send_compression_encodings, 3318 + ) 3319 + .apply_max_message_size_config( 3320 + max_decoding_message_size, 3321 + max_encoding_message_size, 3322 + ); 3323 + let res = grpc.unary(method, req).await; 3324 + Ok(res) 3325 + }; 3326 + Box::pin(fut) 3327 + } 3328 + "/rockbox.v1alpha1.PlaybackService/Pause" => { 3329 + #[allow(non_camel_case_types)] 3330 + struct PauseSvc<T: PlaybackService>(pub Arc<T>); 3331 + impl< 3332 + T: PlaybackService, 3333 + > tonic::server::UnaryService<super::PauseRequest> for PauseSvc<T> { 3334 + type Response = super::PauseResponse; 3335 + type Future = BoxFuture< 3336 + tonic::Response<Self::Response>, 3337 + tonic::Status, 3338 + >; 3339 + fn call( 3340 + &mut self, 3341 + request: tonic::Request<super::PauseRequest>, 3342 + ) -> Self::Future { 3343 + let inner = Arc::clone(&self.0); 3344 + let fut = async move { 3345 + <T as PlaybackService>::pause(&inner, request).await 3346 + }; 3347 + Box::pin(fut) 3348 + } 3349 + } 3350 + let accept_compression_encodings = self.accept_compression_encodings; 3351 + let send_compression_encodings = self.send_compression_encodings; 3352 + let max_decoding_message_size = self.max_decoding_message_size; 3353 + let max_encoding_message_size = self.max_encoding_message_size; 3354 + let inner = self.inner.clone(); 3355 + let fut = async move { 3356 + let method = PauseSvc(inner); 3357 + let codec = tonic::codec::ProstCodec::default(); 3358 + let mut grpc = tonic::server::Grpc::new(codec) 3359 + .apply_compression_config( 3360 + accept_compression_encodings, 3361 + send_compression_encodings, 3362 + ) 3363 + .apply_max_message_size_config( 3364 + max_decoding_message_size, 3365 + max_encoding_message_size, 3366 + ); 3367 + let res = grpc.unary(method, req).await; 3368 + Ok(res) 3369 + }; 3370 + Box::pin(fut) 3371 + } 3372 + "/rockbox.v1alpha1.PlaybackService/PlayOrPause" => { 3373 + #[allow(non_camel_case_types)] 3374 + struct PlayOrPauseSvc<T: PlaybackService>(pub Arc<T>); 3375 + impl< 3376 + T: PlaybackService, 3377 + > tonic::server::UnaryService<super::PlayOrPauseRequest> 3378 + for PlayOrPauseSvc<T> { 3379 + type Response = super::PlayOrPauseResponse; 3380 + type Future = BoxFuture< 3381 + tonic::Response<Self::Response>, 3382 + tonic::Status, 3383 + >; 3384 + fn call( 3385 + &mut self, 3386 + request: tonic::Request<super::PlayOrPauseRequest>, 3387 + ) -> Self::Future { 3388 + let inner = Arc::clone(&self.0); 3389 + let fut = async move { 3390 + <T as PlaybackService>::play_or_pause(&inner, request).await 3391 + }; 3392 + Box::pin(fut) 3393 + } 3394 + } 3395 + let accept_compression_encodings = self.accept_compression_encodings; 3396 + let send_compression_encodings = self.send_compression_encodings; 3397 + let max_decoding_message_size = self.max_decoding_message_size; 3398 + let max_encoding_message_size = self.max_encoding_message_size; 3399 + let inner = self.inner.clone(); 3400 + let fut = async move { 3401 + let method = PlayOrPauseSvc(inner); 3402 + let codec = tonic::codec::ProstCodec::default(); 3403 + let mut grpc = tonic::server::Grpc::new(codec) 3404 + .apply_compression_config( 3405 + accept_compression_encodings, 3406 + send_compression_encodings, 3407 + ) 3408 + .apply_max_message_size_config( 3409 + max_decoding_message_size, 3410 + max_encoding_message_size, 3411 + ); 3412 + let res = grpc.unary(method, req).await; 3413 + Ok(res) 3414 + }; 3415 + Box::pin(fut) 3416 + } 3417 + "/rockbox.v1alpha1.PlaybackService/Resume" => { 3418 + #[allow(non_camel_case_types)] 3419 + struct ResumeSvc<T: PlaybackService>(pub Arc<T>); 3420 + impl< 3421 + T: PlaybackService, 3422 + > tonic::server::UnaryService<super::ResumeRequest> 3423 + for ResumeSvc<T> { 3424 + type Response = super::ResumeResponse; 3425 + type Future = BoxFuture< 3426 + tonic::Response<Self::Response>, 3427 + tonic::Status, 3428 + >; 3429 + fn call( 3430 + &mut self, 3431 + request: tonic::Request<super::ResumeRequest>, 3432 + ) -> Self::Future { 3433 + let inner = Arc::clone(&self.0); 3434 + let fut = async move { 3435 + <T as PlaybackService>::resume(&inner, request).await 3436 + }; 3437 + Box::pin(fut) 3438 + } 3439 + } 3440 + let accept_compression_encodings = self.accept_compression_encodings; 3441 + let send_compression_encodings = self.send_compression_encodings; 3442 + let max_decoding_message_size = self.max_decoding_message_size; 3443 + let max_encoding_message_size = self.max_encoding_message_size; 3444 + let inner = self.inner.clone(); 3445 + let fut = async move { 3446 + let method = ResumeSvc(inner); 3447 + let codec = tonic::codec::ProstCodec::default(); 3448 + let mut grpc = tonic::server::Grpc::new(codec) 3449 + .apply_compression_config( 3450 + accept_compression_encodings, 3451 + send_compression_encodings, 3452 + ) 3453 + .apply_max_message_size_config( 3454 + max_decoding_message_size, 3455 + max_encoding_message_size, 3456 + ); 3457 + let res = grpc.unary(method, req).await; 3458 + Ok(res) 3459 + }; 3460 + Box::pin(fut) 3461 + } 3462 + "/rockbox.v1alpha1.PlaybackService/Next" => { 3463 + #[allow(non_camel_case_types)] 3464 + struct NextSvc<T: PlaybackService>(pub Arc<T>); 3465 + impl< 3466 + T: PlaybackService, 3467 + > tonic::server::UnaryService<super::NextRequest> for NextSvc<T> { 3468 + type Response = super::NextResponse; 3469 + type Future = BoxFuture< 3470 + tonic::Response<Self::Response>, 3471 + tonic::Status, 3472 + >; 3473 + fn call( 3474 + &mut self, 3475 + request: tonic::Request<super::NextRequest>, 3476 + ) -> Self::Future { 3477 + let inner = Arc::clone(&self.0); 3478 + let fut = async move { 3479 + <T as PlaybackService>::next(&inner, request).await 3480 + }; 3481 + Box::pin(fut) 3482 + } 3483 + } 3484 + let accept_compression_encodings = self.accept_compression_encodings; 3485 + let send_compression_encodings = self.send_compression_encodings; 3486 + let max_decoding_message_size = self.max_decoding_message_size; 3487 + let max_encoding_message_size = self.max_encoding_message_size; 3488 + let inner = self.inner.clone(); 3489 + let fut = async move { 3490 + let method = NextSvc(inner); 3491 + let codec = tonic::codec::ProstCodec::default(); 3492 + let mut grpc = tonic::server::Grpc::new(codec) 3493 + .apply_compression_config( 3494 + accept_compression_encodings, 3495 + send_compression_encodings, 3496 + ) 3497 + .apply_max_message_size_config( 3498 + max_decoding_message_size, 3499 + max_encoding_message_size, 3500 + ); 3501 + let res = grpc.unary(method, req).await; 3502 + Ok(res) 3503 + }; 3504 + Box::pin(fut) 3505 + } 3506 + "/rockbox.v1alpha1.PlaybackService/Previous" => { 3507 + #[allow(non_camel_case_types)] 3508 + struct PreviousSvc<T: PlaybackService>(pub Arc<T>); 3509 + impl< 3510 + T: PlaybackService, 3511 + > tonic::server::UnaryService<super::PreviousRequest> 3512 + for PreviousSvc<T> { 3513 + type Response = super::PreviousResponse; 3514 + type Future = BoxFuture< 3515 + tonic::Response<Self::Response>, 3516 + tonic::Status, 3517 + >; 3518 + fn call( 3519 + &mut self, 3520 + request: tonic::Request<super::PreviousRequest>, 3521 + ) -> Self::Future { 3522 + let inner = Arc::clone(&self.0); 3523 + let fut = async move { 3524 + <T as PlaybackService>::previous(&inner, request).await 3525 + }; 3526 + Box::pin(fut) 3527 + } 3528 + } 3529 + let accept_compression_encodings = self.accept_compression_encodings; 3530 + let send_compression_encodings = self.send_compression_encodings; 3531 + let max_decoding_message_size = self.max_decoding_message_size; 3532 + let max_encoding_message_size = self.max_encoding_message_size; 3533 + let inner = self.inner.clone(); 3534 + let fut = async move { 3535 + let method = PreviousSvc(inner); 3536 + let codec = tonic::codec::ProstCodec::default(); 3537 + let mut grpc = tonic::server::Grpc::new(codec) 3538 + .apply_compression_config( 3539 + accept_compression_encodings, 3540 + send_compression_encodings, 3541 + ) 3542 + .apply_max_message_size_config( 3543 + max_decoding_message_size, 3544 + max_encoding_message_size, 3545 + ); 3546 + let res = grpc.unary(method, req).await; 3547 + Ok(res) 3548 + }; 3549 + Box::pin(fut) 3550 + } 3551 + "/rockbox.v1alpha1.PlaybackService/FastForwardRewind" => { 3552 + #[allow(non_camel_case_types)] 3553 + struct FastForwardRewindSvc<T: PlaybackService>(pub Arc<T>); 3554 + impl< 3555 + T: PlaybackService, 3556 + > tonic::server::UnaryService<super::FastForwardRewindRequest> 3557 + for FastForwardRewindSvc<T> { 3558 + type Response = super::FastForwardRewindResponse; 3559 + type Future = BoxFuture< 3560 + tonic::Response<Self::Response>, 3561 + tonic::Status, 3562 + >; 3563 + fn call( 3564 + &mut self, 3565 + request: tonic::Request<super::FastForwardRewindRequest>, 3566 + ) -> Self::Future { 3567 + let inner = Arc::clone(&self.0); 3568 + let fut = async move { 3569 + <T as PlaybackService>::fast_forward_rewind(&inner, request) 3570 + .await 3571 + }; 3572 + Box::pin(fut) 3573 + } 3574 + } 3575 + let accept_compression_encodings = self.accept_compression_encodings; 3576 + let send_compression_encodings = self.send_compression_encodings; 3577 + let max_decoding_message_size = self.max_decoding_message_size; 3578 + let max_encoding_message_size = self.max_encoding_message_size; 3579 + let inner = self.inner.clone(); 3580 + let fut = async move { 3581 + let method = FastForwardRewindSvc(inner); 3582 + let codec = tonic::codec::ProstCodec::default(); 3583 + let mut grpc = tonic::server::Grpc::new(codec) 3584 + .apply_compression_config( 3585 + accept_compression_encodings, 3586 + send_compression_encodings, 3587 + ) 3588 + .apply_max_message_size_config( 3589 + max_decoding_message_size, 3590 + max_encoding_message_size, 3591 + ); 3592 + let res = grpc.unary(method, req).await; 3593 + Ok(res) 3594 + }; 3595 + Box::pin(fut) 3596 + } 3597 + "/rockbox.v1alpha1.PlaybackService/Status" => { 3598 + #[allow(non_camel_case_types)] 3599 + struct StatusSvc<T: PlaybackService>(pub Arc<T>); 3600 + impl< 3601 + T: PlaybackService, 3602 + > tonic::server::UnaryService<super::StatusRequest> 3603 + for StatusSvc<T> { 3604 + type Response = super::StatusResponse; 3605 + type Future = BoxFuture< 3606 + tonic::Response<Self::Response>, 3607 + tonic::Status, 3608 + >; 3609 + fn call( 3610 + &mut self, 3611 + request: tonic::Request<super::StatusRequest>, 3612 + ) -> Self::Future { 3613 + let inner = Arc::clone(&self.0); 3614 + let fut = async move { 3615 + <T as PlaybackService>::status(&inner, request).await 3616 + }; 3617 + Box::pin(fut) 3618 + } 3619 + } 3620 + let accept_compression_encodings = self.accept_compression_encodings; 3621 + let send_compression_encodings = self.send_compression_encodings; 3622 + let max_decoding_message_size = self.max_decoding_message_size; 3623 + let max_encoding_message_size = self.max_encoding_message_size; 3624 + let inner = self.inner.clone(); 3625 + let fut = async move { 3626 + let method = StatusSvc(inner); 3627 + let codec = tonic::codec::ProstCodec::default(); 3628 + let mut grpc = tonic::server::Grpc::new(codec) 3629 + .apply_compression_config( 3630 + accept_compression_encodings, 3631 + send_compression_encodings, 3632 + ) 3633 + .apply_max_message_size_config( 3634 + max_decoding_message_size, 3635 + max_encoding_message_size, 3636 + ); 3637 + let res = grpc.unary(method, req).await; 3638 + Ok(res) 3639 + }; 3640 + Box::pin(fut) 3641 + } 3642 + "/rockbox.v1alpha1.PlaybackService/CurrentTrack" => { 3643 + #[allow(non_camel_case_types)] 3644 + struct CurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 3645 + impl< 3646 + T: PlaybackService, 3647 + > tonic::server::UnaryService<super::CurrentTrackRequest> 3648 + for CurrentTrackSvc<T> { 3649 + type Response = super::CurrentTrackResponse; 3650 + type Future = BoxFuture< 3651 + tonic::Response<Self::Response>, 3652 + tonic::Status, 3653 + >; 3654 + fn call( 3655 + &mut self, 3656 + request: tonic::Request<super::CurrentTrackRequest>, 3657 + ) -> Self::Future { 3658 + let inner = Arc::clone(&self.0); 3659 + let fut = async move { 3660 + <T as PlaybackService>::current_track(&inner, request).await 3661 + }; 3662 + Box::pin(fut) 3663 + } 3664 + } 3665 + let accept_compression_encodings = self.accept_compression_encodings; 3666 + let send_compression_encodings = self.send_compression_encodings; 3667 + let max_decoding_message_size = self.max_decoding_message_size; 3668 + let max_encoding_message_size = self.max_encoding_message_size; 3669 + let inner = self.inner.clone(); 3670 + let fut = async move { 3671 + let method = CurrentTrackSvc(inner); 3672 + let codec = tonic::codec::ProstCodec::default(); 3673 + let mut grpc = tonic::server::Grpc::new(codec) 3674 + .apply_compression_config( 3675 + accept_compression_encodings, 3676 + send_compression_encodings, 3677 + ) 3678 + .apply_max_message_size_config( 3679 + max_decoding_message_size, 3680 + max_encoding_message_size, 3681 + ); 3682 + let res = grpc.unary(method, req).await; 3683 + Ok(res) 3684 + }; 3685 + Box::pin(fut) 3686 + } 3687 + "/rockbox.v1alpha1.PlaybackService/NextTrack" => { 3688 + #[allow(non_camel_case_types)] 3689 + struct NextTrackSvc<T: PlaybackService>(pub Arc<T>); 3690 + impl< 3691 + T: PlaybackService, 3692 + > tonic::server::UnaryService<super::NextTrackRequest> 3693 + for NextTrackSvc<T> { 3694 + type Response = super::NextTrackResponse; 3695 + type Future = BoxFuture< 3696 + tonic::Response<Self::Response>, 3697 + tonic::Status, 3698 + >; 3699 + fn call( 3700 + &mut self, 3701 + request: tonic::Request<super::NextTrackRequest>, 3702 + ) -> Self::Future { 3703 + let inner = Arc::clone(&self.0); 3704 + let fut = async move { 3705 + <T as PlaybackService>::next_track(&inner, request).await 3706 + }; 3707 + Box::pin(fut) 3708 + } 3709 + } 3710 + let accept_compression_encodings = self.accept_compression_encodings; 3711 + let send_compression_encodings = self.send_compression_encodings; 3712 + let max_decoding_message_size = self.max_decoding_message_size; 3713 + let max_encoding_message_size = self.max_encoding_message_size; 3714 + let inner = self.inner.clone(); 3715 + let fut = async move { 3716 + let method = NextTrackSvc(inner); 3717 + let codec = tonic::codec::ProstCodec::default(); 3718 + let mut grpc = tonic::server::Grpc::new(codec) 3719 + .apply_compression_config( 3720 + accept_compression_encodings, 3721 + send_compression_encodings, 3722 + ) 3723 + .apply_max_message_size_config( 3724 + max_decoding_message_size, 3725 + max_encoding_message_size, 3726 + ); 3727 + let res = grpc.unary(method, req).await; 3728 + Ok(res) 3729 + }; 3730 + Box::pin(fut) 3731 + } 3732 + "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks" => { 3733 + #[allow(non_camel_case_types)] 3734 + struct FlushAndReloadTracksSvc<T: PlaybackService>(pub Arc<T>); 3735 + impl< 3736 + T: PlaybackService, 3737 + > tonic::server::UnaryService<super::FlushAndReloadTracksRequest> 3738 + for FlushAndReloadTracksSvc<T> { 3739 + type Response = super::FlushAndReloadTracksResponse; 3740 + type Future = BoxFuture< 3741 + tonic::Response<Self::Response>, 3742 + tonic::Status, 3743 + >; 3744 + fn call( 3745 + &mut self, 3746 + request: tonic::Request<super::FlushAndReloadTracksRequest>, 3747 + ) -> Self::Future { 3748 + let inner = Arc::clone(&self.0); 3749 + let fut = async move { 3750 + <T as PlaybackService>::flush_and_reload_tracks( 3751 + &inner, 3752 + request, 3753 + ) 3754 + .await 3755 + }; 3756 + Box::pin(fut) 3757 + } 3758 + } 3759 + let accept_compression_encodings = self.accept_compression_encodings; 3760 + let send_compression_encodings = self.send_compression_encodings; 3761 + let max_decoding_message_size = self.max_decoding_message_size; 3762 + let max_encoding_message_size = self.max_encoding_message_size; 3763 + let inner = self.inner.clone(); 3764 + let fut = async move { 3765 + let method = FlushAndReloadTracksSvc(inner); 3766 + let codec = tonic::codec::ProstCodec::default(); 3767 + let mut grpc = tonic::server::Grpc::new(codec) 3768 + .apply_compression_config( 3769 + accept_compression_encodings, 3770 + send_compression_encodings, 3771 + ) 3772 + .apply_max_message_size_config( 3773 + max_decoding_message_size, 3774 + max_encoding_message_size, 3775 + ); 3776 + let res = grpc.unary(method, req).await; 3777 + Ok(res) 3778 + }; 3779 + Box::pin(fut) 3780 + } 3781 + "/rockbox.v1alpha1.PlaybackService/GetFilePosition" => { 3782 + #[allow(non_camel_case_types)] 3783 + struct GetFilePositionSvc<T: PlaybackService>(pub Arc<T>); 3784 + impl< 3785 + T: PlaybackService, 3786 + > tonic::server::UnaryService<super::GetFilePositionRequest> 3787 + for GetFilePositionSvc<T> { 3788 + type Response = super::GetFilePositionResponse; 3789 + type Future = BoxFuture< 3790 + tonic::Response<Self::Response>, 3791 + tonic::Status, 3792 + >; 3793 + fn call( 3794 + &mut self, 3795 + request: tonic::Request<super::GetFilePositionRequest>, 3796 + ) -> Self::Future { 3797 + let inner = Arc::clone(&self.0); 3798 + let fut = async move { 3799 + <T as PlaybackService>::get_file_position(&inner, request) 3800 + .await 3801 + }; 3802 + Box::pin(fut) 3803 + } 3804 + } 3805 + let accept_compression_encodings = self.accept_compression_encodings; 3806 + let send_compression_encodings = self.send_compression_encodings; 3807 + let max_decoding_message_size = self.max_decoding_message_size; 3808 + let max_encoding_message_size = self.max_encoding_message_size; 3809 + let inner = self.inner.clone(); 3810 + let fut = async move { 3811 + let method = GetFilePositionSvc(inner); 3812 + let codec = tonic::codec::ProstCodec::default(); 3813 + let mut grpc = tonic::server::Grpc::new(codec) 3814 + .apply_compression_config( 3815 + accept_compression_encodings, 3816 + send_compression_encodings, 3817 + ) 3818 + .apply_max_message_size_config( 3819 + max_decoding_message_size, 3820 + max_encoding_message_size, 3821 + ); 3822 + let res = grpc.unary(method, req).await; 3823 + Ok(res) 3824 + }; 3825 + Box::pin(fut) 3826 + } 3827 + "/rockbox.v1alpha1.PlaybackService/HardStop" => { 3828 + #[allow(non_camel_case_types)] 3829 + struct HardStopSvc<T: PlaybackService>(pub Arc<T>); 3830 + impl< 3831 + T: PlaybackService, 3832 + > tonic::server::UnaryService<super::HardStopRequest> 3833 + for HardStopSvc<T> { 3834 + type Response = super::HardStopResponse; 3835 + type Future = BoxFuture< 3836 + tonic::Response<Self::Response>, 3837 + tonic::Status, 3838 + >; 3839 + fn call( 3840 + &mut self, 3841 + request: tonic::Request<super::HardStopRequest>, 3842 + ) -> Self::Future { 3843 + let inner = Arc::clone(&self.0); 3844 + let fut = async move { 3845 + <T as PlaybackService>::hard_stop(&inner, request).await 3846 + }; 3847 + Box::pin(fut) 3848 + } 3849 + } 3850 + let accept_compression_encodings = self.accept_compression_encodings; 3851 + let send_compression_encodings = self.send_compression_encodings; 3852 + let max_decoding_message_size = self.max_decoding_message_size; 3853 + let max_encoding_message_size = self.max_encoding_message_size; 3854 + let inner = self.inner.clone(); 3855 + let fut = async move { 3856 + let method = HardStopSvc(inner); 3857 + let codec = tonic::codec::ProstCodec::default(); 3858 + let mut grpc = tonic::server::Grpc::new(codec) 3859 + .apply_compression_config( 3860 + accept_compression_encodings, 3861 + send_compression_encodings, 3862 + ) 3863 + .apply_max_message_size_config( 3864 + max_decoding_message_size, 3865 + max_encoding_message_size, 3866 + ); 3867 + let res = grpc.unary(method, req).await; 3868 + Ok(res) 3869 + }; 3870 + Box::pin(fut) 3871 + } 3872 + "/rockbox.v1alpha1.PlaybackService/PlayAlbum" => { 3873 + #[allow(non_camel_case_types)] 3874 + struct PlayAlbumSvc<T: PlaybackService>(pub Arc<T>); 3875 + impl< 3876 + T: PlaybackService, 3877 + > tonic::server::UnaryService<super::PlayAlbumRequest> 3878 + for PlayAlbumSvc<T> { 3879 + type Response = super::PlayAlbumResponse; 3880 + type Future = BoxFuture< 3881 + tonic::Response<Self::Response>, 3882 + tonic::Status, 3883 + >; 3884 + fn call( 3885 + &mut self, 3886 + request: tonic::Request<super::PlayAlbumRequest>, 3887 + ) -> Self::Future { 3888 + let inner = Arc::clone(&self.0); 3889 + let fut = async move { 3890 + <T as PlaybackService>::play_album(&inner, request).await 3891 + }; 3892 + Box::pin(fut) 3893 + } 3894 + } 3895 + let accept_compression_encodings = self.accept_compression_encodings; 3896 + let send_compression_encodings = self.send_compression_encodings; 3897 + let max_decoding_message_size = self.max_decoding_message_size; 3898 + let max_encoding_message_size = self.max_encoding_message_size; 3899 + let inner = self.inner.clone(); 3900 + let fut = async move { 3901 + let method = PlayAlbumSvc(inner); 3902 + let codec = tonic::codec::ProstCodec::default(); 3903 + let mut grpc = tonic::server::Grpc::new(codec) 3904 + .apply_compression_config( 3905 + accept_compression_encodings, 3906 + send_compression_encodings, 3907 + ) 3908 + .apply_max_message_size_config( 3909 + max_decoding_message_size, 3910 + max_encoding_message_size, 3911 + ); 3912 + let res = grpc.unary(method, req).await; 3913 + Ok(res) 3914 + }; 3915 + Box::pin(fut) 3916 + } 3917 + "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks" => { 3918 + #[allow(non_camel_case_types)] 3919 + struct PlayArtistTracksSvc<T: PlaybackService>(pub Arc<T>); 3920 + impl< 3921 + T: PlaybackService, 3922 + > tonic::server::UnaryService<super::PlayArtistTracksRequest> 3923 + for PlayArtistTracksSvc<T> { 3924 + type Response = super::PlayArtistTracksResponse; 3925 + type Future = BoxFuture< 3926 + tonic::Response<Self::Response>, 3927 + tonic::Status, 3928 + >; 3929 + fn call( 3930 + &mut self, 3931 + request: tonic::Request<super::PlayArtistTracksRequest>, 3932 + ) -> Self::Future { 3933 + let inner = Arc::clone(&self.0); 3934 + let fut = async move { 3935 + <T as PlaybackService>::play_artist_tracks(&inner, request) 3936 + .await 3937 + }; 3938 + Box::pin(fut) 3939 + } 3940 + } 3941 + let accept_compression_encodings = self.accept_compression_encodings; 3942 + let send_compression_encodings = self.send_compression_encodings; 3943 + let max_decoding_message_size = self.max_decoding_message_size; 3944 + let max_encoding_message_size = self.max_encoding_message_size; 3945 + let inner = self.inner.clone(); 3946 + let fut = async move { 3947 + let method = PlayArtistTracksSvc(inner); 3948 + let codec = tonic::codec::ProstCodec::default(); 3949 + let mut grpc = tonic::server::Grpc::new(codec) 3950 + .apply_compression_config( 3951 + accept_compression_encodings, 3952 + send_compression_encodings, 3953 + ) 3954 + .apply_max_message_size_config( 3955 + max_decoding_message_size, 3956 + max_encoding_message_size, 3957 + ); 3958 + let res = grpc.unary(method, req).await; 3959 + Ok(res) 3960 + }; 3961 + Box::pin(fut) 3962 + } 3963 + "/rockbox.v1alpha1.PlaybackService/PlayPlaylist" => { 3964 + #[allow(non_camel_case_types)] 3965 + struct PlayPlaylistSvc<T: PlaybackService>(pub Arc<T>); 3966 + impl< 3967 + T: PlaybackService, 3968 + > tonic::server::UnaryService<super::PlayPlaylistRequest> 3969 + for PlayPlaylistSvc<T> { 3970 + type Response = super::PlayPlaylistResponse; 3971 + type Future = BoxFuture< 3972 + tonic::Response<Self::Response>, 3973 + tonic::Status, 3974 + >; 3975 + fn call( 3976 + &mut self, 3977 + request: tonic::Request<super::PlayPlaylistRequest>, 3978 + ) -> Self::Future { 3979 + let inner = Arc::clone(&self.0); 3980 + let fut = async move { 3981 + <T as PlaybackService>::play_playlist(&inner, request).await 3982 + }; 3983 + Box::pin(fut) 3984 + } 3985 + } 3986 + let accept_compression_encodings = self.accept_compression_encodings; 3987 + let send_compression_encodings = self.send_compression_encodings; 3988 + let max_decoding_message_size = self.max_decoding_message_size; 3989 + let max_encoding_message_size = self.max_encoding_message_size; 3990 + let inner = self.inner.clone(); 3991 + let fut = async move { 3992 + let method = PlayPlaylistSvc(inner); 3993 + let codec = tonic::codec::ProstCodec::default(); 3994 + let mut grpc = tonic::server::Grpc::new(codec) 3995 + .apply_compression_config( 3996 + accept_compression_encodings, 3997 + send_compression_encodings, 3998 + ) 3999 + .apply_max_message_size_config( 4000 + max_decoding_message_size, 4001 + max_encoding_message_size, 4002 + ); 4003 + let res = grpc.unary(method, req).await; 4004 + Ok(res) 4005 + }; 4006 + Box::pin(fut) 4007 + } 4008 + "/rockbox.v1alpha1.PlaybackService/PlayDirectory" => { 4009 + #[allow(non_camel_case_types)] 4010 + struct PlayDirectorySvc<T: PlaybackService>(pub Arc<T>); 4011 + impl< 4012 + T: PlaybackService, 4013 + > tonic::server::UnaryService<super::PlayDirectoryRequest> 4014 + for PlayDirectorySvc<T> { 4015 + type Response = super::PlayDirectoryResponse; 4016 + type Future = BoxFuture< 4017 + tonic::Response<Self::Response>, 4018 + tonic::Status, 4019 + >; 4020 + fn call( 4021 + &mut self, 4022 + request: tonic::Request<super::PlayDirectoryRequest>, 4023 + ) -> Self::Future { 4024 + let inner = Arc::clone(&self.0); 4025 + let fut = async move { 4026 + <T as PlaybackService>::play_directory(&inner, request) 4027 + .await 4028 + }; 4029 + Box::pin(fut) 4030 + } 4031 + } 4032 + let accept_compression_encodings = self.accept_compression_encodings; 4033 + let send_compression_encodings = self.send_compression_encodings; 4034 + let max_decoding_message_size = self.max_decoding_message_size; 4035 + let max_encoding_message_size = self.max_encoding_message_size; 4036 + let inner = self.inner.clone(); 4037 + let fut = async move { 4038 + let method = PlayDirectorySvc(inner); 4039 + let codec = tonic::codec::ProstCodec::default(); 4040 + let mut grpc = tonic::server::Grpc::new(codec) 4041 + .apply_compression_config( 4042 + accept_compression_encodings, 4043 + send_compression_encodings, 4044 + ) 4045 + .apply_max_message_size_config( 4046 + max_decoding_message_size, 4047 + max_encoding_message_size, 4048 + ); 4049 + let res = grpc.unary(method, req).await; 4050 + Ok(res) 4051 + }; 4052 + Box::pin(fut) 4053 + } 4054 + "/rockbox.v1alpha1.PlaybackService/PlayMusicDirectory" => { 4055 + #[allow(non_camel_case_types)] 4056 + struct PlayMusicDirectorySvc<T: PlaybackService>(pub Arc<T>); 4057 + impl< 4058 + T: PlaybackService, 4059 + > tonic::server::UnaryService<super::PlayMusicDirectoryRequest> 4060 + for PlayMusicDirectorySvc<T> { 4061 + type Response = super::PlayMusicDirectoryResponse; 4062 + type Future = BoxFuture< 4063 + tonic::Response<Self::Response>, 4064 + tonic::Status, 4065 + >; 4066 + fn call( 4067 + &mut self, 4068 + request: tonic::Request<super::PlayMusicDirectoryRequest>, 4069 + ) -> Self::Future { 4070 + let inner = Arc::clone(&self.0); 4071 + let fut = async move { 4072 + <T as PlaybackService>::play_music_directory( 4073 + &inner, 4074 + request, 4075 + ) 4076 + .await 4077 + }; 4078 + Box::pin(fut) 4079 + } 4080 + } 4081 + let accept_compression_encodings = self.accept_compression_encodings; 4082 + let send_compression_encodings = self.send_compression_encodings; 4083 + let max_decoding_message_size = self.max_decoding_message_size; 4084 + let max_encoding_message_size = self.max_encoding_message_size; 4085 + let inner = self.inner.clone(); 4086 + let fut = async move { 4087 + let method = PlayMusicDirectorySvc(inner); 4088 + let codec = tonic::codec::ProstCodec::default(); 4089 + let mut grpc = tonic::server::Grpc::new(codec) 4090 + .apply_compression_config( 4091 + accept_compression_encodings, 4092 + send_compression_encodings, 4093 + ) 4094 + .apply_max_message_size_config( 4095 + max_decoding_message_size, 4096 + max_encoding_message_size, 4097 + ); 4098 + let res = grpc.unary(method, req).await; 4099 + Ok(res) 4100 + }; 4101 + Box::pin(fut) 4102 + } 4103 + "/rockbox.v1alpha1.PlaybackService/PlayTrack" => { 4104 + #[allow(non_camel_case_types)] 4105 + struct PlayTrackSvc<T: PlaybackService>(pub Arc<T>); 4106 + impl< 4107 + T: PlaybackService, 4108 + > tonic::server::UnaryService<super::PlayTrackRequest> 4109 + for PlayTrackSvc<T> { 4110 + type Response = super::PlayTrackResponse; 4111 + type Future = BoxFuture< 4112 + tonic::Response<Self::Response>, 4113 + tonic::Status, 4114 + >; 4115 + fn call( 4116 + &mut self, 4117 + request: tonic::Request<super::PlayTrackRequest>, 4118 + ) -> Self::Future { 4119 + let inner = Arc::clone(&self.0); 4120 + let fut = async move { 4121 + <T as PlaybackService>::play_track(&inner, request).await 4122 + }; 4123 + Box::pin(fut) 4124 + } 4125 + } 4126 + let accept_compression_encodings = self.accept_compression_encodings; 4127 + let send_compression_encodings = self.send_compression_encodings; 4128 + let max_decoding_message_size = self.max_decoding_message_size; 4129 + let max_encoding_message_size = self.max_encoding_message_size; 4130 + let inner = self.inner.clone(); 4131 + let fut = async move { 4132 + let method = PlayTrackSvc(inner); 4133 + let codec = tonic::codec::ProstCodec::default(); 4134 + let mut grpc = tonic::server::Grpc::new(codec) 4135 + .apply_compression_config( 4136 + accept_compression_encodings, 4137 + send_compression_encodings, 4138 + ) 4139 + .apply_max_message_size_config( 4140 + max_decoding_message_size, 4141 + max_encoding_message_size, 4142 + ); 4143 + let res = grpc.unary(method, req).await; 4144 + Ok(res) 4145 + }; 4146 + Box::pin(fut) 4147 + } 4148 + "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks" => { 4149 + #[allow(non_camel_case_types)] 4150 + struct PlayLikedTracksSvc<T: PlaybackService>(pub Arc<T>); 4151 + impl< 4152 + T: PlaybackService, 4153 + > tonic::server::UnaryService<super::PlayLikedTracksRequest> 4154 + for PlayLikedTracksSvc<T> { 4155 + type Response = super::PlayLikedTracksResponse; 4156 + type Future = BoxFuture< 4157 + tonic::Response<Self::Response>, 4158 + tonic::Status, 4159 + >; 4160 + fn call( 4161 + &mut self, 4162 + request: tonic::Request<super::PlayLikedTracksRequest>, 4163 + ) -> Self::Future { 4164 + let inner = Arc::clone(&self.0); 4165 + let fut = async move { 4166 + <T as PlaybackService>::play_liked_tracks(&inner, request) 4167 + .await 4168 + }; 4169 + Box::pin(fut) 4170 + } 4171 + } 4172 + let accept_compression_encodings = self.accept_compression_encodings; 4173 + let send_compression_encodings = self.send_compression_encodings; 4174 + let max_decoding_message_size = self.max_decoding_message_size; 4175 + let max_encoding_message_size = self.max_encoding_message_size; 4176 + let inner = self.inner.clone(); 4177 + let fut = async move { 4178 + let method = PlayLikedTracksSvc(inner); 4179 + let codec = tonic::codec::ProstCodec::default(); 4180 + let mut grpc = tonic::server::Grpc::new(codec) 4181 + .apply_compression_config( 4182 + accept_compression_encodings, 4183 + send_compression_encodings, 4184 + ) 4185 + .apply_max_message_size_config( 4186 + max_decoding_message_size, 4187 + max_encoding_message_size, 4188 + ); 4189 + let res = grpc.unary(method, req).await; 4190 + Ok(res) 4191 + }; 4192 + Box::pin(fut) 4193 + } 4194 + "/rockbox.v1alpha1.PlaybackService/PlayAllTracks" => { 4195 + #[allow(non_camel_case_types)] 4196 + struct PlayAllTracksSvc<T: PlaybackService>(pub Arc<T>); 4197 + impl< 4198 + T: PlaybackService, 4199 + > tonic::server::UnaryService<super::PlayAllTracksRequest> 4200 + for PlayAllTracksSvc<T> { 4201 + type Response = super::PlayAllTracksResponse; 4202 + type Future = BoxFuture< 4203 + tonic::Response<Self::Response>, 4204 + tonic::Status, 4205 + >; 4206 + fn call( 4207 + &mut self, 4208 + request: tonic::Request<super::PlayAllTracksRequest>, 4209 + ) -> Self::Future { 4210 + let inner = Arc::clone(&self.0); 4211 + let fut = async move { 4212 + <T as PlaybackService>::play_all_tracks(&inner, request) 4213 + .await 4214 + }; 4215 + Box::pin(fut) 4216 + } 4217 + } 4218 + let accept_compression_encodings = self.accept_compression_encodings; 4219 + let send_compression_encodings = self.send_compression_encodings; 4220 + let max_decoding_message_size = self.max_decoding_message_size; 4221 + let max_encoding_message_size = self.max_encoding_message_size; 4222 + let inner = self.inner.clone(); 4223 + let fut = async move { 4224 + let method = PlayAllTracksSvc(inner); 4225 + let codec = tonic::codec::ProstCodec::default(); 4226 + let mut grpc = tonic::server::Grpc::new(codec) 4227 + .apply_compression_config( 4228 + accept_compression_encodings, 4229 + send_compression_encodings, 4230 + ) 4231 + .apply_max_message_size_config( 4232 + max_decoding_message_size, 4233 + max_encoding_message_size, 4234 + ); 4235 + let res = grpc.unary(method, req).await; 4236 + Ok(res) 4237 + }; 4238 + Box::pin(fut) 4239 + } 4240 + "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack" => { 4241 + #[allow(non_camel_case_types)] 4242 + struct StreamCurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 4243 + impl< 4244 + T: PlaybackService, 4245 + > tonic::server::ServerStreamingService< 4246 + super::StreamCurrentTrackRequest, 4247 + > for StreamCurrentTrackSvc<T> { 4248 + type Response = super::CurrentTrackResponse; 4249 + type ResponseStream = T::StreamCurrentTrackStream; 4250 + type Future = BoxFuture< 4251 + tonic::Response<Self::ResponseStream>, 4252 + tonic::Status, 4253 + >; 4254 + fn call( 4255 + &mut self, 4256 + request: tonic::Request<super::StreamCurrentTrackRequest>, 4257 + ) -> Self::Future { 4258 + let inner = Arc::clone(&self.0); 4259 + let fut = async move { 4260 + <T as PlaybackService>::stream_current_track( 4261 + &inner, 4262 + request, 4263 + ) 4264 + .await 4265 + }; 4266 + Box::pin(fut) 4267 + } 4268 + } 4269 + let accept_compression_encodings = self.accept_compression_encodings; 4270 + let send_compression_encodings = self.send_compression_encodings; 4271 + let max_decoding_message_size = self.max_decoding_message_size; 4272 + let max_encoding_message_size = self.max_encoding_message_size; 4273 + let inner = self.inner.clone(); 4274 + let fut = async move { 4275 + let method = StreamCurrentTrackSvc(inner); 4276 + let codec = tonic::codec::ProstCodec::default(); 4277 + let mut grpc = tonic::server::Grpc::new(codec) 4278 + .apply_compression_config( 4279 + accept_compression_encodings, 4280 + send_compression_encodings, 4281 + ) 4282 + .apply_max_message_size_config( 4283 + max_decoding_message_size, 4284 + max_encoding_message_size, 4285 + ); 4286 + let res = grpc.server_streaming(method, req).await; 4287 + Ok(res) 4288 + }; 4289 + Box::pin(fut) 4290 + } 4291 + "/rockbox.v1alpha1.PlaybackService/StreamStatus" => { 4292 + #[allow(non_camel_case_types)] 4293 + struct StreamStatusSvc<T: PlaybackService>(pub Arc<T>); 4294 + impl< 4295 + T: PlaybackService, 4296 + > tonic::server::ServerStreamingService<super::StreamStatusRequest> 4297 + for StreamStatusSvc<T> { 4298 + type Response = super::StatusResponse; 4299 + type ResponseStream = T::StreamStatusStream; 4300 + type Future = BoxFuture< 4301 + tonic::Response<Self::ResponseStream>, 4302 + tonic::Status, 4303 + >; 4304 + fn call( 4305 + &mut self, 4306 + request: tonic::Request<super::StreamStatusRequest>, 4307 + ) -> Self::Future { 4308 + let inner = Arc::clone(&self.0); 4309 + let fut = async move { 4310 + <T as PlaybackService>::stream_status(&inner, request).await 4311 + }; 4312 + Box::pin(fut) 4313 + } 4314 + } 4315 + let accept_compression_encodings = self.accept_compression_encodings; 4316 + let send_compression_encodings = self.send_compression_encodings; 4317 + let max_decoding_message_size = self.max_decoding_message_size; 4318 + let max_encoding_message_size = self.max_encoding_message_size; 4319 + let inner = self.inner.clone(); 4320 + let fut = async move { 4321 + let method = StreamStatusSvc(inner); 4322 + let codec = tonic::codec::ProstCodec::default(); 4323 + let mut grpc = tonic::server::Grpc::new(codec) 4324 + .apply_compression_config( 4325 + accept_compression_encodings, 4326 + send_compression_encodings, 4327 + ) 4328 + .apply_max_message_size_config( 4329 + max_decoding_message_size, 4330 + max_encoding_message_size, 4331 + ); 4332 + let res = grpc.server_streaming(method, req).await; 4333 + Ok(res) 4334 + }; 4335 + Box::pin(fut) 4336 + } 4337 + "/rockbox.v1alpha1.PlaybackService/StreamPlaylist" => { 4338 + #[allow(non_camel_case_types)] 4339 + struct StreamPlaylistSvc<T: PlaybackService>(pub Arc<T>); 4340 + impl< 4341 + T: PlaybackService, 4342 + > tonic::server::ServerStreamingService<super::StreamPlaylistRequest> 4343 + for StreamPlaylistSvc<T> { 4344 + type Response = super::PlaylistResponse; 4345 + type ResponseStream = T::StreamPlaylistStream; 4346 + type Future = BoxFuture< 4347 + tonic::Response<Self::ResponseStream>, 4348 + tonic::Status, 4349 + >; 4350 + fn call( 4351 + &mut self, 4352 + request: tonic::Request<super::StreamPlaylistRequest>, 4353 + ) -> Self::Future { 4354 + let inner = Arc::clone(&self.0); 4355 + let fut = async move { 4356 + <T as PlaybackService>::stream_playlist(&inner, request) 4357 + .await 4358 + }; 4359 + Box::pin(fut) 4360 + } 4361 + } 4362 + let accept_compression_encodings = self.accept_compression_encodings; 4363 + let send_compression_encodings = self.send_compression_encodings; 4364 + let max_decoding_message_size = self.max_decoding_message_size; 4365 + let max_encoding_message_size = self.max_encoding_message_size; 4366 + let inner = self.inner.clone(); 4367 + let fut = async move { 4368 + let method = StreamPlaylistSvc(inner); 4369 + let codec = tonic::codec::ProstCodec::default(); 4370 + let mut grpc = tonic::server::Grpc::new(codec) 4371 + .apply_compression_config( 4372 + accept_compression_encodings, 4373 + send_compression_encodings, 4374 + ) 4375 + .apply_max_message_size_config( 4376 + max_decoding_message_size, 4377 + max_encoding_message_size, 4378 + ); 4379 + let res = grpc.server_streaming(method, req).await; 4380 + Ok(res) 4381 + }; 4382 + Box::pin(fut) 4383 + } 4384 + _ => { 4385 + Box::pin(async move { 4386 + let mut response = http::Response::new(empty_body()); 4387 + let headers = response.headers_mut(); 4388 + headers 4389 + .insert( 4390 + tonic::Status::GRPC_STATUS, 4391 + (tonic::Code::Unimplemented as i32).into(), 4392 + ); 4393 + headers 4394 + .insert( 4395 + http::header::CONTENT_TYPE, 4396 + tonic::metadata::GRPC_CONTENT_TYPE, 4397 + ); 4398 + Ok(response) 4399 + }) 4400 + } 4401 + } 4402 + } 4403 + } 4404 + impl<T> Clone for PlaybackServiceServer<T> { 4405 + fn clone(&self) -> Self { 4406 + let inner = self.inner.clone(); 4407 + Self { 4408 + inner, 4409 + accept_compression_encodings: self.accept_compression_encodings, 4410 + send_compression_encodings: self.send_compression_encodings, 4411 + max_decoding_message_size: self.max_decoding_message_size, 4412 + max_encoding_message_size: self.max_encoding_message_size, 4413 + } 4414 + } 4415 + } 4416 + /// Generated gRPC service name 4417 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.PlaybackService"; 4418 + impl<T> tonic::server::NamedService for PlaybackServiceServer<T> { 4419 + const NAME: &'static str = SERVICE_NAME; 4420 + } 4421 + } 4422 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4423 + pub struct GetCurrentRequest {} 4424 + #[derive(Clone, PartialEq, ::prost::Message)] 4425 + pub struct GetCurrentResponse { 4426 + #[prost(int32, tag = "1")] 4427 + pub index: i32, 4428 + #[prost(int32, tag = "2")] 4429 + pub amount: i32, 4430 + #[prost(int32, tag = "3")] 4431 + pub max_playlist_size: i32, 4432 + #[prost(int32, tag = "4")] 4433 + pub first_index: i32, 4434 + #[prost(int32, tag = "5")] 4435 + pub last_insert_pos: i32, 4436 + #[prost(int32, tag = "6")] 4437 + pub seed: i32, 4438 + #[prost(int32, tag = "7")] 4439 + pub last_shuffled_start: i32, 4440 + #[prost(message, repeated, tag = "8")] 4441 + pub tracks: ::prost::alloc::vec::Vec<CurrentTrackResponse>, 4442 + } 4443 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4444 + pub struct GetResumeInfoRequest {} 4445 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4446 + pub struct GetResumeInfoResponse {} 4447 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4448 + pub struct GetTrackInfoRequest {} 4449 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4450 + pub struct GetTrackInfoResponse {} 4451 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4452 + pub struct GetFirstIndexRequest {} 4453 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4454 + pub struct GetFirstIndexResponse {} 4455 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4456 + pub struct GetDisplayIndexRequest {} 4457 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4458 + pub struct GetDisplayIndexResponse {} 4459 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4460 + pub struct AmountRequest {} 4461 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4462 + pub struct AmountResponse { 4463 + #[prost(int32, tag = "1")] 4464 + pub amount: i32, 4465 + } 4466 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4467 + pub struct PlaylistResumeRequest {} 4468 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4469 + pub struct PlaylistResumeResponse { 4470 + #[prost(int32, tag = "1")] 4471 + pub code: i32, 4472 + } 4473 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4474 + pub struct ResumeTrackRequest { 4475 + #[prost(int32, tag = "1")] 4476 + pub start_index: i32, 4477 + #[prost(uint32, tag = "2")] 4478 + pub crc: u32, 4479 + #[prost(uint64, tag = "3")] 4480 + pub elapsed: u64, 4481 + #[prost(uint64, tag = "4")] 4482 + pub offset: u64, 4483 + } 4484 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4485 + pub struct ResumeTrackResponse {} 4486 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4487 + pub struct SetModifiedRequest {} 4488 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4489 + pub struct SetModifiedResponse {} 4490 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4491 + pub struct StartRequest { 4492 + #[prost(int32, optional, tag = "1")] 4493 + pub start_index: ::core::option::Option<i32>, 4494 + #[prost(int32, optional, tag = "2")] 4495 + pub elapsed: ::core::option::Option<i32>, 4496 + #[prost(int32, optional, tag = "3")] 4497 + pub offset: ::core::option::Option<i32>, 4498 + } 4499 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4500 + pub struct StartResponse {} 4501 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4502 + pub struct SyncRequest {} 4503 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4504 + pub struct SyncResponse {} 4505 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4506 + pub struct RemoveAllTracksRequest {} 4507 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4508 + pub struct RemoveAllTracksResponse {} 4509 + #[derive(Clone, PartialEq, ::prost::Message)] 4510 + pub struct RemoveTracksRequest { 4511 + #[prost(int32, repeated, tag = "1")] 4512 + pub positions: ::prost::alloc::vec::Vec<i32>, 4513 + } 4514 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4515 + pub struct RemoveTracksResponse {} 4516 + #[derive(Clone, PartialEq, ::prost::Message)] 4517 + pub struct CreatePlaylistRequest { 4518 + #[prost(string, tag = "1")] 4519 + pub name: ::prost::alloc::string::String, 4520 + #[prost(string, repeated, tag = "2")] 4521 + pub tracks: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, 4522 + #[prost(string, optional, tag = "3")] 4523 + pub folder_id: ::core::option::Option<::prost::alloc::string::String>, 4524 + } 4525 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4526 + pub struct CreatePlaylistResponse { 4527 + #[prost(int32, tag = "1")] 4528 + pub start_index: i32, 4529 + } 4530 + #[derive(Clone, PartialEq, ::prost::Message)] 4531 + pub struct InsertTracksRequest { 4532 + #[prost(string, optional, tag = "1")] 4533 + pub playlist_id: ::core::option::Option<::prost::alloc::string::String>, 4534 + #[prost(int32, tag = "2")] 4535 + pub position: i32, 4536 + #[prost(string, repeated, tag = "3")] 4537 + pub tracks: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, 4538 + #[prost(bool, optional, tag = "4")] 4539 + pub shuffle: ::core::option::Option<bool>, 4540 + } 4541 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4542 + pub struct InsertTracksResponse {} 4543 + #[derive(Clone, PartialEq, ::prost::Message)] 4544 + pub struct InsertDirectoryRequest { 4545 + #[prost(string, optional, tag = "1")] 4546 + pub playlist_id: ::core::option::Option<::prost::alloc::string::String>, 4547 + #[prost(int32, tag = "2")] 4548 + pub position: i32, 4549 + #[prost(string, tag = "3")] 4550 + pub directory: ::prost::alloc::string::String, 4551 + #[prost(bool, optional, tag = "4")] 4552 + pub recurse: ::core::option::Option<bool>, 4553 + #[prost(bool, optional, tag = "5")] 4554 + pub shuffle: ::core::option::Option<bool>, 4555 + } 4556 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4557 + pub struct InsertDirectoryResponse {} 4558 + #[derive(Clone, PartialEq, ::prost::Message)] 4559 + pub struct InsertPlaylistRequest { 4560 + #[prost(int32, tag = "1")] 4561 + pub position: i32, 4562 + #[prost(string, tag = "2")] 4563 + pub target_playlist_id: ::prost::alloc::string::String, 4564 + #[prost(string, tag = "3")] 4565 + pub playlist_id: ::prost::alloc::string::String, 4566 + #[prost(bool, optional, tag = "4")] 4567 + pub shuffle: ::core::option::Option<bool>, 4568 + } 4569 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4570 + pub struct InsertPlaylistResponse {} 4571 + #[derive(Clone, PartialEq, ::prost::Message)] 4572 + pub struct InsertAlbumRequest { 4573 + #[prost(int32, tag = "1")] 4574 + pub position: i32, 4575 + #[prost(string, tag = "2")] 4576 + pub album_id: ::prost::alloc::string::String, 4577 + #[prost(bool, optional, tag = "3")] 4578 + pub shuffle: ::core::option::Option<bool>, 4579 + } 4580 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4581 + pub struct InsertAlbumResponse {} 4582 + #[derive(Clone, PartialEq, ::prost::Message)] 4583 + pub struct InsertArtistTracksRequest { 4584 + #[prost(int32, tag = "1")] 4585 + pub position: i32, 4586 + #[prost(string, tag = "2")] 4587 + pub artist_id: ::prost::alloc::string::String, 4588 + #[prost(bool, optional, tag = "3")] 4589 + pub shuffle: ::core::option::Option<bool>, 4590 + } 4591 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4592 + pub struct InsertArtistTracksResponse {} 4593 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4594 + pub struct ShufflePlaylistRequest { 4595 + #[prost(int32, tag = "1")] 4596 + pub start_index: i32, 4597 + } 4598 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4599 + pub struct ShufflePlaylistResponse {} 4600 + /// Generated client implementations. 4601 + pub mod playlist_service_client { 4602 + #![allow( 4603 + unused_variables, 4604 + dead_code, 4605 + missing_docs, 4606 + clippy::wildcard_imports, 4607 + clippy::let_unit_value, 4608 + )] 4609 + use tonic::codegen::*; 4610 + use tonic::codegen::http::Uri; 4611 + #[derive(Debug, Clone)] 4612 + pub struct PlaylistServiceClient<T> { 4613 + inner: tonic::client::Grpc<T>, 4614 + } 4615 + impl PlaylistServiceClient<tonic::transport::Channel> { 4616 + /// Attempt to create a new client by connecting to a given endpoint. 4617 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 4618 + where 4619 + D: TryInto<tonic::transport::Endpoint>, 4620 + D::Error: Into<StdError>, 4621 + { 4622 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 4623 + Ok(Self::new(conn)) 4624 + } 4625 + } 4626 + impl<T> PlaylistServiceClient<T> 4627 + where 4628 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 4629 + T::Error: Into<StdError>, 4630 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 4631 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 4632 + { 4633 + pub fn new(inner: T) -> Self { 4634 + let inner = tonic::client::Grpc::new(inner); 4635 + Self { inner } 4636 + } 4637 + pub fn with_origin(inner: T, origin: Uri) -> Self { 4638 + let inner = tonic::client::Grpc::with_origin(inner, origin); 4639 + Self { inner } 4640 + } 4641 + pub fn with_interceptor<F>( 4642 + inner: T, 4643 + interceptor: F, 4644 + ) -> PlaylistServiceClient<InterceptedService<T, F>> 4645 + where 4646 + F: tonic::service::Interceptor, 4647 + T::ResponseBody: Default, 4648 + T: tonic::codegen::Service< 4649 + http::Request<tonic::body::BoxBody>, 4650 + Response = http::Response< 4651 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 4652 + >, 4653 + >, 4654 + <T as tonic::codegen::Service< 4655 + http::Request<tonic::body::BoxBody>, 4656 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 4657 + { 4658 + PlaylistServiceClient::new(InterceptedService::new(inner, interceptor)) 4659 + } 4660 + /// Compress requests with the given encoding. 4661 + /// 4662 + /// This requires the server to support it otherwise it might respond with an 4663 + /// error. 4664 + #[must_use] 4665 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 4666 + self.inner = self.inner.send_compressed(encoding); 4667 + self 4668 + } 4669 + /// Enable decompressing responses. 4670 + #[must_use] 4671 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 4672 + self.inner = self.inner.accept_compressed(encoding); 4673 + self 4674 + } 4675 + /// Limits the maximum size of a decoded message. 4676 + /// 4677 + /// Default: `4MB` 4678 + #[must_use] 4679 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 4680 + self.inner = self.inner.max_decoding_message_size(limit); 4681 + self 4682 + } 4683 + /// Limits the maximum size of an encoded message. 4684 + /// 4685 + /// Default: `usize::MAX` 4686 + #[must_use] 4687 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 4688 + self.inner = self.inner.max_encoding_message_size(limit); 4689 + self 4690 + } 4691 + pub async fn get_current( 4692 + &mut self, 4693 + request: impl tonic::IntoRequest<super::GetCurrentRequest>, 4694 + ) -> std::result::Result< 4695 + tonic::Response<super::GetCurrentResponse>, 4696 + tonic::Status, 4697 + > { 4698 + self.inner 4699 + .ready() 4700 + .await 4701 + .map_err(|e| { 4702 + tonic::Status::unknown( 4703 + format!("Service was not ready: {}", e.into()), 4704 + ) 4705 + })?; 4706 + let codec = tonic::codec::ProstCodec::default(); 4707 + let path = http::uri::PathAndQuery::from_static( 4708 + "/rockbox.v1alpha1.PlaylistService/GetCurrent", 4709 + ); 4710 + let mut req = request.into_request(); 4711 + req.extensions_mut() 4712 + .insert( 4713 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetCurrent"), 4714 + ); 4715 + self.inner.unary(req, path, codec).await 4716 + } 4717 + pub async fn get_resume_info( 4718 + &mut self, 4719 + request: impl tonic::IntoRequest<super::GetResumeInfoRequest>, 4720 + ) -> std::result::Result< 4721 + tonic::Response<super::GetResumeInfoResponse>, 4722 + tonic::Status, 4723 + > { 4724 + self.inner 4725 + .ready() 4726 + .await 4727 + .map_err(|e| { 4728 + tonic::Status::unknown( 4729 + format!("Service was not ready: {}", e.into()), 4730 + ) 4731 + })?; 4732 + let codec = tonic::codec::ProstCodec::default(); 4733 + let path = http::uri::PathAndQuery::from_static( 4734 + "/rockbox.v1alpha1.PlaylistService/GetResumeInfo", 4735 + ); 4736 + let mut req = request.into_request(); 4737 + req.extensions_mut() 4738 + .insert( 4739 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetResumeInfo"), 4740 + ); 4741 + self.inner.unary(req, path, codec).await 4742 + } 4743 + pub async fn get_track_info( 4744 + &mut self, 4745 + request: impl tonic::IntoRequest<super::GetTrackInfoRequest>, 4746 + ) -> std::result::Result< 4747 + tonic::Response<super::GetTrackInfoResponse>, 4748 + tonic::Status, 4749 + > { 4750 + self.inner 4751 + .ready() 4752 + .await 4753 + .map_err(|e| { 4754 + tonic::Status::unknown( 4755 + format!("Service was not ready: {}", e.into()), 4756 + ) 4757 + })?; 4758 + let codec = tonic::codec::ProstCodec::default(); 4759 + let path = http::uri::PathAndQuery::from_static( 4760 + "/rockbox.v1alpha1.PlaylistService/GetTrackInfo", 4761 + ); 4762 + let mut req = request.into_request(); 4763 + req.extensions_mut() 4764 + .insert( 4765 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetTrackInfo"), 4766 + ); 4767 + self.inner.unary(req, path, codec).await 4768 + } 4769 + pub async fn get_first_index( 4770 + &mut self, 4771 + request: impl tonic::IntoRequest<super::GetFirstIndexRequest>, 4772 + ) -> std::result::Result< 4773 + tonic::Response<super::GetFirstIndexResponse>, 4774 + tonic::Status, 4775 + > { 4776 + self.inner 4777 + .ready() 4778 + .await 4779 + .map_err(|e| { 4780 + tonic::Status::unknown( 4781 + format!("Service was not ready: {}", e.into()), 4782 + ) 4783 + })?; 4784 + let codec = tonic::codec::ProstCodec::default(); 4785 + let path = http::uri::PathAndQuery::from_static( 4786 + "/rockbox.v1alpha1.PlaylistService/GetFirstIndex", 4787 + ); 4788 + let mut req = request.into_request(); 4789 + req.extensions_mut() 4790 + .insert( 4791 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetFirstIndex"), 4792 + ); 4793 + self.inner.unary(req, path, codec).await 4794 + } 4795 + pub async fn get_display_index( 4796 + &mut self, 4797 + request: impl tonic::IntoRequest<super::GetDisplayIndexRequest>, 4798 + ) -> std::result::Result< 4799 + tonic::Response<super::GetDisplayIndexResponse>, 4800 + tonic::Status, 4801 + > { 4802 + self.inner 4803 + .ready() 4804 + .await 4805 + .map_err(|e| { 4806 + tonic::Status::unknown( 4807 + format!("Service was not ready: {}", e.into()), 4808 + ) 4809 + })?; 4810 + let codec = tonic::codec::ProstCodec::default(); 4811 + let path = http::uri::PathAndQuery::from_static( 4812 + "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex", 4813 + ); 4814 + let mut req = request.into_request(); 4815 + req.extensions_mut() 4816 + .insert( 4817 + GrpcMethod::new( 4818 + "rockbox.v1alpha1.PlaylistService", 4819 + "GetDisplayIndex", 4820 + ), 4821 + ); 4822 + self.inner.unary(req, path, codec).await 4823 + } 4824 + pub async fn amount( 4825 + &mut self, 4826 + request: impl tonic::IntoRequest<super::AmountRequest>, 4827 + ) -> std::result::Result<tonic::Response<super::AmountResponse>, tonic::Status> { 4828 + self.inner 4829 + .ready() 4830 + .await 4831 + .map_err(|e| { 4832 + tonic::Status::unknown( 4833 + format!("Service was not ready: {}", e.into()), 4834 + ) 4835 + })?; 4836 + let codec = tonic::codec::ProstCodec::default(); 4837 + let path = http::uri::PathAndQuery::from_static( 4838 + "/rockbox.v1alpha1.PlaylistService/Amount", 4839 + ); 4840 + let mut req = request.into_request(); 4841 + req.extensions_mut() 4842 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Amount")); 4843 + self.inner.unary(req, path, codec).await 4844 + } 4845 + pub async fn playlist_resume( 4846 + &mut self, 4847 + request: impl tonic::IntoRequest<super::PlaylistResumeRequest>, 4848 + ) -> std::result::Result< 4849 + tonic::Response<super::PlaylistResumeResponse>, 4850 + tonic::Status, 4851 + > { 4852 + self.inner 4853 + .ready() 4854 + .await 4855 + .map_err(|e| { 4856 + tonic::Status::unknown( 4857 + format!("Service was not ready: {}", e.into()), 4858 + ) 4859 + })?; 4860 + let codec = tonic::codec::ProstCodec::default(); 4861 + let path = http::uri::PathAndQuery::from_static( 4862 + "/rockbox.v1alpha1.PlaylistService/PlaylistResume", 4863 + ); 4864 + let mut req = request.into_request(); 4865 + req.extensions_mut() 4866 + .insert( 4867 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "PlaylistResume"), 4868 + ); 4869 + self.inner.unary(req, path, codec).await 4870 + } 4871 + pub async fn resume_track( 4872 + &mut self, 4873 + request: impl tonic::IntoRequest<super::ResumeTrackRequest>, 4874 + ) -> std::result::Result< 4875 + tonic::Response<super::ResumeTrackResponse>, 4876 + tonic::Status, 4877 + > { 4878 + self.inner 4879 + .ready() 4880 + .await 4881 + .map_err(|e| { 4882 + tonic::Status::unknown( 4883 + format!("Service was not ready: {}", e.into()), 4884 + ) 4885 + })?; 4886 + let codec = tonic::codec::ProstCodec::default(); 4887 + let path = http::uri::PathAndQuery::from_static( 4888 + "/rockbox.v1alpha1.PlaylistService/ResumeTrack", 4889 + ); 4890 + let mut req = request.into_request(); 4891 + req.extensions_mut() 4892 + .insert( 4893 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "ResumeTrack"), 4894 + ); 4895 + self.inner.unary(req, path, codec).await 4896 + } 4897 + pub async fn set_modified( 4898 + &mut self, 4899 + request: impl tonic::IntoRequest<super::SetModifiedRequest>, 4900 + ) -> std::result::Result< 4901 + tonic::Response<super::SetModifiedResponse>, 4902 + tonic::Status, 4903 + > { 4904 + self.inner 4905 + .ready() 4906 + .await 4907 + .map_err(|e| { 4908 + tonic::Status::unknown( 4909 + format!("Service was not ready: {}", e.into()), 4910 + ) 4911 + })?; 4912 + let codec = tonic::codec::ProstCodec::default(); 4913 + let path = http::uri::PathAndQuery::from_static( 4914 + "/rockbox.v1alpha1.PlaylistService/SetModified", 4915 + ); 4916 + let mut req = request.into_request(); 4917 + req.extensions_mut() 4918 + .insert( 4919 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "SetModified"), 4920 + ); 4921 + self.inner.unary(req, path, codec).await 4922 + } 4923 + pub async fn start( 4924 + &mut self, 4925 + request: impl tonic::IntoRequest<super::StartRequest>, 4926 + ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status> { 4927 + self.inner 4928 + .ready() 4929 + .await 4930 + .map_err(|e| { 4931 + tonic::Status::unknown( 4932 + format!("Service was not ready: {}", e.into()), 4933 + ) 4934 + })?; 4935 + let codec = tonic::codec::ProstCodec::default(); 4936 + let path = http::uri::PathAndQuery::from_static( 4937 + "/rockbox.v1alpha1.PlaylistService/Start", 4938 + ); 4939 + let mut req = request.into_request(); 4940 + req.extensions_mut() 4941 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Start")); 4942 + self.inner.unary(req, path, codec).await 4943 + } 4944 + pub async fn sync( 4945 + &mut self, 4946 + request: impl tonic::IntoRequest<super::SyncRequest>, 4947 + ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> { 4948 + self.inner 4949 + .ready() 4950 + .await 4951 + .map_err(|e| { 4952 + tonic::Status::unknown( 4953 + format!("Service was not ready: {}", e.into()), 4954 + ) 4955 + })?; 4956 + let codec = tonic::codec::ProstCodec::default(); 4957 + let path = http::uri::PathAndQuery::from_static( 4958 + "/rockbox.v1alpha1.PlaylistService/Sync", 4959 + ); 4960 + let mut req = request.into_request(); 4961 + req.extensions_mut() 4962 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Sync")); 4963 + self.inner.unary(req, path, codec).await 4964 + } 4965 + pub async fn remove_all_tracks( 4966 + &mut self, 4967 + request: impl tonic::IntoRequest<super::RemoveAllTracksRequest>, 4968 + ) -> std::result::Result< 4969 + tonic::Response<super::RemoveAllTracksResponse>, 4970 + tonic::Status, 4971 + > { 4972 + self.inner 4973 + .ready() 4974 + .await 4975 + .map_err(|e| { 4976 + tonic::Status::unknown( 4977 + format!("Service was not ready: {}", e.into()), 4978 + ) 4979 + })?; 4980 + let codec = tonic::codec::ProstCodec::default(); 4981 + let path = http::uri::PathAndQuery::from_static( 4982 + "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks", 4983 + ); 4984 + let mut req = request.into_request(); 4985 + req.extensions_mut() 4986 + .insert( 4987 + GrpcMethod::new( 4988 + "rockbox.v1alpha1.PlaylistService", 4989 + "RemoveAllTracks", 4990 + ), 4991 + ); 4992 + self.inner.unary(req, path, codec).await 4993 + } 4994 + pub async fn remove_tracks( 4995 + &mut self, 4996 + request: impl tonic::IntoRequest<super::RemoveTracksRequest>, 4997 + ) -> std::result::Result< 4998 + tonic::Response<super::RemoveTracksResponse>, 4999 + tonic::Status, 5000 + > { 5001 + self.inner 5002 + .ready() 5003 + .await 5004 + .map_err(|e| { 5005 + tonic::Status::unknown( 5006 + format!("Service was not ready: {}", e.into()), 5007 + ) 5008 + })?; 5009 + let codec = tonic::codec::ProstCodec::default(); 5010 + let path = http::uri::PathAndQuery::from_static( 5011 + "/rockbox.v1alpha1.PlaylistService/RemoveTracks", 5012 + ); 5013 + let mut req = request.into_request(); 5014 + req.extensions_mut() 5015 + .insert( 5016 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "RemoveTracks"), 5017 + ); 5018 + self.inner.unary(req, path, codec).await 5019 + } 5020 + pub async fn create_playlist( 5021 + &mut self, 5022 + request: impl tonic::IntoRequest<super::CreatePlaylistRequest>, 5023 + ) -> std::result::Result< 5024 + tonic::Response<super::CreatePlaylistResponse>, 5025 + tonic::Status, 5026 + > { 5027 + self.inner 5028 + .ready() 5029 + .await 5030 + .map_err(|e| { 5031 + tonic::Status::unknown( 5032 + format!("Service was not ready: {}", e.into()), 5033 + ) 5034 + })?; 5035 + let codec = tonic::codec::ProstCodec::default(); 5036 + let path = http::uri::PathAndQuery::from_static( 5037 + "/rockbox.v1alpha1.PlaylistService/CreatePlaylist", 5038 + ); 5039 + let mut req = request.into_request(); 5040 + req.extensions_mut() 5041 + .insert( 5042 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "CreatePlaylist"), 5043 + ); 5044 + self.inner.unary(req, path, codec).await 5045 + } 5046 + pub async fn insert_tracks( 5047 + &mut self, 5048 + request: impl tonic::IntoRequest<super::InsertTracksRequest>, 5049 + ) -> std::result::Result< 5050 + tonic::Response<super::InsertTracksResponse>, 5051 + tonic::Status, 5052 + > { 5053 + self.inner 5054 + .ready() 5055 + .await 5056 + .map_err(|e| { 5057 + tonic::Status::unknown( 5058 + format!("Service was not ready: {}", e.into()), 5059 + ) 5060 + })?; 5061 + let codec = tonic::codec::ProstCodec::default(); 5062 + let path = http::uri::PathAndQuery::from_static( 5063 + "/rockbox.v1alpha1.PlaylistService/InsertTracks", 5064 + ); 5065 + let mut req = request.into_request(); 5066 + req.extensions_mut() 5067 + .insert( 5068 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertTracks"), 5069 + ); 5070 + self.inner.unary(req, path, codec).await 5071 + } 5072 + pub async fn insert_directory( 5073 + &mut self, 5074 + request: impl tonic::IntoRequest<super::InsertDirectoryRequest>, 5075 + ) -> std::result::Result< 5076 + tonic::Response<super::InsertDirectoryResponse>, 5077 + tonic::Status, 5078 + > { 5079 + self.inner 5080 + .ready() 5081 + .await 5082 + .map_err(|e| { 5083 + tonic::Status::unknown( 5084 + format!("Service was not ready: {}", e.into()), 5085 + ) 5086 + })?; 5087 + let codec = tonic::codec::ProstCodec::default(); 5088 + let path = http::uri::PathAndQuery::from_static( 5089 + "/rockbox.v1alpha1.PlaylistService/InsertDirectory", 5090 + ); 5091 + let mut req = request.into_request(); 5092 + req.extensions_mut() 5093 + .insert( 5094 + GrpcMethod::new( 5095 + "rockbox.v1alpha1.PlaylistService", 5096 + "InsertDirectory", 5097 + ), 5098 + ); 5099 + self.inner.unary(req, path, codec).await 5100 + } 5101 + pub async fn insert_playlist( 5102 + &mut self, 5103 + request: impl tonic::IntoRequest<super::InsertPlaylistRequest>, 5104 + ) -> std::result::Result< 5105 + tonic::Response<super::InsertPlaylistResponse>, 5106 + tonic::Status, 5107 + > { 5108 + self.inner 5109 + .ready() 5110 + .await 5111 + .map_err(|e| { 5112 + tonic::Status::unknown( 5113 + format!("Service was not ready: {}", e.into()), 5114 + ) 5115 + })?; 5116 + let codec = tonic::codec::ProstCodec::default(); 5117 + let path = http::uri::PathAndQuery::from_static( 5118 + "/rockbox.v1alpha1.PlaylistService/InsertPlaylist", 5119 + ); 5120 + let mut req = request.into_request(); 5121 + req.extensions_mut() 5122 + .insert( 5123 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertPlaylist"), 5124 + ); 5125 + self.inner.unary(req, path, codec).await 5126 + } 5127 + pub async fn insert_album( 5128 + &mut self, 5129 + request: impl tonic::IntoRequest<super::InsertAlbumRequest>, 5130 + ) -> std::result::Result< 5131 + tonic::Response<super::InsertAlbumResponse>, 5132 + tonic::Status, 5133 + > { 5134 + self.inner 5135 + .ready() 5136 + .await 5137 + .map_err(|e| { 5138 + tonic::Status::unknown( 5139 + format!("Service was not ready: {}", e.into()), 5140 + ) 5141 + })?; 5142 + let codec = tonic::codec::ProstCodec::default(); 5143 + let path = http::uri::PathAndQuery::from_static( 5144 + "/rockbox.v1alpha1.PlaylistService/InsertAlbum", 5145 + ); 5146 + let mut req = request.into_request(); 5147 + req.extensions_mut() 5148 + .insert( 5149 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertAlbum"), 5150 + ); 5151 + self.inner.unary(req, path, codec).await 5152 + } 5153 + pub async fn insert_artist_tracks( 5154 + &mut self, 5155 + request: impl tonic::IntoRequest<super::InsertArtistTracksRequest>, 5156 + ) -> std::result::Result< 5157 + tonic::Response<super::InsertArtistTracksResponse>, 5158 + tonic::Status, 5159 + > { 5160 + self.inner 5161 + .ready() 5162 + .await 5163 + .map_err(|e| { 5164 + tonic::Status::unknown( 5165 + format!("Service was not ready: {}", e.into()), 5166 + ) 5167 + })?; 5168 + let codec = tonic::codec::ProstCodec::default(); 5169 + let path = http::uri::PathAndQuery::from_static( 5170 + "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks", 5171 + ); 5172 + let mut req = request.into_request(); 5173 + req.extensions_mut() 5174 + .insert( 5175 + GrpcMethod::new( 5176 + "rockbox.v1alpha1.PlaylistService", 5177 + "InsertArtistTracks", 5178 + ), 5179 + ); 5180 + self.inner.unary(req, path, codec).await 5181 + } 5182 + pub async fn shuffle_playlist( 5183 + &mut self, 5184 + request: impl tonic::IntoRequest<super::ShufflePlaylistRequest>, 5185 + ) -> std::result::Result< 5186 + tonic::Response<super::ShufflePlaylistResponse>, 5187 + tonic::Status, 5188 + > { 5189 + self.inner 5190 + .ready() 5191 + .await 5192 + .map_err(|e| { 5193 + tonic::Status::unknown( 5194 + format!("Service was not ready: {}", e.into()), 5195 + ) 5196 + })?; 5197 + let codec = tonic::codec::ProstCodec::default(); 5198 + let path = http::uri::PathAndQuery::from_static( 5199 + "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist", 5200 + ); 5201 + let mut req = request.into_request(); 5202 + req.extensions_mut() 5203 + .insert( 5204 + GrpcMethod::new( 5205 + "rockbox.v1alpha1.PlaylistService", 5206 + "ShufflePlaylist", 5207 + ), 5208 + ); 5209 + self.inner.unary(req, path, codec).await 5210 + } 5211 + } 5212 + } 5213 + /// Generated server implementations. 5214 + pub mod playlist_service_server { 5215 + #![allow( 5216 + unused_variables, 5217 + dead_code, 5218 + missing_docs, 5219 + clippy::wildcard_imports, 5220 + clippy::let_unit_value, 5221 + )] 5222 + use tonic::codegen::*; 5223 + /// Generated trait containing gRPC methods that should be implemented for use with PlaylistServiceServer. 5224 + #[async_trait] 5225 + pub trait PlaylistService: std::marker::Send + std::marker::Sync + 'static { 5226 + async fn get_current( 5227 + &self, 5228 + request: tonic::Request<super::GetCurrentRequest>, 5229 + ) -> std::result::Result< 5230 + tonic::Response<super::GetCurrentResponse>, 5231 + tonic::Status, 5232 + >; 5233 + async fn get_resume_info( 5234 + &self, 5235 + request: tonic::Request<super::GetResumeInfoRequest>, 5236 + ) -> std::result::Result< 5237 + tonic::Response<super::GetResumeInfoResponse>, 5238 + tonic::Status, 5239 + >; 5240 + async fn get_track_info( 5241 + &self, 5242 + request: tonic::Request<super::GetTrackInfoRequest>, 5243 + ) -> std::result::Result< 5244 + tonic::Response<super::GetTrackInfoResponse>, 5245 + tonic::Status, 5246 + >; 5247 + async fn get_first_index( 5248 + &self, 5249 + request: tonic::Request<super::GetFirstIndexRequest>, 5250 + ) -> std::result::Result< 5251 + tonic::Response<super::GetFirstIndexResponse>, 5252 + tonic::Status, 5253 + >; 5254 + async fn get_display_index( 5255 + &self, 5256 + request: tonic::Request<super::GetDisplayIndexRequest>, 5257 + ) -> std::result::Result< 5258 + tonic::Response<super::GetDisplayIndexResponse>, 5259 + tonic::Status, 5260 + >; 5261 + async fn amount( 5262 + &self, 5263 + request: tonic::Request<super::AmountRequest>, 5264 + ) -> std::result::Result<tonic::Response<super::AmountResponse>, tonic::Status>; 5265 + async fn playlist_resume( 5266 + &self, 5267 + request: tonic::Request<super::PlaylistResumeRequest>, 5268 + ) -> std::result::Result< 5269 + tonic::Response<super::PlaylistResumeResponse>, 5270 + tonic::Status, 5271 + >; 5272 + async fn resume_track( 5273 + &self, 5274 + request: tonic::Request<super::ResumeTrackRequest>, 5275 + ) -> std::result::Result< 5276 + tonic::Response<super::ResumeTrackResponse>, 5277 + tonic::Status, 5278 + >; 5279 + async fn set_modified( 5280 + &self, 5281 + request: tonic::Request<super::SetModifiedRequest>, 5282 + ) -> std::result::Result< 5283 + tonic::Response<super::SetModifiedResponse>, 5284 + tonic::Status, 5285 + >; 5286 + async fn start( 5287 + &self, 5288 + request: tonic::Request<super::StartRequest>, 5289 + ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status>; 5290 + async fn sync( 5291 + &self, 5292 + request: tonic::Request<super::SyncRequest>, 5293 + ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>; 5294 + async fn remove_all_tracks( 5295 + &self, 5296 + request: tonic::Request<super::RemoveAllTracksRequest>, 5297 + ) -> std::result::Result< 5298 + tonic::Response<super::RemoveAllTracksResponse>, 5299 + tonic::Status, 5300 + >; 5301 + async fn remove_tracks( 5302 + &self, 5303 + request: tonic::Request<super::RemoveTracksRequest>, 5304 + ) -> std::result::Result< 5305 + tonic::Response<super::RemoveTracksResponse>, 5306 + tonic::Status, 5307 + >; 5308 + async fn create_playlist( 5309 + &self, 5310 + request: tonic::Request<super::CreatePlaylistRequest>, 5311 + ) -> std::result::Result< 5312 + tonic::Response<super::CreatePlaylistResponse>, 5313 + tonic::Status, 5314 + >; 5315 + async fn insert_tracks( 5316 + &self, 5317 + request: tonic::Request<super::InsertTracksRequest>, 5318 + ) -> std::result::Result< 5319 + tonic::Response<super::InsertTracksResponse>, 5320 + tonic::Status, 5321 + >; 5322 + async fn insert_directory( 5323 + &self, 5324 + request: tonic::Request<super::InsertDirectoryRequest>, 5325 + ) -> std::result::Result< 5326 + tonic::Response<super::InsertDirectoryResponse>, 5327 + tonic::Status, 5328 + >; 5329 + async fn insert_playlist( 5330 + &self, 5331 + request: tonic::Request<super::InsertPlaylistRequest>, 5332 + ) -> std::result::Result< 5333 + tonic::Response<super::InsertPlaylistResponse>, 5334 + tonic::Status, 5335 + >; 5336 + async fn insert_album( 5337 + &self, 5338 + request: tonic::Request<super::InsertAlbumRequest>, 5339 + ) -> std::result::Result< 5340 + tonic::Response<super::InsertAlbumResponse>, 5341 + tonic::Status, 5342 + >; 5343 + async fn insert_artist_tracks( 5344 + &self, 5345 + request: tonic::Request<super::InsertArtistTracksRequest>, 5346 + ) -> std::result::Result< 5347 + tonic::Response<super::InsertArtistTracksResponse>, 5348 + tonic::Status, 5349 + >; 5350 + async fn shuffle_playlist( 5351 + &self, 5352 + request: tonic::Request<super::ShufflePlaylistRequest>, 5353 + ) -> std::result::Result< 5354 + tonic::Response<super::ShufflePlaylistResponse>, 5355 + tonic::Status, 5356 + >; 5357 + } 5358 + #[derive(Debug)] 5359 + pub struct PlaylistServiceServer<T> { 5360 + inner: Arc<T>, 5361 + accept_compression_encodings: EnabledCompressionEncodings, 5362 + send_compression_encodings: EnabledCompressionEncodings, 5363 + max_decoding_message_size: Option<usize>, 5364 + max_encoding_message_size: Option<usize>, 5365 + } 5366 + impl<T> PlaylistServiceServer<T> { 5367 + pub fn new(inner: T) -> Self { 5368 + Self::from_arc(Arc::new(inner)) 5369 + } 5370 + pub fn from_arc(inner: Arc<T>) -> Self { 5371 + Self { 5372 + inner, 5373 + accept_compression_encodings: Default::default(), 5374 + send_compression_encodings: Default::default(), 5375 + max_decoding_message_size: None, 5376 + max_encoding_message_size: None, 5377 + } 5378 + } 5379 + pub fn with_interceptor<F>( 5380 + inner: T, 5381 + interceptor: F, 5382 + ) -> InterceptedService<Self, F> 5383 + where 5384 + F: tonic::service::Interceptor, 5385 + { 5386 + InterceptedService::new(Self::new(inner), interceptor) 5387 + } 5388 + /// Enable decompressing requests with the given encoding. 5389 + #[must_use] 5390 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 5391 + self.accept_compression_encodings.enable(encoding); 5392 + self 5393 + } 5394 + /// Compress responses with the given encoding, if the client supports it. 5395 + #[must_use] 5396 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 5397 + self.send_compression_encodings.enable(encoding); 5398 + self 5399 + } 5400 + /// Limits the maximum size of a decoded message. 5401 + /// 5402 + /// Default: `4MB` 5403 + #[must_use] 5404 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 5405 + self.max_decoding_message_size = Some(limit); 5406 + self 5407 + } 5408 + /// Limits the maximum size of an encoded message. 5409 + /// 5410 + /// Default: `usize::MAX` 5411 + #[must_use] 5412 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 5413 + self.max_encoding_message_size = Some(limit); 5414 + self 5415 + } 5416 + } 5417 + impl<T, B> tonic::codegen::Service<http::Request<B>> for PlaylistServiceServer<T> 5418 + where 5419 + T: PlaylistService, 5420 + B: Body + std::marker::Send + 'static, 5421 + B::Error: Into<StdError> + std::marker::Send + 'static, 5422 + { 5423 + type Response = http::Response<tonic::body::BoxBody>; 5424 + type Error = std::convert::Infallible; 5425 + type Future = BoxFuture<Self::Response, Self::Error>; 5426 + fn poll_ready( 5427 + &mut self, 5428 + _cx: &mut Context<'_>, 5429 + ) -> Poll<std::result::Result<(), Self::Error>> { 5430 + Poll::Ready(Ok(())) 5431 + } 5432 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 5433 + match req.uri().path() { 5434 + "/rockbox.v1alpha1.PlaylistService/GetCurrent" => { 5435 + #[allow(non_camel_case_types)] 5436 + struct GetCurrentSvc<T: PlaylistService>(pub Arc<T>); 5437 + impl< 5438 + T: PlaylistService, 5439 + > tonic::server::UnaryService<super::GetCurrentRequest> 5440 + for GetCurrentSvc<T> { 5441 + type Response = super::GetCurrentResponse; 5442 + type Future = BoxFuture< 5443 + tonic::Response<Self::Response>, 5444 + tonic::Status, 5445 + >; 5446 + fn call( 5447 + &mut self, 5448 + request: tonic::Request<super::GetCurrentRequest>, 5449 + ) -> Self::Future { 5450 + let inner = Arc::clone(&self.0); 5451 + let fut = async move { 5452 + <T as PlaylistService>::get_current(&inner, request).await 5453 + }; 5454 + Box::pin(fut) 5455 + } 5456 + } 5457 + let accept_compression_encodings = self.accept_compression_encodings; 5458 + let send_compression_encodings = self.send_compression_encodings; 5459 + let max_decoding_message_size = self.max_decoding_message_size; 5460 + let max_encoding_message_size = self.max_encoding_message_size; 5461 + let inner = self.inner.clone(); 5462 + let fut = async move { 5463 + let method = GetCurrentSvc(inner); 5464 + let codec = tonic::codec::ProstCodec::default(); 5465 + let mut grpc = tonic::server::Grpc::new(codec) 5466 + .apply_compression_config( 5467 + accept_compression_encodings, 5468 + send_compression_encodings, 5469 + ) 5470 + .apply_max_message_size_config( 5471 + max_decoding_message_size, 5472 + max_encoding_message_size, 5473 + ); 5474 + let res = grpc.unary(method, req).await; 5475 + Ok(res) 5476 + }; 5477 + Box::pin(fut) 5478 + } 5479 + "/rockbox.v1alpha1.PlaylistService/GetResumeInfo" => { 5480 + #[allow(non_camel_case_types)] 5481 + struct GetResumeInfoSvc<T: PlaylistService>(pub Arc<T>); 5482 + impl< 5483 + T: PlaylistService, 5484 + > tonic::server::UnaryService<super::GetResumeInfoRequest> 5485 + for GetResumeInfoSvc<T> { 5486 + type Response = super::GetResumeInfoResponse; 5487 + type Future = BoxFuture< 5488 + tonic::Response<Self::Response>, 5489 + tonic::Status, 5490 + >; 5491 + fn call( 5492 + &mut self, 5493 + request: tonic::Request<super::GetResumeInfoRequest>, 5494 + ) -> Self::Future { 5495 + let inner = Arc::clone(&self.0); 5496 + let fut = async move { 5497 + <T as PlaylistService>::get_resume_info(&inner, request) 5498 + .await 5499 + }; 5500 + Box::pin(fut) 5501 + } 5502 + } 5503 + let accept_compression_encodings = self.accept_compression_encodings; 5504 + let send_compression_encodings = self.send_compression_encodings; 5505 + let max_decoding_message_size = self.max_decoding_message_size; 5506 + let max_encoding_message_size = self.max_encoding_message_size; 5507 + let inner = self.inner.clone(); 5508 + let fut = async move { 5509 + let method = GetResumeInfoSvc(inner); 5510 + let codec = tonic::codec::ProstCodec::default(); 5511 + let mut grpc = tonic::server::Grpc::new(codec) 5512 + .apply_compression_config( 5513 + accept_compression_encodings, 5514 + send_compression_encodings, 5515 + ) 5516 + .apply_max_message_size_config( 5517 + max_decoding_message_size, 5518 + max_encoding_message_size, 5519 + ); 5520 + let res = grpc.unary(method, req).await; 5521 + Ok(res) 5522 + }; 5523 + Box::pin(fut) 5524 + } 5525 + "/rockbox.v1alpha1.PlaylistService/GetTrackInfo" => { 5526 + #[allow(non_camel_case_types)] 5527 + struct GetTrackInfoSvc<T: PlaylistService>(pub Arc<T>); 5528 + impl< 5529 + T: PlaylistService, 5530 + > tonic::server::UnaryService<super::GetTrackInfoRequest> 5531 + for GetTrackInfoSvc<T> { 5532 + type Response = super::GetTrackInfoResponse; 5533 + type Future = BoxFuture< 5534 + tonic::Response<Self::Response>, 5535 + tonic::Status, 5536 + >; 5537 + fn call( 5538 + &mut self, 5539 + request: tonic::Request<super::GetTrackInfoRequest>, 5540 + ) -> Self::Future { 5541 + let inner = Arc::clone(&self.0); 5542 + let fut = async move { 5543 + <T as PlaylistService>::get_track_info(&inner, request) 5544 + .await 5545 + }; 5546 + Box::pin(fut) 5547 + } 5548 + } 5549 + let accept_compression_encodings = self.accept_compression_encodings; 5550 + let send_compression_encodings = self.send_compression_encodings; 5551 + let max_decoding_message_size = self.max_decoding_message_size; 5552 + let max_encoding_message_size = self.max_encoding_message_size; 5553 + let inner = self.inner.clone(); 5554 + let fut = async move { 5555 + let method = GetTrackInfoSvc(inner); 5556 + let codec = tonic::codec::ProstCodec::default(); 5557 + let mut grpc = tonic::server::Grpc::new(codec) 5558 + .apply_compression_config( 5559 + accept_compression_encodings, 5560 + send_compression_encodings, 5561 + ) 5562 + .apply_max_message_size_config( 5563 + max_decoding_message_size, 5564 + max_encoding_message_size, 5565 + ); 5566 + let res = grpc.unary(method, req).await; 5567 + Ok(res) 5568 + }; 5569 + Box::pin(fut) 5570 + } 5571 + "/rockbox.v1alpha1.PlaylistService/GetFirstIndex" => { 5572 + #[allow(non_camel_case_types)] 5573 + struct GetFirstIndexSvc<T: PlaylistService>(pub Arc<T>); 5574 + impl< 5575 + T: PlaylistService, 5576 + > tonic::server::UnaryService<super::GetFirstIndexRequest> 5577 + for GetFirstIndexSvc<T> { 5578 + type Response = super::GetFirstIndexResponse; 5579 + type Future = BoxFuture< 5580 + tonic::Response<Self::Response>, 5581 + tonic::Status, 5582 + >; 5583 + fn call( 5584 + &mut self, 5585 + request: tonic::Request<super::GetFirstIndexRequest>, 5586 + ) -> Self::Future { 5587 + let inner = Arc::clone(&self.0); 5588 + let fut = async move { 5589 + <T as PlaylistService>::get_first_index(&inner, request) 5590 + .await 5591 + }; 5592 + Box::pin(fut) 5593 + } 5594 + } 5595 + let accept_compression_encodings = self.accept_compression_encodings; 5596 + let send_compression_encodings = self.send_compression_encodings; 5597 + let max_decoding_message_size = self.max_decoding_message_size; 5598 + let max_encoding_message_size = self.max_encoding_message_size; 5599 + let inner = self.inner.clone(); 5600 + let fut = async move { 5601 + let method = GetFirstIndexSvc(inner); 5602 + let codec = tonic::codec::ProstCodec::default(); 5603 + let mut grpc = tonic::server::Grpc::new(codec) 5604 + .apply_compression_config( 5605 + accept_compression_encodings, 5606 + send_compression_encodings, 5607 + ) 5608 + .apply_max_message_size_config( 5609 + max_decoding_message_size, 5610 + max_encoding_message_size, 5611 + ); 5612 + let res = grpc.unary(method, req).await; 5613 + Ok(res) 5614 + }; 5615 + Box::pin(fut) 5616 + } 5617 + "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex" => { 5618 + #[allow(non_camel_case_types)] 5619 + struct GetDisplayIndexSvc<T: PlaylistService>(pub Arc<T>); 5620 + impl< 5621 + T: PlaylistService, 5622 + > tonic::server::UnaryService<super::GetDisplayIndexRequest> 5623 + for GetDisplayIndexSvc<T> { 5624 + type Response = super::GetDisplayIndexResponse; 5625 + type Future = BoxFuture< 5626 + tonic::Response<Self::Response>, 5627 + tonic::Status, 5628 + >; 5629 + fn call( 5630 + &mut self, 5631 + request: tonic::Request<super::GetDisplayIndexRequest>, 5632 + ) -> Self::Future { 5633 + let inner = Arc::clone(&self.0); 5634 + let fut = async move { 5635 + <T as PlaylistService>::get_display_index(&inner, request) 5636 + .await 5637 + }; 5638 + Box::pin(fut) 5639 + } 5640 + } 5641 + let accept_compression_encodings = self.accept_compression_encodings; 5642 + let send_compression_encodings = self.send_compression_encodings; 5643 + let max_decoding_message_size = self.max_decoding_message_size; 5644 + let max_encoding_message_size = self.max_encoding_message_size; 5645 + let inner = self.inner.clone(); 5646 + let fut = async move { 5647 + let method = GetDisplayIndexSvc(inner); 5648 + let codec = tonic::codec::ProstCodec::default(); 5649 + let mut grpc = tonic::server::Grpc::new(codec) 5650 + .apply_compression_config( 5651 + accept_compression_encodings, 5652 + send_compression_encodings, 5653 + ) 5654 + .apply_max_message_size_config( 5655 + max_decoding_message_size, 5656 + max_encoding_message_size, 5657 + ); 5658 + let res = grpc.unary(method, req).await; 5659 + Ok(res) 5660 + }; 5661 + Box::pin(fut) 5662 + } 5663 + "/rockbox.v1alpha1.PlaylistService/Amount" => { 5664 + #[allow(non_camel_case_types)] 5665 + struct AmountSvc<T: PlaylistService>(pub Arc<T>); 5666 + impl< 5667 + T: PlaylistService, 5668 + > tonic::server::UnaryService<super::AmountRequest> 5669 + for AmountSvc<T> { 5670 + type Response = super::AmountResponse; 5671 + type Future = BoxFuture< 5672 + tonic::Response<Self::Response>, 5673 + tonic::Status, 5674 + >; 5675 + fn call( 5676 + &mut self, 5677 + request: tonic::Request<super::AmountRequest>, 5678 + ) -> Self::Future { 5679 + let inner = Arc::clone(&self.0); 5680 + let fut = async move { 5681 + <T as PlaylistService>::amount(&inner, request).await 5682 + }; 5683 + Box::pin(fut) 5684 + } 5685 + } 5686 + let accept_compression_encodings = self.accept_compression_encodings; 5687 + let send_compression_encodings = self.send_compression_encodings; 5688 + let max_decoding_message_size = self.max_decoding_message_size; 5689 + let max_encoding_message_size = self.max_encoding_message_size; 5690 + let inner = self.inner.clone(); 5691 + let fut = async move { 5692 + let method = AmountSvc(inner); 5693 + let codec = tonic::codec::ProstCodec::default(); 5694 + let mut grpc = tonic::server::Grpc::new(codec) 5695 + .apply_compression_config( 5696 + accept_compression_encodings, 5697 + send_compression_encodings, 5698 + ) 5699 + .apply_max_message_size_config( 5700 + max_decoding_message_size, 5701 + max_encoding_message_size, 5702 + ); 5703 + let res = grpc.unary(method, req).await; 5704 + Ok(res) 5705 + }; 5706 + Box::pin(fut) 5707 + } 5708 + "/rockbox.v1alpha1.PlaylistService/PlaylistResume" => { 5709 + #[allow(non_camel_case_types)] 5710 + struct PlaylistResumeSvc<T: PlaylistService>(pub Arc<T>); 5711 + impl< 5712 + T: PlaylistService, 5713 + > tonic::server::UnaryService<super::PlaylistResumeRequest> 5714 + for PlaylistResumeSvc<T> { 5715 + type Response = super::PlaylistResumeResponse; 5716 + type Future = BoxFuture< 5717 + tonic::Response<Self::Response>, 5718 + tonic::Status, 5719 + >; 5720 + fn call( 5721 + &mut self, 5722 + request: tonic::Request<super::PlaylistResumeRequest>, 5723 + ) -> Self::Future { 5724 + let inner = Arc::clone(&self.0); 5725 + let fut = async move { 5726 + <T as PlaylistService>::playlist_resume(&inner, request) 5727 + .await 5728 + }; 5729 + Box::pin(fut) 5730 + } 5731 + } 5732 + let accept_compression_encodings = self.accept_compression_encodings; 5733 + let send_compression_encodings = self.send_compression_encodings; 5734 + let max_decoding_message_size = self.max_decoding_message_size; 5735 + let max_encoding_message_size = self.max_encoding_message_size; 5736 + let inner = self.inner.clone(); 5737 + let fut = async move { 5738 + let method = PlaylistResumeSvc(inner); 5739 + let codec = tonic::codec::ProstCodec::default(); 5740 + let mut grpc = tonic::server::Grpc::new(codec) 5741 + .apply_compression_config( 5742 + accept_compression_encodings, 5743 + send_compression_encodings, 5744 + ) 5745 + .apply_max_message_size_config( 5746 + max_decoding_message_size, 5747 + max_encoding_message_size, 5748 + ); 5749 + let res = grpc.unary(method, req).await; 5750 + Ok(res) 5751 + }; 5752 + Box::pin(fut) 5753 + } 5754 + "/rockbox.v1alpha1.PlaylistService/ResumeTrack" => { 5755 + #[allow(non_camel_case_types)] 5756 + struct ResumeTrackSvc<T: PlaylistService>(pub Arc<T>); 5757 + impl< 5758 + T: PlaylistService, 5759 + > tonic::server::UnaryService<super::ResumeTrackRequest> 5760 + for ResumeTrackSvc<T> { 5761 + type Response = super::ResumeTrackResponse; 5762 + type Future = BoxFuture< 5763 + tonic::Response<Self::Response>, 5764 + tonic::Status, 5765 + >; 5766 + fn call( 5767 + &mut self, 5768 + request: tonic::Request<super::ResumeTrackRequest>, 5769 + ) -> Self::Future { 5770 + let inner = Arc::clone(&self.0); 5771 + let fut = async move { 5772 + <T as PlaylistService>::resume_track(&inner, request).await 5773 + }; 5774 + Box::pin(fut) 5775 + } 5776 + } 5777 + let accept_compression_encodings = self.accept_compression_encodings; 5778 + let send_compression_encodings = self.send_compression_encodings; 5779 + let max_decoding_message_size = self.max_decoding_message_size; 5780 + let max_encoding_message_size = self.max_encoding_message_size; 5781 + let inner = self.inner.clone(); 5782 + let fut = async move { 5783 + let method = ResumeTrackSvc(inner); 5784 + let codec = tonic::codec::ProstCodec::default(); 5785 + let mut grpc = tonic::server::Grpc::new(codec) 5786 + .apply_compression_config( 5787 + accept_compression_encodings, 5788 + send_compression_encodings, 5789 + ) 5790 + .apply_max_message_size_config( 5791 + max_decoding_message_size, 5792 + max_encoding_message_size, 5793 + ); 5794 + let res = grpc.unary(method, req).await; 5795 + Ok(res) 5796 + }; 5797 + Box::pin(fut) 5798 + } 5799 + "/rockbox.v1alpha1.PlaylistService/SetModified" => { 5800 + #[allow(non_camel_case_types)] 5801 + struct SetModifiedSvc<T: PlaylistService>(pub Arc<T>); 5802 + impl< 5803 + T: PlaylistService, 5804 + > tonic::server::UnaryService<super::SetModifiedRequest> 5805 + for SetModifiedSvc<T> { 5806 + type Response = super::SetModifiedResponse; 5807 + type Future = BoxFuture< 5808 + tonic::Response<Self::Response>, 5809 + tonic::Status, 5810 + >; 5811 + fn call( 5812 + &mut self, 5813 + request: tonic::Request<super::SetModifiedRequest>, 5814 + ) -> Self::Future { 5815 + let inner = Arc::clone(&self.0); 5816 + let fut = async move { 5817 + <T as PlaylistService>::set_modified(&inner, request).await 5818 + }; 5819 + Box::pin(fut) 5820 + } 5821 + } 5822 + let accept_compression_encodings = self.accept_compression_encodings; 5823 + let send_compression_encodings = self.send_compression_encodings; 5824 + let max_decoding_message_size = self.max_decoding_message_size; 5825 + let max_encoding_message_size = self.max_encoding_message_size; 5826 + let inner = self.inner.clone(); 5827 + let fut = async move { 5828 + let method = SetModifiedSvc(inner); 5829 + let codec = tonic::codec::ProstCodec::default(); 5830 + let mut grpc = tonic::server::Grpc::new(codec) 5831 + .apply_compression_config( 5832 + accept_compression_encodings, 5833 + send_compression_encodings, 5834 + ) 5835 + .apply_max_message_size_config( 5836 + max_decoding_message_size, 5837 + max_encoding_message_size, 5838 + ); 5839 + let res = grpc.unary(method, req).await; 5840 + Ok(res) 5841 + }; 5842 + Box::pin(fut) 5843 + } 5844 + "/rockbox.v1alpha1.PlaylistService/Start" => { 5845 + #[allow(non_camel_case_types)] 5846 + struct StartSvc<T: PlaylistService>(pub Arc<T>); 5847 + impl< 5848 + T: PlaylistService, 5849 + > tonic::server::UnaryService<super::StartRequest> for StartSvc<T> { 5850 + type Response = super::StartResponse; 5851 + type Future = BoxFuture< 5852 + tonic::Response<Self::Response>, 5853 + tonic::Status, 5854 + >; 5855 + fn call( 5856 + &mut self, 5857 + request: tonic::Request<super::StartRequest>, 5858 + ) -> Self::Future { 5859 + let inner = Arc::clone(&self.0); 5860 + let fut = async move { 5861 + <T as PlaylistService>::start(&inner, request).await 5862 + }; 5863 + Box::pin(fut) 5864 + } 5865 + } 5866 + let accept_compression_encodings = self.accept_compression_encodings; 5867 + let send_compression_encodings = self.send_compression_encodings; 5868 + let max_decoding_message_size = self.max_decoding_message_size; 5869 + let max_encoding_message_size = self.max_encoding_message_size; 5870 + let inner = self.inner.clone(); 5871 + let fut = async move { 5872 + let method = StartSvc(inner); 5873 + let codec = tonic::codec::ProstCodec::default(); 5874 + let mut grpc = tonic::server::Grpc::new(codec) 5875 + .apply_compression_config( 5876 + accept_compression_encodings, 5877 + send_compression_encodings, 5878 + ) 5879 + .apply_max_message_size_config( 5880 + max_decoding_message_size, 5881 + max_encoding_message_size, 5882 + ); 5883 + let res = grpc.unary(method, req).await; 5884 + Ok(res) 5885 + }; 5886 + Box::pin(fut) 5887 + } 5888 + "/rockbox.v1alpha1.PlaylistService/Sync" => { 5889 + #[allow(non_camel_case_types)] 5890 + struct SyncSvc<T: PlaylistService>(pub Arc<T>); 5891 + impl< 5892 + T: PlaylistService, 5893 + > tonic::server::UnaryService<super::SyncRequest> for SyncSvc<T> { 5894 + type Response = super::SyncResponse; 5895 + type Future = BoxFuture< 5896 + tonic::Response<Self::Response>, 5897 + tonic::Status, 5898 + >; 5899 + fn call( 5900 + &mut self, 5901 + request: tonic::Request<super::SyncRequest>, 5902 + ) -> Self::Future { 5903 + let inner = Arc::clone(&self.0); 5904 + let fut = async move { 5905 + <T as PlaylistService>::sync(&inner, request).await 5906 + }; 5907 + Box::pin(fut) 5908 + } 5909 + } 5910 + let accept_compression_encodings = self.accept_compression_encodings; 5911 + let send_compression_encodings = self.send_compression_encodings; 5912 + let max_decoding_message_size = self.max_decoding_message_size; 5913 + let max_encoding_message_size = self.max_encoding_message_size; 5914 + let inner = self.inner.clone(); 5915 + let fut = async move { 5916 + let method = SyncSvc(inner); 5917 + let codec = tonic::codec::ProstCodec::default(); 5918 + let mut grpc = tonic::server::Grpc::new(codec) 5919 + .apply_compression_config( 5920 + accept_compression_encodings, 5921 + send_compression_encodings, 5922 + ) 5923 + .apply_max_message_size_config( 5924 + max_decoding_message_size, 5925 + max_encoding_message_size, 5926 + ); 5927 + let res = grpc.unary(method, req).await; 5928 + Ok(res) 5929 + }; 5930 + Box::pin(fut) 5931 + } 5932 + "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks" => { 5933 + #[allow(non_camel_case_types)] 5934 + struct RemoveAllTracksSvc<T: PlaylistService>(pub Arc<T>); 5935 + impl< 5936 + T: PlaylistService, 5937 + > tonic::server::UnaryService<super::RemoveAllTracksRequest> 5938 + for RemoveAllTracksSvc<T> { 5939 + type Response = super::RemoveAllTracksResponse; 5940 + type Future = BoxFuture< 5941 + tonic::Response<Self::Response>, 5942 + tonic::Status, 5943 + >; 5944 + fn call( 5945 + &mut self, 5946 + request: tonic::Request<super::RemoveAllTracksRequest>, 5947 + ) -> Self::Future { 5948 + let inner = Arc::clone(&self.0); 5949 + let fut = async move { 5950 + <T as PlaylistService>::remove_all_tracks(&inner, request) 5951 + .await 5952 + }; 5953 + Box::pin(fut) 5954 + } 5955 + } 5956 + let accept_compression_encodings = self.accept_compression_encodings; 5957 + let send_compression_encodings = self.send_compression_encodings; 5958 + let max_decoding_message_size = self.max_decoding_message_size; 5959 + let max_encoding_message_size = self.max_encoding_message_size; 5960 + let inner = self.inner.clone(); 5961 + let fut = async move { 5962 + let method = RemoveAllTracksSvc(inner); 5963 + let codec = tonic::codec::ProstCodec::default(); 5964 + let mut grpc = tonic::server::Grpc::new(codec) 5965 + .apply_compression_config( 5966 + accept_compression_encodings, 5967 + send_compression_encodings, 5968 + ) 5969 + .apply_max_message_size_config( 5970 + max_decoding_message_size, 5971 + max_encoding_message_size, 5972 + ); 5973 + let res = grpc.unary(method, req).await; 5974 + Ok(res) 5975 + }; 5976 + Box::pin(fut) 5977 + } 5978 + "/rockbox.v1alpha1.PlaylistService/RemoveTracks" => { 5979 + #[allow(non_camel_case_types)] 5980 + struct RemoveTracksSvc<T: PlaylistService>(pub Arc<T>); 5981 + impl< 5982 + T: PlaylistService, 5983 + > tonic::server::UnaryService<super::RemoveTracksRequest> 5984 + for RemoveTracksSvc<T> { 5985 + type Response = super::RemoveTracksResponse; 5986 + type Future = BoxFuture< 5987 + tonic::Response<Self::Response>, 5988 + tonic::Status, 5989 + >; 5990 + fn call( 5991 + &mut self, 5992 + request: tonic::Request<super::RemoveTracksRequest>, 5993 + ) -> Self::Future { 5994 + let inner = Arc::clone(&self.0); 5995 + let fut = async move { 5996 + <T as PlaylistService>::remove_tracks(&inner, request).await 5997 + }; 5998 + Box::pin(fut) 5999 + } 6000 + } 6001 + let accept_compression_encodings = self.accept_compression_encodings; 6002 + let send_compression_encodings = self.send_compression_encodings; 6003 + let max_decoding_message_size = self.max_decoding_message_size; 6004 + let max_encoding_message_size = self.max_encoding_message_size; 6005 + let inner = self.inner.clone(); 6006 + let fut = async move { 6007 + let method = RemoveTracksSvc(inner); 6008 + let codec = tonic::codec::ProstCodec::default(); 6009 + let mut grpc = tonic::server::Grpc::new(codec) 6010 + .apply_compression_config( 6011 + accept_compression_encodings, 6012 + send_compression_encodings, 6013 + ) 6014 + .apply_max_message_size_config( 6015 + max_decoding_message_size, 6016 + max_encoding_message_size, 6017 + ); 6018 + let res = grpc.unary(method, req).await; 6019 + Ok(res) 6020 + }; 6021 + Box::pin(fut) 6022 + } 6023 + "/rockbox.v1alpha1.PlaylistService/CreatePlaylist" => { 6024 + #[allow(non_camel_case_types)] 6025 + struct CreatePlaylistSvc<T: PlaylistService>(pub Arc<T>); 6026 + impl< 6027 + T: PlaylistService, 6028 + > tonic::server::UnaryService<super::CreatePlaylistRequest> 6029 + for CreatePlaylistSvc<T> { 6030 + type Response = super::CreatePlaylistResponse; 6031 + type Future = BoxFuture< 6032 + tonic::Response<Self::Response>, 6033 + tonic::Status, 6034 + >; 6035 + fn call( 6036 + &mut self, 6037 + request: tonic::Request<super::CreatePlaylistRequest>, 6038 + ) -> Self::Future { 6039 + let inner = Arc::clone(&self.0); 6040 + let fut = async move { 6041 + <T as PlaylistService>::create_playlist(&inner, request) 6042 + .await 6043 + }; 6044 + Box::pin(fut) 6045 + } 6046 + } 6047 + let accept_compression_encodings = self.accept_compression_encodings; 6048 + let send_compression_encodings = self.send_compression_encodings; 6049 + let max_decoding_message_size = self.max_decoding_message_size; 6050 + let max_encoding_message_size = self.max_encoding_message_size; 6051 + let inner = self.inner.clone(); 6052 + let fut = async move { 6053 + let method = CreatePlaylistSvc(inner); 6054 + let codec = tonic::codec::ProstCodec::default(); 6055 + let mut grpc = tonic::server::Grpc::new(codec) 6056 + .apply_compression_config( 6057 + accept_compression_encodings, 6058 + send_compression_encodings, 6059 + ) 6060 + .apply_max_message_size_config( 6061 + max_decoding_message_size, 6062 + max_encoding_message_size, 6063 + ); 6064 + let res = grpc.unary(method, req).await; 6065 + Ok(res) 6066 + }; 6067 + Box::pin(fut) 6068 + } 6069 + "/rockbox.v1alpha1.PlaylistService/InsertTracks" => { 6070 + #[allow(non_camel_case_types)] 6071 + struct InsertTracksSvc<T: PlaylistService>(pub Arc<T>); 6072 + impl< 6073 + T: PlaylistService, 6074 + > tonic::server::UnaryService<super::InsertTracksRequest> 6075 + for InsertTracksSvc<T> { 6076 + type Response = super::InsertTracksResponse; 6077 + type Future = BoxFuture< 6078 + tonic::Response<Self::Response>, 6079 + tonic::Status, 6080 + >; 6081 + fn call( 6082 + &mut self, 6083 + request: tonic::Request<super::InsertTracksRequest>, 6084 + ) -> Self::Future { 6085 + let inner = Arc::clone(&self.0); 6086 + let fut = async move { 6087 + <T as PlaylistService>::insert_tracks(&inner, request).await 6088 + }; 6089 + Box::pin(fut) 6090 + } 6091 + } 6092 + let accept_compression_encodings = self.accept_compression_encodings; 6093 + let send_compression_encodings = self.send_compression_encodings; 6094 + let max_decoding_message_size = self.max_decoding_message_size; 6095 + let max_encoding_message_size = self.max_encoding_message_size; 6096 + let inner = self.inner.clone(); 6097 + let fut = async move { 6098 + let method = InsertTracksSvc(inner); 6099 + let codec = tonic::codec::ProstCodec::default(); 6100 + let mut grpc = tonic::server::Grpc::new(codec) 6101 + .apply_compression_config( 6102 + accept_compression_encodings, 6103 + send_compression_encodings, 6104 + ) 6105 + .apply_max_message_size_config( 6106 + max_decoding_message_size, 6107 + max_encoding_message_size, 6108 + ); 6109 + let res = grpc.unary(method, req).await; 6110 + Ok(res) 6111 + }; 6112 + Box::pin(fut) 6113 + } 6114 + "/rockbox.v1alpha1.PlaylistService/InsertDirectory" => { 6115 + #[allow(non_camel_case_types)] 6116 + struct InsertDirectorySvc<T: PlaylistService>(pub Arc<T>); 6117 + impl< 6118 + T: PlaylistService, 6119 + > tonic::server::UnaryService<super::InsertDirectoryRequest> 6120 + for InsertDirectorySvc<T> { 6121 + type Response = super::InsertDirectoryResponse; 6122 + type Future = BoxFuture< 6123 + tonic::Response<Self::Response>, 6124 + tonic::Status, 6125 + >; 6126 + fn call( 6127 + &mut self, 6128 + request: tonic::Request<super::InsertDirectoryRequest>, 6129 + ) -> Self::Future { 6130 + let inner = Arc::clone(&self.0); 6131 + let fut = async move { 6132 + <T as PlaylistService>::insert_directory(&inner, request) 6133 + .await 6134 + }; 6135 + Box::pin(fut) 6136 + } 6137 + } 6138 + let accept_compression_encodings = self.accept_compression_encodings; 6139 + let send_compression_encodings = self.send_compression_encodings; 6140 + let max_decoding_message_size = self.max_decoding_message_size; 6141 + let max_encoding_message_size = self.max_encoding_message_size; 6142 + let inner = self.inner.clone(); 6143 + let fut = async move { 6144 + let method = InsertDirectorySvc(inner); 6145 + let codec = tonic::codec::ProstCodec::default(); 6146 + let mut grpc = tonic::server::Grpc::new(codec) 6147 + .apply_compression_config( 6148 + accept_compression_encodings, 6149 + send_compression_encodings, 6150 + ) 6151 + .apply_max_message_size_config( 6152 + max_decoding_message_size, 6153 + max_encoding_message_size, 6154 + ); 6155 + let res = grpc.unary(method, req).await; 6156 + Ok(res) 6157 + }; 6158 + Box::pin(fut) 6159 + } 6160 + "/rockbox.v1alpha1.PlaylistService/InsertPlaylist" => { 6161 + #[allow(non_camel_case_types)] 6162 + struct InsertPlaylistSvc<T: PlaylistService>(pub Arc<T>); 6163 + impl< 6164 + T: PlaylistService, 6165 + > tonic::server::UnaryService<super::InsertPlaylistRequest> 6166 + for InsertPlaylistSvc<T> { 6167 + type Response = super::InsertPlaylistResponse; 6168 + type Future = BoxFuture< 6169 + tonic::Response<Self::Response>, 6170 + tonic::Status, 6171 + >; 6172 + fn call( 6173 + &mut self, 6174 + request: tonic::Request<super::InsertPlaylistRequest>, 6175 + ) -> Self::Future { 6176 + let inner = Arc::clone(&self.0); 6177 + let fut = async move { 6178 + <T as PlaylistService>::insert_playlist(&inner, request) 6179 + .await 6180 + }; 6181 + Box::pin(fut) 6182 + } 6183 + } 6184 + let accept_compression_encodings = self.accept_compression_encodings; 6185 + let send_compression_encodings = self.send_compression_encodings; 6186 + let max_decoding_message_size = self.max_decoding_message_size; 6187 + let max_encoding_message_size = self.max_encoding_message_size; 6188 + let inner = self.inner.clone(); 6189 + let fut = async move { 6190 + let method = InsertPlaylistSvc(inner); 6191 + let codec = tonic::codec::ProstCodec::default(); 6192 + let mut grpc = tonic::server::Grpc::new(codec) 6193 + .apply_compression_config( 6194 + accept_compression_encodings, 6195 + send_compression_encodings, 6196 + ) 6197 + .apply_max_message_size_config( 6198 + max_decoding_message_size, 6199 + max_encoding_message_size, 6200 + ); 6201 + let res = grpc.unary(method, req).await; 6202 + Ok(res) 6203 + }; 6204 + Box::pin(fut) 6205 + } 6206 + "/rockbox.v1alpha1.PlaylistService/InsertAlbum" => { 6207 + #[allow(non_camel_case_types)] 6208 + struct InsertAlbumSvc<T: PlaylistService>(pub Arc<T>); 6209 + impl< 6210 + T: PlaylistService, 6211 + > tonic::server::UnaryService<super::InsertAlbumRequest> 6212 + for InsertAlbumSvc<T> { 6213 + type Response = super::InsertAlbumResponse; 6214 + type Future = BoxFuture< 6215 + tonic::Response<Self::Response>, 6216 + tonic::Status, 6217 + >; 6218 + fn call( 6219 + &mut self, 6220 + request: tonic::Request<super::InsertAlbumRequest>, 6221 + ) -> Self::Future { 6222 + let inner = Arc::clone(&self.0); 6223 + let fut = async move { 6224 + <T as PlaylistService>::insert_album(&inner, request).await 6225 + }; 6226 + Box::pin(fut) 6227 + } 6228 + } 6229 + let accept_compression_encodings = self.accept_compression_encodings; 6230 + let send_compression_encodings = self.send_compression_encodings; 6231 + let max_decoding_message_size = self.max_decoding_message_size; 6232 + let max_encoding_message_size = self.max_encoding_message_size; 6233 + let inner = self.inner.clone(); 6234 + let fut = async move { 6235 + let method = InsertAlbumSvc(inner); 6236 + let codec = tonic::codec::ProstCodec::default(); 6237 + let mut grpc = tonic::server::Grpc::new(codec) 6238 + .apply_compression_config( 6239 + accept_compression_encodings, 6240 + send_compression_encodings, 6241 + ) 6242 + .apply_max_message_size_config( 6243 + max_decoding_message_size, 6244 + max_encoding_message_size, 6245 + ); 6246 + let res = grpc.unary(method, req).await; 6247 + Ok(res) 6248 + }; 6249 + Box::pin(fut) 6250 + } 6251 + "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks" => { 6252 + #[allow(non_camel_case_types)] 6253 + struct InsertArtistTracksSvc<T: PlaylistService>(pub Arc<T>); 6254 + impl< 6255 + T: PlaylistService, 6256 + > tonic::server::UnaryService<super::InsertArtistTracksRequest> 6257 + for InsertArtistTracksSvc<T> { 6258 + type Response = super::InsertArtistTracksResponse; 6259 + type Future = BoxFuture< 6260 + tonic::Response<Self::Response>, 6261 + tonic::Status, 6262 + >; 6263 + fn call( 6264 + &mut self, 6265 + request: tonic::Request<super::InsertArtistTracksRequest>, 6266 + ) -> Self::Future { 6267 + let inner = Arc::clone(&self.0); 6268 + let fut = async move { 6269 + <T as PlaylistService>::insert_artist_tracks( 6270 + &inner, 6271 + request, 6272 + ) 6273 + .await 6274 + }; 6275 + Box::pin(fut) 6276 + } 6277 + } 6278 + let accept_compression_encodings = self.accept_compression_encodings; 6279 + let send_compression_encodings = self.send_compression_encodings; 6280 + let max_decoding_message_size = self.max_decoding_message_size; 6281 + let max_encoding_message_size = self.max_encoding_message_size; 6282 + let inner = self.inner.clone(); 6283 + let fut = async move { 6284 + let method = InsertArtistTracksSvc(inner); 6285 + let codec = tonic::codec::ProstCodec::default(); 6286 + let mut grpc = tonic::server::Grpc::new(codec) 6287 + .apply_compression_config( 6288 + accept_compression_encodings, 6289 + send_compression_encodings, 6290 + ) 6291 + .apply_max_message_size_config( 6292 + max_decoding_message_size, 6293 + max_encoding_message_size, 6294 + ); 6295 + let res = grpc.unary(method, req).await; 6296 + Ok(res) 6297 + }; 6298 + Box::pin(fut) 6299 + } 6300 + "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist" => { 6301 + #[allow(non_camel_case_types)] 6302 + struct ShufflePlaylistSvc<T: PlaylistService>(pub Arc<T>); 6303 + impl< 6304 + T: PlaylistService, 6305 + > tonic::server::UnaryService<super::ShufflePlaylistRequest> 6306 + for ShufflePlaylistSvc<T> { 6307 + type Response = super::ShufflePlaylistResponse; 6308 + type Future = BoxFuture< 6309 + tonic::Response<Self::Response>, 6310 + tonic::Status, 6311 + >; 6312 + fn call( 6313 + &mut self, 6314 + request: tonic::Request<super::ShufflePlaylistRequest>, 6315 + ) -> Self::Future { 6316 + let inner = Arc::clone(&self.0); 6317 + let fut = async move { 6318 + <T as PlaylistService>::shuffle_playlist(&inner, request) 6319 + .await 6320 + }; 6321 + Box::pin(fut) 6322 + } 6323 + } 6324 + let accept_compression_encodings = self.accept_compression_encodings; 6325 + let send_compression_encodings = self.send_compression_encodings; 6326 + let max_decoding_message_size = self.max_decoding_message_size; 6327 + let max_encoding_message_size = self.max_encoding_message_size; 6328 + let inner = self.inner.clone(); 6329 + let fut = async move { 6330 + let method = ShufflePlaylistSvc(inner); 6331 + let codec = tonic::codec::ProstCodec::default(); 6332 + let mut grpc = tonic::server::Grpc::new(codec) 6333 + .apply_compression_config( 6334 + accept_compression_encodings, 6335 + send_compression_encodings, 6336 + ) 6337 + .apply_max_message_size_config( 6338 + max_decoding_message_size, 6339 + max_encoding_message_size, 6340 + ); 6341 + let res = grpc.unary(method, req).await; 6342 + Ok(res) 6343 + }; 6344 + Box::pin(fut) 6345 + } 6346 + _ => { 6347 + Box::pin(async move { 6348 + let mut response = http::Response::new(empty_body()); 6349 + let headers = response.headers_mut(); 6350 + headers 6351 + .insert( 6352 + tonic::Status::GRPC_STATUS, 6353 + (tonic::Code::Unimplemented as i32).into(), 6354 + ); 6355 + headers 6356 + .insert( 6357 + http::header::CONTENT_TYPE, 6358 + tonic::metadata::GRPC_CONTENT_TYPE, 6359 + ); 6360 + Ok(response) 6361 + }) 6362 + } 6363 + } 6364 + } 6365 + } 6366 + impl<T> Clone for PlaylistServiceServer<T> { 6367 + fn clone(&self) -> Self { 6368 + let inner = self.inner.clone(); 6369 + Self { 6370 + inner, 6371 + accept_compression_encodings: self.accept_compression_encodings, 6372 + send_compression_encodings: self.send_compression_encodings, 6373 + max_decoding_message_size: self.max_decoding_message_size, 6374 + max_encoding_message_size: self.max_encoding_message_size, 6375 + } 6376 + } 6377 + } 6378 + /// Generated gRPC service name 6379 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.PlaylistService"; 6380 + impl<T> tonic::server::NamedService for PlaylistServiceServer<T> { 6381 + const NAME: &'static str = SERVICE_NAME; 6382 + } 6383 + } 6384 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6385 + pub struct GetSettingsListRequest { 6386 + #[prost(int32, tag = "1")] 6387 + pub count: i32, 6388 + } 6389 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6390 + pub struct GetSettingsListResponse {} 6391 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6392 + pub struct GetGlobalSettingsRequest {} 6393 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6394 + pub struct ReplaygainSettings { 6395 + #[prost(bool, tag = "1")] 6396 + pub noclip: bool, 6397 + #[prost(int32, tag = "2")] 6398 + pub r#type: i32, 6399 + #[prost(int32, tag = "3")] 6400 + pub preamp: i32, 6401 + } 6402 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6403 + pub struct EqBandSetting { 6404 + #[prost(int32, tag = "1")] 6405 + pub cutoff: i32, 6406 + #[prost(int32, tag = "2")] 6407 + pub q: i32, 6408 + #[prost(int32, tag = "3")] 6409 + pub gain: i32, 6410 + } 6411 + #[derive(Clone, PartialEq, ::prost::Message)] 6412 + pub struct SettingsList { 6413 + #[prost(uint32, tag = "1")] 6414 + pub flags: u32, 6415 + #[prost(int32, tag = "2")] 6416 + pub lang_id: i32, 6417 + #[prost(string, tag = "3")] 6418 + pub cfg_name: ::prost::alloc::string::String, 6419 + #[prost(string, tag = "4")] 6420 + pub cfg_vals: ::prost::alloc::string::String, 6421 + } 6422 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6423 + pub struct CompressorSettings { 6424 + #[prost(int32, tag = "1")] 6425 + pub threshold: i32, 6426 + #[prost(int32, tag = "2")] 6427 + pub makeup_gain: i32, 6428 + #[prost(int32, tag = "3")] 6429 + pub ratio: i32, 6430 + #[prost(int32, tag = "4")] 6431 + pub knee: i32, 6432 + #[prost(int32, tag = "5")] 6433 + pub release_time: i32, 6434 + #[prost(int32, tag = "6")] 6435 + pub attack_time: i32, 6436 + } 6437 + #[derive(Clone, PartialEq, ::prost::Message)] 6438 + pub struct GetGlobalSettingsResponse { 6439 + #[prost(int32, tag = "1")] 6440 + pub volume: i32, 6441 + #[prost(int32, tag = "2")] 6442 + pub balance: i32, 6443 + #[prost(int32, tag = "3")] 6444 + pub bass: i32, 6445 + #[prost(int32, tag = "4")] 6446 + pub treble: i32, 6447 + #[prost(int32, tag = "5")] 6448 + pub channel_config: i32, 6449 + #[prost(int32, tag = "6")] 6450 + pub stereo_width: i32, 6451 + #[prost(int32, tag = "7")] 6452 + pub bass_cutoff: i32, 6453 + #[prost(int32, tag = "8")] 6454 + pub treble_cutoff: i32, 6455 + #[prost(int32, tag = "9")] 6456 + pub crossfade: i32, 6457 + #[prost(int32, tag = "10")] 6458 + pub crossfade_fade_in_delay: i32, 6459 + #[prost(int32, tag = "11")] 6460 + pub crossfade_fade_out_delay: i32, 6461 + #[prost(int32, tag = "12")] 6462 + pub crossfade_fade_in_duration: i32, 6463 + #[prost(int32, tag = "13")] 6464 + pub crossfade_fade_out_duration: i32, 6465 + #[prost(int32, tag = "14")] 6466 + pub crossfade_fade_out_mixmode: i32, 6467 + #[prost(message, optional, tag = "15")] 6468 + pub replaygain_settings: ::core::option::Option<ReplaygainSettings>, 6469 + #[prost(int32, tag = "16")] 6470 + pub crossfeed: i32, 6471 + #[prost(uint32, tag = "17")] 6472 + pub crossfeed_direct_gain: u32, 6473 + #[prost(uint32, tag = "18")] 6474 + pub crossfeed_cross_gain: u32, 6475 + #[prost(uint32, tag = "19")] 6476 + pub crossfeed_hf_attenuation: u32, 6477 + #[prost(uint32, tag = "20")] 6478 + pub crossfeed_hf_cutoff: u32, 6479 + #[prost(bool, tag = "21")] 6480 + pub eq_enabled: bool, 6481 + #[prost(uint32, tag = "22")] 6482 + pub eq_precut: u32, 6483 + #[prost(message, repeated, tag = "23")] 6484 + pub eq_band_settings: ::prost::alloc::vec::Vec<EqBandSetting>, 6485 + #[prost(int32, tag = "24")] 6486 + pub beep: i32, 6487 + #[prost(int32, tag = "25")] 6488 + pub keyclick: i32, 6489 + #[prost(int32, tag = "26")] 6490 + pub keyclick_repeats: i32, 6491 + #[prost(bool, tag = "27")] 6492 + pub dithering_enabled: bool, 6493 + #[prost(bool, tag = "28")] 6494 + pub timestretch_enabled: bool, 6495 + #[prost(int32, tag = "29")] 6496 + pub list_accel_start_delay: i32, 6497 + #[prost(int32, tag = "30")] 6498 + pub list_accel_wait: i32, 6499 + #[prost(int32, tag = "31")] 6500 + pub touchpad_sensitivity: i32, 6501 + #[prost(int32, tag = "32")] 6502 + pub touchpad_deadzone: i32, 6503 + #[prost(int32, tag = "33")] 6504 + pub pause_rewind: i32, 6505 + #[prost(int32, tag = "34")] 6506 + pub unplug_mode: i32, 6507 + #[prost(bool, tag = "35")] 6508 + pub unplug_autoresume: bool, 6509 + #[prost(int32, tag = "37")] 6510 + pub timeformat: i32, 6511 + #[prost(int32, tag = "38")] 6512 + pub disk_spindown: i32, 6513 + #[prost(int32, tag = "39")] 6514 + pub buffer_margin: i32, 6515 + #[prost(int32, tag = "40")] 6516 + pub dirfilter: i32, 6517 + #[prost(int32, tag = "41")] 6518 + pub show_filename_ext: i32, 6519 + #[prost(int32, tag = "42")] 6520 + pub default_codepage: i32, 6521 + #[prost(bool, tag = "43")] 6522 + pub hold_lr_for_scroll_in_list: bool, 6523 + #[prost(bool, tag = "44")] 6524 + pub play_selected: bool, 6525 + #[prost(int32, tag = "45")] 6526 + pub single_mode: i32, 6527 + #[prost(bool, tag = "46")] 6528 + pub party_mode: bool, 6529 + #[prost(bool, tag = "48")] 6530 + pub car_adapter_mode: bool, 6531 + #[prost(int32, tag = "49")] 6532 + pub car_adapter_mode_delay: i32, 6533 + #[prost(int32, tag = "50")] 6534 + pub start_in_screen: i32, 6535 + #[prost(int32, tag = "51")] 6536 + pub ff_rewind_min_step: i32, 6537 + #[prost(int32, tag = "52")] 6538 + pub ff_rewind_accel: i32, 6539 + #[prost(int32, tag = "53")] 6540 + pub peak_meter_release: i32, 6541 + #[prost(int32, tag = "54")] 6542 + pub peak_meter_hold: i32, 6543 + #[prost(int32, tag = "55")] 6544 + pub peak_meter_clip_hold: i32, 6545 + #[prost(bool, tag = "56")] 6546 + pub peak_meter_dbfs: bool, 6547 + #[prost(int32, tag = "57")] 6548 + pub peak_meter_min: i32, 6549 + #[prost(int32, tag = "58")] 6550 + pub peak_meter_max: i32, 6551 + #[prost(string, tag = "59")] 6552 + pub wps_file: ::prost::alloc::string::String, 6553 + #[prost(string, tag = "60")] 6554 + pub sbs_file: ::prost::alloc::string::String, 6555 + #[prost(string, tag = "61")] 6556 + pub lang_file: ::prost::alloc::string::String, 6557 + #[prost(string, tag = "62")] 6558 + pub playlist_catalog_dir: ::prost::alloc::string::String, 6559 + #[prost(int32, tag = "63")] 6560 + pub skip_length: i32, 6561 + #[prost(int32, tag = "64")] 6562 + pub max_files_in_dir: i32, 6563 + #[prost(int32, tag = "65")] 6564 + pub max_files_in_playlist: i32, 6565 + #[prost(int32, tag = "66")] 6566 + pub volume_type: i32, 6567 + #[prost(int32, tag = "67")] 6568 + pub battery_display: i32, 6569 + #[prost(bool, tag = "68")] 6570 + pub show_icons: bool, 6571 + #[prost(int32, tag = "69")] 6572 + pub statusbar: i32, 6573 + #[prost(int32, tag = "70")] 6574 + pub scrollbar: i32, 6575 + #[prost(int32, tag = "71")] 6576 + pub scrollbar_width: i32, 6577 + #[prost(int32, tag = "72")] 6578 + pub list_line_padding: i32, 6579 + #[prost(int32, tag = "73")] 6580 + pub list_separator_color: i32, 6581 + #[prost(bool, tag = "74")] 6582 + pub browse_current: bool, 6583 + #[prost(bool, tag = "75")] 6584 + pub scroll_paginated: bool, 6585 + #[prost(bool, tag = "76")] 6586 + pub list_wraparound: bool, 6587 + #[prost(int32, tag = "77")] 6588 + pub list_order: i32, 6589 + #[prost(int32, tag = "78")] 6590 + pub scroll_speed: i32, 6591 + #[prost(int32, tag = "79")] 6592 + pub bidir_limit: i32, 6593 + #[prost(int32, tag = "80")] 6594 + pub scroll_delay: i32, 6595 + #[prost(int32, tag = "81")] 6596 + pub scroll_step: i32, 6597 + #[prost(int32, tag = "82")] 6598 + pub autoloadbookmark: i32, 6599 + #[prost(int32, tag = "83")] 6600 + pub autocreatebookmark: i32, 6601 + #[prost(bool, tag = "84")] 6602 + pub autoupdatebookmark: bool, 6603 + #[prost(int32, tag = "85")] 6604 + pub usemrb: i32, 6605 + #[prost(bool, tag = "86")] 6606 + pub dircache: bool, 6607 + #[prost(int32, tag = "87")] 6608 + pub tagcache_ram: i32, 6609 + #[prost(bool, tag = "88")] 6610 + pub tagcache_autoupdate: bool, 6611 + #[prost(bool, tag = "89")] 6612 + pub autoresume_enable: bool, 6613 + #[prost(int32, tag = "90")] 6614 + pub autoresume_automatic: i32, 6615 + #[prost(string, tag = "91")] 6616 + pub autoresume_paths: ::prost::alloc::string::String, 6617 + #[prost(bool, tag = "92")] 6618 + pub runtimedb: bool, 6619 + #[prost(string, tag = "93")] 6620 + pub tagcache_scan_paths: ::prost::alloc::string::String, 6621 + #[prost(string, tag = "94")] 6622 + pub tagcache_db_path: ::prost::alloc::string::String, 6623 + #[prost(string, tag = "95")] 6624 + pub backdrop_file: ::prost::alloc::string::String, 6625 + #[prost(int32, tag = "96")] 6626 + pub bg_color: i32, 6627 + #[prost(int32, tag = "97")] 6628 + pub fg_color: i32, 6629 + #[prost(int32, tag = "98")] 6630 + pub lss_color: i32, 6631 + #[prost(int32, tag = "99")] 6632 + pub lse_color: i32, 6633 + #[prost(int32, tag = "100")] 6634 + pub lst_color: i32, 6635 + #[prost(string, tag = "101")] 6636 + pub colors_file: ::prost::alloc::string::String, 6637 + #[prost(int32, tag = "102")] 6638 + pub browser_default: i32, 6639 + #[prost(int32, tag = "103")] 6640 + pub repeat_mode: i32, 6641 + #[prost(int32, tag = "104")] 6642 + pub next_folder: i32, 6643 + #[prost(bool, tag = "105")] 6644 + pub constrain_next_folder: bool, 6645 + #[prost(int32, tag = "106")] 6646 + pub recursive_dir_insert: i32, 6647 + #[prost(bool, tag = "107")] 6648 + pub fade_on_stop: bool, 6649 + #[prost(bool, tag = "108")] 6650 + pub playlist_shuffle: bool, 6651 + #[prost(bool, tag = "109")] 6652 + pub warnon_erase_dynplaylist: bool, 6653 + #[prost(bool, tag = "110")] 6654 + pub keep_current_track_on_replace_playlist: bool, 6655 + #[prost(bool, tag = "111")] 6656 + pub show_shuffled_adding_options: bool, 6657 + #[prost(int32, tag = "112")] 6658 + pub show_queue_options: i32, 6659 + #[prost(int32, tag = "113")] 6660 + pub album_art: i32, 6661 + #[prost(bool, tag = "114")] 6662 + pub rewind_across_tracks: bool, 6663 + #[prost(bool, tag = "115")] 6664 + pub playlist_viewer_icons: bool, 6665 + #[prost(bool, tag = "116")] 6666 + pub playlist_viewer_indices: bool, 6667 + #[prost(int32, tag = "117")] 6668 + pub playlist_viewer_track_display: i32, 6669 + #[prost(bool, tag = "118")] 6670 + pub sort_case: bool, 6671 + #[prost(int32, tag = "119")] 6672 + pub sort_dir: i32, 6673 + #[prost(int32, tag = "120")] 6674 + pub sort_file: i32, 6675 + #[prost(int32, tag = "121")] 6676 + pub interpret_numbers: i32, 6677 + #[prost(int32, tag = "122")] 6678 + pub poweroff: i32, 6679 + #[prost(bool, tag = "123")] 6680 + pub spdif_enable: bool, 6681 + #[prost(int32, tag = "124")] 6682 + pub contrast: i32, 6683 + #[prost(bool, tag = "125")] 6684 + pub invert: bool, 6685 + #[prost(bool, tag = "126")] 6686 + pub flip_display: bool, 6687 + #[prost(int32, tag = "127")] 6688 + pub cursor_style: i32, 6689 + #[prost(int32, tag = "128")] 6690 + pub screen_scroll_step: i32, 6691 + #[prost(int32, tag = "129")] 6692 + pub show_path_in_browser: i32, 6693 + #[prost(bool, tag = "130")] 6694 + pub offset_out_of_view: bool, 6695 + #[prost(bool, tag = "131")] 6696 + pub disable_mainmenu_scrolling: bool, 6697 + #[prost(string, tag = "132")] 6698 + pub icon_file: ::prost::alloc::string::String, 6699 + #[prost(string, tag = "133")] 6700 + pub viewers_icon_file: ::prost::alloc::string::String, 6701 + #[prost(string, tag = "134")] 6702 + pub font_file: ::prost::alloc::string::String, 6703 + #[prost(int32, tag = "135")] 6704 + pub glyphs_to_cache: i32, 6705 + #[prost(string, tag = "136")] 6706 + pub kbd_file: ::prost::alloc::string::String, 6707 + #[prost(int32, tag = "137")] 6708 + pub backlight_timeout: i32, 6709 + #[prost(bool, tag = "138")] 6710 + pub caption_backlight: bool, 6711 + #[prost(bool, tag = "139")] 6712 + pub bl_filter_first_keypress: bool, 6713 + #[prost(int32, tag = "140")] 6714 + pub backlight_timeout_plugged: i32, 6715 + #[prost(bool, tag = "141")] 6716 + pub bt_selective_softlock_actions: bool, 6717 + #[prost(int32, tag = "142")] 6718 + pub bt_selective_softlock_actions_mask: i32, 6719 + #[prost(bool, tag = "143")] 6720 + pub bl_selective_actions: bool, 6721 + #[prost(int32, tag = "144")] 6722 + pub bl_selective_actions_mask: i32, 6723 + #[prost(int32, tag = "145")] 6724 + pub backlight_on_button_hold: i32, 6725 + #[prost(int32, tag = "146")] 6726 + pub lcd_sleep_after_backlight_off: i32, 6727 + #[prost(int32, tag = "147")] 6728 + pub brightness: i32, 6729 + #[prost(int32, tag = "148")] 6730 + pub speaker_mode: i32, 6731 + #[prost(bool, tag = "149")] 6732 + pub prevent_skip: bool, 6733 + #[prost(int32, tag = "150")] 6734 + pub touch_mode: i32, 6735 + #[prost(bool, tag = "151")] 6736 + pub pitch_mode_semitone: bool, 6737 + #[prost(bool, tag = "152")] 6738 + pub pitch_mode_timestretch: bool, 6739 + #[prost(string, tag = "153")] 6740 + pub player_name: ::prost::alloc::string::String, 6741 + #[prost(message, optional, tag = "154")] 6742 + pub compressor_settings: ::core::option::Option<CompressorSettings>, 6743 + #[prost(int32, tag = "155")] 6744 + pub sleeptimer_duration: i32, 6745 + #[prost(bool, tag = "156")] 6746 + pub sleeptimer_on_startup: bool, 6747 + #[prost(bool, tag = "157")] 6748 + pub keypress_restarts_sleeptimer: bool, 6749 + #[prost(bool, tag = "158")] 6750 + pub show_shutdown_message: bool, 6751 + #[prost(int32, tag = "159")] 6752 + pub hotkey_wps: i32, 6753 + #[prost(int32, tag = "160")] 6754 + pub hotkey_tree: i32, 6755 + #[prost(int32, tag = "161")] 6756 + pub resume_rewind: i32, 6757 + #[prost(int32, tag = "162")] 6758 + pub depth_3d: i32, 6759 + #[prost(int32, tag = "163")] 6760 + pub roll_off: i32, 6761 + #[prost(int32, tag = "164")] 6762 + pub power_mode: i32, 6763 + #[prost(bool, tag = "165")] 6764 + pub keyclick_hardware: bool, 6765 + #[prost(string, tag = "166")] 6766 + pub start_directory: ::prost::alloc::string::String, 6767 + #[prost(bool, tag = "167")] 6768 + pub root_menu_customized: bool, 6769 + #[prost(bool, tag = "168")] 6770 + pub shortcuts_replaces_qs: bool, 6771 + #[prost(int32, tag = "169")] 6772 + pub play_frequency: i32, 6773 + #[prost(int32, tag = "170")] 6774 + pub volume_limit: i32, 6775 + #[prost(int32, tag = "171")] 6776 + pub volume_adjust_mode: i32, 6777 + #[prost(int32, tag = "172")] 6778 + pub volume_adjust_norm_steps: i32, 6779 + #[prost(int32, tag = "173")] 6780 + pub surround_enabled: i32, 6781 + #[prost(int32, tag = "174")] 6782 + pub surround_balance: i32, 6783 + #[prost(int32, tag = "175")] 6784 + pub surround_fx1: i32, 6785 + #[prost(int32, tag = "176")] 6786 + pub surround_fx2: i32, 6787 + #[prost(bool, tag = "177")] 6788 + pub surround_method2: bool, 6789 + #[prost(int32, tag = "178")] 6790 + pub surround_mix: i32, 6791 + #[prost(int32, tag = "179")] 6792 + pub pbe: i32, 6793 + #[prost(int32, tag = "180")] 6794 + pub pbe_precut: i32, 6795 + #[prost(int32, tag = "181")] 6796 + pub afr_enabled: i32, 6797 + #[prost(int32, tag = "182")] 6798 + pub governor: i32, 6799 + #[prost(int32, tag = "183")] 6800 + pub stereosw_mode: i32, 6801 + #[prost(string, tag = "184")] 6802 + pub music_dir: ::prost::alloc::string::String, 6803 + } 6804 + #[derive(Clone, PartialEq, ::prost::Message)] 6805 + pub struct SaveSettingsRequest { 6806 + #[prost(string, optional, tag = "1")] 6807 + pub music_dir: ::core::option::Option<::prost::alloc::string::String>, 6808 + #[prost(bool, optional, tag = "2")] 6809 + pub playlist_shuffle: ::core::option::Option<bool>, 6810 + #[prost(int32, optional, tag = "3")] 6811 + pub repeat_mode: ::core::option::Option<i32>, 6812 + #[prost(int32, optional, tag = "4")] 6813 + pub bass: ::core::option::Option<i32>, 6814 + #[prost(int32, optional, tag = "5")] 6815 + pub treble: ::core::option::Option<i32>, 6816 + #[prost(int32, optional, tag = "6")] 6817 + pub bass_cutoff: ::core::option::Option<i32>, 6818 + #[prost(int32, optional, tag = "7")] 6819 + pub treble_cutoff: ::core::option::Option<i32>, 6820 + #[prost(int32, optional, tag = "8")] 6821 + pub crossfade: ::core::option::Option<i32>, 6822 + #[prost(bool, optional, tag = "9")] 6823 + pub fade_on_stop: ::core::option::Option<bool>, 6824 + #[prost(int32, optional, tag = "10")] 6825 + pub fade_in_delay: ::core::option::Option<i32>, 6826 + #[prost(int32, optional, tag = "11")] 6827 + pub fade_in_duration: ::core::option::Option<i32>, 6828 + #[prost(int32, optional, tag = "12")] 6829 + pub fade_out_delay: ::core::option::Option<i32>, 6830 + #[prost(int32, optional, tag = "13")] 6831 + pub fade_out_duration: ::core::option::Option<i32>, 6832 + #[prost(int32, optional, tag = "14")] 6833 + pub fade_out_mixmode: ::core::option::Option<i32>, 6834 + #[prost(int32, optional, tag = "15")] 6835 + pub balance: ::core::option::Option<i32>, 6836 + #[prost(int32, optional, tag = "16")] 6837 + pub stereo_width: ::core::option::Option<i32>, 6838 + #[prost(int32, optional, tag = "17")] 6839 + pub stereosw_mode: ::core::option::Option<i32>, 6840 + #[prost(int32, optional, tag = "18")] 6841 + pub surround_enabled: ::core::option::Option<i32>, 6842 + #[prost(int32, optional, tag = "19")] 6843 + pub surround_balance: ::core::option::Option<i32>, 6844 + #[prost(int32, optional, tag = "20")] 6845 + pub surround_fx1: ::core::option::Option<i32>, 6846 + #[prost(int32, optional, tag = "21")] 6847 + pub surround_fx2: ::core::option::Option<i32>, 6848 + #[prost(bool, optional, tag = "22")] 6849 + pub party_mode: ::core::option::Option<bool>, 6850 + #[prost(int32, optional, tag = "23")] 6851 + pub channel_config: ::core::option::Option<i32>, 6852 + #[prost(string, optional, tag = "24")] 6853 + pub player_name: ::core::option::Option<::prost::alloc::string::String>, 6854 + #[prost(bool, optional, tag = "25")] 6855 + pub eq_enabled: ::core::option::Option<bool>, 6856 + #[prost(message, repeated, tag = "26")] 6857 + pub eq_band_settings: ::prost::alloc::vec::Vec<EqBandSetting>, 6858 + #[prost(message, optional, tag = "27")] 6859 + pub replaygain_settings: ::core::option::Option<ReplaygainSettings>, 6860 + #[prost(message, optional, tag = "28")] 6861 + pub compressor_settings: ::core::option::Option<CompressorSettings>, 6862 + } 6863 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6864 + pub struct SaveSettingsResponse {} 6865 + /// Generated client implementations. 6866 + pub mod settings_service_client { 6867 + #![allow( 6868 + unused_variables, 6869 + dead_code, 6870 + missing_docs, 6871 + clippy::wildcard_imports, 6872 + clippy::let_unit_value, 6873 + )] 6874 + use tonic::codegen::*; 6875 + use tonic::codegen::http::Uri; 6876 + #[derive(Debug, Clone)] 6877 + pub struct SettingsServiceClient<T> { 6878 + inner: tonic::client::Grpc<T>, 6879 + } 6880 + impl SettingsServiceClient<tonic::transport::Channel> { 6881 + /// Attempt to create a new client by connecting to a given endpoint. 6882 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 6883 + where 6884 + D: TryInto<tonic::transport::Endpoint>, 6885 + D::Error: Into<StdError>, 6886 + { 6887 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 6888 + Ok(Self::new(conn)) 6889 + } 6890 + } 6891 + impl<T> SettingsServiceClient<T> 6892 + where 6893 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 6894 + T::Error: Into<StdError>, 6895 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 6896 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 6897 + { 6898 + pub fn new(inner: T) -> Self { 6899 + let inner = tonic::client::Grpc::new(inner); 6900 + Self { inner } 6901 + } 6902 + pub fn with_origin(inner: T, origin: Uri) -> Self { 6903 + let inner = tonic::client::Grpc::with_origin(inner, origin); 6904 + Self { inner } 6905 + } 6906 + pub fn with_interceptor<F>( 6907 + inner: T, 6908 + interceptor: F, 6909 + ) -> SettingsServiceClient<InterceptedService<T, F>> 6910 + where 6911 + F: tonic::service::Interceptor, 6912 + T::ResponseBody: Default, 6913 + T: tonic::codegen::Service< 6914 + http::Request<tonic::body::BoxBody>, 6915 + Response = http::Response< 6916 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 6917 + >, 6918 + >, 6919 + <T as tonic::codegen::Service< 6920 + http::Request<tonic::body::BoxBody>, 6921 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 6922 + { 6923 + SettingsServiceClient::new(InterceptedService::new(inner, interceptor)) 6924 + } 6925 + /// Compress requests with the given encoding. 6926 + /// 6927 + /// This requires the server to support it otherwise it might respond with an 6928 + /// error. 6929 + #[must_use] 6930 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 6931 + self.inner = self.inner.send_compressed(encoding); 6932 + self 6933 + } 6934 + /// Enable decompressing responses. 6935 + #[must_use] 6936 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 6937 + self.inner = self.inner.accept_compressed(encoding); 6938 + self 6939 + } 6940 + /// Limits the maximum size of a decoded message. 6941 + /// 6942 + /// Default: `4MB` 6943 + #[must_use] 6944 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 6945 + self.inner = self.inner.max_decoding_message_size(limit); 6946 + self 6947 + } 6948 + /// Limits the maximum size of an encoded message. 6949 + /// 6950 + /// Default: `usize::MAX` 6951 + #[must_use] 6952 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 6953 + self.inner = self.inner.max_encoding_message_size(limit); 6954 + self 6955 + } 6956 + pub async fn get_settings_list( 6957 + &mut self, 6958 + request: impl tonic::IntoRequest<super::GetSettingsListRequest>, 6959 + ) -> std::result::Result< 6960 + tonic::Response<super::GetSettingsListResponse>, 6961 + tonic::Status, 6962 + > { 6963 + self.inner 6964 + .ready() 6965 + .await 6966 + .map_err(|e| { 6967 + tonic::Status::unknown( 6968 + format!("Service was not ready: {}", e.into()), 6969 + ) 6970 + })?; 6971 + let codec = tonic::codec::ProstCodec::default(); 6972 + let path = http::uri::PathAndQuery::from_static( 6973 + "/rockbox.v1alpha1.SettingsService/GetSettingsList", 6974 + ); 6975 + let mut req = request.into_request(); 6976 + req.extensions_mut() 6977 + .insert( 6978 + GrpcMethod::new( 6979 + "rockbox.v1alpha1.SettingsService", 6980 + "GetSettingsList", 6981 + ), 6982 + ); 6983 + self.inner.unary(req, path, codec).await 6984 + } 6985 + pub async fn get_global_settings( 6986 + &mut self, 6987 + request: impl tonic::IntoRequest<super::GetGlobalSettingsRequest>, 6988 + ) -> std::result::Result< 6989 + tonic::Response<super::GetGlobalSettingsResponse>, 6990 + tonic::Status, 6991 + > { 6992 + self.inner 6993 + .ready() 6994 + .await 6995 + .map_err(|e| { 6996 + tonic::Status::unknown( 6997 + format!("Service was not ready: {}", e.into()), 6998 + ) 6999 + })?; 7000 + let codec = tonic::codec::ProstCodec::default(); 7001 + let path = http::uri::PathAndQuery::from_static( 7002 + "/rockbox.v1alpha1.SettingsService/GetGlobalSettings", 7003 + ); 7004 + let mut req = request.into_request(); 7005 + req.extensions_mut() 7006 + .insert( 7007 + GrpcMethod::new( 7008 + "rockbox.v1alpha1.SettingsService", 7009 + "GetGlobalSettings", 7010 + ), 7011 + ); 7012 + self.inner.unary(req, path, codec).await 7013 + } 7014 + pub async fn save_settings( 7015 + &mut self, 7016 + request: impl tonic::IntoRequest<super::SaveSettingsRequest>, 7017 + ) -> std::result::Result< 7018 + tonic::Response<super::SaveSettingsResponse>, 7019 + tonic::Status, 7020 + > { 7021 + self.inner 7022 + .ready() 7023 + .await 7024 + .map_err(|e| { 7025 + tonic::Status::unknown( 7026 + format!("Service was not ready: {}", e.into()), 7027 + ) 7028 + })?; 7029 + let codec = tonic::codec::ProstCodec::default(); 7030 + let path = http::uri::PathAndQuery::from_static( 7031 + "/rockbox.v1alpha1.SettingsService/SaveSettings", 7032 + ); 7033 + let mut req = request.into_request(); 7034 + req.extensions_mut() 7035 + .insert( 7036 + GrpcMethod::new("rockbox.v1alpha1.SettingsService", "SaveSettings"), 7037 + ); 7038 + self.inner.unary(req, path, codec).await 7039 + } 7040 + } 7041 + } 7042 + /// Generated server implementations. 7043 + pub mod settings_service_server { 7044 + #![allow( 7045 + unused_variables, 7046 + dead_code, 7047 + missing_docs, 7048 + clippy::wildcard_imports, 7049 + clippy::let_unit_value, 7050 + )] 7051 + use tonic::codegen::*; 7052 + /// Generated trait containing gRPC methods that should be implemented for use with SettingsServiceServer. 7053 + #[async_trait] 7054 + pub trait SettingsService: std::marker::Send + std::marker::Sync + 'static { 7055 + async fn get_settings_list( 7056 + &self, 7057 + request: tonic::Request<super::GetSettingsListRequest>, 7058 + ) -> std::result::Result< 7059 + tonic::Response<super::GetSettingsListResponse>, 7060 + tonic::Status, 7061 + >; 7062 + async fn get_global_settings( 7063 + &self, 7064 + request: tonic::Request<super::GetGlobalSettingsRequest>, 7065 + ) -> std::result::Result< 7066 + tonic::Response<super::GetGlobalSettingsResponse>, 7067 + tonic::Status, 7068 + >; 7069 + async fn save_settings( 7070 + &self, 7071 + request: tonic::Request<super::SaveSettingsRequest>, 7072 + ) -> std::result::Result< 7073 + tonic::Response<super::SaveSettingsResponse>, 7074 + tonic::Status, 7075 + >; 7076 + } 7077 + #[derive(Debug)] 7078 + pub struct SettingsServiceServer<T> { 7079 + inner: Arc<T>, 7080 + accept_compression_encodings: EnabledCompressionEncodings, 7081 + send_compression_encodings: EnabledCompressionEncodings, 7082 + max_decoding_message_size: Option<usize>, 7083 + max_encoding_message_size: Option<usize>, 7084 + } 7085 + impl<T> SettingsServiceServer<T> { 7086 + pub fn new(inner: T) -> Self { 7087 + Self::from_arc(Arc::new(inner)) 7088 + } 7089 + pub fn from_arc(inner: Arc<T>) -> Self { 7090 + Self { 7091 + inner, 7092 + accept_compression_encodings: Default::default(), 7093 + send_compression_encodings: Default::default(), 7094 + max_decoding_message_size: None, 7095 + max_encoding_message_size: None, 7096 + } 7097 + } 7098 + pub fn with_interceptor<F>( 7099 + inner: T, 7100 + interceptor: F, 7101 + ) -> InterceptedService<Self, F> 7102 + where 7103 + F: tonic::service::Interceptor, 7104 + { 7105 + InterceptedService::new(Self::new(inner), interceptor) 7106 + } 7107 + /// Enable decompressing requests with the given encoding. 7108 + #[must_use] 7109 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 7110 + self.accept_compression_encodings.enable(encoding); 7111 + self 7112 + } 7113 + /// Compress responses with the given encoding, if the client supports it. 7114 + #[must_use] 7115 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 7116 + self.send_compression_encodings.enable(encoding); 7117 + self 7118 + } 7119 + /// Limits the maximum size of a decoded message. 7120 + /// 7121 + /// Default: `4MB` 7122 + #[must_use] 7123 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 7124 + self.max_decoding_message_size = Some(limit); 7125 + self 7126 + } 7127 + /// Limits the maximum size of an encoded message. 7128 + /// 7129 + /// Default: `usize::MAX` 7130 + #[must_use] 7131 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 7132 + self.max_encoding_message_size = Some(limit); 7133 + self 7134 + } 7135 + } 7136 + impl<T, B> tonic::codegen::Service<http::Request<B>> for SettingsServiceServer<T> 7137 + where 7138 + T: SettingsService, 7139 + B: Body + std::marker::Send + 'static, 7140 + B::Error: Into<StdError> + std::marker::Send + 'static, 7141 + { 7142 + type Response = http::Response<tonic::body::BoxBody>; 7143 + type Error = std::convert::Infallible; 7144 + type Future = BoxFuture<Self::Response, Self::Error>; 7145 + fn poll_ready( 7146 + &mut self, 7147 + _cx: &mut Context<'_>, 7148 + ) -> Poll<std::result::Result<(), Self::Error>> { 7149 + Poll::Ready(Ok(())) 7150 + } 7151 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 7152 + match req.uri().path() { 7153 + "/rockbox.v1alpha1.SettingsService/GetSettingsList" => { 7154 + #[allow(non_camel_case_types)] 7155 + struct GetSettingsListSvc<T: SettingsService>(pub Arc<T>); 7156 + impl< 7157 + T: SettingsService, 7158 + > tonic::server::UnaryService<super::GetSettingsListRequest> 7159 + for GetSettingsListSvc<T> { 7160 + type Response = super::GetSettingsListResponse; 7161 + type Future = BoxFuture< 7162 + tonic::Response<Self::Response>, 7163 + tonic::Status, 7164 + >; 7165 + fn call( 7166 + &mut self, 7167 + request: tonic::Request<super::GetSettingsListRequest>, 7168 + ) -> Self::Future { 7169 + let inner = Arc::clone(&self.0); 7170 + let fut = async move { 7171 + <T as SettingsService>::get_settings_list(&inner, request) 7172 + .await 7173 + }; 7174 + Box::pin(fut) 7175 + } 7176 + } 7177 + let accept_compression_encodings = self.accept_compression_encodings; 7178 + let send_compression_encodings = self.send_compression_encodings; 7179 + let max_decoding_message_size = self.max_decoding_message_size; 7180 + let max_encoding_message_size = self.max_encoding_message_size; 7181 + let inner = self.inner.clone(); 7182 + let fut = async move { 7183 + let method = GetSettingsListSvc(inner); 7184 + let codec = tonic::codec::ProstCodec::default(); 7185 + let mut grpc = tonic::server::Grpc::new(codec) 7186 + .apply_compression_config( 7187 + accept_compression_encodings, 7188 + send_compression_encodings, 7189 + ) 7190 + .apply_max_message_size_config( 7191 + max_decoding_message_size, 7192 + max_encoding_message_size, 7193 + ); 7194 + let res = grpc.unary(method, req).await; 7195 + Ok(res) 7196 + }; 7197 + Box::pin(fut) 7198 + } 7199 + "/rockbox.v1alpha1.SettingsService/GetGlobalSettings" => { 7200 + #[allow(non_camel_case_types)] 7201 + struct GetGlobalSettingsSvc<T: SettingsService>(pub Arc<T>); 7202 + impl< 7203 + T: SettingsService, 7204 + > tonic::server::UnaryService<super::GetGlobalSettingsRequest> 7205 + for GetGlobalSettingsSvc<T> { 7206 + type Response = super::GetGlobalSettingsResponse; 7207 + type Future = BoxFuture< 7208 + tonic::Response<Self::Response>, 7209 + tonic::Status, 7210 + >; 7211 + fn call( 7212 + &mut self, 7213 + request: tonic::Request<super::GetGlobalSettingsRequest>, 7214 + ) -> Self::Future { 7215 + let inner = Arc::clone(&self.0); 7216 + let fut = async move { 7217 + <T as SettingsService>::get_global_settings(&inner, request) 7218 + .await 7219 + }; 7220 + Box::pin(fut) 7221 + } 7222 + } 7223 + let accept_compression_encodings = self.accept_compression_encodings; 7224 + let send_compression_encodings = self.send_compression_encodings; 7225 + let max_decoding_message_size = self.max_decoding_message_size; 7226 + let max_encoding_message_size = self.max_encoding_message_size; 7227 + let inner = self.inner.clone(); 7228 + let fut = async move { 7229 + let method = GetGlobalSettingsSvc(inner); 7230 + let codec = tonic::codec::ProstCodec::default(); 7231 + let mut grpc = tonic::server::Grpc::new(codec) 7232 + .apply_compression_config( 7233 + accept_compression_encodings, 7234 + send_compression_encodings, 7235 + ) 7236 + .apply_max_message_size_config( 7237 + max_decoding_message_size, 7238 + max_encoding_message_size, 7239 + ); 7240 + let res = grpc.unary(method, req).await; 7241 + Ok(res) 7242 + }; 7243 + Box::pin(fut) 7244 + } 7245 + "/rockbox.v1alpha1.SettingsService/SaveSettings" => { 7246 + #[allow(non_camel_case_types)] 7247 + struct SaveSettingsSvc<T: SettingsService>(pub Arc<T>); 7248 + impl< 7249 + T: SettingsService, 7250 + > tonic::server::UnaryService<super::SaveSettingsRequest> 7251 + for SaveSettingsSvc<T> { 7252 + type Response = super::SaveSettingsResponse; 7253 + type Future = BoxFuture< 7254 + tonic::Response<Self::Response>, 7255 + tonic::Status, 7256 + >; 7257 + fn call( 7258 + &mut self, 7259 + request: tonic::Request<super::SaveSettingsRequest>, 7260 + ) -> Self::Future { 7261 + let inner = Arc::clone(&self.0); 7262 + let fut = async move { 7263 + <T as SettingsService>::save_settings(&inner, request).await 7264 + }; 7265 + Box::pin(fut) 7266 + } 7267 + } 7268 + let accept_compression_encodings = self.accept_compression_encodings; 7269 + let send_compression_encodings = self.send_compression_encodings; 7270 + let max_decoding_message_size = self.max_decoding_message_size; 7271 + let max_encoding_message_size = self.max_encoding_message_size; 7272 + let inner = self.inner.clone(); 7273 + let fut = async move { 7274 + let method = SaveSettingsSvc(inner); 7275 + let codec = tonic::codec::ProstCodec::default(); 7276 + let mut grpc = tonic::server::Grpc::new(codec) 7277 + .apply_compression_config( 7278 + accept_compression_encodings, 7279 + send_compression_encodings, 7280 + ) 7281 + .apply_max_message_size_config( 7282 + max_decoding_message_size, 7283 + max_encoding_message_size, 7284 + ); 7285 + let res = grpc.unary(method, req).await; 7286 + Ok(res) 7287 + }; 7288 + Box::pin(fut) 7289 + } 7290 + _ => { 7291 + Box::pin(async move { 7292 + let mut response = http::Response::new(empty_body()); 7293 + let headers = response.headers_mut(); 7294 + headers 7295 + .insert( 7296 + tonic::Status::GRPC_STATUS, 7297 + (tonic::Code::Unimplemented as i32).into(), 7298 + ); 7299 + headers 7300 + .insert( 7301 + http::header::CONTENT_TYPE, 7302 + tonic::metadata::GRPC_CONTENT_TYPE, 7303 + ); 7304 + Ok(response) 7305 + }) 7306 + } 7307 + } 7308 + } 7309 + } 7310 + impl<T> Clone for SettingsServiceServer<T> { 7311 + fn clone(&self) -> Self { 7312 + let inner = self.inner.clone(); 7313 + Self { 7314 + inner, 7315 + accept_compression_encodings: self.accept_compression_encodings, 7316 + send_compression_encodings: self.send_compression_encodings, 7317 + max_decoding_message_size: self.max_decoding_message_size, 7318 + max_encoding_message_size: self.max_encoding_message_size, 7319 + } 7320 + } 7321 + } 7322 + /// Generated gRPC service name 7323 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.SettingsService"; 7324 + impl<T> tonic::server::NamedService for SettingsServiceServer<T> { 7325 + const NAME: &'static str = SERVICE_NAME; 7326 + } 7327 + } 7328 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7329 + pub struct AdjustVolumeRequest { 7330 + #[prost(int32, tag = "1")] 7331 + pub steps: i32, 7332 + } 7333 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7334 + pub struct AdjustVolumeResponse {} 7335 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7336 + pub struct SoundSetRequest { 7337 + #[prost(int32, tag = "1")] 7338 + pub setting: i32, 7339 + #[prost(int32, tag = "2")] 7340 + pub value: i32, 7341 + } 7342 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7343 + pub struct SoundSetResponse {} 7344 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7345 + pub struct SoundCurrentRequest { 7346 + #[prost(int32, tag = "1")] 7347 + pub setting: i32, 7348 + } 7349 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7350 + pub struct SoundCurrentResponse { 7351 + #[prost(int32, tag = "1")] 7352 + pub value: i32, 7353 + } 7354 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7355 + pub struct SoundDefaultRequest { 7356 + #[prost(int32, tag = "1")] 7357 + pub setting: i32, 7358 + } 7359 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7360 + pub struct SoundDefaultResponse { 7361 + #[prost(int32, tag = "1")] 7362 + pub value: i32, 7363 + } 7364 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7365 + pub struct SoundMinRequest { 7366 + #[prost(int32, tag = "1")] 7367 + pub setting: i32, 7368 + } 7369 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7370 + pub struct SoundMinResponse { 7371 + #[prost(int32, tag = "1")] 7372 + pub value: i32, 7373 + } 7374 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7375 + pub struct SoundMaxRequest { 7376 + #[prost(int32, tag = "1")] 7377 + pub setting: i32, 7378 + } 7379 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7380 + pub struct SoundMaxResponse { 7381 + #[prost(int32, tag = "1")] 7382 + pub value: i32, 7383 + } 7384 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7385 + pub struct SoundUnitRequest {} 7386 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7387 + pub struct SoundUnitResponse {} 7388 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7389 + pub struct SoundVal2PhysRequest { 7390 + #[prost(int32, tag = "1")] 7391 + pub setting: i32, 7392 + #[prost(int32, tag = "2")] 7393 + pub value: i32, 7394 + } 7395 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7396 + pub struct SoundVal2PhysResponse { 7397 + #[prost(int32, tag = "1")] 7398 + pub value: i32, 7399 + } 7400 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7401 + pub struct GetPitchRequest {} 7402 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7403 + pub struct GetPitchResponse { 7404 + #[prost(int32, tag = "1")] 7405 + pub value: i32, 7406 + } 7407 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7408 + pub struct SetPitchRequest { 7409 + #[prost(int32, tag = "1")] 7410 + pub value: i32, 7411 + } 7412 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7413 + pub struct SetPitchResponse {} 7414 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7415 + pub struct BeepPlayRequest { 7416 + #[prost(uint32, tag = "1")] 7417 + pub frequency: u32, 7418 + #[prost(uint32, tag = "2")] 7419 + pub duration: u32, 7420 + #[prost(uint32, tag = "3")] 7421 + pub amplitude: u32, 7422 + } 7423 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7424 + pub struct BeepPlayResponse {} 7425 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7426 + pub struct PcmbufFadeRequest { 7427 + #[prost(int32, tag = "1")] 7428 + pub fade: i32, 7429 + #[prost(bool, tag = "2")] 7430 + pub r#in: bool, 7431 + } 7432 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7433 + pub struct PcmbufFadeResponse {} 7434 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7435 + pub struct PcmbufSetLowLatencyRequest { 7436 + #[prost(bool, tag = "1")] 7437 + pub state: bool, 7438 + } 7439 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7440 + pub struct PcmbufSetLowLatencyResponse {} 7441 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7442 + pub struct SystemSoundPlayRequest { 7443 + #[prost(uint32, tag = "1")] 7444 + pub sound: u32, 7445 + } 7446 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7447 + pub struct SystemSoundPlayResponse {} 7448 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7449 + pub struct KeyclickClickRequest { 7450 + #[prost(bool, tag = "1")] 7451 + pub rawbutton: bool, 7452 + #[prost(int32, tag = "2")] 7453 + pub action: i32, 7454 + } 7455 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7456 + pub struct KeyclickClickResponse {} 7457 + /// Generated client implementations. 7458 + pub mod sound_service_client { 7459 + #![allow( 7460 + unused_variables, 7461 + dead_code, 7462 + missing_docs, 7463 + clippy::wildcard_imports, 7464 + clippy::let_unit_value, 7465 + )] 7466 + use tonic::codegen::*; 7467 + use tonic::codegen::http::Uri; 7468 + #[derive(Debug, Clone)] 7469 + pub struct SoundServiceClient<T> { 7470 + inner: tonic::client::Grpc<T>, 7471 + } 7472 + impl SoundServiceClient<tonic::transport::Channel> { 7473 + /// Attempt to create a new client by connecting to a given endpoint. 7474 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 7475 + where 7476 + D: TryInto<tonic::transport::Endpoint>, 7477 + D::Error: Into<StdError>, 7478 + { 7479 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 7480 + Ok(Self::new(conn)) 7481 + } 7482 + } 7483 + impl<T> SoundServiceClient<T> 7484 + where 7485 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 7486 + T::Error: Into<StdError>, 7487 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 7488 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 7489 + { 7490 + pub fn new(inner: T) -> Self { 7491 + let inner = tonic::client::Grpc::new(inner); 7492 + Self { inner } 7493 + } 7494 + pub fn with_origin(inner: T, origin: Uri) -> Self { 7495 + let inner = tonic::client::Grpc::with_origin(inner, origin); 7496 + Self { inner } 7497 + } 7498 + pub fn with_interceptor<F>( 7499 + inner: T, 7500 + interceptor: F, 7501 + ) -> SoundServiceClient<InterceptedService<T, F>> 7502 + where 7503 + F: tonic::service::Interceptor, 7504 + T::ResponseBody: Default, 7505 + T: tonic::codegen::Service< 7506 + http::Request<tonic::body::BoxBody>, 7507 + Response = http::Response< 7508 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 7509 + >, 7510 + >, 7511 + <T as tonic::codegen::Service< 7512 + http::Request<tonic::body::BoxBody>, 7513 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 7514 + { 7515 + SoundServiceClient::new(InterceptedService::new(inner, interceptor)) 7516 + } 7517 + /// Compress requests with the given encoding. 7518 + /// 7519 + /// This requires the server to support it otherwise it might respond with an 7520 + /// error. 7521 + #[must_use] 7522 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 7523 + self.inner = self.inner.send_compressed(encoding); 7524 + self 7525 + } 7526 + /// Enable decompressing responses. 7527 + #[must_use] 7528 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 7529 + self.inner = self.inner.accept_compressed(encoding); 7530 + self 7531 + } 7532 + /// Limits the maximum size of a decoded message. 7533 + /// 7534 + /// Default: `4MB` 7535 + #[must_use] 7536 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 7537 + self.inner = self.inner.max_decoding_message_size(limit); 7538 + self 7539 + } 7540 + /// Limits the maximum size of an encoded message. 7541 + /// 7542 + /// Default: `usize::MAX` 7543 + #[must_use] 7544 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 7545 + self.inner = self.inner.max_encoding_message_size(limit); 7546 + self 7547 + } 7548 + pub async fn adjust_volume( 7549 + &mut self, 7550 + request: impl tonic::IntoRequest<super::AdjustVolumeRequest>, 7551 + ) -> std::result::Result< 7552 + tonic::Response<super::AdjustVolumeResponse>, 7553 + tonic::Status, 7554 + > { 7555 + self.inner 7556 + .ready() 7557 + .await 7558 + .map_err(|e| { 7559 + tonic::Status::unknown( 7560 + format!("Service was not ready: {}", e.into()), 7561 + ) 7562 + })?; 7563 + let codec = tonic::codec::ProstCodec::default(); 7564 + let path = http::uri::PathAndQuery::from_static( 7565 + "/rockbox.v1alpha1.SoundService/AdjustVolume", 7566 + ); 7567 + let mut req = request.into_request(); 7568 + req.extensions_mut() 7569 + .insert( 7570 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "AdjustVolume"), 7571 + ); 7572 + self.inner.unary(req, path, codec).await 7573 + } 7574 + pub async fn sound_set( 7575 + &mut self, 7576 + request: impl tonic::IntoRequest<super::SoundSetRequest>, 7577 + ) -> std::result::Result< 7578 + tonic::Response<super::SoundSetResponse>, 7579 + tonic::Status, 7580 + > { 7581 + self.inner 7582 + .ready() 7583 + .await 7584 + .map_err(|e| { 7585 + tonic::Status::unknown( 7586 + format!("Service was not ready: {}", e.into()), 7587 + ) 7588 + })?; 7589 + let codec = tonic::codec::ProstCodec::default(); 7590 + let path = http::uri::PathAndQuery::from_static( 7591 + "/rockbox.v1alpha1.SoundService/SoundSet", 7592 + ); 7593 + let mut req = request.into_request(); 7594 + req.extensions_mut() 7595 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundSet")); 7596 + self.inner.unary(req, path, codec).await 7597 + } 7598 + pub async fn sound_current( 7599 + &mut self, 7600 + request: impl tonic::IntoRequest<super::SoundCurrentRequest>, 7601 + ) -> std::result::Result< 7602 + tonic::Response<super::SoundCurrentResponse>, 7603 + tonic::Status, 7604 + > { 7605 + self.inner 7606 + .ready() 7607 + .await 7608 + .map_err(|e| { 7609 + tonic::Status::unknown( 7610 + format!("Service was not ready: {}", e.into()), 7611 + ) 7612 + })?; 7613 + let codec = tonic::codec::ProstCodec::default(); 7614 + let path = http::uri::PathAndQuery::from_static( 7615 + "/rockbox.v1alpha1.SoundService/SoundCurrent", 7616 + ); 7617 + let mut req = request.into_request(); 7618 + req.extensions_mut() 7619 + .insert( 7620 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundCurrent"), 7621 + ); 7622 + self.inner.unary(req, path, codec).await 7623 + } 7624 + pub async fn sound_default( 7625 + &mut self, 7626 + request: impl tonic::IntoRequest<super::SoundDefaultRequest>, 7627 + ) -> std::result::Result< 7628 + tonic::Response<super::SoundDefaultResponse>, 7629 + tonic::Status, 7630 + > { 7631 + self.inner 7632 + .ready() 7633 + .await 7634 + .map_err(|e| { 7635 + tonic::Status::unknown( 7636 + format!("Service was not ready: {}", e.into()), 7637 + ) 7638 + })?; 7639 + let codec = tonic::codec::ProstCodec::default(); 7640 + let path = http::uri::PathAndQuery::from_static( 7641 + "/rockbox.v1alpha1.SoundService/SoundDefault", 7642 + ); 7643 + let mut req = request.into_request(); 7644 + req.extensions_mut() 7645 + .insert( 7646 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundDefault"), 7647 + ); 7648 + self.inner.unary(req, path, codec).await 7649 + } 7650 + pub async fn sound_min( 7651 + &mut self, 7652 + request: impl tonic::IntoRequest<super::SoundMinRequest>, 7653 + ) -> std::result::Result< 7654 + tonic::Response<super::SoundMinResponse>, 7655 + tonic::Status, 7656 + > { 7657 + self.inner 7658 + .ready() 7659 + .await 7660 + .map_err(|e| { 7661 + tonic::Status::unknown( 7662 + format!("Service was not ready: {}", e.into()), 7663 + ) 7664 + })?; 7665 + let codec = tonic::codec::ProstCodec::default(); 7666 + let path = http::uri::PathAndQuery::from_static( 7667 + "/rockbox.v1alpha1.SoundService/SoundMin", 7668 + ); 7669 + let mut req = request.into_request(); 7670 + req.extensions_mut() 7671 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMin")); 7672 + self.inner.unary(req, path, codec).await 7673 + } 7674 + pub async fn sound_max( 7675 + &mut self, 7676 + request: impl tonic::IntoRequest<super::SoundMaxRequest>, 7677 + ) -> std::result::Result< 7678 + tonic::Response<super::SoundMaxResponse>, 7679 + tonic::Status, 7680 + > { 7681 + self.inner 7682 + .ready() 7683 + .await 7684 + .map_err(|e| { 7685 + tonic::Status::unknown( 7686 + format!("Service was not ready: {}", e.into()), 7687 + ) 7688 + })?; 7689 + let codec = tonic::codec::ProstCodec::default(); 7690 + let path = http::uri::PathAndQuery::from_static( 7691 + "/rockbox.v1alpha1.SoundService/SoundMax", 7692 + ); 7693 + let mut req = request.into_request(); 7694 + req.extensions_mut() 7695 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMax")); 7696 + self.inner.unary(req, path, codec).await 7697 + } 7698 + pub async fn sound_unit( 7699 + &mut self, 7700 + request: impl tonic::IntoRequest<super::SoundUnitRequest>, 7701 + ) -> std::result::Result< 7702 + tonic::Response<super::SoundUnitResponse>, 7703 + tonic::Status, 7704 + > { 7705 + self.inner 7706 + .ready() 7707 + .await 7708 + .map_err(|e| { 7709 + tonic::Status::unknown( 7710 + format!("Service was not ready: {}", e.into()), 7711 + ) 7712 + })?; 7713 + let codec = tonic::codec::ProstCodec::default(); 7714 + let path = http::uri::PathAndQuery::from_static( 7715 + "/rockbox.v1alpha1.SoundService/SoundUnit", 7716 + ); 7717 + let mut req = request.into_request(); 7718 + req.extensions_mut() 7719 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundUnit")); 7720 + self.inner.unary(req, path, codec).await 7721 + } 7722 + pub async fn sound_val2_phys( 7723 + &mut self, 7724 + request: impl tonic::IntoRequest<super::SoundVal2PhysRequest>, 7725 + ) -> std::result::Result< 7726 + tonic::Response<super::SoundVal2PhysResponse>, 7727 + tonic::Status, 7728 + > { 7729 + self.inner 7730 + .ready() 7731 + .await 7732 + .map_err(|e| { 7733 + tonic::Status::unknown( 7734 + format!("Service was not ready: {}", e.into()), 7735 + ) 7736 + })?; 7737 + let codec = tonic::codec::ProstCodec::default(); 7738 + let path = http::uri::PathAndQuery::from_static( 7739 + "/rockbox.v1alpha1.SoundService/SoundVal2Phys", 7740 + ); 7741 + let mut req = request.into_request(); 7742 + req.extensions_mut() 7743 + .insert( 7744 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundVal2Phys"), 7745 + ); 7746 + self.inner.unary(req, path, codec).await 7747 + } 7748 + pub async fn get_pitch( 7749 + &mut self, 7750 + request: impl tonic::IntoRequest<super::GetPitchRequest>, 7751 + ) -> std::result::Result< 7752 + tonic::Response<super::GetPitchResponse>, 7753 + tonic::Status, 7754 + > { 7755 + self.inner 7756 + .ready() 7757 + .await 7758 + .map_err(|e| { 7759 + tonic::Status::unknown( 7760 + format!("Service was not ready: {}", e.into()), 7761 + ) 7762 + })?; 7763 + let codec = tonic::codec::ProstCodec::default(); 7764 + let path = http::uri::PathAndQuery::from_static( 7765 + "/rockbox.v1alpha1.SoundService/GetPitch", 7766 + ); 7767 + let mut req = request.into_request(); 7768 + req.extensions_mut() 7769 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "GetPitch")); 7770 + self.inner.unary(req, path, codec).await 7771 + } 7772 + pub async fn set_pitch( 7773 + &mut self, 7774 + request: impl tonic::IntoRequest<super::SetPitchRequest>, 7775 + ) -> std::result::Result< 7776 + tonic::Response<super::SetPitchResponse>, 7777 + tonic::Status, 7778 + > { 7779 + self.inner 7780 + .ready() 7781 + .await 7782 + .map_err(|e| { 7783 + tonic::Status::unknown( 7784 + format!("Service was not ready: {}", e.into()), 7785 + ) 7786 + })?; 7787 + let codec = tonic::codec::ProstCodec::default(); 7788 + let path = http::uri::PathAndQuery::from_static( 7789 + "/rockbox.v1alpha1.SoundService/SetPitch", 7790 + ); 7791 + let mut req = request.into_request(); 7792 + req.extensions_mut() 7793 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SetPitch")); 7794 + self.inner.unary(req, path, codec).await 7795 + } 7796 + pub async fn beep_play( 7797 + &mut self, 7798 + request: impl tonic::IntoRequest<super::BeepPlayRequest>, 7799 + ) -> std::result::Result< 7800 + tonic::Response<super::BeepPlayResponse>, 7801 + tonic::Status, 7802 + > { 7803 + self.inner 7804 + .ready() 7805 + .await 7806 + .map_err(|e| { 7807 + tonic::Status::unknown( 7808 + format!("Service was not ready: {}", e.into()), 7809 + ) 7810 + })?; 7811 + let codec = tonic::codec::ProstCodec::default(); 7812 + let path = http::uri::PathAndQuery::from_static( 7813 + "/rockbox.v1alpha1.SoundService/BeepPlay", 7814 + ); 7815 + let mut req = request.into_request(); 7816 + req.extensions_mut() 7817 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "BeepPlay")); 7818 + self.inner.unary(req, path, codec).await 7819 + } 7820 + pub async fn pcmbuf_fade( 7821 + &mut self, 7822 + request: impl tonic::IntoRequest<super::PcmbufFadeRequest>, 7823 + ) -> std::result::Result< 7824 + tonic::Response<super::PcmbufFadeResponse>, 7825 + tonic::Status, 7826 + > { 7827 + self.inner 7828 + .ready() 7829 + .await 7830 + .map_err(|e| { 7831 + tonic::Status::unknown( 7832 + format!("Service was not ready: {}", e.into()), 7833 + ) 7834 + })?; 7835 + let codec = tonic::codec::ProstCodec::default(); 7836 + let path = http::uri::PathAndQuery::from_static( 7837 + "/rockbox.v1alpha1.SoundService/PcmbufFade", 7838 + ); 7839 + let mut req = request.into_request(); 7840 + req.extensions_mut() 7841 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "PcmbufFade")); 7842 + self.inner.unary(req, path, codec).await 7843 + } 7844 + pub async fn pcmbuf_set_low_latency( 7845 + &mut self, 7846 + request: impl tonic::IntoRequest<super::PcmbufSetLowLatencyRequest>, 7847 + ) -> std::result::Result< 7848 + tonic::Response<super::PcmbufSetLowLatencyResponse>, 7849 + tonic::Status, 7850 + > { 7851 + self.inner 7852 + .ready() 7853 + .await 7854 + .map_err(|e| { 7855 + tonic::Status::unknown( 7856 + format!("Service was not ready: {}", e.into()), 7857 + ) 7858 + })?; 7859 + let codec = tonic::codec::ProstCodec::default(); 7860 + let path = http::uri::PathAndQuery::from_static( 7861 + "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency", 7862 + ); 7863 + let mut req = request.into_request(); 7864 + req.extensions_mut() 7865 + .insert( 7866 + GrpcMethod::new( 7867 + "rockbox.v1alpha1.SoundService", 7868 + "PcmbufSetLowLatency", 7869 + ), 7870 + ); 7871 + self.inner.unary(req, path, codec).await 7872 + } 7873 + pub async fn system_sound_play( 7874 + &mut self, 7875 + request: impl tonic::IntoRequest<super::SystemSoundPlayRequest>, 7876 + ) -> std::result::Result< 7877 + tonic::Response<super::SystemSoundPlayResponse>, 7878 + tonic::Status, 7879 + > { 7880 + self.inner 7881 + .ready() 7882 + .await 7883 + .map_err(|e| { 7884 + tonic::Status::unknown( 7885 + format!("Service was not ready: {}", e.into()), 7886 + ) 7887 + })?; 7888 + let codec = tonic::codec::ProstCodec::default(); 7889 + let path = http::uri::PathAndQuery::from_static( 7890 + "/rockbox.v1alpha1.SoundService/SystemSoundPlay", 7891 + ); 7892 + let mut req = request.into_request(); 7893 + req.extensions_mut() 7894 + .insert( 7895 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SystemSoundPlay"), 7896 + ); 7897 + self.inner.unary(req, path, codec).await 7898 + } 7899 + pub async fn keyclick_click( 7900 + &mut self, 7901 + request: impl tonic::IntoRequest<super::KeyclickClickRequest>, 7902 + ) -> std::result::Result< 7903 + tonic::Response<super::KeyclickClickResponse>, 7904 + tonic::Status, 7905 + > { 7906 + self.inner 7907 + .ready() 7908 + .await 7909 + .map_err(|e| { 7910 + tonic::Status::unknown( 7911 + format!("Service was not ready: {}", e.into()), 7912 + ) 7913 + })?; 7914 + let codec = tonic::codec::ProstCodec::default(); 7915 + let path = http::uri::PathAndQuery::from_static( 7916 + "/rockbox.v1alpha1.SoundService/KeyclickClick", 7917 + ); 7918 + let mut req = request.into_request(); 7919 + req.extensions_mut() 7920 + .insert( 7921 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "KeyclickClick"), 7922 + ); 7923 + self.inner.unary(req, path, codec).await 7924 + } 7925 + } 7926 + } 7927 + /// Generated server implementations. 7928 + pub mod sound_service_server { 7929 + #![allow( 7930 + unused_variables, 7931 + dead_code, 7932 + missing_docs, 7933 + clippy::wildcard_imports, 7934 + clippy::let_unit_value, 7935 + )] 7936 + use tonic::codegen::*; 7937 + /// Generated trait containing gRPC methods that should be implemented for use with SoundServiceServer. 7938 + #[async_trait] 7939 + pub trait SoundService: std::marker::Send + std::marker::Sync + 'static { 7940 + async fn adjust_volume( 7941 + &self, 7942 + request: tonic::Request<super::AdjustVolumeRequest>, 7943 + ) -> std::result::Result< 7944 + tonic::Response<super::AdjustVolumeResponse>, 7945 + tonic::Status, 7946 + >; 7947 + async fn sound_set( 7948 + &self, 7949 + request: tonic::Request<super::SoundSetRequest>, 7950 + ) -> std::result::Result< 7951 + tonic::Response<super::SoundSetResponse>, 7952 + tonic::Status, 7953 + >; 7954 + async fn sound_current( 7955 + &self, 7956 + request: tonic::Request<super::SoundCurrentRequest>, 7957 + ) -> std::result::Result< 7958 + tonic::Response<super::SoundCurrentResponse>, 7959 + tonic::Status, 7960 + >; 7961 + async fn sound_default( 7962 + &self, 7963 + request: tonic::Request<super::SoundDefaultRequest>, 7964 + ) -> std::result::Result< 7965 + tonic::Response<super::SoundDefaultResponse>, 7966 + tonic::Status, 7967 + >; 7968 + async fn sound_min( 7969 + &self, 7970 + request: tonic::Request<super::SoundMinRequest>, 7971 + ) -> std::result::Result< 7972 + tonic::Response<super::SoundMinResponse>, 7973 + tonic::Status, 7974 + >; 7975 + async fn sound_max( 7976 + &self, 7977 + request: tonic::Request<super::SoundMaxRequest>, 7978 + ) -> std::result::Result< 7979 + tonic::Response<super::SoundMaxResponse>, 7980 + tonic::Status, 7981 + >; 7982 + async fn sound_unit( 7983 + &self, 7984 + request: tonic::Request<super::SoundUnitRequest>, 7985 + ) -> std::result::Result< 7986 + tonic::Response<super::SoundUnitResponse>, 7987 + tonic::Status, 7988 + >; 7989 + async fn sound_val2_phys( 7990 + &self, 7991 + request: tonic::Request<super::SoundVal2PhysRequest>, 7992 + ) -> std::result::Result< 7993 + tonic::Response<super::SoundVal2PhysResponse>, 7994 + tonic::Status, 7995 + >; 7996 + async fn get_pitch( 7997 + &self, 7998 + request: tonic::Request<super::GetPitchRequest>, 7999 + ) -> std::result::Result< 8000 + tonic::Response<super::GetPitchResponse>, 8001 + tonic::Status, 8002 + >; 8003 + async fn set_pitch( 8004 + &self, 8005 + request: tonic::Request<super::SetPitchRequest>, 8006 + ) -> std::result::Result< 8007 + tonic::Response<super::SetPitchResponse>, 8008 + tonic::Status, 8009 + >; 8010 + async fn beep_play( 8011 + &self, 8012 + request: tonic::Request<super::BeepPlayRequest>, 8013 + ) -> std::result::Result< 8014 + tonic::Response<super::BeepPlayResponse>, 8015 + tonic::Status, 8016 + >; 8017 + async fn pcmbuf_fade( 8018 + &self, 8019 + request: tonic::Request<super::PcmbufFadeRequest>, 8020 + ) -> std::result::Result< 8021 + tonic::Response<super::PcmbufFadeResponse>, 8022 + tonic::Status, 8023 + >; 8024 + async fn pcmbuf_set_low_latency( 8025 + &self, 8026 + request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 8027 + ) -> std::result::Result< 8028 + tonic::Response<super::PcmbufSetLowLatencyResponse>, 8029 + tonic::Status, 8030 + >; 8031 + async fn system_sound_play( 8032 + &self, 8033 + request: tonic::Request<super::SystemSoundPlayRequest>, 8034 + ) -> std::result::Result< 8035 + tonic::Response<super::SystemSoundPlayResponse>, 8036 + tonic::Status, 8037 + >; 8038 + async fn keyclick_click( 8039 + &self, 8040 + request: tonic::Request<super::KeyclickClickRequest>, 8041 + ) -> std::result::Result< 8042 + tonic::Response<super::KeyclickClickResponse>, 8043 + tonic::Status, 8044 + >; 8045 + } 8046 + #[derive(Debug)] 8047 + pub struct SoundServiceServer<T> { 8048 + inner: Arc<T>, 8049 + accept_compression_encodings: EnabledCompressionEncodings, 8050 + send_compression_encodings: EnabledCompressionEncodings, 8051 + max_decoding_message_size: Option<usize>, 8052 + max_encoding_message_size: Option<usize>, 8053 + } 8054 + impl<T> SoundServiceServer<T> { 8055 + pub fn new(inner: T) -> Self { 8056 + Self::from_arc(Arc::new(inner)) 8057 + } 8058 + pub fn from_arc(inner: Arc<T>) -> Self { 8059 + Self { 8060 + inner, 8061 + accept_compression_encodings: Default::default(), 8062 + send_compression_encodings: Default::default(), 8063 + max_decoding_message_size: None, 8064 + max_encoding_message_size: None, 8065 + } 8066 + } 8067 + pub fn with_interceptor<F>( 8068 + inner: T, 8069 + interceptor: F, 8070 + ) -> InterceptedService<Self, F> 8071 + where 8072 + F: tonic::service::Interceptor, 8073 + { 8074 + InterceptedService::new(Self::new(inner), interceptor) 8075 + } 8076 + /// Enable decompressing requests with the given encoding. 8077 + #[must_use] 8078 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 8079 + self.accept_compression_encodings.enable(encoding); 8080 + self 8081 + } 8082 + /// Compress responses with the given encoding, if the client supports it. 8083 + #[must_use] 8084 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 8085 + self.send_compression_encodings.enable(encoding); 8086 + self 8087 + } 8088 + /// Limits the maximum size of a decoded message. 8089 + /// 8090 + /// Default: `4MB` 8091 + #[must_use] 8092 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 8093 + self.max_decoding_message_size = Some(limit); 8094 + self 8095 + } 8096 + /// Limits the maximum size of an encoded message. 8097 + /// 8098 + /// Default: `usize::MAX` 8099 + #[must_use] 8100 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 8101 + self.max_encoding_message_size = Some(limit); 8102 + self 8103 + } 8104 + } 8105 + impl<T, B> tonic::codegen::Service<http::Request<B>> for SoundServiceServer<T> 8106 + where 8107 + T: SoundService, 8108 + B: Body + std::marker::Send + 'static, 8109 + B::Error: Into<StdError> + std::marker::Send + 'static, 8110 + { 8111 + type Response = http::Response<tonic::body::BoxBody>; 8112 + type Error = std::convert::Infallible; 8113 + type Future = BoxFuture<Self::Response, Self::Error>; 8114 + fn poll_ready( 8115 + &mut self, 8116 + _cx: &mut Context<'_>, 8117 + ) -> Poll<std::result::Result<(), Self::Error>> { 8118 + Poll::Ready(Ok(())) 8119 + } 8120 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 8121 + match req.uri().path() { 8122 + "/rockbox.v1alpha1.SoundService/AdjustVolume" => { 8123 + #[allow(non_camel_case_types)] 8124 + struct AdjustVolumeSvc<T: SoundService>(pub Arc<T>); 8125 + impl< 8126 + T: SoundService, 8127 + > tonic::server::UnaryService<super::AdjustVolumeRequest> 8128 + for AdjustVolumeSvc<T> { 8129 + type Response = super::AdjustVolumeResponse; 8130 + type Future = BoxFuture< 8131 + tonic::Response<Self::Response>, 8132 + tonic::Status, 8133 + >; 8134 + fn call( 8135 + &mut self, 8136 + request: tonic::Request<super::AdjustVolumeRequest>, 8137 + ) -> Self::Future { 8138 + let inner = Arc::clone(&self.0); 8139 + let fut = async move { 8140 + <T as SoundService>::adjust_volume(&inner, request).await 8141 + }; 8142 + Box::pin(fut) 8143 + } 8144 + } 8145 + let accept_compression_encodings = self.accept_compression_encodings; 8146 + let send_compression_encodings = self.send_compression_encodings; 8147 + let max_decoding_message_size = self.max_decoding_message_size; 8148 + let max_encoding_message_size = self.max_encoding_message_size; 8149 + let inner = self.inner.clone(); 8150 + let fut = async move { 8151 + let method = AdjustVolumeSvc(inner); 8152 + let codec = tonic::codec::ProstCodec::default(); 8153 + let mut grpc = tonic::server::Grpc::new(codec) 8154 + .apply_compression_config( 8155 + accept_compression_encodings, 8156 + send_compression_encodings, 8157 + ) 8158 + .apply_max_message_size_config( 8159 + max_decoding_message_size, 8160 + max_encoding_message_size, 8161 + ); 8162 + let res = grpc.unary(method, req).await; 8163 + Ok(res) 8164 + }; 8165 + Box::pin(fut) 8166 + } 8167 + "/rockbox.v1alpha1.SoundService/SoundSet" => { 8168 + #[allow(non_camel_case_types)] 8169 + struct SoundSetSvc<T: SoundService>(pub Arc<T>); 8170 + impl< 8171 + T: SoundService, 8172 + > tonic::server::UnaryService<super::SoundSetRequest> 8173 + for SoundSetSvc<T> { 8174 + type Response = super::SoundSetResponse; 8175 + type Future = BoxFuture< 8176 + tonic::Response<Self::Response>, 8177 + tonic::Status, 8178 + >; 8179 + fn call( 8180 + &mut self, 8181 + request: tonic::Request<super::SoundSetRequest>, 8182 + ) -> Self::Future { 8183 + let inner = Arc::clone(&self.0); 8184 + let fut = async move { 8185 + <T as SoundService>::sound_set(&inner, request).await 8186 + }; 8187 + Box::pin(fut) 8188 + } 8189 + } 8190 + let accept_compression_encodings = self.accept_compression_encodings; 8191 + let send_compression_encodings = self.send_compression_encodings; 8192 + let max_decoding_message_size = self.max_decoding_message_size; 8193 + let max_encoding_message_size = self.max_encoding_message_size; 8194 + let inner = self.inner.clone(); 8195 + let fut = async move { 8196 + let method = SoundSetSvc(inner); 8197 + let codec = tonic::codec::ProstCodec::default(); 8198 + let mut grpc = tonic::server::Grpc::new(codec) 8199 + .apply_compression_config( 8200 + accept_compression_encodings, 8201 + send_compression_encodings, 8202 + ) 8203 + .apply_max_message_size_config( 8204 + max_decoding_message_size, 8205 + max_encoding_message_size, 8206 + ); 8207 + let res = grpc.unary(method, req).await; 8208 + Ok(res) 8209 + }; 8210 + Box::pin(fut) 8211 + } 8212 + "/rockbox.v1alpha1.SoundService/SoundCurrent" => { 8213 + #[allow(non_camel_case_types)] 8214 + struct SoundCurrentSvc<T: SoundService>(pub Arc<T>); 8215 + impl< 8216 + T: SoundService, 8217 + > tonic::server::UnaryService<super::SoundCurrentRequest> 8218 + for SoundCurrentSvc<T> { 8219 + type Response = super::SoundCurrentResponse; 8220 + type Future = BoxFuture< 8221 + tonic::Response<Self::Response>, 8222 + tonic::Status, 8223 + >; 8224 + fn call( 8225 + &mut self, 8226 + request: tonic::Request<super::SoundCurrentRequest>, 8227 + ) -> Self::Future { 8228 + let inner = Arc::clone(&self.0); 8229 + let fut = async move { 8230 + <T as SoundService>::sound_current(&inner, request).await 8231 + }; 8232 + Box::pin(fut) 8233 + } 8234 + } 8235 + let accept_compression_encodings = self.accept_compression_encodings; 8236 + let send_compression_encodings = self.send_compression_encodings; 8237 + let max_decoding_message_size = self.max_decoding_message_size; 8238 + let max_encoding_message_size = self.max_encoding_message_size; 8239 + let inner = self.inner.clone(); 8240 + let fut = async move { 8241 + let method = SoundCurrentSvc(inner); 8242 + let codec = tonic::codec::ProstCodec::default(); 8243 + let mut grpc = tonic::server::Grpc::new(codec) 8244 + .apply_compression_config( 8245 + accept_compression_encodings, 8246 + send_compression_encodings, 8247 + ) 8248 + .apply_max_message_size_config( 8249 + max_decoding_message_size, 8250 + max_encoding_message_size, 8251 + ); 8252 + let res = grpc.unary(method, req).await; 8253 + Ok(res) 8254 + }; 8255 + Box::pin(fut) 8256 + } 8257 + "/rockbox.v1alpha1.SoundService/SoundDefault" => { 8258 + #[allow(non_camel_case_types)] 8259 + struct SoundDefaultSvc<T: SoundService>(pub Arc<T>); 8260 + impl< 8261 + T: SoundService, 8262 + > tonic::server::UnaryService<super::SoundDefaultRequest> 8263 + for SoundDefaultSvc<T> { 8264 + type Response = super::SoundDefaultResponse; 8265 + type Future = BoxFuture< 8266 + tonic::Response<Self::Response>, 8267 + tonic::Status, 8268 + >; 8269 + fn call( 8270 + &mut self, 8271 + request: tonic::Request<super::SoundDefaultRequest>, 8272 + ) -> Self::Future { 8273 + let inner = Arc::clone(&self.0); 8274 + let fut = async move { 8275 + <T as SoundService>::sound_default(&inner, request).await 8276 + }; 8277 + Box::pin(fut) 8278 + } 8279 + } 8280 + let accept_compression_encodings = self.accept_compression_encodings; 8281 + let send_compression_encodings = self.send_compression_encodings; 8282 + let max_decoding_message_size = self.max_decoding_message_size; 8283 + let max_encoding_message_size = self.max_encoding_message_size; 8284 + let inner = self.inner.clone(); 8285 + let fut = async move { 8286 + let method = SoundDefaultSvc(inner); 8287 + let codec = tonic::codec::ProstCodec::default(); 8288 + let mut grpc = tonic::server::Grpc::new(codec) 8289 + .apply_compression_config( 8290 + accept_compression_encodings, 8291 + send_compression_encodings, 8292 + ) 8293 + .apply_max_message_size_config( 8294 + max_decoding_message_size, 8295 + max_encoding_message_size, 8296 + ); 8297 + let res = grpc.unary(method, req).await; 8298 + Ok(res) 8299 + }; 8300 + Box::pin(fut) 8301 + } 8302 + "/rockbox.v1alpha1.SoundService/SoundMin" => { 8303 + #[allow(non_camel_case_types)] 8304 + struct SoundMinSvc<T: SoundService>(pub Arc<T>); 8305 + impl< 8306 + T: SoundService, 8307 + > tonic::server::UnaryService<super::SoundMinRequest> 8308 + for SoundMinSvc<T> { 8309 + type Response = super::SoundMinResponse; 8310 + type Future = BoxFuture< 8311 + tonic::Response<Self::Response>, 8312 + tonic::Status, 8313 + >; 8314 + fn call( 8315 + &mut self, 8316 + request: tonic::Request<super::SoundMinRequest>, 8317 + ) -> Self::Future { 8318 + let inner = Arc::clone(&self.0); 8319 + let fut = async move { 8320 + <T as SoundService>::sound_min(&inner, request).await 8321 + }; 8322 + Box::pin(fut) 8323 + } 8324 + } 8325 + let accept_compression_encodings = self.accept_compression_encodings; 8326 + let send_compression_encodings = self.send_compression_encodings; 8327 + let max_decoding_message_size = self.max_decoding_message_size; 8328 + let max_encoding_message_size = self.max_encoding_message_size; 8329 + let inner = self.inner.clone(); 8330 + let fut = async move { 8331 + let method = SoundMinSvc(inner); 8332 + let codec = tonic::codec::ProstCodec::default(); 8333 + let mut grpc = tonic::server::Grpc::new(codec) 8334 + .apply_compression_config( 8335 + accept_compression_encodings, 8336 + send_compression_encodings, 8337 + ) 8338 + .apply_max_message_size_config( 8339 + max_decoding_message_size, 8340 + max_encoding_message_size, 8341 + ); 8342 + let res = grpc.unary(method, req).await; 8343 + Ok(res) 8344 + }; 8345 + Box::pin(fut) 8346 + } 8347 + "/rockbox.v1alpha1.SoundService/SoundMax" => { 8348 + #[allow(non_camel_case_types)] 8349 + struct SoundMaxSvc<T: SoundService>(pub Arc<T>); 8350 + impl< 8351 + T: SoundService, 8352 + > tonic::server::UnaryService<super::SoundMaxRequest> 8353 + for SoundMaxSvc<T> { 8354 + type Response = super::SoundMaxResponse; 8355 + type Future = BoxFuture< 8356 + tonic::Response<Self::Response>, 8357 + tonic::Status, 8358 + >; 8359 + fn call( 8360 + &mut self, 8361 + request: tonic::Request<super::SoundMaxRequest>, 8362 + ) -> Self::Future { 8363 + let inner = Arc::clone(&self.0); 8364 + let fut = async move { 8365 + <T as SoundService>::sound_max(&inner, request).await 8366 + }; 8367 + Box::pin(fut) 8368 + } 8369 + } 8370 + let accept_compression_encodings = self.accept_compression_encodings; 8371 + let send_compression_encodings = self.send_compression_encodings; 8372 + let max_decoding_message_size = self.max_decoding_message_size; 8373 + let max_encoding_message_size = self.max_encoding_message_size; 8374 + let inner = self.inner.clone(); 8375 + let fut = async move { 8376 + let method = SoundMaxSvc(inner); 8377 + let codec = tonic::codec::ProstCodec::default(); 8378 + let mut grpc = tonic::server::Grpc::new(codec) 8379 + .apply_compression_config( 8380 + accept_compression_encodings, 8381 + send_compression_encodings, 8382 + ) 8383 + .apply_max_message_size_config( 8384 + max_decoding_message_size, 8385 + max_encoding_message_size, 8386 + ); 8387 + let res = grpc.unary(method, req).await; 8388 + Ok(res) 8389 + }; 8390 + Box::pin(fut) 8391 + } 8392 + "/rockbox.v1alpha1.SoundService/SoundUnit" => { 8393 + #[allow(non_camel_case_types)] 8394 + struct SoundUnitSvc<T: SoundService>(pub Arc<T>); 8395 + impl< 8396 + T: SoundService, 8397 + > tonic::server::UnaryService<super::SoundUnitRequest> 8398 + for SoundUnitSvc<T> { 8399 + type Response = super::SoundUnitResponse; 8400 + type Future = BoxFuture< 8401 + tonic::Response<Self::Response>, 8402 + tonic::Status, 8403 + >; 8404 + fn call( 8405 + &mut self, 8406 + request: tonic::Request<super::SoundUnitRequest>, 8407 + ) -> Self::Future { 8408 + let inner = Arc::clone(&self.0); 8409 + let fut = async move { 8410 + <T as SoundService>::sound_unit(&inner, request).await 8411 + }; 8412 + Box::pin(fut) 8413 + } 8414 + } 8415 + let accept_compression_encodings = self.accept_compression_encodings; 8416 + let send_compression_encodings = self.send_compression_encodings; 8417 + let max_decoding_message_size = self.max_decoding_message_size; 8418 + let max_encoding_message_size = self.max_encoding_message_size; 8419 + let inner = self.inner.clone(); 8420 + let fut = async move { 8421 + let method = SoundUnitSvc(inner); 8422 + let codec = tonic::codec::ProstCodec::default(); 8423 + let mut grpc = tonic::server::Grpc::new(codec) 8424 + .apply_compression_config( 8425 + accept_compression_encodings, 8426 + send_compression_encodings, 8427 + ) 8428 + .apply_max_message_size_config( 8429 + max_decoding_message_size, 8430 + max_encoding_message_size, 8431 + ); 8432 + let res = grpc.unary(method, req).await; 8433 + Ok(res) 8434 + }; 8435 + Box::pin(fut) 8436 + } 8437 + "/rockbox.v1alpha1.SoundService/SoundVal2Phys" => { 8438 + #[allow(non_camel_case_types)] 8439 + struct SoundVal2PhysSvc<T: SoundService>(pub Arc<T>); 8440 + impl< 8441 + T: SoundService, 8442 + > tonic::server::UnaryService<super::SoundVal2PhysRequest> 8443 + for SoundVal2PhysSvc<T> { 8444 + type Response = super::SoundVal2PhysResponse; 8445 + type Future = BoxFuture< 8446 + tonic::Response<Self::Response>, 8447 + tonic::Status, 8448 + >; 8449 + fn call( 8450 + &mut self, 8451 + request: tonic::Request<super::SoundVal2PhysRequest>, 8452 + ) -> Self::Future { 8453 + let inner = Arc::clone(&self.0); 8454 + let fut = async move { 8455 + <T as SoundService>::sound_val2_phys(&inner, request).await 8456 + }; 8457 + Box::pin(fut) 8458 + } 8459 + } 8460 + let accept_compression_encodings = self.accept_compression_encodings; 8461 + let send_compression_encodings = self.send_compression_encodings; 8462 + let max_decoding_message_size = self.max_decoding_message_size; 8463 + let max_encoding_message_size = self.max_encoding_message_size; 8464 + let inner = self.inner.clone(); 8465 + let fut = async move { 8466 + let method = SoundVal2PhysSvc(inner); 8467 + let codec = tonic::codec::ProstCodec::default(); 8468 + let mut grpc = tonic::server::Grpc::new(codec) 8469 + .apply_compression_config( 8470 + accept_compression_encodings, 8471 + send_compression_encodings, 8472 + ) 8473 + .apply_max_message_size_config( 8474 + max_decoding_message_size, 8475 + max_encoding_message_size, 8476 + ); 8477 + let res = grpc.unary(method, req).await; 8478 + Ok(res) 8479 + }; 8480 + Box::pin(fut) 8481 + } 8482 + "/rockbox.v1alpha1.SoundService/GetPitch" => { 8483 + #[allow(non_camel_case_types)] 8484 + struct GetPitchSvc<T: SoundService>(pub Arc<T>); 8485 + impl< 8486 + T: SoundService, 8487 + > tonic::server::UnaryService<super::GetPitchRequest> 8488 + for GetPitchSvc<T> { 8489 + type Response = super::GetPitchResponse; 8490 + type Future = BoxFuture< 8491 + tonic::Response<Self::Response>, 8492 + tonic::Status, 8493 + >; 8494 + fn call( 8495 + &mut self, 8496 + request: tonic::Request<super::GetPitchRequest>, 8497 + ) -> Self::Future { 8498 + let inner = Arc::clone(&self.0); 8499 + let fut = async move { 8500 + <T as SoundService>::get_pitch(&inner, request).await 8501 + }; 8502 + Box::pin(fut) 8503 + } 8504 + } 8505 + let accept_compression_encodings = self.accept_compression_encodings; 8506 + let send_compression_encodings = self.send_compression_encodings; 8507 + let max_decoding_message_size = self.max_decoding_message_size; 8508 + let max_encoding_message_size = self.max_encoding_message_size; 8509 + let inner = self.inner.clone(); 8510 + let fut = async move { 8511 + let method = GetPitchSvc(inner); 8512 + let codec = tonic::codec::ProstCodec::default(); 8513 + let mut grpc = tonic::server::Grpc::new(codec) 8514 + .apply_compression_config( 8515 + accept_compression_encodings, 8516 + send_compression_encodings, 8517 + ) 8518 + .apply_max_message_size_config( 8519 + max_decoding_message_size, 8520 + max_encoding_message_size, 8521 + ); 8522 + let res = grpc.unary(method, req).await; 8523 + Ok(res) 8524 + }; 8525 + Box::pin(fut) 8526 + } 8527 + "/rockbox.v1alpha1.SoundService/SetPitch" => { 8528 + #[allow(non_camel_case_types)] 8529 + struct SetPitchSvc<T: SoundService>(pub Arc<T>); 8530 + impl< 8531 + T: SoundService, 8532 + > tonic::server::UnaryService<super::SetPitchRequest> 8533 + for SetPitchSvc<T> { 8534 + type Response = super::SetPitchResponse; 8535 + type Future = BoxFuture< 8536 + tonic::Response<Self::Response>, 8537 + tonic::Status, 8538 + >; 8539 + fn call( 8540 + &mut self, 8541 + request: tonic::Request<super::SetPitchRequest>, 8542 + ) -> Self::Future { 8543 + let inner = Arc::clone(&self.0); 8544 + let fut = async move { 8545 + <T as SoundService>::set_pitch(&inner, request).await 8546 + }; 8547 + Box::pin(fut) 8548 + } 8549 + } 8550 + let accept_compression_encodings = self.accept_compression_encodings; 8551 + let send_compression_encodings = self.send_compression_encodings; 8552 + let max_decoding_message_size = self.max_decoding_message_size; 8553 + let max_encoding_message_size = self.max_encoding_message_size; 8554 + let inner = self.inner.clone(); 8555 + let fut = async move { 8556 + let method = SetPitchSvc(inner); 8557 + let codec = tonic::codec::ProstCodec::default(); 8558 + let mut grpc = tonic::server::Grpc::new(codec) 8559 + .apply_compression_config( 8560 + accept_compression_encodings, 8561 + send_compression_encodings, 8562 + ) 8563 + .apply_max_message_size_config( 8564 + max_decoding_message_size, 8565 + max_encoding_message_size, 8566 + ); 8567 + let res = grpc.unary(method, req).await; 8568 + Ok(res) 8569 + }; 8570 + Box::pin(fut) 8571 + } 8572 + "/rockbox.v1alpha1.SoundService/BeepPlay" => { 8573 + #[allow(non_camel_case_types)] 8574 + struct BeepPlaySvc<T: SoundService>(pub Arc<T>); 8575 + impl< 8576 + T: SoundService, 8577 + > tonic::server::UnaryService<super::BeepPlayRequest> 8578 + for BeepPlaySvc<T> { 8579 + type Response = super::BeepPlayResponse; 8580 + type Future = BoxFuture< 8581 + tonic::Response<Self::Response>, 8582 + tonic::Status, 8583 + >; 8584 + fn call( 8585 + &mut self, 8586 + request: tonic::Request<super::BeepPlayRequest>, 8587 + ) -> Self::Future { 8588 + let inner = Arc::clone(&self.0); 8589 + let fut = async move { 8590 + <T as SoundService>::beep_play(&inner, request).await 8591 + }; 8592 + Box::pin(fut) 8593 + } 8594 + } 8595 + let accept_compression_encodings = self.accept_compression_encodings; 8596 + let send_compression_encodings = self.send_compression_encodings; 8597 + let max_decoding_message_size = self.max_decoding_message_size; 8598 + let max_encoding_message_size = self.max_encoding_message_size; 8599 + let inner = self.inner.clone(); 8600 + let fut = async move { 8601 + let method = BeepPlaySvc(inner); 8602 + let codec = tonic::codec::ProstCodec::default(); 8603 + let mut grpc = tonic::server::Grpc::new(codec) 8604 + .apply_compression_config( 8605 + accept_compression_encodings, 8606 + send_compression_encodings, 8607 + ) 8608 + .apply_max_message_size_config( 8609 + max_decoding_message_size, 8610 + max_encoding_message_size, 8611 + ); 8612 + let res = grpc.unary(method, req).await; 8613 + Ok(res) 8614 + }; 8615 + Box::pin(fut) 8616 + } 8617 + "/rockbox.v1alpha1.SoundService/PcmbufFade" => { 8618 + #[allow(non_camel_case_types)] 8619 + struct PcmbufFadeSvc<T: SoundService>(pub Arc<T>); 8620 + impl< 8621 + T: SoundService, 8622 + > tonic::server::UnaryService<super::PcmbufFadeRequest> 8623 + for PcmbufFadeSvc<T> { 8624 + type Response = super::PcmbufFadeResponse; 8625 + type Future = BoxFuture< 8626 + tonic::Response<Self::Response>, 8627 + tonic::Status, 8628 + >; 8629 + fn call( 8630 + &mut self, 8631 + request: tonic::Request<super::PcmbufFadeRequest>, 8632 + ) -> Self::Future { 8633 + let inner = Arc::clone(&self.0); 8634 + let fut = async move { 8635 + <T as SoundService>::pcmbuf_fade(&inner, request).await 8636 + }; 8637 + Box::pin(fut) 8638 + } 8639 + } 8640 + let accept_compression_encodings = self.accept_compression_encodings; 8641 + let send_compression_encodings = self.send_compression_encodings; 8642 + let max_decoding_message_size = self.max_decoding_message_size; 8643 + let max_encoding_message_size = self.max_encoding_message_size; 8644 + let inner = self.inner.clone(); 8645 + let fut = async move { 8646 + let method = PcmbufFadeSvc(inner); 8647 + let codec = tonic::codec::ProstCodec::default(); 8648 + let mut grpc = tonic::server::Grpc::new(codec) 8649 + .apply_compression_config( 8650 + accept_compression_encodings, 8651 + send_compression_encodings, 8652 + ) 8653 + .apply_max_message_size_config( 8654 + max_decoding_message_size, 8655 + max_encoding_message_size, 8656 + ); 8657 + let res = grpc.unary(method, req).await; 8658 + Ok(res) 8659 + }; 8660 + Box::pin(fut) 8661 + } 8662 + "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency" => { 8663 + #[allow(non_camel_case_types)] 8664 + struct PcmbufSetLowLatencySvc<T: SoundService>(pub Arc<T>); 8665 + impl< 8666 + T: SoundService, 8667 + > tonic::server::UnaryService<super::PcmbufSetLowLatencyRequest> 8668 + for PcmbufSetLowLatencySvc<T> { 8669 + type Response = super::PcmbufSetLowLatencyResponse; 8670 + type Future = BoxFuture< 8671 + tonic::Response<Self::Response>, 8672 + tonic::Status, 8673 + >; 8674 + fn call( 8675 + &mut self, 8676 + request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 8677 + ) -> Self::Future { 8678 + let inner = Arc::clone(&self.0); 8679 + let fut = async move { 8680 + <T as SoundService>::pcmbuf_set_low_latency(&inner, request) 8681 + .await 8682 + }; 8683 + Box::pin(fut) 8684 + } 8685 + } 8686 + let accept_compression_encodings = self.accept_compression_encodings; 8687 + let send_compression_encodings = self.send_compression_encodings; 8688 + let max_decoding_message_size = self.max_decoding_message_size; 8689 + let max_encoding_message_size = self.max_encoding_message_size; 8690 + let inner = self.inner.clone(); 8691 + let fut = async move { 8692 + let method = PcmbufSetLowLatencySvc(inner); 8693 + let codec = tonic::codec::ProstCodec::default(); 8694 + let mut grpc = tonic::server::Grpc::new(codec) 8695 + .apply_compression_config( 8696 + accept_compression_encodings, 8697 + send_compression_encodings, 8698 + ) 8699 + .apply_max_message_size_config( 8700 + max_decoding_message_size, 8701 + max_encoding_message_size, 8702 + ); 8703 + let res = grpc.unary(method, req).await; 8704 + Ok(res) 8705 + }; 8706 + Box::pin(fut) 8707 + } 8708 + "/rockbox.v1alpha1.SoundService/SystemSoundPlay" => { 8709 + #[allow(non_camel_case_types)] 8710 + struct SystemSoundPlaySvc<T: SoundService>(pub Arc<T>); 8711 + impl< 8712 + T: SoundService, 8713 + > tonic::server::UnaryService<super::SystemSoundPlayRequest> 8714 + for SystemSoundPlaySvc<T> { 8715 + type Response = super::SystemSoundPlayResponse; 8716 + type Future = BoxFuture< 8717 + tonic::Response<Self::Response>, 8718 + tonic::Status, 8719 + >; 8720 + fn call( 8721 + &mut self, 8722 + request: tonic::Request<super::SystemSoundPlayRequest>, 8723 + ) -> Self::Future { 8724 + let inner = Arc::clone(&self.0); 8725 + let fut = async move { 8726 + <T as SoundService>::system_sound_play(&inner, request) 8727 + .await 8728 + }; 8729 + Box::pin(fut) 8730 + } 8731 + } 8732 + let accept_compression_encodings = self.accept_compression_encodings; 8733 + let send_compression_encodings = self.send_compression_encodings; 8734 + let max_decoding_message_size = self.max_decoding_message_size; 8735 + let max_encoding_message_size = self.max_encoding_message_size; 8736 + let inner = self.inner.clone(); 8737 + let fut = async move { 8738 + let method = SystemSoundPlaySvc(inner); 8739 + let codec = tonic::codec::ProstCodec::default(); 8740 + let mut grpc = tonic::server::Grpc::new(codec) 8741 + .apply_compression_config( 8742 + accept_compression_encodings, 8743 + send_compression_encodings, 8744 + ) 8745 + .apply_max_message_size_config( 8746 + max_decoding_message_size, 8747 + max_encoding_message_size, 8748 + ); 8749 + let res = grpc.unary(method, req).await; 8750 + Ok(res) 8751 + }; 8752 + Box::pin(fut) 8753 + } 8754 + "/rockbox.v1alpha1.SoundService/KeyclickClick" => { 8755 + #[allow(non_camel_case_types)] 8756 + struct KeyclickClickSvc<T: SoundService>(pub Arc<T>); 8757 + impl< 8758 + T: SoundService, 8759 + > tonic::server::UnaryService<super::KeyclickClickRequest> 8760 + for KeyclickClickSvc<T> { 8761 + type Response = super::KeyclickClickResponse; 8762 + type Future = BoxFuture< 8763 + tonic::Response<Self::Response>, 8764 + tonic::Status, 8765 + >; 8766 + fn call( 8767 + &mut self, 8768 + request: tonic::Request<super::KeyclickClickRequest>, 8769 + ) -> Self::Future { 8770 + let inner = Arc::clone(&self.0); 8771 + let fut = async move { 8772 + <T as SoundService>::keyclick_click(&inner, request).await 8773 + }; 8774 + Box::pin(fut) 8775 + } 8776 + } 8777 + let accept_compression_encodings = self.accept_compression_encodings; 8778 + let send_compression_encodings = self.send_compression_encodings; 8779 + let max_decoding_message_size = self.max_decoding_message_size; 8780 + let max_encoding_message_size = self.max_encoding_message_size; 8781 + let inner = self.inner.clone(); 8782 + let fut = async move { 8783 + let method = KeyclickClickSvc(inner); 8784 + let codec = tonic::codec::ProstCodec::default(); 8785 + let mut grpc = tonic::server::Grpc::new(codec) 8786 + .apply_compression_config( 8787 + accept_compression_encodings, 8788 + send_compression_encodings, 8789 + ) 8790 + .apply_max_message_size_config( 8791 + max_decoding_message_size, 8792 + max_encoding_message_size, 8793 + ); 8794 + let res = grpc.unary(method, req).await; 8795 + Ok(res) 8796 + }; 8797 + Box::pin(fut) 8798 + } 8799 + _ => { 8800 + Box::pin(async move { 8801 + let mut response = http::Response::new(empty_body()); 8802 + let headers = response.headers_mut(); 8803 + headers 8804 + .insert( 8805 + tonic::Status::GRPC_STATUS, 8806 + (tonic::Code::Unimplemented as i32).into(), 8807 + ); 8808 + headers 8809 + .insert( 8810 + http::header::CONTENT_TYPE, 8811 + tonic::metadata::GRPC_CONTENT_TYPE, 8812 + ); 8813 + Ok(response) 8814 + }) 8815 + } 8816 + } 8817 + } 8818 + } 8819 + impl<T> Clone for SoundServiceServer<T> { 8820 + fn clone(&self) -> Self { 8821 + let inner = self.inner.clone(); 8822 + Self { 8823 + inner, 8824 + accept_compression_encodings: self.accept_compression_encodings, 8825 + send_compression_encodings: self.send_compression_encodings, 8826 + max_decoding_message_size: self.max_decoding_message_size, 8827 + max_encoding_message_size: self.max_encoding_message_size, 8828 + } 8829 + } 8830 + } 8831 + /// Generated gRPC service name 8832 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.SoundService"; 8833 + impl<T> tonic::server::NamedService for SoundServiceServer<T> { 8834 + const NAME: &'static str = SERVICE_NAME; 8835 + } 8836 + } 8837 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 8838 + pub struct GetRockboxVersionRequest {} 8839 + #[derive(Clone, PartialEq, ::prost::Message)] 8840 + pub struct GetRockboxVersionResponse { 8841 + #[prost(string, tag = "1")] 8842 + pub version: ::prost::alloc::string::String, 8843 + } 8844 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 8845 + pub struct GetGlobalStatusRequest {} 8846 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 8847 + pub struct GetGlobalStatusResponse { 8848 + #[prost(int32, tag = "1")] 8849 + pub resume_index: i32, 8850 + #[prost(uint32, tag = "2")] 8851 + pub resume_crc32: u32, 8852 + #[prost(uint32, tag = "3")] 8853 + pub resume_elapsed: u32, 8854 + #[prost(uint32, tag = "4")] 8855 + pub resume_offset: u32, 8856 + #[prost(int32, tag = "5")] 8857 + pub runtime: i32, 8858 + #[prost(int32, tag = "6")] 8859 + pub topruntime: i32, 8860 + #[prost(int32, tag = "7")] 8861 + pub dircache_size: i32, 8862 + #[prost(int32, tag = "8")] 8863 + pub last_screen: i32, 8864 + #[prost(int32, tag = "9")] 8865 + pub viewer_icon_count: i32, 8866 + #[prost(int32, tag = "10")] 8867 + pub last_volume_change: i32, 8868 + } 8869 + /// Generated client implementations. 8870 + pub mod system_service_client { 8871 + #![allow( 8872 + unused_variables, 8873 + dead_code, 8874 + missing_docs, 8875 + clippy::wildcard_imports, 8876 + clippy::let_unit_value, 8877 + )] 8878 + use tonic::codegen::*; 8879 + use tonic::codegen::http::Uri; 8880 + #[derive(Debug, Clone)] 8881 + pub struct SystemServiceClient<T> { 8882 + inner: tonic::client::Grpc<T>, 8883 + } 8884 + impl SystemServiceClient<tonic::transport::Channel> { 8885 + /// Attempt to create a new client by connecting to a given endpoint. 8886 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 8887 + where 8888 + D: TryInto<tonic::transport::Endpoint>, 8889 + D::Error: Into<StdError>, 8890 + { 8891 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 8892 + Ok(Self::new(conn)) 8893 + } 8894 + } 8895 + impl<T> SystemServiceClient<T> 8896 + where 8897 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 8898 + T::Error: Into<StdError>, 8899 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 8900 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 8901 + { 8902 + pub fn new(inner: T) -> Self { 8903 + let inner = tonic::client::Grpc::new(inner); 8904 + Self { inner } 8905 + } 8906 + pub fn with_origin(inner: T, origin: Uri) -> Self { 8907 + let inner = tonic::client::Grpc::with_origin(inner, origin); 8908 + Self { inner } 8909 + } 8910 + pub fn with_interceptor<F>( 8911 + inner: T, 8912 + interceptor: F, 8913 + ) -> SystemServiceClient<InterceptedService<T, F>> 8914 + where 8915 + F: tonic::service::Interceptor, 8916 + T::ResponseBody: Default, 8917 + T: tonic::codegen::Service< 8918 + http::Request<tonic::body::BoxBody>, 8919 + Response = http::Response< 8920 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 8921 + >, 8922 + >, 8923 + <T as tonic::codegen::Service< 8924 + http::Request<tonic::body::BoxBody>, 8925 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 8926 + { 8927 + SystemServiceClient::new(InterceptedService::new(inner, interceptor)) 8928 + } 8929 + /// Compress requests with the given encoding. 8930 + /// 8931 + /// This requires the server to support it otherwise it might respond with an 8932 + /// error. 8933 + #[must_use] 8934 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 8935 + self.inner = self.inner.send_compressed(encoding); 8936 + self 8937 + } 8938 + /// Enable decompressing responses. 8939 + #[must_use] 8940 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 8941 + self.inner = self.inner.accept_compressed(encoding); 8942 + self 8943 + } 8944 + /// Limits the maximum size of a decoded message. 8945 + /// 8946 + /// Default: `4MB` 8947 + #[must_use] 8948 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 8949 + self.inner = self.inner.max_decoding_message_size(limit); 8950 + self 8951 + } 8952 + /// Limits the maximum size of an encoded message. 8953 + /// 8954 + /// Default: `usize::MAX` 8955 + #[must_use] 8956 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 8957 + self.inner = self.inner.max_encoding_message_size(limit); 8958 + self 8959 + } 8960 + pub async fn get_rockbox_version( 8961 + &mut self, 8962 + request: impl tonic::IntoRequest<super::GetRockboxVersionRequest>, 8963 + ) -> std::result::Result< 8964 + tonic::Response<super::GetRockboxVersionResponse>, 8965 + tonic::Status, 8966 + > { 8967 + self.inner 8968 + .ready() 8969 + .await 8970 + .map_err(|e| { 8971 + tonic::Status::unknown( 8972 + format!("Service was not ready: {}", e.into()), 8973 + ) 8974 + })?; 8975 + let codec = tonic::codec::ProstCodec::default(); 8976 + let path = http::uri::PathAndQuery::from_static( 8977 + "/rockbox.v1alpha1.SystemService/GetRockboxVersion", 8978 + ); 8979 + let mut req = request.into_request(); 8980 + req.extensions_mut() 8981 + .insert( 8982 + GrpcMethod::new( 8983 + "rockbox.v1alpha1.SystemService", 8984 + "GetRockboxVersion", 8985 + ), 8986 + ); 8987 + self.inner.unary(req, path, codec).await 8988 + } 8989 + pub async fn get_global_status( 8990 + &mut self, 8991 + request: impl tonic::IntoRequest<super::GetGlobalStatusRequest>, 8992 + ) -> std::result::Result< 8993 + tonic::Response<super::GetGlobalStatusResponse>, 8994 + tonic::Status, 8995 + > { 8996 + self.inner 8997 + .ready() 8998 + .await 8999 + .map_err(|e| { 9000 + tonic::Status::unknown( 9001 + format!("Service was not ready: {}", e.into()), 9002 + ) 9003 + })?; 9004 + let codec = tonic::codec::ProstCodec::default(); 9005 + let path = http::uri::PathAndQuery::from_static( 9006 + "/rockbox.v1alpha1.SystemService/GetGlobalStatus", 9007 + ); 9008 + let mut req = request.into_request(); 9009 + req.extensions_mut() 9010 + .insert( 9011 + GrpcMethod::new("rockbox.v1alpha1.SystemService", "GetGlobalStatus"), 9012 + ); 9013 + self.inner.unary(req, path, codec).await 9014 + } 9015 + } 9016 + } 9017 + /// Generated server implementations. 9018 + pub mod system_service_server { 9019 + #![allow( 9020 + unused_variables, 9021 + dead_code, 9022 + missing_docs, 9023 + clippy::wildcard_imports, 9024 + clippy::let_unit_value, 9025 + )] 9026 + use tonic::codegen::*; 9027 + /// Generated trait containing gRPC methods that should be implemented for use with SystemServiceServer. 9028 + #[async_trait] 9029 + pub trait SystemService: std::marker::Send + std::marker::Sync + 'static { 9030 + async fn get_rockbox_version( 9031 + &self, 9032 + request: tonic::Request<super::GetRockboxVersionRequest>, 9033 + ) -> std::result::Result< 9034 + tonic::Response<super::GetRockboxVersionResponse>, 9035 + tonic::Status, 9036 + >; 9037 + async fn get_global_status( 9038 + &self, 9039 + request: tonic::Request<super::GetGlobalStatusRequest>, 9040 + ) -> std::result::Result< 9041 + tonic::Response<super::GetGlobalStatusResponse>, 9042 + tonic::Status, 9043 + >; 9044 + } 9045 + #[derive(Debug)] 9046 + pub struct SystemServiceServer<T> { 9047 + inner: Arc<T>, 9048 + accept_compression_encodings: EnabledCompressionEncodings, 9049 + send_compression_encodings: EnabledCompressionEncodings, 9050 + max_decoding_message_size: Option<usize>, 9051 + max_encoding_message_size: Option<usize>, 9052 + } 9053 + impl<T> SystemServiceServer<T> { 9054 + pub fn new(inner: T) -> Self { 9055 + Self::from_arc(Arc::new(inner)) 9056 + } 9057 + pub fn from_arc(inner: Arc<T>) -> Self { 9058 + Self { 9059 + inner, 9060 + accept_compression_encodings: Default::default(), 9061 + send_compression_encodings: Default::default(), 9062 + max_decoding_message_size: None, 9063 + max_encoding_message_size: None, 9064 + } 9065 + } 9066 + pub fn with_interceptor<F>( 9067 + inner: T, 9068 + interceptor: F, 9069 + ) -> InterceptedService<Self, F> 9070 + where 9071 + F: tonic::service::Interceptor, 9072 + { 9073 + InterceptedService::new(Self::new(inner), interceptor) 9074 + } 9075 + /// Enable decompressing requests with the given encoding. 9076 + #[must_use] 9077 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 9078 + self.accept_compression_encodings.enable(encoding); 9079 + self 9080 + } 9081 + /// Compress responses with the given encoding, if the client supports it. 9082 + #[must_use] 9083 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 9084 + self.send_compression_encodings.enable(encoding); 9085 + self 9086 + } 9087 + /// Limits the maximum size of a decoded message. 9088 + /// 9089 + /// Default: `4MB` 9090 + #[must_use] 9091 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 9092 + self.max_decoding_message_size = Some(limit); 9093 + self 9094 + } 9095 + /// Limits the maximum size of an encoded message. 9096 + /// 9097 + /// Default: `usize::MAX` 9098 + #[must_use] 9099 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 9100 + self.max_encoding_message_size = Some(limit); 9101 + self 9102 + } 9103 + } 9104 + impl<T, B> tonic::codegen::Service<http::Request<B>> for SystemServiceServer<T> 9105 + where 9106 + T: SystemService, 9107 + B: Body + std::marker::Send + 'static, 9108 + B::Error: Into<StdError> + std::marker::Send + 'static, 9109 + { 9110 + type Response = http::Response<tonic::body::BoxBody>; 9111 + type Error = std::convert::Infallible; 9112 + type Future = BoxFuture<Self::Response, Self::Error>; 9113 + fn poll_ready( 9114 + &mut self, 9115 + _cx: &mut Context<'_>, 9116 + ) -> Poll<std::result::Result<(), Self::Error>> { 9117 + Poll::Ready(Ok(())) 9118 + } 9119 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 9120 + match req.uri().path() { 9121 + "/rockbox.v1alpha1.SystemService/GetRockboxVersion" => { 9122 + #[allow(non_camel_case_types)] 9123 + struct GetRockboxVersionSvc<T: SystemService>(pub Arc<T>); 9124 + impl< 9125 + T: SystemService, 9126 + > tonic::server::UnaryService<super::GetRockboxVersionRequest> 9127 + for GetRockboxVersionSvc<T> { 9128 + type Response = super::GetRockboxVersionResponse; 9129 + type Future = BoxFuture< 9130 + tonic::Response<Self::Response>, 9131 + tonic::Status, 9132 + >; 9133 + fn call( 9134 + &mut self, 9135 + request: tonic::Request<super::GetRockboxVersionRequest>, 9136 + ) -> Self::Future { 9137 + let inner = Arc::clone(&self.0); 9138 + let fut = async move { 9139 + <T as SystemService>::get_rockbox_version(&inner, request) 9140 + .await 9141 + }; 9142 + Box::pin(fut) 9143 + } 9144 + } 9145 + let accept_compression_encodings = self.accept_compression_encodings; 9146 + let send_compression_encodings = self.send_compression_encodings; 9147 + let max_decoding_message_size = self.max_decoding_message_size; 9148 + let max_encoding_message_size = self.max_encoding_message_size; 9149 + let inner = self.inner.clone(); 9150 + let fut = async move { 9151 + let method = GetRockboxVersionSvc(inner); 9152 + let codec = tonic::codec::ProstCodec::default(); 9153 + let mut grpc = tonic::server::Grpc::new(codec) 9154 + .apply_compression_config( 9155 + accept_compression_encodings, 9156 + send_compression_encodings, 9157 + ) 9158 + .apply_max_message_size_config( 9159 + max_decoding_message_size, 9160 + max_encoding_message_size, 9161 + ); 9162 + let res = grpc.unary(method, req).await; 9163 + Ok(res) 9164 + }; 9165 + Box::pin(fut) 9166 + } 9167 + "/rockbox.v1alpha1.SystemService/GetGlobalStatus" => { 9168 + #[allow(non_camel_case_types)] 9169 + struct GetGlobalStatusSvc<T: SystemService>(pub Arc<T>); 9170 + impl< 9171 + T: SystemService, 9172 + > tonic::server::UnaryService<super::GetGlobalStatusRequest> 9173 + for GetGlobalStatusSvc<T> { 9174 + type Response = super::GetGlobalStatusResponse; 9175 + type Future = BoxFuture< 9176 + tonic::Response<Self::Response>, 9177 + tonic::Status, 9178 + >; 9179 + fn call( 9180 + &mut self, 9181 + request: tonic::Request<super::GetGlobalStatusRequest>, 9182 + ) -> Self::Future { 9183 + let inner = Arc::clone(&self.0); 9184 + let fut = async move { 9185 + <T as SystemService>::get_global_status(&inner, request) 9186 + .await 9187 + }; 9188 + Box::pin(fut) 9189 + } 9190 + } 9191 + let accept_compression_encodings = self.accept_compression_encodings; 9192 + let send_compression_encodings = self.send_compression_encodings; 9193 + let max_decoding_message_size = self.max_decoding_message_size; 9194 + let max_encoding_message_size = self.max_encoding_message_size; 9195 + let inner = self.inner.clone(); 9196 + let fut = async move { 9197 + let method = GetGlobalStatusSvc(inner); 9198 + let codec = tonic::codec::ProstCodec::default(); 9199 + let mut grpc = tonic::server::Grpc::new(codec) 9200 + .apply_compression_config( 9201 + accept_compression_encodings, 9202 + send_compression_encodings, 9203 + ) 9204 + .apply_max_message_size_config( 9205 + max_decoding_message_size, 9206 + max_encoding_message_size, 9207 + ); 9208 + let res = grpc.unary(method, req).await; 9209 + Ok(res) 9210 + }; 9211 + Box::pin(fut) 9212 + } 9213 + _ => { 9214 + Box::pin(async move { 9215 + let mut response = http::Response::new(empty_body()); 9216 + let headers = response.headers_mut(); 9217 + headers 9218 + .insert( 9219 + tonic::Status::GRPC_STATUS, 9220 + (tonic::Code::Unimplemented as i32).into(), 9221 + ); 9222 + headers 9223 + .insert( 9224 + http::header::CONTENT_TYPE, 9225 + tonic::metadata::GRPC_CONTENT_TYPE, 9226 + ); 9227 + Ok(response) 9228 + }) 9229 + } 9230 + } 9231 + } 9232 + } 9233 + impl<T> Clone for SystemServiceServer<T> { 9234 + fn clone(&self) -> Self { 9235 + let inner = self.inner.clone(); 9236 + Self { 9237 + inner, 9238 + accept_compression_encodings: self.accept_compression_encodings, 9239 + send_compression_encodings: self.send_compression_encodings, 9240 + max_decoding_message_size: self.max_decoding_message_size, 9241 + max_encoding_message_size: self.max_encoding_message_size, 9242 + } 9243 + } 9244 + } 9245 + /// Generated gRPC service name 9246 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.SystemService"; 9247 + impl<T> tonic::server::NamedService for SystemServiceServer<T> { 9248 + const NAME: &'static str = SERVICE_NAME; 9249 + } 9250 + }
gpui/src/api/rockbox_descriptor.bin

This is a binary file and will not be displayed.

+33 -29
gpui/src/app.rs
··· 1 1 use crate::controller::Controller; 2 2 use crate::state::AppState; 3 3 use crate::ui::{assets::Assets, rockbox::Rockbox}; 4 - use gpui::{AppContext, Application, Bounds, TitlebarOptions, WindowBounds, WindowOptions, px, size}; 4 + use gpui::{ 5 + px, size, AppContext, Application, Bounds, TitlebarOptions, WindowBounds, WindowOptions, 6 + }; 5 7 6 8 pub fn run() { 7 9 let assets = Assets {}; 8 10 9 - Application::new().with_assets(assets.clone()).run(move |cx| { 10 - let bounds = Bounds::centered(None, size(px(1280.0), px(760.0)), cx); 11 - assets.load_fonts(cx).expect("failed to load fonts"); 11 + Application::new() 12 + .with_assets(assets.clone()) 13 + .run(move |cx| { 14 + let bounds = Bounds::centered(None, size(px(1280.0), px(760.0)), cx); 15 + assets.load_fonts(cx).expect("failed to load fonts"); 12 16 13 - cx.open_window( 14 - WindowOptions { 15 - window_bounds: Some(WindowBounds::Windowed(bounds)), 16 - app_id: Some("rockbox".into()), 17 - focus: true, 18 - titlebar: Some(TitlebarOptions { 19 - title: None, 20 - appears_transparent: true, 17 + cx.open_window( 18 + WindowOptions { 19 + window_bounds: Some(WindowBounds::Windowed(bounds)), 20 + app_id: Some("rockbox".into()), 21 + focus: true, 22 + titlebar: Some(TitlebarOptions { 23 + title: None, 24 + appears_transparent: true, 25 + ..Default::default() 26 + }), 27 + window_min_size: Some(gpui::Size { 28 + width: px(800.0), 29 + height: px(600.0), 30 + }), 21 31 ..Default::default() 22 - }), 23 - window_min_size: Some(gpui::Size { 24 - width: px(800.0), 25 - height: px(600.0), 26 - }), 27 - ..Default::default() 28 - }, 29 - |_window, cx| { 30 - let state = cx.new(|_| AppState::new()); 31 - let controller = Controller::new(state); 32 - cx.set_global(controller); 33 - cx.new(Rockbox::new) 34 - }, 35 - ) 36 - .expect("failed to open window"); 32 + }, 33 + |_window, cx| { 34 + let state = cx.new(|_| AppState::new()); 35 + let controller = Controller::new(state); 36 + cx.set_global(controller); 37 + cx.new(Rockbox::new) 38 + }, 39 + ) 40 + .expect("failed to open window"); 37 41 38 - cx.activate(true); 39 - }); 42 + cx.activate(true); 43 + }); 40 44 }
+113 -13
gpui/src/state.rs
··· 64 64 65 65 pub fn prev(&mut self) { 66 66 if let Some(idx) = self.current_idx { 67 - self.current_idx = Some(if idx == 0 { self.tracks.len() - 1 } else { idx - 1 }); 67 + self.current_idx = Some(if idx == 0 { 68 + self.tracks.len() - 1 69 + } else { 70 + idx - 1 71 + }); 68 72 self.position = 0; 69 73 } 70 74 } ··· 86 90 87 91 fn mock_tracks() -> Vec<Track> { 88 92 vec![ 89 - Track { id: 1, title: "Bohemian Rhapsody".into(), artist: "Queen".into(), album: "A Night at the Opera".into(), genre: "Rock".into(), duration: 354, track_number: 11 }, 90 - Track { id: 2, title: "Hotel California".into(), artist: "Eagles".into(), album: "Hotel California".into(), genre: "Rock".into(), duration: 391, track_number: 1 }, 91 - Track { id: 3, title: "Stairway to Heaven".into(), artist: "Led Zeppelin".into(), album: "Led Zeppelin IV".into(), genre: "Rock".into(), duration: 482, track_number: 4 }, 92 - Track { id: 4, title: "Blinding Lights".into(), artist: "The Weeknd".into(), album: "After Hours".into(), genre: "Pop".into(), duration: 200, track_number: 2 }, 93 - Track { id: 5, title: "Shape of You".into(), artist: "Ed Sheeran".into(), album: "Divide".into(), genre: "Pop".into(), duration: 234, track_number: 1 }, 94 - Track { id: 6, title: "Lose Yourself".into(), artist: "Eminem".into(), album: "8 Mile".into(), genre: "Hip-Hop".into(), duration: 326, track_number: 1 }, 95 - Track { id: 7, title: "One More Time".into(), artist: "Daft Punk".into(), album: "Discovery".into(), genre: "Electronic".into(), duration: 320, track_number: 1 }, 96 - Track { id: 8, title: "Get Lucky".into(), artist: "Daft Punk".into(), album: "Random Access Memories".into(), genre: "Electronic".into(), duration: 248, track_number: 8 }, 97 - Track { id: 9, title: "Comfortably Numb".into(), artist: "Pink Floyd".into(), album: "The Wall".into(), genre: "Rock".into(), duration: 382, track_number: 27 }, 98 - Track { id: 10, title: "Wish You Were Here".into(), artist: "Pink Floyd".into(), album: "Wish You Were Here".into(), genre: "Rock".into(), duration: 310, track_number: 1 }, 99 - Track { id: 11, title: "Superstition".into(), artist: "Stevie Wonder".into(), album: "Talking Book".into(), genre: "Soul".into(), duration: 245, track_number: 1 }, 100 - Track { id: 12, title: "Billie Jean".into(), artist: "Michael Jackson".into(), album: "Thriller".into(), genre: "Pop".into(), duration: 294, track_number: 6 }, 93 + Track { 94 + id: 1, 95 + title: "Bohemian Rhapsody".into(), 96 + artist: "Queen".into(), 97 + album: "A Night at the Opera".into(), 98 + genre: "Rock".into(), 99 + duration: 354, 100 + track_number: 11, 101 + }, 102 + Track { 103 + id: 2, 104 + title: "Hotel California".into(), 105 + artist: "Eagles".into(), 106 + album: "Hotel California".into(), 107 + genre: "Rock".into(), 108 + duration: 391, 109 + track_number: 1, 110 + }, 111 + Track { 112 + id: 3, 113 + title: "Stairway to Heaven".into(), 114 + artist: "Led Zeppelin".into(), 115 + album: "Led Zeppelin IV".into(), 116 + genre: "Rock".into(), 117 + duration: 482, 118 + track_number: 4, 119 + }, 120 + Track { 121 + id: 4, 122 + title: "Blinding Lights".into(), 123 + artist: "The Weeknd".into(), 124 + album: "After Hours".into(), 125 + genre: "Pop".into(), 126 + duration: 200, 127 + track_number: 2, 128 + }, 129 + Track { 130 + id: 5, 131 + title: "Shape of You".into(), 132 + artist: "Ed Sheeran".into(), 133 + album: "Divide".into(), 134 + genre: "Pop".into(), 135 + duration: 234, 136 + track_number: 1, 137 + }, 138 + Track { 139 + id: 6, 140 + title: "Lose Yourself".into(), 141 + artist: "Eminem".into(), 142 + album: "8 Mile".into(), 143 + genre: "Hip-Hop".into(), 144 + duration: 326, 145 + track_number: 1, 146 + }, 147 + Track { 148 + id: 7, 149 + title: "One More Time".into(), 150 + artist: "Daft Punk".into(), 151 + album: "Discovery".into(), 152 + genre: "Electronic".into(), 153 + duration: 320, 154 + track_number: 1, 155 + }, 156 + Track { 157 + id: 8, 158 + title: "Get Lucky".into(), 159 + artist: "Daft Punk".into(), 160 + album: "Random Access Memories".into(), 161 + genre: "Electronic".into(), 162 + duration: 248, 163 + track_number: 8, 164 + }, 165 + Track { 166 + id: 9, 167 + title: "Comfortably Numb".into(), 168 + artist: "Pink Floyd".into(), 169 + album: "The Wall".into(), 170 + genre: "Rock".into(), 171 + duration: 382, 172 + track_number: 27, 173 + }, 174 + Track { 175 + id: 10, 176 + title: "Wish You Were Here".into(), 177 + artist: "Pink Floyd".into(), 178 + album: "Wish You Were Here".into(), 179 + genre: "Rock".into(), 180 + duration: 310, 181 + track_number: 1, 182 + }, 183 + Track { 184 + id: 11, 185 + title: "Superstition".into(), 186 + artist: "Stevie Wonder".into(), 187 + album: "Talking Book".into(), 188 + genre: "Soul".into(), 189 + duration: 245, 190 + track_number: 1, 191 + }, 192 + Track { 193 + id: 12, 194 + title: "Billie Jean".into(), 195 + artist: "Michael Jackson".into(), 196 + album: "Thriller".into(), 197 + genre: "Pop".into(), 198 + duration: 294, 199 + track_number: 6, 200 + }, 101 201 ] 102 202 } 103 203
+31 -36
gpui/src/ui/components/controlbar.rs
··· 3 3 use crate::ui::components::icons::{Icon, Icons}; 4 4 use crate::ui::helpers::secs_to_slider; 5 5 use crate::ui::theme::Theme; 6 - use gpui::{Context, IntoElement, ParentElement, Render, Styled, Window, div, px}; 6 + use gpui::{div, px, Context, IntoElement, ParentElement, Render, Styled, Window}; 7 7 8 8 pub struct ControlBar; 9 9 ··· 22 22 .w_full() 23 23 .flex_shrink_0() 24 24 .flex() 25 - .flex_col() 26 - .gap_y_2() 27 - .px_4() 25 + .items_center() 26 + .gap_x_3() 27 + .px_6() 28 28 .py_3() 29 - .border_t_1() 30 - .border_color(theme.border) 29 + // Elapsed 31 30 .child( 32 - // Progress bar 33 31 div() 34 - .w_full() 35 - .flex() 36 - .items_center() 37 - .gap_x_3() 32 + .text_xs() 33 + .text_color(theme.playback_position_text) 34 + .flex_shrink_0() 35 + .child(format_duration(position)), 36 + ) 37 + // Progress bar 38 + .child( 39 + div() 40 + .flex_1() 41 + .h(px(4.0)) 42 + .rounded_full() 43 + .bg(theme.playback_slider_track) 38 44 .child( 39 45 div() 40 - .text_xs() 41 - .text_color(theme.playback_position_text) 42 - .child(format_duration(position)), 43 - ) 44 - .child( 45 - div() 46 - .flex_1() 47 - .h(px(4.0)) 46 + .h_full() 48 47 .rounded_full() 49 - .bg(theme.playback_slider_track) 50 - .child( 51 - div() 52 - .h_full() 53 - .rounded_full() 54 - .bg(theme.playback_slider_fill) 55 - .w(px(fill_pct / 100.0 * 800.0)), // approximate fill; will size properly with canvas 56 - ), 57 - ) 58 - .child( 59 - div() 60 - .text_xs() 61 - .text_color(theme.playback_position_text) 62 - .child(format_duration(duration)), 48 + .bg(theme.playback_slider_fill) 49 + .w(px(fill_pct / 100.0 * 800.0)), 63 50 ), 64 51 ) 52 + // Duration 65 53 .child( 66 - // Volume 67 54 div() 68 - .w_full() 55 + .text_xs() 56 + .text_color(theme.playback_position_text) 57 + .flex_shrink_0() 58 + .child(format_duration(duration)), 59 + ) 60 + // Volume 61 + .child( 62 + div() 63 + .flex_shrink_0() 69 64 .flex() 70 65 .items_center() 71 - .justify_end() 72 66 .gap_x_2() 67 + .ml_4() 73 68 .child( 74 69 div() 75 70 .text_color(theme.volume_icon)
+3 -3
gpui/src/ui/components/icons.rs
··· 1 1 use gpui::{ 2 - AnyElement, App, AppContext, Context, Entity, Hsla, IntoElement, Radians, Render, 3 - RenderOnce, SharedString, StyleRefinement, Styled, Svg, Transformation, Window, 4 - prelude::FluentBuilder as _, svg, white, 2 + prelude::FluentBuilder as _, svg, white, AnyElement, App, AppContext, Context, Entity, Hsla, 3 + IntoElement, Radians, Render, RenderOnce, SharedString, StyleRefinement, Styled, Svg, 4 + Transformation, Window, 5 5 }; 6 6 7 7 pub trait IconNamed {
+3 -3
gpui/src/ui/components/miniplayer.rs
··· 1 1 use crate::controller::Controller; 2 - use crate::state::{AppState, PlaybackStatus, format_duration}; 2 + use crate::state::{format_duration, AppState, PlaybackStatus}; 3 3 use crate::ui::components::icons::{Icon, Icons}; 4 4 use crate::ui::components::Page; 5 5 use crate::ui::helpers::secs_to_slider; 6 6 use crate::ui::theme::Theme; 7 7 use gpui::{ 8 - App, Context, FontWeight, InteractiveElement, IntoElement, ParentElement, Render, 9 - StatefulInteractiveElement, Styled, Window, div, px, relative, 8 + div, px, relative, App, Context, FontWeight, InteractiveElement, IntoElement, ParentElement, 9 + Render, StatefulInteractiveElement, Styled, Window, 10 10 }; 11 11 12 12 pub struct MiniPlayer;
+10
gpui/src/ui/components/mod.rs
··· 3 3 pub mod miniplayer; 4 4 pub mod navbar; 5 5 pub mod pages; 6 + pub mod search_input; 6 7 pub mod titlebar; 7 8 8 9 #[derive(Clone, Copy, PartialEq)] ··· 13 14 } 14 15 15 16 impl gpui::Global for Page {} 17 + 18 + #[derive(Clone, Copy, PartialEq)] 19 + pub enum LibrarySection { 20 + Songs, 21 + Albums, 22 + Artists, 23 + } 24 + 25 + impl gpui::Global for LibrarySection {}
+4 -4
gpui/src/ui/components/navbar.rs
··· 2 2 use crate::ui::theme::Theme; 3 3 use gpui::prelude::FluentBuilder; 4 4 use gpui::{ 5 - Animation, AnimationExt as _, Context, ElementId, FontWeight, InteractiveElement, 6 - IntoElement, ParentElement, Render, StatefulInteractiveElement, Styled, Window, div, px, 5 + div, px, Animation, AnimationExt as _, Context, ElementId, FontWeight, InteractiveElement, 6 + IntoElement, ParentElement, Render, StatefulInteractiveElement, Styled, Window, 7 7 }; 8 8 9 9 #[derive(Clone)] ··· 34 34 .justify_center() 35 35 .relative() 36 36 .child({ 37 - let tab_state = window 38 - .use_keyed_state("navbar_tab", cx, |_, _| (page, active_offset)); 37 + let tab_state = 38 + window.use_keyed_state("navbar_tab", cx, |_, _| (page, active_offset)); 39 39 40 40 let (prev_page, prev_offset) = *tab_state.read(cx); 41 41 let duration = std::time::Duration::from_millis(200);
+360 -133
gpui/src/ui/components/pages/library.rs
··· 1 1 use crate::controller::Controller; 2 2 use crate::state::format_duration; 3 + use crate::ui::components::icons::{Icon, Icons}; 3 4 use crate::ui::components::miniplayer::MiniPlayer; 5 + use crate::ui::components::search_input::SearchInput; 6 + use crate::ui::components::LibrarySection; 4 7 use crate::ui::theme::Theme; 5 8 use gpui::prelude::FluentBuilder; 6 9 use gpui::{ 7 - App, AppContext, Entity, FontWeight, InteractiveElement, IntoElement, ParentElement, Render, 8 - StatefulInteractiveElement, Styled, UniformListScrollHandle, Window, div, px, uniform_list, 10 + div, px, uniform_list, App, AppContext, Entity, FontWeight, InteractiveElement, IntoElement, 11 + MouseButton, ParentElement, Render, StatefulInteractiveElement, Styled, UniformListScrollHandle, 12 + Window, 9 13 }; 10 14 11 15 pub struct LibraryPage { 12 16 scroll_handle: UniformListScrollHandle, 13 17 miniplayer: Entity<MiniPlayer>, 18 + search_input: Entity<SearchInput>, 14 19 } 15 20 16 21 impl LibraryPage { 17 22 pub fn new(cx: &mut App) -> Self { 23 + cx.set_global(LibrarySection::Songs); 18 24 LibraryPage { 19 25 scroll_handle: UniformListScrollHandle::new(), 20 26 miniplayer: cx.new(|_| MiniPlayer), 27 + search_input: cx.new(|cx| SearchInput::new(cx)), 21 28 } 22 29 } 23 30 } 24 31 25 32 impl Render for LibraryPage { 26 - fn render(&mut self, _: &mut Window, cx: &mut gpui::Context<Self>) -> impl IntoElement { 33 + fn render(&mut self, window: &mut Window, cx: &mut gpui::Context<Self>) -> impl IntoElement { 27 34 let theme = *cx.global::<Theme>(); 28 - let n = cx.global::<Controller>().state.read(cx).tracks.len(); 35 + let section = *cx.global::<LibrarySection>(); 36 + 37 + let content_width = f32::from(window.viewport_size().width) - 200.0; 38 + let album_cols = ((content_width / 200.0).floor() as u16).max(2); 39 + let artist_cols = ((content_width / 160.0).floor() as u16).max(2); 40 + 41 + // Pre-compute section data while holding state borrow 42 + let (n_songs, albums, artists) = { 43 + let state = cx.global::<Controller>().state.read(cx); 44 + 45 + let n_songs = state.tracks.len(); 46 + 47 + let mut album_map: std::collections::BTreeMap<String, (String, usize)> = 48 + Default::default(); 49 + for track in &state.tracks { 50 + let e = album_map 51 + .entry(track.album.clone()) 52 + .or_insert((track.artist.clone(), 0)); 53 + e.1 += 1; 54 + } 55 + let albums: Vec<(String, String, usize)> = album_map 56 + .into_iter() 57 + .map(|(name, (artist, count))| (name, artist, count)) 58 + .collect(); 59 + 60 + let mut artist_map: std::collections::BTreeMap<String, usize> = Default::default(); 61 + for track in &state.tracks { 62 + *artist_map.entry(track.artist.clone()).or_default() += 1; 63 + } 64 + let artists: Vec<(String, usize)> = artist_map.into_iter().collect(); 65 + 66 + (n_songs, albums, artists) 67 + }; 68 + 29 69 let scroll_handle = self.scroll_handle.clone(); 30 70 71 + // Sidebar nav item builder 72 + let make_nav_item = move |label: &'static str, target: LibrarySection| { 73 + let is_active = section == target; 74 + div() 75 + .id(label) 76 + .w_full() 77 + .px_4() 78 + .py_2p5() 79 + .cursor_pointer() 80 + .text_sm() 81 + .font_weight(if is_active { 82 + FontWeight(600.0) 83 + } else { 84 + FontWeight(400.0) 85 + }) 86 + .text_color(if is_active { 87 + gpui::rgb(0xFFFFFF) 88 + } else { 89 + theme.library_header_text 90 + }) 91 + .when(is_active, |this| { 92 + this.border_l_2().border_color(theme.switcher_active) 93 + }) 94 + .hover(|this| this.text_color(theme.library_text)) 95 + .on_click(move |_, _, cx: &mut App| { 96 + *cx.global_mut::<LibrarySection>() = target; 97 + }) 98 + .child(label) 99 + }; 100 + 101 + // Content area — switches per section 102 + let content = match section { 103 + LibrarySection::Songs => div() 104 + .flex_1() 105 + .min_h_0() 106 + .flex() 107 + .flex_col() 108 + .child( 109 + div() 110 + .w_full() 111 + .flex_shrink_0() 112 + .flex() 113 + .items_center() 114 + .px_6() 115 + .py_4() 116 + .border_b_1() 117 + .border_color(theme.library_table_border) 118 + .child( 119 + div() 120 + .w(px(32.0)) 121 + .text_xs() 122 + .font_weight(FontWeight::MEDIUM) 123 + .text_color(theme.library_header_text) 124 + .child("#"), 125 + ) 126 + .child( 127 + div() 128 + .flex_1() 129 + .text_xs() 130 + .font_weight(FontWeight::MEDIUM) 131 + .text_color(theme.library_header_text) 132 + .child("TITLE"), 133 + ) 134 + .child( 135 + div() 136 + .w_48() 137 + .text_xs() 138 + .font_weight(FontWeight::MEDIUM) 139 + .text_color(theme.library_header_text) 140 + .child("ARTIST"), 141 + ) 142 + .child( 143 + div() 144 + .w_48() 145 + .text_xs() 146 + .font_weight(FontWeight::MEDIUM) 147 + .text_color(theme.library_header_text) 148 + .child("ALBUM"), 149 + ) 150 + .child( 151 + div() 152 + .w_16() 153 + .text_xs() 154 + .font_weight(FontWeight::MEDIUM) 155 + .text_color(theme.library_header_text) 156 + .child("TIME"), 157 + ), 158 + ) 159 + .child( 160 + uniform_list("library_tracks", n_songs, move |range, _window, cx| { 161 + let theme = *cx.global::<Theme>(); 162 + let state = cx.global::<Controller>().state.read(cx); 163 + let current_idx = state.current_idx; 164 + range 165 + .map(|idx| { 166 + let track = &state.tracks[idx]; 167 + let is_current = current_idx == Some(idx); 168 + div() 169 + .id(("track_row", idx)) 170 + .w_full() 171 + .flex() 172 + .items_center() 173 + .px_6() 174 + .py_3() 175 + .cursor_pointer() 176 + .hover(|this| this.bg(theme.library_track_bg_hover)) 177 + .when(is_current, |this| { 178 + this.bg(theme.library_track_bg_active) 179 + .border_b_2() 180 + .border_color(theme.switcher_active) 181 + }) 182 + .on_click(move |_, _, cx: &mut App| { 183 + let state = cx.global::<Controller>().state.clone(); 184 + state.update(cx, |s: &mut crate::state::AppState, _| { 185 + s.play_track(idx) 186 + }); 187 + }) 188 + .child( 189 + div() 190 + .w(px(32.0)) 191 + .text_sm() 192 + .text_color(theme.library_header_text) 193 + .child(track.track_number.to_string()), 194 + ) 195 + .child( 196 + div() 197 + .flex_1() 198 + .text_sm() 199 + .truncate() 200 + .text_color(if is_current { 201 + theme.library_track_title_active 202 + } else { 203 + theme.library_text 204 + }) 205 + .font_weight(if is_current { 206 + FontWeight(600.0) 207 + } else { 208 + FontWeight(400.0) 209 + }) 210 + .child(track.title.clone()), 211 + ) 212 + .child( 213 + div() 214 + .w_48() 215 + .text_sm() 216 + .truncate() 217 + .text_color(theme.library_header_text) 218 + .child(track.artist.clone()), 219 + ) 220 + .child( 221 + div() 222 + .w_48() 223 + .text_sm() 224 + .truncate() 225 + .text_color(theme.library_header_text) 226 + .child(track.album.clone()), 227 + ) 228 + .child( 229 + div() 230 + .w_16() 231 + .text_sm() 232 + .text_color(theme.library_header_text) 233 + .child(format_duration(track.duration)), 234 + ) 235 + }) 236 + .collect() 237 + }) 238 + .flex_1() 239 + .w_full() 240 + .track_scroll(scroll_handle), 241 + ) 242 + .into_any_element(), 243 + 244 + LibrarySection::Albums => div() 245 + .id("albums_scroll") 246 + .flex_1() 247 + .min_h_0() 248 + .overflow_y_scroll() 249 + .child( 250 + div() 251 + .w_full() 252 + .p_6() 253 + .grid() 254 + .grid_cols(album_cols) 255 + .gap_6() 256 + .children(albums.into_iter().enumerate().map( 257 + |(idx, (name, artist, _count))| { 258 + let theme = theme; 259 + div() 260 + .id(("album_card", idx)) 261 + .flex() 262 + .flex_col() 263 + .gap_y_2() 264 + .cursor_pointer() 265 + .hover(|this| this.opacity(0.8)) 266 + .child({ 267 + let mut art = div() 268 + .w_full() 269 + .rounded_lg() 270 + .bg(theme.border) 271 + .flex() 272 + .items_center() 273 + .justify_center() 274 + .text_color(theme.player_icons_text) 275 + .child(Icon::new(Icons::Music).size_8()); 276 + art.style().aspect_ratio = Some(1.0_f32); 277 + art 278 + }) 279 + .child( 280 + div() 281 + .flex() 282 + .flex_col() 283 + .gap_y_0p5() 284 + .child( 285 + div() 286 + .text_sm() 287 + .font_weight(FontWeight(500.0)) 288 + .text_color(theme.library_text) 289 + .truncate() 290 + .child(name), 291 + ) 292 + .child( 293 + div() 294 + .text_xs() 295 + .text_color(theme.library_header_text) 296 + .truncate() 297 + .child(artist), 298 + ), 299 + ) 300 + }, 301 + )), 302 + ) 303 + .into_any_element(), 304 + 305 + LibrarySection::Artists => div() 306 + .id("artists_scroll") 307 + .flex_1() 308 + .min_h_0() 309 + .overflow_y_scroll() 310 + .child( 311 + div() 312 + .w_full() 313 + .p_6() 314 + .grid() 315 + .grid_cols(artist_cols) 316 + .gap_6() 317 + .children(artists.into_iter().enumerate().map(|(idx, (name, count))| { 318 + let theme = theme; 319 + div() 320 + .id(("artist_card", idx)) 321 + .flex() 322 + .flex_col() 323 + .items_center() 324 + .gap_y_2() 325 + .cursor_pointer() 326 + .hover(|this| this.opacity(0.8)) 327 + .child({ 328 + let mut avatar = div() 329 + .w_full() 330 + .rounded_full() 331 + .bg(theme.border) 332 + .flex() 333 + .items_center() 334 + .justify_center() 335 + .text_color(theme.player_icons_text) 336 + .child(Icon::new(Icons::Music).size_8()); 337 + avatar.style().aspect_ratio = Some(1.0_f32); 338 + avatar 339 + }) 340 + .child( 341 + div() 342 + .flex() 343 + .flex_col() 344 + .items_center() 345 + .gap_y_0p5() 346 + .child( 347 + div() 348 + .text_sm() 349 + .font_weight(FontWeight(500.0)) 350 + .text_color(theme.library_text) 351 + .truncate() 352 + .child(name), 353 + ) 354 + .child( 355 + div() 356 + .text_xs() 357 + .text_color(theme.library_header_text) 358 + .child(format!("{count} tracks")), 359 + ), 360 + ) 361 + })), 362 + ) 363 + .into_any_element(), 364 + }; 365 + 31 366 div() 32 367 .size_full() 33 368 .flex() 34 369 .flex_col() 35 370 .bg(theme.library_bg) 371 + .on_mouse_down(MouseButton::Left, |_, window, _| window.blur()) 36 372 .child( 37 373 div() 374 + .flex_1() 375 + .min_h_0() 38 376 .w_full() 39 - .flex_shrink_0() 40 377 .flex() 41 - .items_center() 42 - .px_6() 43 - .py_4() 44 - .border_b_1() 45 - .border_color(theme.library_table_border) 46 - .child( 47 - div() 48 - .w(px(32.0)) 49 - .text_xs() 50 - .font_weight(FontWeight::MEDIUM) 51 - .text_color(theme.library_header_text) 52 - .child("#"), 53 - ) 54 - .child( 55 - div() 56 - .flex_1() 57 - .text_xs() 58 - .font_weight(FontWeight::MEDIUM) 59 - .text_color(theme.library_header_text) 60 - .child("TITLE"), 61 - ) 62 - .child( 63 - div() 64 - .w_48() 65 - .text_xs() 66 - .font_weight(FontWeight::MEDIUM) 67 - .text_color(theme.library_header_text) 68 - .child("ARTIST"), 69 - ) 378 + .overflow_hidden() 379 + // Sidebar 70 380 .child( 71 381 div() 72 - .w_48() 73 - .text_xs() 74 - .font_weight(FontWeight::MEDIUM) 75 - .text_color(theme.library_header_text) 76 - .child("ALBUM"), 382 + .w(px(200.0)) 383 + .h_full() 384 + .flex_shrink_0() 385 + .flex() 386 + .flex_col() 387 + .border_r_1() 388 + .border_color(theme.library_table_border) 389 + .pt_4() 390 + // Search input 391 + .child(self.search_input.clone()) 392 + .gap_y_1() 393 + .child(make_nav_item("Songs", LibrarySection::Songs)) 394 + .child(make_nav_item("Albums", LibrarySection::Albums)) 395 + .child(make_nav_item("Artists", LibrarySection::Artists)), 77 396 ) 78 - .child( 79 - div() 80 - .w_16() 81 - .text_xs() 82 - .font_weight(FontWeight::MEDIUM) 83 - .text_color(theme.library_header_text) 84 - .child("TIME"), 85 - ), 86 - ) 87 - .child( 88 - uniform_list("library_tracks", n, move |range, _window, cx| { 89 - let theme = *cx.global::<Theme>(); 90 - let state = cx.global::<Controller>().state.read(cx); 91 - let current_idx = state.current_idx; 92 - 93 - range 94 - .map(|idx| { 95 - let track = &state.tracks[idx]; 96 - let is_current = current_idx == Some(idx); 97 - 98 - div() 99 - .id(("track_row", idx)) 100 - .w_full() 101 - .flex() 102 - .items_center() 103 - .px_6() 104 - .py_3() 105 - .border_b_1() 106 - .border_color(theme.library_track_border) 107 - .cursor_pointer() 108 - .hover(|this| this.bg(theme.library_track_bg_hover)) 109 - .when(is_current, |this| { 110 - this.bg(theme.library_track_bg_active) 111 - .border_l_2() 112 - .border_b_2() 113 - .border_color(theme.switcher_active) 114 - }) 115 - .on_click(move |_, _, cx: &mut App| { 116 - let state = cx.global::<Controller>().state.clone(); 117 - state.update(cx, |s: &mut crate::state::AppState, _| s.play_track(idx)); 118 - }) 119 - .child( 120 - div() 121 - .w(px(32.0)) 122 - .text_sm() 123 - .text_color(theme.library_header_text) 124 - .child(track.track_number.to_string()), 125 - ) 126 - .child( 127 - div() 128 - .flex_1() 129 - .text_sm() 130 - .truncate() 131 - .text_color(if is_current { 132 - theme.library_track_title_active 133 - } else { 134 - theme.library_text 135 - }) 136 - .font_weight(if is_current { 137 - FontWeight(600.0) 138 - } else { 139 - FontWeight(400.0) 140 - }) 141 - .child(track.title.clone()), 142 - ) 143 - .child( 144 - div() 145 - .w_48() 146 - .text_sm() 147 - .truncate() 148 - .text_color(theme.library_header_text) 149 - .child(track.artist.clone()), 150 - ) 151 - .child( 152 - div() 153 - .w_48() 154 - .text_sm() 155 - .truncate() 156 - .text_color(theme.library_header_text) 157 - .child(track.album.clone()), 158 - ) 159 - .child( 160 - div() 161 - .w_16() 162 - .text_sm() 163 - .text_color(theme.library_header_text) 164 - .child(format_duration(track.duration)), 165 - ) 166 - }) 167 - .collect() 168 - }) 169 - .flex_1() 170 - .w_full() 171 - .track_scroll(scroll_handle), 397 + // Content area 398 + .child(content), 172 399 ) 173 400 .child(self.miniplayer.clone()) 174 401 }
+22 -11
gpui/src/ui/components/pages/player.rs
··· 2 2 use crate::state::PlaybackStatus; 3 3 use crate::ui::components::controlbar::ControlBar; 4 4 use crate::ui::components::icons::{Icon, Icons}; 5 - use gpui::px; 6 5 use crate::ui::theme::Theme; 7 6 use gpui::prelude::FluentBuilder; 7 + use gpui::px; 8 8 use gpui::{ 9 - App, Context, Entity, FontWeight, IntoElement, InteractiveElement, ParentElement, 10 - Render, StatefulInteractiveElement, Styled, Window, div, 9 + div, App, Context, Entity, FontWeight, InteractiveElement, IntoElement, ParentElement, Render, 10 + StatefulInteractiveElement, Styled, Window, 11 11 }; 12 12 13 13 pub struct PlayerPage { ··· 130 130 }) 131 131 .on_click(|_, _, cx: &mut App| { 132 132 let state = cx.global::<Controller>().state.clone(); 133 - state.update(cx, |s: &mut crate::state::AppState, _| s.toggle_shuffle()); 133 + state.update(cx, |s: &mut crate::state::AppState, _| { 134 + s.toggle_shuffle() 135 + }); 134 136 }) 135 137 .child(Icon::new(Icons::Shuffle).size_4()), 136 138 ) ··· 150 152 }) 151 153 .on_click(|_, _, cx: &mut App| { 152 154 let state = cx.global::<Controller>().state.clone(); 153 - state.update(cx, |s: &mut crate::state::AppState, _| s.prev()); 155 + state.update(cx, |s: &mut crate::state::AppState, _| { 156 + s.prev() 157 + }); 154 158 }) 155 159 .child(Icon::new(Icons::Prev).size_4()), 156 160 ) ··· 168 172 .text_color(theme.player_play_pause_text) 169 173 .on_click(|_, _, cx: &mut App| { 170 174 let state = cx.global::<Controller>().state.clone(); 171 - state.update(cx, |s: &mut crate::state::AppState, _| match s.status { 172 - PlaybackStatus::Playing => s.pause(), 173 - _ => s.play(), 174 - }); 175 + state.update( 176 + cx, 177 + |s: &mut crate::state::AppState, _| match s.status { 178 + PlaybackStatus::Playing => s.pause(), 179 + _ => s.play(), 180 + }, 181 + ); 175 182 }) 176 183 .child(if is_playing { 177 184 Icon::new(Icons::Pause).size_5() ··· 195 202 }) 196 203 .on_click(|_, _, cx: &mut App| { 197 204 let state = cx.global::<Controller>().state.clone(); 198 - state.update(cx, |s: &mut crate::state::AppState, _| s.next()); 205 + state.update(cx, |s: &mut crate::state::AppState, _| { 206 + s.next() 207 + }); 199 208 }) 200 209 .child(Icon::new(Icons::Next).size_4()), 201 210 ) ··· 219 228 }) 220 229 .on_click(|_, _, cx: &mut App| { 221 230 let state = cx.global::<Controller>().state.clone(); 222 - state.update(cx, |s: &mut crate::state::AppState, _| s.toggle_repeat()); 231 + state.update(cx, |s: &mut crate::state::AppState, _| { 232 + s.toggle_repeat() 233 + }); 223 234 }) 224 235 .child(Icon::new(Icons::Repeat).size_4()), 225 236 ),
+5 -3
gpui/src/ui/components/pages/queue.rs
··· 4 4 use crate::ui::theme::Theme; 5 5 use gpui::prelude::FluentBuilder; 6 6 use gpui::{ 7 - App, AppContext, Entity, FontWeight, InteractiveElement, IntoElement, ParentElement, Render, 8 - StatefulInteractiveElement, Styled, UniformListScrollHandle, Window, div, px, uniform_list, 7 + div, px, uniform_list, App, AppContext, Entity, FontWeight, InteractiveElement, IntoElement, 8 + ParentElement, Render, StatefulInteractiveElement, Styled, UniformListScrollHandle, Window, 9 9 }; 10 10 11 11 pub struct QueuePage { ··· 89 89 }) 90 90 .on_click(move |_, _, cx: &mut App| { 91 91 let state = cx.global::<Controller>().state.clone(); 92 - state.update(cx, |s: &mut crate::state::AppState, _| s.play_track(track_idx)); 92 + state.update(cx, |s: &mut crate::state::AppState, _| { 93 + s.play_track(track_idx) 94 + }); 93 95 }) 94 96 .child( 95 97 div()
+107
gpui/src/ui/components/search_input.rs
··· 1 + use crate::ui::components::icons::{Icon, Icons}; 2 + use crate::ui::theme::Theme; 3 + use gpui::{ 4 + div, App, Context, FocusHandle, InteractiveElement, IntoElement, KeyDownEvent, ParentElement, 5 + Render, StatefulInteractiveElement, Styled, Subscription, Window, 6 + }; 7 + 8 + pub struct SearchInput { 9 + pub query: String, 10 + pub focus_handle: FocusHandle, 11 + _focus_out_sub: Option<Subscription>, 12 + } 13 + 14 + impl SearchInput { 15 + pub fn new(cx: &mut App) -> Self { 16 + SearchInput { 17 + query: String::new(), 18 + focus_handle: cx.focus_handle(), 19 + _focus_out_sub: None, 20 + } 21 + } 22 + } 23 + 24 + impl Render for SearchInput { 25 + fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement { 26 + let theme = *cx.global::<Theme>(); 27 + let is_focused = self.focus_handle.is_focused(window); 28 + 29 + if self._focus_out_sub.is_none() { 30 + let handle = self.focus_handle.clone(); 31 + self._focus_out_sub = Some(cx.on_focus_out(&handle, window, |_, _, _, cx| { 32 + cx.notify(); 33 + })); 34 + } 35 + 36 + let display = if self.query.is_empty() && !is_focused { 37 + "Search...".to_string() 38 + } else { 39 + self.query.clone() 40 + }; 41 + let text_color = if self.query.is_empty() && !is_focused { 42 + theme.library_header_text 43 + } else { 44 + theme.library_text 45 + }; 46 + 47 + div() 48 + .id("search_input_box") 49 + .key_context("SearchInput") 50 + .track_focus(&self.focus_handle) 51 + .on_click(cx.listener(|this, _, window, _cx| { 52 + window.focus(&this.focus_handle); 53 + })) 54 + .on_key_down(cx.listener(|this, event: &KeyDownEvent, _window, cx| { 55 + let key = event.keystroke.key.as_str(); 56 + if key == "backspace" { 57 + this.query.pop(); 58 + cx.notify(); 59 + } else if key == "escape" { 60 + this.query.clear(); 61 + cx.notify(); 62 + } else if !event.keystroke.modifiers.platform && !event.keystroke.modifiers.control 63 + { 64 + if let Some(c) = &event.keystroke.key_char { 65 + this.query.push_str(c); 66 + cx.notify(); 67 + } 68 + } 69 + })) 70 + .mx_3() 71 + .mb_4() 72 + .px_3() 73 + .py_2() 74 + .rounded_lg() 75 + .bg(theme.switcher_bg) 76 + .border_1() 77 + .border_color(if is_focused { 78 + theme.switcher_active 79 + } else { 80 + theme.border 81 + }) 82 + .flex() 83 + .items_center() 84 + .gap_x_2() 85 + .cursor_pointer() 86 + .child( 87 + div() 88 + .text_color(if is_focused { 89 + theme.library_text 90 + } else { 91 + theme.library_header_text 92 + }) 93 + .child(Icon::new(Icons::Search).size_3()), 94 + ) 95 + .child( 96 + div() 97 + .flex_1() 98 + .text_sm() 99 + .text_color(text_color) 100 + .child(if is_focused { 101 + format!("{display}|") 102 + } else { 103 + display 104 + }), 105 + ) 106 + } 107 + }
+2 -2
gpui/src/ui/components/titlebar.rs
··· 2 2 use crate::ui::components::icons::{Icon, Icons}; 3 3 use crate::ui::theme::Theme; 4 4 use gpui::{ 5 - App, AppContext, Context, Entity, InteractiveElement, IntoElement, ParentElement, Render, 6 - Styled, Window, WindowControlArea, div, white, 5 + div, white, App, AppContext, Context, Entity, InteractiveElement, IntoElement, ParentElement, 6 + Render, Styled, Window, WindowControlArea, 7 7 }; 8 8 9 9 #[derive(Clone)]
+3 -3
gpui/src/ui/global_keybinds.rs
··· 1 + use crate::controller::Controller; 1 2 use crate::state::PlaybackStatus; 2 3 use crate::ui::components::Page; 3 - use crate::controller::Controller; 4 - use gpui::{App, KeyBinding, actions}; 4 + use gpui::{actions, App, KeyBinding}; 5 5 6 6 actions!(player, [PlayPause, Next, Prev, Shuffle, Repeat]); 7 7 actions!(pages, [CycleNext, CyclePrev, Library, Player, Queue]); 8 8 9 9 pub fn register_keybinds(cx: &mut App) { 10 10 cx.bind_keys([ 11 - KeyBinding::new("space", PlayPause, None), 11 + KeyBinding::new("space", PlayPause, Some("! SearchInput")), 12 12 KeyBinding::new("cmd-right", Next, None), 13 13 KeyBinding::new("cmd-left", Prev, None), 14 14 KeyBinding::new("shift-s", Shuffle, None),
+9 -7
gpui/src/ui/rockbox.rs
··· 1 1 use crate::ui::animations::ease_in_out_expo; 2 + use crate::ui::components::controlbar::ControlBar; 2 3 use crate::ui::components::pages::{library::LibraryPage, player::PlayerPage, queue::QueuePage}; 3 4 use crate::ui::components::titlebar::Titlebar; 4 - use crate::ui::components::controlbar::ControlBar; 5 5 use crate::ui::components::Page; 6 - use crate::ui::theme::Theme; 7 6 use crate::ui::global_keybinds; 7 + use crate::ui::theme::Theme; 8 8 use gpui::prelude::FluentBuilder; 9 9 use gpui::{ 10 - Animation, AnimationExt as _, AppContext, Context, ElementId, Entity, InteractiveElement, 11 - IntoElement, ParentElement, Render, Styled, Window, div, px, 10 + div, px, Animation, AnimationExt as _, AppContext, Context, ElementId, Entity, 11 + InteractiveElement, IntoElement, ParentElement, Render, Styled, Window, 12 12 }; 13 13 14 14 pub struct Rockbox { ··· 49 49 _ => 0.0, 50 50 }; 51 51 let page_el = match page { 52 - Page::Player => div().w_full().h_full().child(self.player_page.clone()), 53 - Page::Library => div().w_full().h_full().child(self.library_page.clone()), 54 - Page::Queue => div().w_full().h_full().child(self.queue_page.clone()), 52 + Page::Player => div().w_full().h_full().min_h_0().child(self.player_page.clone()), 53 + Page::Library => div().w_full().h_full().min_h_0().child(self.library_page.clone()), 54 + Page::Queue => div().w_full().h_full().min_h_0().child(self.queue_page.clone()), 55 55 }; 56 56 div() 57 57 .id("root") ··· 67 67 .id("page_container") 68 68 .w_full() 69 69 .flex_1() 70 + .min_h_0() 71 + .overflow_hidden() 70 72 .map(move |this| { 71 73 if prev_page == page { 72 74 this.child(page_el).into_any_element()
+1 -1
gpui/src/ui/theme.rs
··· 1 - use gpui::{Rgba, rgb, rgba}; 1 + use gpui::{rgb, rgba, Rgba}; 2 2 3 3 #[allow(dead_code)] 4 4 #[derive(Clone, Copy, Debug)]