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.

Merge pull request #131 from tsirysndr/feat/macos-media-controls

feat: add support for media controls on macos

authored by

Tsiry Sandratraina and committed by
GitHub
39036dc2 0ba60ce8

+9415 -32
+990 -24
Cargo.lock
··· 13 13 ] 14 14 15 15 [[package]] 16 + name = "ab_glyph" 17 + version = "0.2.32" 18 + source = "registry+https://github.com/rust-lang/crates.io-index" 19 + checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2" 20 + dependencies = [ 21 + "ab_glyph_rasterizer", 22 + "owned_ttf_parser", 23 + ] 24 + 25 + [[package]] 26 + name = "ab_glyph_rasterizer" 27 + version = "0.1.10" 28 + source = "registry+https://github.com/rust-lang/crates.io-index" 29 + checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" 30 + 31 + [[package]] 16 32 name = "actix" 17 33 version = "0.13.5" 18 34 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 416 432 checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" 417 433 418 434 [[package]] 435 + name = "android-activity" 436 + version = "0.6.0" 437 + source = "registry+https://github.com/rust-lang/crates.io-index" 438 + checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" 439 + dependencies = [ 440 + "android-properties", 441 + "bitflags 2.6.0", 442 + "cc", 443 + "cesu8", 444 + "jni", 445 + "jni-sys", 446 + "libc", 447 + "log", 448 + "ndk", 449 + "ndk-context", 450 + "ndk-sys 0.6.0+11769913", 451 + "num_enum", 452 + "thiserror 1.0.63", 453 + ] 454 + 455 + [[package]] 456 + name = "android-properties" 457 + version = "0.2.2" 458 + source = "registry+https://github.com/rust-lang/crates.io-index" 459 + checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" 460 + 461 + [[package]] 419 462 name = "android-tzdata" 420 463 version = "0.1.1" 421 464 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 512 555 ] 513 556 514 557 [[package]] 558 + name = "arrayref" 559 + version = "0.3.9" 560 + source = "registry+https://github.com/rust-lang/crates.io-index" 561 + checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" 562 + 563 + [[package]] 515 564 name = "arrayvec" 516 565 version = "0.7.6" 517 566 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 519 568 dependencies = [ 520 569 "serde", 521 570 ] 571 + 572 + [[package]] 573 + name = "as-raw-xcb-connection" 574 + version = "1.0.1" 575 + source = "registry+https://github.com/rust-lang/crates.io-index" 576 + checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" 522 577 523 578 [[package]] 524 579 name = "ascii_utils" ··· 791 846 "futures-lite", 792 847 "parking", 793 848 "polling 3.7.3", 794 - "rustix", 849 + "rustix 0.38.42", 795 850 "slab", 796 851 "tracing", 797 852 "windows-sys 0.59.0", ··· 823 878 "cfg-if 1.0.0", 824 879 "event-listener 5.3.1", 825 880 "futures-lite", 826 - "rustix", 881 + "rustix 0.38.42", 827 882 "tracing", 828 883 ] 829 884 ··· 850 905 "cfg-if 1.0.0", 851 906 "futures-core", 852 907 "futures-io", 853 - "rustix", 908 + "rustix 0.38.42", 854 909 "signal-hook-registry", 855 910 "slab", 856 911 "windows-sys 0.59.0", ··· 1286 1341 ] 1287 1342 1288 1343 [[package]] 1344 + name = "block2" 1345 + version = "0.5.1" 1346 + source = "registry+https://github.com/rust-lang/crates.io-index" 1347 + checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" 1348 + dependencies = [ 1349 + "objc2", 1350 + ] 1351 + 1352 + [[package]] 1289 1353 name = "blocking" 1290 1354 version = "1.6.1" 1291 1355 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1418 1482 "glib-sys", 1419 1483 "libc", 1420 1484 "system-deps 7.0.3", 1485 + ] 1486 + 1487 + [[package]] 1488 + name = "calloop" 1489 + version = "0.13.0" 1490 + source = "registry+https://github.com/rust-lang/crates.io-index" 1491 + checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" 1492 + dependencies = [ 1493 + "bitflags 2.6.0", 1494 + "log", 1495 + "polling 3.7.3", 1496 + "rustix 0.38.42", 1497 + "slab", 1498 + "thiserror 1.0.63", 1499 + ] 1500 + 1501 + [[package]] 1502 + name = "calloop-wayland-source" 1503 + version = "0.3.0" 1504 + source = "registry+https://github.com/rust-lang/crates.io-index" 1505 + checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" 1506 + dependencies = [ 1507 + "calloop", 1508 + "rustix 0.38.42", 1509 + "wayland-backend", 1510 + "wayland-client", 1421 1511 ] 1422 1512 1423 1513 [[package]] ··· 1481 1571 checksum = "4f4c707c6a209cbe82d10abd08e1ea8995e9ea937d2550646e02798948992be0" 1482 1572 1483 1573 [[package]] 1574 + name = "cesu8" 1575 + version = "1.1.0" 1576 + source = "registry+https://github.com/rust-lang/crates.io-index" 1577 + checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" 1578 + 1579 + [[package]] 1484 1580 name = "cexpr" 1485 1581 version = "0.6.0" 1486 1582 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1675 1771 ] 1676 1772 1677 1773 [[package]] 1774 + name = "cocoa" 1775 + version = "0.24.1" 1776 + source = "registry+https://github.com/rust-lang/crates.io-index" 1777 + checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" 1778 + dependencies = [ 1779 + "bitflags 1.3.2", 1780 + "block", 1781 + "cocoa-foundation", 1782 + "core-foundation", 1783 + "core-graphics 0.22.3", 1784 + "foreign-types 0.3.2", 1785 + "libc", 1786 + "objc", 1787 + ] 1788 + 1789 + [[package]] 1790 + name = "cocoa-foundation" 1791 + version = "0.1.2" 1792 + source = "registry+https://github.com/rust-lang/crates.io-index" 1793 + checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" 1794 + dependencies = [ 1795 + "bitflags 1.3.2", 1796 + "block", 1797 + "core-foundation", 1798 + "core-graphics-types", 1799 + "libc", 1800 + "objc", 1801 + ] 1802 + 1803 + [[package]] 1678 1804 name = "codespan-reporting" 1679 1805 version = "0.11.1" 1680 1806 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1716 1842 version = "1.0.2" 1717 1843 source = "registry+https://github.com/rust-lang/crates.io-index" 1718 1844 checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" 1845 + 1846 + [[package]] 1847 + name = "combine" 1848 + version = "4.6.7" 1849 + source = "registry+https://github.com/rust-lang/crates.io-index" 1850 + checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" 1851 + dependencies = [ 1852 + "bytes", 1853 + "memchr", 1854 + ] 1719 1855 1720 1856 [[package]] 1721 1857 name = "compact_str" ··· 1813 1949 checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 1814 1950 1815 1951 [[package]] 1952 + name = "core-graphics" 1953 + version = "0.22.3" 1954 + source = "registry+https://github.com/rust-lang/crates.io-index" 1955 + checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" 1956 + dependencies = [ 1957 + "bitflags 1.3.2", 1958 + "core-foundation", 1959 + "core-graphics-types", 1960 + "foreign-types 0.3.2", 1961 + "libc", 1962 + ] 1963 + 1964 + [[package]] 1965 + name = "core-graphics" 1966 + version = "0.23.2" 1967 + source = "registry+https://github.com/rust-lang/crates.io-index" 1968 + checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" 1969 + dependencies = [ 1970 + "bitflags 1.3.2", 1971 + "core-foundation", 1972 + "core-graphics-types", 1973 + "foreign-types 0.5.0", 1974 + "libc", 1975 + ] 1976 + 1977 + [[package]] 1816 1978 name = "core-graphics-types" 1817 1979 version = "0.1.3" 1818 1980 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1930 2092 "crossterm_winapi", 1931 2093 "mio 1.0.2", 1932 2094 "parking_lot", 1933 - "rustix", 2095 + "rustix 0.38.42", 1934 2096 "serde", 1935 2097 "signal-hook", 1936 2098 "signal-hook-mio", ··· 2026 2188 ] 2027 2189 2028 2190 [[package]] 2191 + name = "cursor-icon" 2192 + version = "1.2.0" 2193 + source = "registry+https://github.com/rust-lang/crates.io-index" 2194 + checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f" 2195 + 2196 + [[package]] 2029 2197 name = "curve25519-dalek" 2030 2198 version = "4.1.3" 2031 2199 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 2132 2300 "libc", 2133 2301 "libdbus-sys", 2134 2302 "winapi", 2303 + ] 2304 + 2305 + [[package]] 2306 + name = "dbus-crossroads" 2307 + version = "0.5.3" 2308 + source = "registry+https://github.com/rust-lang/crates.io-index" 2309 + checksum = "64bff0bd181fba667660276c6b7ebdc50cff37ce593e7adf9e734f89c8f444e8" 2310 + dependencies = [ 2311 + "dbus", 2135 2312 ] 2136 2313 2137 2314 [[package]] ··· 3646 3823 "redox_users 0.5.0", 3647 3824 "windows-sys 0.59.0", 3648 3825 ] 3826 + 3827 + [[package]] 3828 + name = "dispatch" 3829 + version = "0.2.0" 3830 + source = "registry+https://github.com/rust-lang/crates.io-index" 3831 + checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" 3649 3832 3650 3833 [[package]] 3651 3834 name = "displaydoc" ··· 3665 3848 checksum = "8c97b9233581d84b8e1e689cdd3a47b6f69770084fc246e86a7f78b0d9c1d4a5" 3666 3849 3667 3850 [[package]] 3851 + name = "dlib" 3852 + version = "0.5.2" 3853 + source = "registry+https://github.com/rust-lang/crates.io-index" 3854 + checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" 3855 + dependencies = [ 3856 + "libloading 0.8.5", 3857 + ] 3858 + 3859 + [[package]] 3668 3860 name = "dlopen2" 3669 3861 version = "0.6.1" 3670 3862 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 3729 3921 version = "1.2.1" 3730 3922 source = "registry+https://github.com/rust-lang/crates.io-index" 3731 3923 checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" 3924 + 3925 + [[package]] 3926 + name = "dpi" 3927 + version = "0.1.2" 3928 + source = "registry+https://github.com/rust-lang/crates.io-index" 3929 + checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" 3732 3930 3733 3931 [[package]] 3734 3932 name = "dprint-core" ··· 4308 4506 checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" 4309 4507 dependencies = [ 4310 4508 "cfg-if 1.0.0", 4311 - "rustix", 4509 + "rustix 0.38.42", 4312 4510 "windows-sys 0.52.0", 4313 4511 ] 4314 4512 ··· 4450 4648 4451 4649 [[package]] 4452 4650 name = "foreign-types" 4651 + version = "0.3.2" 4652 + source = "registry+https://github.com/rust-lang/crates.io-index" 4653 + checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 4654 + dependencies = [ 4655 + "foreign-types-shared 0.1.1", 4656 + ] 4657 + 4658 + [[package]] 4659 + name = "foreign-types" 4453 4660 version = "0.5.0" 4454 4661 source = "registry+https://github.com/rust-lang/crates.io-index" 4455 4662 checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" 4456 4663 dependencies = [ 4457 4664 "foreign-types-macros", 4458 - "foreign-types-shared", 4665 + "foreign-types-shared 0.3.1", 4459 4666 ] 4460 4667 4461 4668 [[package]] ··· 4471 4678 4472 4679 [[package]] 4473 4680 name = "foreign-types-shared" 4681 + version = "0.1.1" 4682 + source = "registry+https://github.com/rust-lang/crates.io-index" 4683 + checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 4684 + 4685 + [[package]] 4686 + name = "foreign-types-shared" 4474 4687 version = "0.3.1" 4475 4688 source = "registry+https://github.com/rust-lang/crates.io-index" 4476 4689 checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" ··· 4518 4731 source = "registry+https://github.com/rust-lang/crates.io-index" 4519 4732 checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8" 4520 4733 dependencies = [ 4521 - "rustix", 4734 + "rustix 0.38.42", 4522 4735 "windows-sys 0.52.0", 4523 4736 ] 4524 4737 ··· 4732 4945 "typenum", 4733 4946 "version_check", 4734 4947 "zeroize", 4948 + ] 4949 + 4950 + [[package]] 4951 + name = "gethostname" 4952 + version = "1.1.0" 4953 + source = "registry+https://github.com/rust-lang/crates.io-index" 4954 + checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8" 4955 + dependencies = [ 4956 + "rustix 1.1.2", 4957 + "windows-link", 4735 4958 ] 4736 4959 4737 4960 [[package]] ··· 6103 6326 checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" 6104 6327 6105 6328 [[package]] 6329 + name = "jni" 6330 + version = "0.21.1" 6331 + source = "registry+https://github.com/rust-lang/crates.io-index" 6332 + checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" 6333 + dependencies = [ 6334 + "cesu8", 6335 + "cfg-if 1.0.0", 6336 + "combine", 6337 + "jni-sys", 6338 + "log", 6339 + "thiserror 1.0.63", 6340 + "walkdir", 6341 + "windows-sys 0.45.0", 6342 + ] 6343 + 6344 + [[package]] 6106 6345 name = "jni-sys" 6107 6346 version = "0.3.0" 6108 6347 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 6317 6556 6318 6557 [[package]] 6319 6558 name = "libc" 6320 - version = "0.2.169" 6559 + version = "0.2.178" 6321 6560 source = "registry+https://github.com/rust-lang/crates.io-index" 6322 - checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" 6561 + checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" 6323 6562 6324 6563 [[package]] 6325 6564 name = "libdbus-sys" ··· 6412 6651 dependencies = [ 6413 6652 "bitflags 2.6.0", 6414 6653 "libc", 6415 - "redox_syscall", 6654 + "redox_syscall 0.5.3", 6416 6655 ] 6417 6656 6418 6657 [[package]] ··· 6469 6708 checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" 6470 6709 6471 6710 [[package]] 6711 + name = "linux-raw-sys" 6712 + version = "0.11.0" 6713 + source = "registry+https://github.com/rust-lang/crates.io-index" 6714 + checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" 6715 + 6716 + [[package]] 6472 6717 name = "litemap" 6473 6718 version = "0.7.4" 6474 6719 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 6759 7004 "bitflags 2.6.0", 6760 7005 "block", 6761 7006 "core-graphics-types", 6762 - "foreign-types", 7007 + "foreign-types 0.5.0", 6763 7008 "log", 6764 7009 "objc", 6765 7010 "paste", ··· 6974 7219 ] 6975 7220 6976 7221 [[package]] 7222 + name = "ndk" 7223 + version = "0.9.0" 7224 + source = "registry+https://github.com/rust-lang/crates.io-index" 7225 + checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" 7226 + dependencies = [ 7227 + "bitflags 2.6.0", 7228 + "jni-sys", 7229 + "log", 7230 + "ndk-sys 0.6.0+11769913", 7231 + "num_enum", 7232 + "raw-window-handle", 7233 + "thiserror 1.0.63", 7234 + ] 7235 + 7236 + [[package]] 7237 + name = "ndk-context" 7238 + version = "0.1.1" 7239 + source = "registry+https://github.com/rust-lang/crates.io-index" 7240 + checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" 7241 + 7242 + [[package]] 6977 7243 name = "ndk-sys" 6978 7244 version = "0.5.0+25.2.9519653" 6979 7245 source = "registry+https://github.com/rust-lang/crates.io-index" 6980 7246 checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" 7247 + dependencies = [ 7248 + "jni-sys", 7249 + ] 7250 + 7251 + [[package]] 7252 + name = "ndk-sys" 7253 + version = "0.6.0+11769913" 7254 + source = "registry+https://github.com/rust-lang/crates.io-index" 7255 + checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" 6981 7256 dependencies = [ 6982 7257 "jni-sys", 6983 7258 ] ··· 7272 7547 ] 7273 7548 7274 7549 [[package]] 7550 + name = "num_enum" 7551 + version = "0.7.5" 7552 + source = "registry+https://github.com/rust-lang/crates.io-index" 7553 + checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" 7554 + dependencies = [ 7555 + "num_enum_derive", 7556 + "rustversion", 7557 + ] 7558 + 7559 + [[package]] 7560 + name = "num_enum_derive" 7561 + version = "0.7.5" 7562 + source = "registry+https://github.com/rust-lang/crates.io-index" 7563 + checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" 7564 + dependencies = [ 7565 + "proc-macro-crate", 7566 + "proc-macro2", 7567 + "quote", 7568 + "syn 2.0.91", 7569 + ] 7570 + 7571 + [[package]] 7275 7572 name = "num_threads" 7276 7573 version = "0.1.7" 7277 7574 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 7290 7587 ] 7291 7588 7292 7589 [[package]] 7590 + name = "objc-sys" 7591 + version = "0.3.5" 7592 + source = "registry+https://github.com/rust-lang/crates.io-index" 7593 + checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" 7594 + 7595 + [[package]] 7596 + name = "objc2" 7597 + version = "0.5.2" 7598 + source = "registry+https://github.com/rust-lang/crates.io-index" 7599 + checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" 7600 + dependencies = [ 7601 + "objc-sys", 7602 + "objc2-encode", 7603 + ] 7604 + 7605 + [[package]] 7606 + name = "objc2-app-kit" 7607 + version = "0.2.2" 7608 + source = "registry+https://github.com/rust-lang/crates.io-index" 7609 + checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" 7610 + dependencies = [ 7611 + "bitflags 2.6.0", 7612 + "block2", 7613 + "libc", 7614 + "objc2", 7615 + "objc2-core-data", 7616 + "objc2-core-image", 7617 + "objc2-foundation", 7618 + "objc2-quartz-core", 7619 + ] 7620 + 7621 + [[package]] 7622 + name = "objc2-cloud-kit" 7623 + version = "0.2.2" 7624 + source = "registry+https://github.com/rust-lang/crates.io-index" 7625 + checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" 7626 + dependencies = [ 7627 + "bitflags 2.6.0", 7628 + "block2", 7629 + "objc2", 7630 + "objc2-core-location", 7631 + "objc2-foundation", 7632 + ] 7633 + 7634 + [[package]] 7635 + name = "objc2-contacts" 7636 + version = "0.2.2" 7637 + source = "registry+https://github.com/rust-lang/crates.io-index" 7638 + checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" 7639 + dependencies = [ 7640 + "block2", 7641 + "objc2", 7642 + "objc2-foundation", 7643 + ] 7644 + 7645 + [[package]] 7646 + name = "objc2-core-data" 7647 + version = "0.2.2" 7648 + source = "registry+https://github.com/rust-lang/crates.io-index" 7649 + checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" 7650 + dependencies = [ 7651 + "bitflags 2.6.0", 7652 + "block2", 7653 + "objc2", 7654 + "objc2-foundation", 7655 + ] 7656 + 7657 + [[package]] 7658 + name = "objc2-core-image" 7659 + version = "0.2.2" 7660 + source = "registry+https://github.com/rust-lang/crates.io-index" 7661 + checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" 7662 + dependencies = [ 7663 + "block2", 7664 + "objc2", 7665 + "objc2-foundation", 7666 + "objc2-metal", 7667 + ] 7668 + 7669 + [[package]] 7670 + name = "objc2-core-location" 7671 + version = "0.2.2" 7672 + source = "registry+https://github.com/rust-lang/crates.io-index" 7673 + checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" 7674 + dependencies = [ 7675 + "block2", 7676 + "objc2", 7677 + "objc2-contacts", 7678 + "objc2-foundation", 7679 + ] 7680 + 7681 + [[package]] 7682 + name = "objc2-encode" 7683 + version = "4.1.0" 7684 + source = "registry+https://github.com/rust-lang/crates.io-index" 7685 + checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" 7686 + 7687 + [[package]] 7688 + name = "objc2-foundation" 7689 + version = "0.2.2" 7690 + source = "registry+https://github.com/rust-lang/crates.io-index" 7691 + checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" 7692 + dependencies = [ 7693 + "bitflags 2.6.0", 7694 + "block2", 7695 + "dispatch", 7696 + "libc", 7697 + "objc2", 7698 + ] 7699 + 7700 + [[package]] 7701 + name = "objc2-link-presentation" 7702 + version = "0.2.2" 7703 + source = "registry+https://github.com/rust-lang/crates.io-index" 7704 + checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" 7705 + dependencies = [ 7706 + "block2", 7707 + "objc2", 7708 + "objc2-app-kit", 7709 + "objc2-foundation", 7710 + ] 7711 + 7712 + [[package]] 7713 + name = "objc2-metal" 7714 + version = "0.2.2" 7715 + source = "registry+https://github.com/rust-lang/crates.io-index" 7716 + checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" 7717 + dependencies = [ 7718 + "bitflags 2.6.0", 7719 + "block2", 7720 + "objc2", 7721 + "objc2-foundation", 7722 + ] 7723 + 7724 + [[package]] 7725 + name = "objc2-quartz-core" 7726 + version = "0.2.2" 7727 + source = "registry+https://github.com/rust-lang/crates.io-index" 7728 + checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" 7729 + dependencies = [ 7730 + "bitflags 2.6.0", 7731 + "block2", 7732 + "objc2", 7733 + "objc2-foundation", 7734 + "objc2-metal", 7735 + ] 7736 + 7737 + [[package]] 7738 + name = "objc2-symbols" 7739 + version = "0.2.2" 7740 + source = "registry+https://github.com/rust-lang/crates.io-index" 7741 + checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" 7742 + dependencies = [ 7743 + "objc2", 7744 + "objc2-foundation", 7745 + ] 7746 + 7747 + [[package]] 7748 + name = "objc2-ui-kit" 7749 + version = "0.2.2" 7750 + source = "registry+https://github.com/rust-lang/crates.io-index" 7751 + checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" 7752 + dependencies = [ 7753 + "bitflags 2.6.0", 7754 + "block2", 7755 + "objc2", 7756 + "objc2-cloud-kit", 7757 + "objc2-core-data", 7758 + "objc2-core-image", 7759 + "objc2-core-location", 7760 + "objc2-foundation", 7761 + "objc2-link-presentation", 7762 + "objc2-quartz-core", 7763 + "objc2-symbols", 7764 + "objc2-uniform-type-identifiers", 7765 + "objc2-user-notifications", 7766 + ] 7767 + 7768 + [[package]] 7769 + name = "objc2-uniform-type-identifiers" 7770 + version = "0.2.2" 7771 + source = "registry+https://github.com/rust-lang/crates.io-index" 7772 + checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" 7773 + dependencies = [ 7774 + "block2", 7775 + "objc2", 7776 + "objc2-foundation", 7777 + ] 7778 + 7779 + [[package]] 7780 + name = "objc2-user-notifications" 7781 + version = "0.2.2" 7782 + source = "registry+https://github.com/rust-lang/crates.io-index" 7783 + checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" 7784 + dependencies = [ 7785 + "bitflags 2.6.0", 7786 + "block2", 7787 + "objc2", 7788 + "objc2-core-location", 7789 + "objc2-foundation", 7790 + ] 7791 + 7792 + [[package]] 7293 7793 name = "object" 7294 7794 version = "0.36.4" 7295 7795 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 7456 7956 checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" 7457 7957 7458 7958 [[package]] 7959 + name = "orbclient" 7960 + version = "0.3.49" 7961 + source = "registry+https://github.com/rust-lang/crates.io-index" 7962 + checksum = "247ad146e19b9437f8604c21f8652423595cf710ad108af40e77d3ae6e96b827" 7963 + dependencies = [ 7964 + "libredox", 7965 + ] 7966 + 7967 + [[package]] 7459 7968 name = "ordered-float" 7460 7969 version = "2.10.1" 7461 7970 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 7506 8015 checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" 7507 8016 7508 8017 [[package]] 8018 + name = "owned_ttf_parser" 8019 + version = "0.25.1" 8020 + source = "registry+https://github.com/rust-lang/crates.io-index" 8021 + checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" 8022 + dependencies = [ 8023 + "ttf-parser", 8024 + ] 8025 + 8026 + [[package]] 7509 8027 name = "ownedbytes" 7510 8028 version = "0.7.0" 7511 8029 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 7624 8142 dependencies = [ 7625 8143 "cfg-if 1.0.0", 7626 8144 "libc", 7627 - "redox_syscall", 8145 + "redox_syscall 0.5.3", 7628 8146 "smallvec", 7629 8147 "windows-targets 0.52.6", 7630 8148 ] ··· 7925 8443 "concurrent-queue", 7926 8444 "hermit-abi 0.4.0", 7927 8445 "pin-project-lite", 7928 - "rustix", 8446 + "rustix 0.38.42", 7929 8447 "tracing", 7930 8448 "windows-sys 0.59.0", 7931 8449 ] ··· 8282 8800 dependencies = [ 8283 8801 "chrono", 8284 8802 "indexmap 2.5.0", 8285 - "quick-xml", 8803 + "quick-xml 0.31.0", 8286 8804 "strip-ansi-escapes", 8287 8805 "thiserror 1.0.63", 8288 8806 "uuid", ··· 8293 8811 version = "0.31.0" 8294 8812 source = "registry+https://github.com/rust-lang/crates.io-index" 8295 8813 checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" 8814 + dependencies = [ 8815 + "memchr", 8816 + ] 8817 + 8818 + [[package]] 8819 + name = "quick-xml" 8820 + version = "0.37.5" 8821 + source = "registry+https://github.com/rust-lang/crates.io-index" 8822 + checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" 8296 8823 dependencies = [ 8297 8824 "memchr", 8298 8825 ] ··· 8591 9118 8592 9119 [[package]] 8593 9120 name = "redox_syscall" 9121 + version = "0.4.1" 9122 + source = "registry+https://github.com/rust-lang/crates.io-index" 9123 + checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" 9124 + dependencies = [ 9125 + "bitflags 1.3.2", 9126 + ] 9127 + 9128 + [[package]] 9129 + name = "redox_syscall" 8594 9130 version = "0.5.3" 8595 9131 source = "registry+https://github.com/rust-lang/crates.io-index" 8596 9132 checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" ··· 8803 9339 "log", 8804 9340 "ratatui", 8805 9341 "ron", 8806 - "rustix", 9342 + "rustix 0.38.42", 8807 9343 "serde", 8808 9344 "serde_json", 8809 9345 "serde_with", ··· 8833 9369 "prost", 8834 9370 "reqwest", 8835 9371 "rmpc", 9372 + "rockbox-controls", 8836 9373 "serde", 8837 9374 "serde_json", 8838 9375 "tokio", ··· 8877 9414 ] 8878 9415 8879 9416 [[package]] 9417 + name = "rockbox-controls" 9418 + version = "0.1.0" 9419 + dependencies = [ 9420 + "anyhow", 9421 + "prost", 9422 + "rockbox-library", 9423 + "souvlaki", 9424 + "tokio", 9425 + "tonic", 9426 + "tonic-build", 9427 + "urlencoding", 9428 + "winit", 9429 + ] 9430 + 9431 + [[package]] 8880 9432 name = "rockbox-discovery" 8881 9433 version = "0.1.0" 8882 9434 dependencies = [ ··· 9353 9905 "bitflags 2.6.0", 9354 9906 "errno 0.3.10", 9355 9907 "libc", 9356 - "linux-raw-sys", 9908 + "linux-raw-sys 0.4.14", 9909 + "windows-sys 0.59.0", 9910 + ] 9911 + 9912 + [[package]] 9913 + name = "rustix" 9914 + version = "1.1.2" 9915 + source = "registry+https://github.com/rust-lang/crates.io-index" 9916 + checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" 9917 + dependencies = [ 9918 + "bitflags 2.6.0", 9919 + "errno 0.3.10", 9920 + "libc", 9921 + "linux-raw-sys 0.11.0", 9357 9922 "windows-sys 0.59.0", 9358 9923 ] 9359 9924 ··· 9572 10137 ] 9573 10138 9574 10139 [[package]] 10140 + name = "sctk-adwaita" 10141 + version = "0.10.1" 10142 + source = "registry+https://github.com/rust-lang/crates.io-index" 10143 + checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec" 10144 + dependencies = [ 10145 + "ab_glyph", 10146 + "log", 10147 + "memmap2 0.9.5", 10148 + "smithay-client-toolkit", 10149 + "tiny-skia", 10150 + ] 10151 + 10152 + [[package]] 9575 10153 name = "sec1" 9576 10154 version = "0.7.3" 9577 10155 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 10014 10592 checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" 10015 10593 10016 10594 [[package]] 10595 + name = "smithay-client-toolkit" 10596 + version = "0.19.2" 10597 + source = "registry+https://github.com/rust-lang/crates.io-index" 10598 + checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" 10599 + dependencies = [ 10600 + "bitflags 2.6.0", 10601 + "calloop", 10602 + "calloop-wayland-source", 10603 + "cursor-icon", 10604 + "libc", 10605 + "log", 10606 + "memmap2 0.9.5", 10607 + "rustix 0.38.42", 10608 + "thiserror 1.0.63", 10609 + "wayland-backend", 10610 + "wayland-client", 10611 + "wayland-csd-frame", 10612 + "wayland-cursor", 10613 + "wayland-protocols", 10614 + "wayland-protocols-wlr", 10615 + "wayland-scanner", 10616 + "xkeysym", 10617 + ] 10618 + 10619 + [[package]] 10620 + name = "smol_str" 10621 + version = "0.2.2" 10622 + source = "registry+https://github.com/rust-lang/crates.io-index" 10623 + checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" 10624 + dependencies = [ 10625 + "serde", 10626 + ] 10627 + 10628 + [[package]] 10017 10629 name = "socket2" 10018 10630 version = "0.4.10" 10019 10631 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 10069 10681 "serde_json", 10070 10682 "unicode-id-start", 10071 10683 "url", 10684 + ] 10685 + 10686 + [[package]] 10687 + name = "souvlaki" 10688 + version = "0.8.3" 10689 + source = "registry+https://github.com/rust-lang/crates.io-index" 10690 + checksum = "5855c8f31521af07d896b852eaa9eca974ddd3211fc2ae292e58dda8eb129bc8" 10691 + dependencies = [ 10692 + "base64 0.22.1", 10693 + "block", 10694 + "cocoa", 10695 + "core-graphics 0.22.3", 10696 + "dbus", 10697 + "dbus-crossroads", 10698 + "dispatch", 10699 + "objc", 10700 + "thiserror 1.0.63", 10701 + "windows 0.44.0", 10072 10702 ] 10073 10703 10074 10704 [[package]] ··· 10354 10984 checksum = "d7beae5182595e9a8b683fa98c4317f956c9a2dec3b9716990d20023cc60c766" 10355 10985 10356 10986 [[package]] 10987 + name = "strict-num" 10988 + version = "0.1.1" 10989 + source = "registry+https://github.com/rust-lang/crates.io-index" 10990 + checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" 10991 + 10992 + [[package]] 10357 10993 name = "string_enum" 10358 10994 version = "0.4.4" 10359 10995 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 11169 11805 "cfg-if 1.0.0", 11170 11806 "fastrand", 11171 11807 "once_cell", 11172 - "rustix", 11808 + "rustix 0.38.42", 11173 11809 "windows-sys 0.59.0", 11174 11810 ] 11175 11811 ··· 11188 11824 source = "registry+https://github.com/rust-lang/crates.io-index" 11189 11825 checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" 11190 11826 dependencies = [ 11191 - "rustix", 11827 + "rustix 0.38.42", 11192 11828 "windows-sys 0.48.0", 11193 11829 ] 11194 11830 ··· 11375 12011 dependencies = [ 11376 12012 "num-conv", 11377 12013 "time-core", 12014 + ] 12015 + 12016 + [[package]] 12017 + name = "tiny-skia" 12018 + version = "0.11.4" 12019 + source = "registry+https://github.com/rust-lang/crates.io-index" 12020 + checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" 12021 + dependencies = [ 12022 + "arrayref", 12023 + "arrayvec", 12024 + "bytemuck", 12025 + "cfg-if 1.0.0", 12026 + "log", 12027 + "tiny-skia-path", 12028 + ] 12029 + 12030 + [[package]] 12031 + name = "tiny-skia-path" 12032 + version = "0.11.4" 12033 + source = "registry+https://github.com/rust-lang/crates.io-index" 12034 + checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" 12035 + dependencies = [ 12036 + "arrayref", 12037 + "bytemuck", 12038 + "strict-num", 11378 12039 ] 11379 12040 11380 12041 [[package]] ··· 11805 12466 checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 11806 12467 11807 12468 [[package]] 12469 + name = "ttf-parser" 12470 + version = "0.25.1" 12471 + source = "registry+https://github.com/rust-lang/crates.io-index" 12472 + checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" 12473 + 12474 + [[package]] 11808 12475 name = "tungstenite" 11809 12476 version = "0.21.0" 11810 12477 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 12415 13082 ] 12416 13083 12417 13084 [[package]] 13085 + name = "wayland-backend" 13086 + version = "0.3.11" 13087 + source = "registry+https://github.com/rust-lang/crates.io-index" 13088 + checksum = "673a33c33048a5ade91a6b139580fa174e19fb0d23f396dca9fa15f2e1e49b35" 13089 + dependencies = [ 13090 + "cc", 13091 + "downcast-rs", 13092 + "rustix 1.1.2", 13093 + "scoped-tls", 13094 + "smallvec", 13095 + "wayland-sys", 13096 + ] 13097 + 13098 + [[package]] 13099 + name = "wayland-client" 13100 + version = "0.31.11" 13101 + source = "registry+https://github.com/rust-lang/crates.io-index" 13102 + checksum = "c66a47e840dc20793f2264eb4b3e4ecb4b75d91c0dd4af04b456128e0bdd449d" 13103 + dependencies = [ 13104 + "bitflags 2.6.0", 13105 + "rustix 1.1.2", 13106 + "wayland-backend", 13107 + "wayland-scanner", 13108 + ] 13109 + 13110 + [[package]] 13111 + name = "wayland-csd-frame" 13112 + version = "0.3.0" 13113 + source = "registry+https://github.com/rust-lang/crates.io-index" 13114 + checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" 13115 + dependencies = [ 13116 + "bitflags 2.6.0", 13117 + "cursor-icon", 13118 + "wayland-backend", 13119 + ] 13120 + 13121 + [[package]] 13122 + name = "wayland-cursor" 13123 + version = "0.31.11" 13124 + source = "registry+https://github.com/rust-lang/crates.io-index" 13125 + checksum = "447ccc440a881271b19e9989f75726d60faa09b95b0200a9b7eb5cc47c3eeb29" 13126 + dependencies = [ 13127 + "rustix 1.1.2", 13128 + "wayland-client", 13129 + "xcursor", 13130 + ] 13131 + 13132 + [[package]] 13133 + name = "wayland-protocols" 13134 + version = "0.32.9" 13135 + source = "registry+https://github.com/rust-lang/crates.io-index" 13136 + checksum = "efa790ed75fbfd71283bd2521a1cfdc022aabcc28bdcff00851f9e4ae88d9901" 13137 + dependencies = [ 13138 + "bitflags 2.6.0", 13139 + "wayland-backend", 13140 + "wayland-client", 13141 + "wayland-scanner", 13142 + ] 13143 + 13144 + [[package]] 13145 + name = "wayland-protocols-plasma" 13146 + version = "0.3.9" 13147 + source = "registry+https://github.com/rust-lang/crates.io-index" 13148 + checksum = "a07a14257c077ab3279987c4f8bb987851bf57081b93710381daea94f2c2c032" 13149 + dependencies = [ 13150 + "bitflags 2.6.0", 13151 + "wayland-backend", 13152 + "wayland-client", 13153 + "wayland-protocols", 13154 + "wayland-scanner", 13155 + ] 13156 + 13157 + [[package]] 13158 + name = "wayland-protocols-wlr" 13159 + version = "0.3.9" 13160 + source = "registry+https://github.com/rust-lang/crates.io-index" 13161 + checksum = "efd94963ed43cf9938a090ca4f7da58eb55325ec8200c3848963e98dc25b78ec" 13162 + dependencies = [ 13163 + "bitflags 2.6.0", 13164 + "wayland-backend", 13165 + "wayland-client", 13166 + "wayland-protocols", 13167 + "wayland-scanner", 13168 + ] 13169 + 13170 + [[package]] 13171 + name = "wayland-scanner" 13172 + version = "0.31.7" 13173 + source = "registry+https://github.com/rust-lang/crates.io-index" 13174 + checksum = "54cb1e9dc49da91950bdfd8b848c49330536d9d1fb03d4bfec8cae50caa50ae3" 13175 + dependencies = [ 13176 + "proc-macro2", 13177 + "quick-xml 0.37.5", 13178 + "quote", 13179 + ] 13180 + 13181 + [[package]] 13182 + name = "wayland-sys" 13183 + version = "0.31.7" 13184 + source = "registry+https://github.com/rust-lang/crates.io-index" 13185 + checksum = "34949b42822155826b41db8e5d0c1be3a2bd296c747577a43a3e6daefc296142" 13186 + dependencies = [ 13187 + "dlib", 13188 + "log", 13189 + "once_cell", 13190 + "pkg-config", 13191 + ] 13192 + 13193 + [[package]] 12418 13194 name = "web-sys" 12419 13195 version = "0.3.76" 12420 13196 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 12532 13308 "log", 12533 13309 "metal", 12534 13310 "naga", 12535 - "ndk-sys", 13311 + "ndk-sys 0.5.0+25.2.9519653", 12536 13312 "objc", 12537 13313 "once_cell", 12538 13314 "parking_lot", ··· 12569 13345 "either", 12570 13346 "home", 12571 13347 "once_cell", 12572 - "rustix", 13348 + "rustix 0.38.42", 12573 13349 ] 12574 13350 12575 13351 [[package]] ··· 12580 13356 dependencies = [ 12581 13357 "either", 12582 13358 "home", 12583 - "rustix", 13359 + "rustix 0.38.42", 12584 13360 "winsafe", 12585 13361 ] 12586 13362 ··· 12590 13366 source = "registry+https://github.com/rust-lang/crates.io-index" 12591 13367 checksum = "372d5b87f58ec45c384ba03563b03544dc5fadc3983e434b286913f5b4a9bb6d" 12592 13368 dependencies = [ 12593 - "redox_syscall", 13369 + "redox_syscall 0.5.3", 12594 13370 "wasite", 12595 13371 "web-sys", 12596 13372 ] ··· 12644 13420 12645 13421 [[package]] 12646 13422 name = "windows" 13423 + version = "0.44.0" 13424 + source = "registry+https://github.com/rust-lang/crates.io-index" 13425 + checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" 13426 + dependencies = [ 13427 + "windows-targets 0.42.2", 13428 + ] 13429 + 13430 + [[package]] 13431 + name = "windows" 12647 13432 version = "0.52.0" 12648 13433 source = "registry+https://github.com/rust-lang/crates.io-index" 12649 13434 checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" ··· 12706 13491 ] 12707 13492 12708 13493 [[package]] 13494 + name = "windows-link" 13495 + version = "0.2.1" 13496 + source = "registry+https://github.com/rust-lang/crates.io-index" 13497 + checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" 13498 + 13499 + [[package]] 12709 13500 name = "windows-result" 12710 13501 version = "0.1.2" 12711 13502 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 12716 13507 12717 13508 [[package]] 12718 13509 name = "windows-sys" 13510 + version = "0.45.0" 13511 + source = "registry+https://github.com/rust-lang/crates.io-index" 13512 + checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 13513 + dependencies = [ 13514 + "windows-targets 0.42.2", 13515 + ] 13516 + 13517 + [[package]] 13518 + name = "windows-sys" 12719 13519 version = "0.48.0" 12720 13520 source = "registry+https://github.com/rust-lang/crates.io-index" 12721 13521 checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" ··· 12743 13543 12744 13544 [[package]] 12745 13545 name = "windows-targets" 13546 + version = "0.42.2" 13547 + source = "registry+https://github.com/rust-lang/crates.io-index" 13548 + checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 13549 + dependencies = [ 13550 + "windows_aarch64_gnullvm 0.42.2", 13551 + "windows_aarch64_msvc 0.42.2", 13552 + "windows_i686_gnu 0.42.2", 13553 + "windows_i686_msvc 0.42.2", 13554 + "windows_x86_64_gnu 0.42.2", 13555 + "windows_x86_64_gnullvm 0.42.2", 13556 + "windows_x86_64_msvc 0.42.2", 13557 + ] 13558 + 13559 + [[package]] 13560 + name = "windows-targets" 12746 13561 version = "0.48.5" 12747 13562 source = "registry+https://github.com/rust-lang/crates.io-index" 12748 13563 checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" ··· 12771 13586 "windows_x86_64_gnullvm 0.52.6", 12772 13587 "windows_x86_64_msvc 0.52.6", 12773 13588 ] 13589 + 13590 + [[package]] 13591 + name = "windows_aarch64_gnullvm" 13592 + version = "0.42.2" 13593 + source = "registry+https://github.com/rust-lang/crates.io-index" 13594 + checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 12774 13595 12775 13596 [[package]] 12776 13597 name = "windows_aarch64_gnullvm" ··· 12786 13607 12787 13608 [[package]] 12788 13609 name = "windows_aarch64_msvc" 13610 + version = "0.42.2" 13611 + source = "registry+https://github.com/rust-lang/crates.io-index" 13612 + checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 13613 + 13614 + [[package]] 13615 + name = "windows_aarch64_msvc" 12789 13616 version = "0.48.5" 12790 13617 source = "registry+https://github.com/rust-lang/crates.io-index" 12791 13618 checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" ··· 12798 13625 12799 13626 [[package]] 12800 13627 name = "windows_i686_gnu" 13628 + version = "0.42.2" 13629 + source = "registry+https://github.com/rust-lang/crates.io-index" 13630 + checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 13631 + 13632 + [[package]] 13633 + name = "windows_i686_gnu" 12801 13634 version = "0.48.5" 12802 13635 source = "registry+https://github.com/rust-lang/crates.io-index" 12803 13636 checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" ··· 12816 13649 12817 13650 [[package]] 12818 13651 name = "windows_i686_msvc" 13652 + version = "0.42.2" 13653 + source = "registry+https://github.com/rust-lang/crates.io-index" 13654 + checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 13655 + 13656 + [[package]] 13657 + name = "windows_i686_msvc" 12819 13658 version = "0.48.5" 12820 13659 source = "registry+https://github.com/rust-lang/crates.io-index" 12821 13660 checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" ··· 12828 13667 12829 13668 [[package]] 12830 13669 name = "windows_x86_64_gnu" 13670 + version = "0.42.2" 13671 + source = "registry+https://github.com/rust-lang/crates.io-index" 13672 + checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 13673 + 13674 + [[package]] 13675 + name = "windows_x86_64_gnu" 12831 13676 version = "0.48.5" 12832 13677 source = "registry+https://github.com/rust-lang/crates.io-index" 12833 13678 checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" ··· 12840 13685 12841 13686 [[package]] 12842 13687 name = "windows_x86_64_gnullvm" 13688 + version = "0.42.2" 13689 + source = "registry+https://github.com/rust-lang/crates.io-index" 13690 + checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 13691 + 13692 + [[package]] 13693 + name = "windows_x86_64_gnullvm" 12843 13694 version = "0.48.5" 12844 13695 source = "registry+https://github.com/rust-lang/crates.io-index" 12845 13696 checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" ··· 12852 13703 12853 13704 [[package]] 12854 13705 name = "windows_x86_64_msvc" 13706 + version = "0.42.2" 13707 + source = "registry+https://github.com/rust-lang/crates.io-index" 13708 + checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 13709 + 13710 + [[package]] 13711 + name = "windows_x86_64_msvc" 12855 13712 version = "0.48.5" 12856 13713 source = "registry+https://github.com/rust-lang/crates.io-index" 12857 13714 checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" ··· 12863 13720 checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 12864 13721 12865 13722 [[package]] 13723 + name = "winit" 13724 + version = "0.30.12" 13725 + source = "registry+https://github.com/rust-lang/crates.io-index" 13726 + checksum = "c66d4b9ed69c4009f6321f762d6e61ad8a2389cd431b97cb1e146812e9e6c732" 13727 + dependencies = [ 13728 + "ahash", 13729 + "android-activity", 13730 + "atomic-waker", 13731 + "bitflags 2.6.0", 13732 + "block2", 13733 + "bytemuck", 13734 + "calloop", 13735 + "cfg_aliases 0.2.1", 13736 + "concurrent-queue", 13737 + "core-foundation", 13738 + "core-graphics 0.23.2", 13739 + "cursor-icon", 13740 + "dpi", 13741 + "js-sys", 13742 + "libc", 13743 + "memmap2 0.9.5", 13744 + "ndk", 13745 + "objc2", 13746 + "objc2-app-kit", 13747 + "objc2-foundation", 13748 + "objc2-ui-kit", 13749 + "orbclient", 13750 + "percent-encoding", 13751 + "pin-project", 13752 + "raw-window-handle", 13753 + "redox_syscall 0.4.1", 13754 + "rustix 0.38.42", 13755 + "sctk-adwaita", 13756 + "smithay-client-toolkit", 13757 + "smol_str", 13758 + "tracing", 13759 + "unicode-segmentation", 13760 + "wasm-bindgen", 13761 + "wasm-bindgen-futures", 13762 + "wayland-backend", 13763 + "wayland-client", 13764 + "wayland-protocols", 13765 + "wayland-protocols-plasma", 13766 + "web-sys", 13767 + "web-time", 13768 + "windows-sys 0.52.0", 13769 + "x11-dl", 13770 + "x11rb", 13771 + "xkbcommon-dl", 13772 + ] 13773 + 13774 + [[package]] 12866 13775 name = "winnow" 12867 13776 version = "0.6.20" 12868 13777 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 12943 13852 ] 12944 13853 12945 13854 [[package]] 13855 + name = "x11-dl" 13856 + version = "2.21.0" 13857 + source = "registry+https://github.com/rust-lang/crates.io-index" 13858 + checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" 13859 + dependencies = [ 13860 + "libc", 13861 + "once_cell", 13862 + "pkg-config", 13863 + ] 13864 + 13865 + [[package]] 13866 + name = "x11rb" 13867 + version = "0.13.2" 13868 + source = "registry+https://github.com/rust-lang/crates.io-index" 13869 + checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414" 13870 + dependencies = [ 13871 + "as-raw-xcb-connection", 13872 + "gethostname", 13873 + "libc", 13874 + "libloading 0.8.5", 13875 + "once_cell", 13876 + "rustix 1.1.2", 13877 + "x11rb-protocol", 13878 + ] 13879 + 13880 + [[package]] 13881 + name = "x11rb-protocol" 13882 + version = "0.13.2" 13883 + source = "registry+https://github.com/rust-lang/crates.io-index" 13884 + checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" 13885 + 13886 + [[package]] 12946 13887 name = "x25519-dalek" 12947 13888 version = "2.0.1" 12948 13889 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 12978 13919 checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" 12979 13920 dependencies = [ 12980 13921 "libc", 12981 - "linux-raw-sys", 12982 - "rustix", 13922 + "linux-raw-sys 0.4.14", 13923 + "rustix 0.38.42", 12983 13924 ] 12984 13925 12985 13926 [[package]] 13927 + name = "xcursor" 13928 + version = "0.3.10" 13929 + source = "registry+https://github.com/rust-lang/crates.io-index" 13930 + checksum = "bec9e4a500ca8864c5b47b8b482a73d62e4237670e5b5f1d6b9e3cae50f28f2b" 13931 + 13932 + [[package]] 12986 13933 name = "xdg-home" 12987 13934 version = "1.3.0" 12988 13935 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 12991 13938 "libc", 12992 13939 "windows-sys 0.59.0", 12993 13940 ] 13941 + 13942 + [[package]] 13943 + name = "xkbcommon-dl" 13944 + version = "0.4.2" 13945 + source = "registry+https://github.com/rust-lang/crates.io-index" 13946 + checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" 13947 + dependencies = [ 13948 + "bitflags 2.6.0", 13949 + "dlib", 13950 + "log", 13951 + "once_cell", 13952 + "xkeysym", 13953 + ] 13954 + 13955 + [[package]] 13956 + name = "xkeysym" 13957 + version = "0.2.1" 13958 + source = "registry+https://github.com/rust-lang/crates.io-index" 13959 + checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" 12994 13960 12995 13961 [[package]] 12996 13962 name = "xml-rs"
+1
cli/Cargo.toml
··· 27 27 "rustls-tls", 28 28 "json", 29 29 ], default-features = false } 30 + rockbox-controls = { path = "../crates/controls"} 30 31 serde = { version = "1.0.210", features = ["derive"] } 31 32 serde_json = "1.0.128" 32 33 open = "5.3.2"
+37 -7
cli/src/cmd/start.rs
··· 24 24 match wait_for_rockboxd(port.parse()?, Some(1)) { 25 25 Ok(_) => {} 26 26 Err(_) => { 27 - let mut child = Command::new("rockboxd") 28 - .env("SDL_VIDEODRIVER", video_driver) 29 - .env("ROCKBOX_PORT", port) 30 - .env("ROCKBOX_GRAPHQL_PORT", ui_port) 31 - .env("ROCKBOX_TCP_PORT", http_port) 32 - .spawn()?; 27 + #[cfg(target_os = "linux")] 28 + { 29 + let mut child = Command::new("rockboxd") 30 + .env("SDL_VIDEODRIVER", video_driver) 31 + .env("ROCKBOX_PORT", port) 32 + .env("ROCKBOX_GRAPHQL_PORT", ui_port) 33 + .env("ROCKBOX_TCP_PORT", http_port) 34 + .spawn()?; 33 35 34 - child.wait()?; 36 + child.wait()?; 37 + } 38 + #[cfg(target_os = "macos")] 39 + { 40 + use std::thread; 41 + 42 + thread::spawn(move || { 43 + let mut child = Command::new("rockboxd") 44 + .env("SDL_VIDEODRIVER", video_driver) 45 + .env("ROCKBOX_PORT", port) 46 + .env("ROCKBOX_GRAPHQL_PORT", ui_port) 47 + .env("ROCKBOX_TCP_PORT", http_port) 48 + .spawn()?; 49 + 50 + child.wait()?; 51 + Ok::<(), Error>(()) 52 + }); 53 + 54 + let port = env::var("ROCKBOX_PORT").unwrap_or_else(|_| "6061".to_string()); 55 + wait_for_rockboxd(port.parse()?, None)?; 56 + 57 + // On macOS, EventLoop must be created on the main thread. 58 + match rockbox_controls::run_media_controls() { 59 + Ok(_) => {} 60 + Err(e) => { 61 + eprintln!("Error starting rockbox controls: {}", e); 62 + } 63 + } 64 + } 35 65 } 36 66 }; 37 67 Ok(())
+20
crates/controls/Cargo.toml
··· 1 + [package] 2 + name = "rockbox-controls" 3 + version = "0.1.0" 4 + authors.workspace = true 5 + edition.workspace = true 6 + license.workspace = true 7 + repository.workspace = true 8 + 9 + [dependencies] 10 + anyhow = "1.0.93" 11 + prost = "0.13.2" 12 + rockbox-library = {path= "../library"} 13 + tokio = {version = "1.36.0", features = ["full"]} 14 + tonic = "0.12.3" 15 + urlencoding = "2.1.3" 16 + souvlaki = "0.8.3" 17 + winit = "0.30.12" 18 + 19 + [build-dependencies] 20 + tonic-build = "0.12.3"
+19
crates/controls/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 + }
+1
crates/controls/proto
··· 1 + ../rpc/proto
+7898
crates/controls/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::http::Uri; 49 + use tonic::codegen::*; 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<http::Request<tonic::body::BoxBody>>>::Error: 94 + Into<StdError> + std::marker::Send + std::marker::Sync, 95 + { 96 + BrowseServiceClient::new(InterceptedService::new(inner, interceptor)) 97 + } 98 + /// Compress requests with the given encoding. 99 + /// 100 + /// This requires the server to support it otherwise it might respond with an 101 + /// error. 102 + #[must_use] 103 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 104 + self.inner = self.inner.send_compressed(encoding); 105 + self 106 + } 107 + /// Enable decompressing responses. 108 + #[must_use] 109 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 110 + self.inner = self.inner.accept_compressed(encoding); 111 + self 112 + } 113 + /// Limits the maximum size of a decoded message. 114 + /// 115 + /// Default: `4MB` 116 + #[must_use] 117 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 118 + self.inner = self.inner.max_decoding_message_size(limit); 119 + self 120 + } 121 + /// Limits the maximum size of an encoded message. 122 + /// 123 + /// Default: `usize::MAX` 124 + #[must_use] 125 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 126 + self.inner = self.inner.max_encoding_message_size(limit); 127 + self 128 + } 129 + pub async fn tree_get_entries( 130 + &mut self, 131 + request: impl tonic::IntoRequest<super::TreeGetEntriesRequest>, 132 + ) -> std::result::Result<tonic::Response<super::TreeGetEntriesResponse>, tonic::Status> 133 + { 134 + self.inner.ready().await.map_err(|e| { 135 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 136 + })?; 137 + let codec = tonic::codec::ProstCodec::default(); 138 + let path = http::uri::PathAndQuery::from_static( 139 + "/rockbox.v1alpha1.BrowseService/TreeGetEntries", 140 + ); 141 + let mut req = request.into_request(); 142 + req.extensions_mut().insert(GrpcMethod::new( 143 + "rockbox.v1alpha1.BrowseService", 144 + "TreeGetEntries", 145 + )); 146 + self.inner.unary(req, path, codec).await 147 + } 148 + } 149 + } 150 + /// Generated server implementations. 151 + pub mod browse_service_server { 152 + #![allow( 153 + unused_variables, 154 + dead_code, 155 + missing_docs, 156 + clippy::wildcard_imports, 157 + clippy::let_unit_value 158 + )] 159 + use tonic::codegen::*; 160 + /// Generated trait containing gRPC methods that should be implemented for use with BrowseServiceServer. 161 + #[async_trait] 162 + pub trait BrowseService: std::marker::Send + std::marker::Sync + 'static { 163 + async fn tree_get_entries( 164 + &self, 165 + request: tonic::Request<super::TreeGetEntriesRequest>, 166 + ) -> std::result::Result<tonic::Response<super::TreeGetEntriesResponse>, tonic::Status>; 167 + } 168 + #[derive(Debug)] 169 + pub struct BrowseServiceServer<T> { 170 + inner: Arc<T>, 171 + accept_compression_encodings: EnabledCompressionEncodings, 172 + send_compression_encodings: EnabledCompressionEncodings, 173 + max_decoding_message_size: Option<usize>, 174 + max_encoding_message_size: Option<usize>, 175 + } 176 + impl<T> BrowseServiceServer<T> { 177 + pub fn new(inner: T) -> Self { 178 + Self::from_arc(Arc::new(inner)) 179 + } 180 + pub fn from_arc(inner: Arc<T>) -> Self { 181 + Self { 182 + inner, 183 + accept_compression_encodings: Default::default(), 184 + send_compression_encodings: Default::default(), 185 + max_decoding_message_size: None, 186 + max_encoding_message_size: None, 187 + } 188 + } 189 + pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 190 + where 191 + F: tonic::service::Interceptor, 192 + { 193 + InterceptedService::new(Self::new(inner), interceptor) 194 + } 195 + /// Enable decompressing requests with the given encoding. 196 + #[must_use] 197 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 198 + self.accept_compression_encodings.enable(encoding); 199 + self 200 + } 201 + /// Compress responses with the given encoding, if the client supports it. 202 + #[must_use] 203 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 204 + self.send_compression_encodings.enable(encoding); 205 + self 206 + } 207 + /// Limits the maximum size of a decoded message. 208 + /// 209 + /// Default: `4MB` 210 + #[must_use] 211 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 212 + self.max_decoding_message_size = Some(limit); 213 + self 214 + } 215 + /// Limits the maximum size of an encoded message. 216 + /// 217 + /// Default: `usize::MAX` 218 + #[must_use] 219 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 220 + self.max_encoding_message_size = Some(limit); 221 + self 222 + } 223 + } 224 + impl<T, B> tonic::codegen::Service<http::Request<B>> for BrowseServiceServer<T> 225 + where 226 + T: BrowseService, 227 + B: Body + std::marker::Send + 'static, 228 + B::Error: Into<StdError> + std::marker::Send + 'static, 229 + { 230 + type Response = http::Response<tonic::body::BoxBody>; 231 + type Error = std::convert::Infallible; 232 + type Future = BoxFuture<Self::Response, Self::Error>; 233 + fn poll_ready( 234 + &mut self, 235 + _cx: &mut Context<'_>, 236 + ) -> Poll<std::result::Result<(), Self::Error>> { 237 + Poll::Ready(Ok(())) 238 + } 239 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 240 + match req.uri().path() { 241 + "/rockbox.v1alpha1.BrowseService/TreeGetEntries" => { 242 + #[allow(non_camel_case_types)] 243 + struct TreeGetEntriesSvc<T: BrowseService>(pub Arc<T>); 244 + impl<T: BrowseService> tonic::server::UnaryService<super::TreeGetEntriesRequest> 245 + for TreeGetEntriesSvc<T> 246 + { 247 + type Response = super::TreeGetEntriesResponse; 248 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 249 + fn call( 250 + &mut self, 251 + request: tonic::Request<super::TreeGetEntriesRequest>, 252 + ) -> Self::Future { 253 + let inner = Arc::clone(&self.0); 254 + let fut = async move { 255 + <T as BrowseService>::tree_get_entries(&inner, request).await 256 + }; 257 + Box::pin(fut) 258 + } 259 + } 260 + let accept_compression_encodings = self.accept_compression_encodings; 261 + let send_compression_encodings = self.send_compression_encodings; 262 + let max_decoding_message_size = self.max_decoding_message_size; 263 + let max_encoding_message_size = self.max_encoding_message_size; 264 + let inner = self.inner.clone(); 265 + let fut = async move { 266 + let method = TreeGetEntriesSvc(inner); 267 + let codec = tonic::codec::ProstCodec::default(); 268 + let mut grpc = tonic::server::Grpc::new(codec) 269 + .apply_compression_config( 270 + accept_compression_encodings, 271 + send_compression_encodings, 272 + ) 273 + .apply_max_message_size_config( 274 + max_decoding_message_size, 275 + max_encoding_message_size, 276 + ); 277 + let res = grpc.unary(method, req).await; 278 + Ok(res) 279 + }; 280 + Box::pin(fut) 281 + } 282 + _ => Box::pin(async move { 283 + let mut response = http::Response::new(empty_body()); 284 + let headers = response.headers_mut(); 285 + headers.insert( 286 + tonic::Status::GRPC_STATUS, 287 + (tonic::Code::Unimplemented as i32).into(), 288 + ); 289 + headers.insert( 290 + http::header::CONTENT_TYPE, 291 + tonic::metadata::GRPC_CONTENT_TYPE, 292 + ); 293 + Ok(response) 294 + }), 295 + } 296 + } 297 + } 298 + impl<T> Clone for BrowseServiceServer<T> { 299 + fn clone(&self) -> Self { 300 + let inner = self.inner.clone(); 301 + Self { 302 + inner, 303 + accept_compression_encodings: self.accept_compression_encodings, 304 + send_compression_encodings: self.send_compression_encodings, 305 + max_decoding_message_size: self.max_decoding_message_size, 306 + max_encoding_message_size: self.max_encoding_message_size, 307 + } 308 + } 309 + } 310 + /// Generated gRPC service name 311 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.BrowseService"; 312 + impl<T> tonic::server::NamedService for BrowseServiceServer<T> { 313 + const NAME: &'static str = SERVICE_NAME; 314 + } 315 + } 316 + #[derive(Clone, PartialEq, ::prost::Message)] 317 + pub struct Track { 318 + #[prost(string, tag = "1")] 319 + pub id: ::prost::alloc::string::String, 320 + #[prost(string, tag = "2")] 321 + pub path: ::prost::alloc::string::String, 322 + #[prost(string, tag = "3")] 323 + pub title: ::prost::alloc::string::String, 324 + #[prost(string, tag = "4")] 325 + pub artist: ::prost::alloc::string::String, 326 + #[prost(string, tag = "5")] 327 + pub album: ::prost::alloc::string::String, 328 + #[prost(string, tag = "6")] 329 + pub album_artist: ::prost::alloc::string::String, 330 + #[prost(uint32, tag = "7")] 331 + pub bitrate: u32, 332 + #[prost(string, tag = "8")] 333 + pub composer: ::prost::alloc::string::String, 334 + #[prost(uint32, tag = "9")] 335 + pub disc_number: u32, 336 + #[prost(uint32, tag = "10")] 337 + pub filesize: u32, 338 + #[prost(uint32, tag = "11")] 339 + pub frequency: u32, 340 + #[prost(uint32, tag = "12")] 341 + pub length: u32, 342 + #[prost(uint32, tag = "13")] 343 + pub track_number: u32, 344 + #[prost(uint32, tag = "14")] 345 + pub year: u32, 346 + #[prost(string, tag = "15")] 347 + pub year_string: ::prost::alloc::string::String, 348 + #[prost(string, tag = "16")] 349 + pub genre: ::prost::alloc::string::String, 350 + #[prost(string, tag = "17")] 351 + pub md5: ::prost::alloc::string::String, 352 + #[prost(string, optional, tag = "18")] 353 + pub album_art: ::core::option::Option<::prost::alloc::string::String>, 354 + #[prost(string, optional, tag = "19")] 355 + pub artist_id: ::core::option::Option<::prost::alloc::string::String>, 356 + #[prost(string, optional, tag = "20")] 357 + pub album_id: ::core::option::Option<::prost::alloc::string::String>, 358 + #[prost(string, optional, tag = "21")] 359 + pub genre_id: ::core::option::Option<::prost::alloc::string::String>, 360 + #[prost(string, tag = "22")] 361 + pub created_at: ::prost::alloc::string::String, 362 + #[prost(string, tag = "23")] 363 + pub updated_at: ::prost::alloc::string::String, 364 + } 365 + #[derive(Clone, PartialEq, ::prost::Message)] 366 + pub struct Artist { 367 + #[prost(string, tag = "1")] 368 + pub id: ::prost::alloc::string::String, 369 + #[prost(string, tag = "2")] 370 + pub name: ::prost::alloc::string::String, 371 + #[prost(string, optional, tag = "3")] 372 + pub bio: ::core::option::Option<::prost::alloc::string::String>, 373 + #[prost(string, optional, tag = "4")] 374 + pub image: ::core::option::Option<::prost::alloc::string::String>, 375 + #[prost(message, repeated, tag = "5")] 376 + pub albums: ::prost::alloc::vec::Vec<Album>, 377 + #[prost(message, repeated, tag = "6")] 378 + pub tracks: ::prost::alloc::vec::Vec<Track>, 379 + } 380 + #[derive(Clone, PartialEq, ::prost::Message)] 381 + pub struct Album { 382 + #[prost(string, tag = "1")] 383 + pub id: ::prost::alloc::string::String, 384 + #[prost(string, tag = "2")] 385 + pub title: ::prost::alloc::string::String, 386 + #[prost(string, tag = "3")] 387 + pub artist: ::prost::alloc::string::String, 388 + #[prost(uint32, tag = "4")] 389 + pub year: u32, 390 + #[prost(string, tag = "5")] 391 + pub year_string: ::prost::alloc::string::String, 392 + #[prost(string, optional, tag = "6")] 393 + pub album_art: ::core::option::Option<::prost::alloc::string::String>, 394 + #[prost(string, tag = "7")] 395 + pub md5: ::prost::alloc::string::String, 396 + #[prost(string, tag = "8")] 397 + pub artist_id: ::prost::alloc::string::String, 398 + #[prost(message, repeated, tag = "9")] 399 + pub tracks: ::prost::alloc::vec::Vec<Track>, 400 + } 401 + #[derive(Clone, PartialEq, ::prost::Message)] 402 + pub struct GetAlbumRequest { 403 + #[prost(string, tag = "1")] 404 + pub id: ::prost::alloc::string::String, 405 + } 406 + #[derive(Clone, PartialEq, ::prost::Message)] 407 + pub struct GetAlbumResponse { 408 + #[prost(message, optional, tag = "1")] 409 + pub album: ::core::option::Option<Album>, 410 + } 411 + #[derive(Clone, PartialEq, ::prost::Message)] 412 + pub struct GetArtistRequest { 413 + #[prost(string, tag = "1")] 414 + pub id: ::prost::alloc::string::String, 415 + } 416 + #[derive(Clone, PartialEq, ::prost::Message)] 417 + pub struct GetArtistResponse { 418 + #[prost(message, optional, tag = "1")] 419 + pub artist: ::core::option::Option<Artist>, 420 + } 421 + #[derive(Clone, PartialEq, ::prost::Message)] 422 + pub struct GetTrackRequest { 423 + #[prost(string, tag = "1")] 424 + pub id: ::prost::alloc::string::String, 425 + } 426 + #[derive(Clone, PartialEq, ::prost::Message)] 427 + pub struct GetTrackResponse { 428 + #[prost(message, optional, tag = "1")] 429 + pub track: ::core::option::Option<Track>, 430 + } 431 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 432 + pub struct GetAlbumsRequest {} 433 + #[derive(Clone, PartialEq, ::prost::Message)] 434 + pub struct GetAlbumsResponse { 435 + #[prost(message, repeated, tag = "1")] 436 + pub albums: ::prost::alloc::vec::Vec<Album>, 437 + } 438 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 439 + pub struct GetArtistsRequest {} 440 + #[derive(Clone, PartialEq, ::prost::Message)] 441 + pub struct GetArtistsResponse { 442 + #[prost(message, repeated, tag = "1")] 443 + pub artists: ::prost::alloc::vec::Vec<Artist>, 444 + } 445 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 446 + pub struct GetTracksRequest {} 447 + #[derive(Clone, PartialEq, ::prost::Message)] 448 + pub struct GetTracksResponse { 449 + #[prost(message, repeated, tag = "1")] 450 + pub tracks: ::prost::alloc::vec::Vec<Track>, 451 + } 452 + #[derive(Clone, PartialEq, ::prost::Message)] 453 + pub struct LikeTrackRequest { 454 + #[prost(string, tag = "1")] 455 + pub id: ::prost::alloc::string::String, 456 + } 457 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 458 + pub struct LikeTrackResponse {} 459 + #[derive(Clone, PartialEq, ::prost::Message)] 460 + pub struct LikeAlbumRequest { 461 + #[prost(string, tag = "1")] 462 + pub id: ::prost::alloc::string::String, 463 + } 464 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 465 + pub struct LikeAlbumResponse {} 466 + #[derive(Clone, PartialEq, ::prost::Message)] 467 + pub struct UnlikeTrackRequest { 468 + #[prost(string, tag = "1")] 469 + pub id: ::prost::alloc::string::String, 470 + } 471 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 472 + pub struct UnlikeTrackResponse {} 473 + #[derive(Clone, PartialEq, ::prost::Message)] 474 + pub struct UnlikeAlbumRequest { 475 + #[prost(string, tag = "1")] 476 + pub id: ::prost::alloc::string::String, 477 + } 478 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 479 + pub struct UnlikeAlbumResponse {} 480 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 481 + pub struct GetLikedTracksRequest {} 482 + #[derive(Clone, PartialEq, ::prost::Message)] 483 + pub struct GetLikedTracksResponse { 484 + #[prost(message, repeated, tag = "1")] 485 + pub tracks: ::prost::alloc::vec::Vec<Track>, 486 + } 487 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 488 + pub struct GetLikedAlbumsRequest {} 489 + #[derive(Clone, PartialEq, ::prost::Message)] 490 + pub struct GetLikedAlbumsResponse { 491 + #[prost(message, repeated, tag = "1")] 492 + pub albums: ::prost::alloc::vec::Vec<Album>, 493 + } 494 + #[derive(Clone, PartialEq, ::prost::Message)] 495 + pub struct ScanLibraryRequest { 496 + #[prost(string, optional, tag = "1")] 497 + pub path: ::core::option::Option<::prost::alloc::string::String>, 498 + } 499 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 500 + pub struct ScanLibraryResponse {} 501 + #[derive(Clone, PartialEq, ::prost::Message)] 502 + pub struct SearchRequest { 503 + #[prost(string, tag = "1")] 504 + pub term: ::prost::alloc::string::String, 505 + } 506 + #[derive(Clone, PartialEq, ::prost::Message)] 507 + pub struct SearchResponse { 508 + #[prost(message, repeated, tag = "1")] 509 + pub tracks: ::prost::alloc::vec::Vec<Track>, 510 + #[prost(message, repeated, tag = "2")] 511 + pub albums: ::prost::alloc::vec::Vec<Album>, 512 + #[prost(message, repeated, tag = "3")] 513 + pub artists: ::prost::alloc::vec::Vec<Artist>, 514 + } 515 + /// Generated client implementations. 516 + pub mod library_service_client { 517 + #![allow( 518 + unused_variables, 519 + dead_code, 520 + missing_docs, 521 + clippy::wildcard_imports, 522 + clippy::let_unit_value 523 + )] 524 + use tonic::codegen::http::Uri; 525 + use tonic::codegen::*; 526 + #[derive(Debug, Clone)] 527 + pub struct LibraryServiceClient<T> { 528 + inner: tonic::client::Grpc<T>, 529 + } 530 + impl LibraryServiceClient<tonic::transport::Channel> { 531 + /// Attempt to create a new client by connecting to a given endpoint. 532 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 533 + where 534 + D: TryInto<tonic::transport::Endpoint>, 535 + D::Error: Into<StdError>, 536 + { 537 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 538 + Ok(Self::new(conn)) 539 + } 540 + } 541 + impl<T> LibraryServiceClient<T> 542 + where 543 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 544 + T::Error: Into<StdError>, 545 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 546 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 547 + { 548 + pub fn new(inner: T) -> Self { 549 + let inner = tonic::client::Grpc::new(inner); 550 + Self { inner } 551 + } 552 + pub fn with_origin(inner: T, origin: Uri) -> Self { 553 + let inner = tonic::client::Grpc::with_origin(inner, origin); 554 + Self { inner } 555 + } 556 + pub fn with_interceptor<F>( 557 + inner: T, 558 + interceptor: F, 559 + ) -> LibraryServiceClient<InterceptedService<T, F>> 560 + where 561 + F: tonic::service::Interceptor, 562 + T::ResponseBody: Default, 563 + T: tonic::codegen::Service< 564 + http::Request<tonic::body::BoxBody>, 565 + Response = http::Response< 566 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 567 + >, 568 + >, 569 + <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 570 + Into<StdError> + std::marker::Send + std::marker::Sync, 571 + { 572 + LibraryServiceClient::new(InterceptedService::new(inner, interceptor)) 573 + } 574 + /// Compress requests with the given encoding. 575 + /// 576 + /// This requires the server to support it otherwise it might respond with an 577 + /// error. 578 + #[must_use] 579 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 580 + self.inner = self.inner.send_compressed(encoding); 581 + self 582 + } 583 + /// Enable decompressing responses. 584 + #[must_use] 585 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 586 + self.inner = self.inner.accept_compressed(encoding); 587 + self 588 + } 589 + /// Limits the maximum size of a decoded message. 590 + /// 591 + /// Default: `4MB` 592 + #[must_use] 593 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 594 + self.inner = self.inner.max_decoding_message_size(limit); 595 + self 596 + } 597 + /// Limits the maximum size of an encoded message. 598 + /// 599 + /// Default: `usize::MAX` 600 + #[must_use] 601 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 602 + self.inner = self.inner.max_encoding_message_size(limit); 603 + self 604 + } 605 + pub async fn get_albums( 606 + &mut self, 607 + request: impl tonic::IntoRequest<super::GetAlbumsRequest>, 608 + ) -> std::result::Result<tonic::Response<super::GetAlbumsResponse>, tonic::Status> { 609 + self.inner.ready().await.map_err(|e| { 610 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 611 + })?; 612 + let codec = tonic::codec::ProstCodec::default(); 613 + let path = 614 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetAlbums"); 615 + let mut req = request.into_request(); 616 + req.extensions_mut().insert(GrpcMethod::new( 617 + "rockbox.v1alpha1.LibraryService", 618 + "GetAlbums", 619 + )); 620 + self.inner.unary(req, path, codec).await 621 + } 622 + pub async fn get_artists( 623 + &mut self, 624 + request: impl tonic::IntoRequest<super::GetArtistsRequest>, 625 + ) -> std::result::Result<tonic::Response<super::GetArtistsResponse>, tonic::Status> 626 + { 627 + self.inner.ready().await.map_err(|e| { 628 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 629 + })?; 630 + let codec = tonic::codec::ProstCodec::default(); 631 + let path = 632 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetArtists"); 633 + let mut req = request.into_request(); 634 + req.extensions_mut().insert(GrpcMethod::new( 635 + "rockbox.v1alpha1.LibraryService", 636 + "GetArtists", 637 + )); 638 + self.inner.unary(req, path, codec).await 639 + } 640 + pub async fn get_tracks( 641 + &mut self, 642 + request: impl tonic::IntoRequest<super::GetTracksRequest>, 643 + ) -> std::result::Result<tonic::Response<super::GetTracksResponse>, tonic::Status> { 644 + self.inner.ready().await.map_err(|e| { 645 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 646 + })?; 647 + let codec = tonic::codec::ProstCodec::default(); 648 + let path = 649 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetTracks"); 650 + let mut req = request.into_request(); 651 + req.extensions_mut().insert(GrpcMethod::new( 652 + "rockbox.v1alpha1.LibraryService", 653 + "GetTracks", 654 + )); 655 + self.inner.unary(req, path, codec).await 656 + } 657 + pub async fn get_album( 658 + &mut self, 659 + request: impl tonic::IntoRequest<super::GetAlbumRequest>, 660 + ) -> std::result::Result<tonic::Response<super::GetAlbumResponse>, tonic::Status> { 661 + self.inner.ready().await.map_err(|e| { 662 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 663 + })?; 664 + let codec = tonic::codec::ProstCodec::default(); 665 + let path = 666 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetAlbum"); 667 + let mut req = request.into_request(); 668 + req.extensions_mut().insert(GrpcMethod::new( 669 + "rockbox.v1alpha1.LibraryService", 670 + "GetAlbum", 671 + )); 672 + self.inner.unary(req, path, codec).await 673 + } 674 + pub async fn get_artist( 675 + &mut self, 676 + request: impl tonic::IntoRequest<super::GetArtistRequest>, 677 + ) -> std::result::Result<tonic::Response<super::GetArtistResponse>, tonic::Status> { 678 + self.inner.ready().await.map_err(|e| { 679 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 680 + })?; 681 + let codec = tonic::codec::ProstCodec::default(); 682 + let path = 683 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetArtist"); 684 + let mut req = request.into_request(); 685 + req.extensions_mut().insert(GrpcMethod::new( 686 + "rockbox.v1alpha1.LibraryService", 687 + "GetArtist", 688 + )); 689 + self.inner.unary(req, path, codec).await 690 + } 691 + pub async fn get_track( 692 + &mut self, 693 + request: impl tonic::IntoRequest<super::GetTrackRequest>, 694 + ) -> std::result::Result<tonic::Response<super::GetTrackResponse>, tonic::Status> { 695 + self.inner.ready().await.map_err(|e| { 696 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 697 + })?; 698 + let codec = tonic::codec::ProstCodec::default(); 699 + let path = 700 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetTrack"); 701 + let mut req = request.into_request(); 702 + req.extensions_mut().insert(GrpcMethod::new( 703 + "rockbox.v1alpha1.LibraryService", 704 + "GetTrack", 705 + )); 706 + self.inner.unary(req, path, codec).await 707 + } 708 + pub async fn like_track( 709 + &mut self, 710 + request: impl tonic::IntoRequest<super::LikeTrackRequest>, 711 + ) -> std::result::Result<tonic::Response<super::LikeTrackResponse>, tonic::Status> { 712 + self.inner.ready().await.map_err(|e| { 713 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 714 + })?; 715 + let codec = tonic::codec::ProstCodec::default(); 716 + let path = 717 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/LikeTrack"); 718 + let mut req = request.into_request(); 719 + req.extensions_mut().insert(GrpcMethod::new( 720 + "rockbox.v1alpha1.LibraryService", 721 + "LikeTrack", 722 + )); 723 + self.inner.unary(req, path, codec).await 724 + } 725 + pub async fn unlike_track( 726 + &mut self, 727 + request: impl tonic::IntoRequest<super::UnlikeTrackRequest>, 728 + ) -> std::result::Result<tonic::Response<super::UnlikeTrackResponse>, tonic::Status> 729 + { 730 + self.inner.ready().await.map_err(|e| { 731 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 732 + })?; 733 + let codec = tonic::codec::ProstCodec::default(); 734 + let path = http::uri::PathAndQuery::from_static( 735 + "/rockbox.v1alpha1.LibraryService/UnlikeTrack", 736 + ); 737 + let mut req = request.into_request(); 738 + req.extensions_mut().insert(GrpcMethod::new( 739 + "rockbox.v1alpha1.LibraryService", 740 + "UnlikeTrack", 741 + )); 742 + self.inner.unary(req, path, codec).await 743 + } 744 + pub async fn like_album( 745 + &mut self, 746 + request: impl tonic::IntoRequest<super::LikeAlbumRequest>, 747 + ) -> std::result::Result<tonic::Response<super::LikeAlbumResponse>, tonic::Status> { 748 + self.inner.ready().await.map_err(|e| { 749 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 750 + })?; 751 + let codec = tonic::codec::ProstCodec::default(); 752 + let path = 753 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/LikeAlbum"); 754 + let mut req = request.into_request(); 755 + req.extensions_mut().insert(GrpcMethod::new( 756 + "rockbox.v1alpha1.LibraryService", 757 + "LikeAlbum", 758 + )); 759 + self.inner.unary(req, path, codec).await 760 + } 761 + pub async fn unlike_album( 762 + &mut self, 763 + request: impl tonic::IntoRequest<super::UnlikeAlbumRequest>, 764 + ) -> std::result::Result<tonic::Response<super::UnlikeAlbumResponse>, tonic::Status> 765 + { 766 + self.inner.ready().await.map_err(|e| { 767 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 768 + })?; 769 + let codec = tonic::codec::ProstCodec::default(); 770 + let path = http::uri::PathAndQuery::from_static( 771 + "/rockbox.v1alpha1.LibraryService/UnlikeAlbum", 772 + ); 773 + let mut req = request.into_request(); 774 + req.extensions_mut().insert(GrpcMethod::new( 775 + "rockbox.v1alpha1.LibraryService", 776 + "UnlikeAlbum", 777 + )); 778 + self.inner.unary(req, path, codec).await 779 + } 780 + pub async fn get_liked_tracks( 781 + &mut self, 782 + request: impl tonic::IntoRequest<super::GetLikedTracksRequest>, 783 + ) -> std::result::Result<tonic::Response<super::GetLikedTracksResponse>, tonic::Status> 784 + { 785 + self.inner.ready().await.map_err(|e| { 786 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 787 + })?; 788 + let codec = tonic::codec::ProstCodec::default(); 789 + let path = http::uri::PathAndQuery::from_static( 790 + "/rockbox.v1alpha1.LibraryService/GetLikedTracks", 791 + ); 792 + let mut req = request.into_request(); 793 + req.extensions_mut().insert(GrpcMethod::new( 794 + "rockbox.v1alpha1.LibraryService", 795 + "GetLikedTracks", 796 + )); 797 + self.inner.unary(req, path, codec).await 798 + } 799 + pub async fn get_liked_albums( 800 + &mut self, 801 + request: impl tonic::IntoRequest<super::GetLikedAlbumsRequest>, 802 + ) -> std::result::Result<tonic::Response<super::GetLikedAlbumsResponse>, tonic::Status> 803 + { 804 + self.inner.ready().await.map_err(|e| { 805 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 806 + })?; 807 + let codec = tonic::codec::ProstCodec::default(); 808 + let path = http::uri::PathAndQuery::from_static( 809 + "/rockbox.v1alpha1.LibraryService/GetLikedAlbums", 810 + ); 811 + let mut req = request.into_request(); 812 + req.extensions_mut().insert(GrpcMethod::new( 813 + "rockbox.v1alpha1.LibraryService", 814 + "GetLikedAlbums", 815 + )); 816 + self.inner.unary(req, path, codec).await 817 + } 818 + pub async fn scan_library( 819 + &mut self, 820 + request: impl tonic::IntoRequest<super::ScanLibraryRequest>, 821 + ) -> std::result::Result<tonic::Response<super::ScanLibraryResponse>, tonic::Status> 822 + { 823 + self.inner.ready().await.map_err(|e| { 824 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 825 + })?; 826 + let codec = tonic::codec::ProstCodec::default(); 827 + let path = http::uri::PathAndQuery::from_static( 828 + "/rockbox.v1alpha1.LibraryService/ScanLibrary", 829 + ); 830 + let mut req = request.into_request(); 831 + req.extensions_mut().insert(GrpcMethod::new( 832 + "rockbox.v1alpha1.LibraryService", 833 + "ScanLibrary", 834 + )); 835 + self.inner.unary(req, path, codec).await 836 + } 837 + pub async fn search( 838 + &mut self, 839 + request: impl tonic::IntoRequest<super::SearchRequest>, 840 + ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status> { 841 + self.inner.ready().await.map_err(|e| { 842 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 843 + })?; 844 + let codec = tonic::codec::ProstCodec::default(); 845 + let path = 846 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/Search"); 847 + let mut req = request.into_request(); 848 + req.extensions_mut() 849 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "Search")); 850 + self.inner.unary(req, path, codec).await 851 + } 852 + } 853 + } 854 + /// Generated server implementations. 855 + pub mod library_service_server { 856 + #![allow( 857 + unused_variables, 858 + dead_code, 859 + missing_docs, 860 + clippy::wildcard_imports, 861 + clippy::let_unit_value 862 + )] 863 + use tonic::codegen::*; 864 + /// Generated trait containing gRPC methods that should be implemented for use with LibraryServiceServer. 865 + #[async_trait] 866 + pub trait LibraryService: std::marker::Send + std::marker::Sync + 'static { 867 + async fn get_albums( 868 + &self, 869 + request: tonic::Request<super::GetAlbumsRequest>, 870 + ) -> std::result::Result<tonic::Response<super::GetAlbumsResponse>, tonic::Status>; 871 + async fn get_artists( 872 + &self, 873 + request: tonic::Request<super::GetArtistsRequest>, 874 + ) -> std::result::Result<tonic::Response<super::GetArtistsResponse>, tonic::Status>; 875 + async fn get_tracks( 876 + &self, 877 + request: tonic::Request<super::GetTracksRequest>, 878 + ) -> std::result::Result<tonic::Response<super::GetTracksResponse>, tonic::Status>; 879 + async fn get_album( 880 + &self, 881 + request: tonic::Request<super::GetAlbumRequest>, 882 + ) -> std::result::Result<tonic::Response<super::GetAlbumResponse>, tonic::Status>; 883 + async fn get_artist( 884 + &self, 885 + request: tonic::Request<super::GetArtistRequest>, 886 + ) -> std::result::Result<tonic::Response<super::GetArtistResponse>, tonic::Status>; 887 + async fn get_track( 888 + &self, 889 + request: tonic::Request<super::GetTrackRequest>, 890 + ) -> std::result::Result<tonic::Response<super::GetTrackResponse>, tonic::Status>; 891 + async fn like_track( 892 + &self, 893 + request: tonic::Request<super::LikeTrackRequest>, 894 + ) -> std::result::Result<tonic::Response<super::LikeTrackResponse>, tonic::Status>; 895 + async fn unlike_track( 896 + &self, 897 + request: tonic::Request<super::UnlikeTrackRequest>, 898 + ) -> std::result::Result<tonic::Response<super::UnlikeTrackResponse>, tonic::Status>; 899 + async fn like_album( 900 + &self, 901 + request: tonic::Request<super::LikeAlbumRequest>, 902 + ) -> std::result::Result<tonic::Response<super::LikeAlbumResponse>, tonic::Status>; 903 + async fn unlike_album( 904 + &self, 905 + request: tonic::Request<super::UnlikeAlbumRequest>, 906 + ) -> std::result::Result<tonic::Response<super::UnlikeAlbumResponse>, tonic::Status>; 907 + async fn get_liked_tracks( 908 + &self, 909 + request: tonic::Request<super::GetLikedTracksRequest>, 910 + ) -> std::result::Result<tonic::Response<super::GetLikedTracksResponse>, tonic::Status>; 911 + async fn get_liked_albums( 912 + &self, 913 + request: tonic::Request<super::GetLikedAlbumsRequest>, 914 + ) -> std::result::Result<tonic::Response<super::GetLikedAlbumsResponse>, tonic::Status>; 915 + async fn scan_library( 916 + &self, 917 + request: tonic::Request<super::ScanLibraryRequest>, 918 + ) -> std::result::Result<tonic::Response<super::ScanLibraryResponse>, tonic::Status>; 919 + async fn search( 920 + &self, 921 + request: tonic::Request<super::SearchRequest>, 922 + ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status>; 923 + } 924 + #[derive(Debug)] 925 + pub struct LibraryServiceServer<T> { 926 + inner: Arc<T>, 927 + accept_compression_encodings: EnabledCompressionEncodings, 928 + send_compression_encodings: EnabledCompressionEncodings, 929 + max_decoding_message_size: Option<usize>, 930 + max_encoding_message_size: Option<usize>, 931 + } 932 + impl<T> LibraryServiceServer<T> { 933 + pub fn new(inner: T) -> Self { 934 + Self::from_arc(Arc::new(inner)) 935 + } 936 + pub fn from_arc(inner: Arc<T>) -> Self { 937 + Self { 938 + inner, 939 + accept_compression_encodings: Default::default(), 940 + send_compression_encodings: Default::default(), 941 + max_decoding_message_size: None, 942 + max_encoding_message_size: None, 943 + } 944 + } 945 + pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 946 + where 947 + F: tonic::service::Interceptor, 948 + { 949 + InterceptedService::new(Self::new(inner), interceptor) 950 + } 951 + /// Enable decompressing requests with the given encoding. 952 + #[must_use] 953 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 954 + self.accept_compression_encodings.enable(encoding); 955 + self 956 + } 957 + /// Compress responses with the given encoding, if the client supports it. 958 + #[must_use] 959 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 960 + self.send_compression_encodings.enable(encoding); 961 + self 962 + } 963 + /// Limits the maximum size of a decoded message. 964 + /// 965 + /// Default: `4MB` 966 + #[must_use] 967 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 968 + self.max_decoding_message_size = Some(limit); 969 + self 970 + } 971 + /// Limits the maximum size of an encoded message. 972 + /// 973 + /// Default: `usize::MAX` 974 + #[must_use] 975 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 976 + self.max_encoding_message_size = Some(limit); 977 + self 978 + } 979 + } 980 + impl<T, B> tonic::codegen::Service<http::Request<B>> for LibraryServiceServer<T> 981 + where 982 + T: LibraryService, 983 + B: Body + std::marker::Send + 'static, 984 + B::Error: Into<StdError> + std::marker::Send + 'static, 985 + { 986 + type Response = http::Response<tonic::body::BoxBody>; 987 + type Error = std::convert::Infallible; 988 + type Future = BoxFuture<Self::Response, Self::Error>; 989 + fn poll_ready( 990 + &mut self, 991 + _cx: &mut Context<'_>, 992 + ) -> Poll<std::result::Result<(), Self::Error>> { 993 + Poll::Ready(Ok(())) 994 + } 995 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 996 + match req.uri().path() { 997 + "/rockbox.v1alpha1.LibraryService/GetAlbums" => { 998 + #[allow(non_camel_case_types)] 999 + struct GetAlbumsSvc<T: LibraryService>(pub Arc<T>); 1000 + impl<T: LibraryService> tonic::server::UnaryService<super::GetAlbumsRequest> for GetAlbumsSvc<T> { 1001 + type Response = super::GetAlbumsResponse; 1002 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1003 + fn call( 1004 + &mut self, 1005 + request: tonic::Request<super::GetAlbumsRequest>, 1006 + ) -> Self::Future { 1007 + let inner = Arc::clone(&self.0); 1008 + let fut = async move { 1009 + <T as LibraryService>::get_albums(&inner, request).await 1010 + }; 1011 + Box::pin(fut) 1012 + } 1013 + } 1014 + let accept_compression_encodings = self.accept_compression_encodings; 1015 + let send_compression_encodings = self.send_compression_encodings; 1016 + let max_decoding_message_size = self.max_decoding_message_size; 1017 + let max_encoding_message_size = self.max_encoding_message_size; 1018 + let inner = self.inner.clone(); 1019 + let fut = async move { 1020 + let method = GetAlbumsSvc(inner); 1021 + let codec = tonic::codec::ProstCodec::default(); 1022 + let mut grpc = tonic::server::Grpc::new(codec) 1023 + .apply_compression_config( 1024 + accept_compression_encodings, 1025 + send_compression_encodings, 1026 + ) 1027 + .apply_max_message_size_config( 1028 + max_decoding_message_size, 1029 + max_encoding_message_size, 1030 + ); 1031 + let res = grpc.unary(method, req).await; 1032 + Ok(res) 1033 + }; 1034 + Box::pin(fut) 1035 + } 1036 + "/rockbox.v1alpha1.LibraryService/GetArtists" => { 1037 + #[allow(non_camel_case_types)] 1038 + struct GetArtistsSvc<T: LibraryService>(pub Arc<T>); 1039 + impl<T: LibraryService> tonic::server::UnaryService<super::GetArtistsRequest> for GetArtistsSvc<T> { 1040 + type Response = super::GetArtistsResponse; 1041 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1042 + fn call( 1043 + &mut self, 1044 + request: tonic::Request<super::GetArtistsRequest>, 1045 + ) -> Self::Future { 1046 + let inner = Arc::clone(&self.0); 1047 + let fut = async move { 1048 + <T as LibraryService>::get_artists(&inner, request).await 1049 + }; 1050 + Box::pin(fut) 1051 + } 1052 + } 1053 + let accept_compression_encodings = self.accept_compression_encodings; 1054 + let send_compression_encodings = self.send_compression_encodings; 1055 + let max_decoding_message_size = self.max_decoding_message_size; 1056 + let max_encoding_message_size = self.max_encoding_message_size; 1057 + let inner = self.inner.clone(); 1058 + let fut = async move { 1059 + let method = GetArtistsSvc(inner); 1060 + let codec = tonic::codec::ProstCodec::default(); 1061 + let mut grpc = tonic::server::Grpc::new(codec) 1062 + .apply_compression_config( 1063 + accept_compression_encodings, 1064 + send_compression_encodings, 1065 + ) 1066 + .apply_max_message_size_config( 1067 + max_decoding_message_size, 1068 + max_encoding_message_size, 1069 + ); 1070 + let res = grpc.unary(method, req).await; 1071 + Ok(res) 1072 + }; 1073 + Box::pin(fut) 1074 + } 1075 + "/rockbox.v1alpha1.LibraryService/GetTracks" => { 1076 + #[allow(non_camel_case_types)] 1077 + struct GetTracksSvc<T: LibraryService>(pub Arc<T>); 1078 + impl<T: LibraryService> tonic::server::UnaryService<super::GetTracksRequest> for GetTracksSvc<T> { 1079 + type Response = super::GetTracksResponse; 1080 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1081 + fn call( 1082 + &mut self, 1083 + request: tonic::Request<super::GetTracksRequest>, 1084 + ) -> Self::Future { 1085 + let inner = Arc::clone(&self.0); 1086 + let fut = async move { 1087 + <T as LibraryService>::get_tracks(&inner, request).await 1088 + }; 1089 + Box::pin(fut) 1090 + } 1091 + } 1092 + let accept_compression_encodings = self.accept_compression_encodings; 1093 + let send_compression_encodings = self.send_compression_encodings; 1094 + let max_decoding_message_size = self.max_decoding_message_size; 1095 + let max_encoding_message_size = self.max_encoding_message_size; 1096 + let inner = self.inner.clone(); 1097 + let fut = async move { 1098 + let method = GetTracksSvc(inner); 1099 + let codec = tonic::codec::ProstCodec::default(); 1100 + let mut grpc = tonic::server::Grpc::new(codec) 1101 + .apply_compression_config( 1102 + accept_compression_encodings, 1103 + send_compression_encodings, 1104 + ) 1105 + .apply_max_message_size_config( 1106 + max_decoding_message_size, 1107 + max_encoding_message_size, 1108 + ); 1109 + let res = grpc.unary(method, req).await; 1110 + Ok(res) 1111 + }; 1112 + Box::pin(fut) 1113 + } 1114 + "/rockbox.v1alpha1.LibraryService/GetAlbum" => { 1115 + #[allow(non_camel_case_types)] 1116 + struct GetAlbumSvc<T: LibraryService>(pub Arc<T>); 1117 + impl<T: LibraryService> tonic::server::UnaryService<super::GetAlbumRequest> for GetAlbumSvc<T> { 1118 + type Response = super::GetAlbumResponse; 1119 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1120 + fn call( 1121 + &mut self, 1122 + request: tonic::Request<super::GetAlbumRequest>, 1123 + ) -> Self::Future { 1124 + let inner = Arc::clone(&self.0); 1125 + let fut = async move { 1126 + <T as LibraryService>::get_album(&inner, request).await 1127 + }; 1128 + Box::pin(fut) 1129 + } 1130 + } 1131 + let accept_compression_encodings = self.accept_compression_encodings; 1132 + let send_compression_encodings = self.send_compression_encodings; 1133 + let max_decoding_message_size = self.max_decoding_message_size; 1134 + let max_encoding_message_size = self.max_encoding_message_size; 1135 + let inner = self.inner.clone(); 1136 + let fut = async move { 1137 + let method = GetAlbumSvc(inner); 1138 + let codec = tonic::codec::ProstCodec::default(); 1139 + let mut grpc = tonic::server::Grpc::new(codec) 1140 + .apply_compression_config( 1141 + accept_compression_encodings, 1142 + send_compression_encodings, 1143 + ) 1144 + .apply_max_message_size_config( 1145 + max_decoding_message_size, 1146 + max_encoding_message_size, 1147 + ); 1148 + let res = grpc.unary(method, req).await; 1149 + Ok(res) 1150 + }; 1151 + Box::pin(fut) 1152 + } 1153 + "/rockbox.v1alpha1.LibraryService/GetArtist" => { 1154 + #[allow(non_camel_case_types)] 1155 + struct GetArtistSvc<T: LibraryService>(pub Arc<T>); 1156 + impl<T: LibraryService> tonic::server::UnaryService<super::GetArtistRequest> for GetArtistSvc<T> { 1157 + type Response = super::GetArtistResponse; 1158 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1159 + fn call( 1160 + &mut self, 1161 + request: tonic::Request<super::GetArtistRequest>, 1162 + ) -> Self::Future { 1163 + let inner = Arc::clone(&self.0); 1164 + let fut = async move { 1165 + <T as LibraryService>::get_artist(&inner, request).await 1166 + }; 1167 + Box::pin(fut) 1168 + } 1169 + } 1170 + let accept_compression_encodings = self.accept_compression_encodings; 1171 + let send_compression_encodings = self.send_compression_encodings; 1172 + let max_decoding_message_size = self.max_decoding_message_size; 1173 + let max_encoding_message_size = self.max_encoding_message_size; 1174 + let inner = self.inner.clone(); 1175 + let fut = async move { 1176 + let method = GetArtistSvc(inner); 1177 + let codec = tonic::codec::ProstCodec::default(); 1178 + let mut grpc = tonic::server::Grpc::new(codec) 1179 + .apply_compression_config( 1180 + accept_compression_encodings, 1181 + send_compression_encodings, 1182 + ) 1183 + .apply_max_message_size_config( 1184 + max_decoding_message_size, 1185 + max_encoding_message_size, 1186 + ); 1187 + let res = grpc.unary(method, req).await; 1188 + Ok(res) 1189 + }; 1190 + Box::pin(fut) 1191 + } 1192 + "/rockbox.v1alpha1.LibraryService/GetTrack" => { 1193 + #[allow(non_camel_case_types)] 1194 + struct GetTrackSvc<T: LibraryService>(pub Arc<T>); 1195 + impl<T: LibraryService> tonic::server::UnaryService<super::GetTrackRequest> for GetTrackSvc<T> { 1196 + type Response = super::GetTrackResponse; 1197 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1198 + fn call( 1199 + &mut self, 1200 + request: tonic::Request<super::GetTrackRequest>, 1201 + ) -> Self::Future { 1202 + let inner = Arc::clone(&self.0); 1203 + let fut = async move { 1204 + <T as LibraryService>::get_track(&inner, request).await 1205 + }; 1206 + Box::pin(fut) 1207 + } 1208 + } 1209 + let accept_compression_encodings = self.accept_compression_encodings; 1210 + let send_compression_encodings = self.send_compression_encodings; 1211 + let max_decoding_message_size = self.max_decoding_message_size; 1212 + let max_encoding_message_size = self.max_encoding_message_size; 1213 + let inner = self.inner.clone(); 1214 + let fut = async move { 1215 + let method = GetTrackSvc(inner); 1216 + let codec = tonic::codec::ProstCodec::default(); 1217 + let mut grpc = tonic::server::Grpc::new(codec) 1218 + .apply_compression_config( 1219 + accept_compression_encodings, 1220 + send_compression_encodings, 1221 + ) 1222 + .apply_max_message_size_config( 1223 + max_decoding_message_size, 1224 + max_encoding_message_size, 1225 + ); 1226 + let res = grpc.unary(method, req).await; 1227 + Ok(res) 1228 + }; 1229 + Box::pin(fut) 1230 + } 1231 + "/rockbox.v1alpha1.LibraryService/LikeTrack" => { 1232 + #[allow(non_camel_case_types)] 1233 + struct LikeTrackSvc<T: LibraryService>(pub Arc<T>); 1234 + impl<T: LibraryService> tonic::server::UnaryService<super::LikeTrackRequest> for LikeTrackSvc<T> { 1235 + type Response = super::LikeTrackResponse; 1236 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1237 + fn call( 1238 + &mut self, 1239 + request: tonic::Request<super::LikeTrackRequest>, 1240 + ) -> Self::Future { 1241 + let inner = Arc::clone(&self.0); 1242 + let fut = async move { 1243 + <T as LibraryService>::like_track(&inner, request).await 1244 + }; 1245 + Box::pin(fut) 1246 + } 1247 + } 1248 + let accept_compression_encodings = self.accept_compression_encodings; 1249 + let send_compression_encodings = self.send_compression_encodings; 1250 + let max_decoding_message_size = self.max_decoding_message_size; 1251 + let max_encoding_message_size = self.max_encoding_message_size; 1252 + let inner = self.inner.clone(); 1253 + let fut = async move { 1254 + let method = LikeTrackSvc(inner); 1255 + let codec = tonic::codec::ProstCodec::default(); 1256 + let mut grpc = tonic::server::Grpc::new(codec) 1257 + .apply_compression_config( 1258 + accept_compression_encodings, 1259 + send_compression_encodings, 1260 + ) 1261 + .apply_max_message_size_config( 1262 + max_decoding_message_size, 1263 + max_encoding_message_size, 1264 + ); 1265 + let res = grpc.unary(method, req).await; 1266 + Ok(res) 1267 + }; 1268 + Box::pin(fut) 1269 + } 1270 + "/rockbox.v1alpha1.LibraryService/UnlikeTrack" => { 1271 + #[allow(non_camel_case_types)] 1272 + struct UnlikeTrackSvc<T: LibraryService>(pub Arc<T>); 1273 + impl<T: LibraryService> tonic::server::UnaryService<super::UnlikeTrackRequest> 1274 + for UnlikeTrackSvc<T> 1275 + { 1276 + type Response = super::UnlikeTrackResponse; 1277 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1278 + fn call( 1279 + &mut self, 1280 + request: tonic::Request<super::UnlikeTrackRequest>, 1281 + ) -> Self::Future { 1282 + let inner = Arc::clone(&self.0); 1283 + let fut = async move { 1284 + <T as LibraryService>::unlike_track(&inner, request).await 1285 + }; 1286 + Box::pin(fut) 1287 + } 1288 + } 1289 + let accept_compression_encodings = self.accept_compression_encodings; 1290 + let send_compression_encodings = self.send_compression_encodings; 1291 + let max_decoding_message_size = self.max_decoding_message_size; 1292 + let max_encoding_message_size = self.max_encoding_message_size; 1293 + let inner = self.inner.clone(); 1294 + let fut = async move { 1295 + let method = UnlikeTrackSvc(inner); 1296 + let codec = tonic::codec::ProstCodec::default(); 1297 + let mut grpc = tonic::server::Grpc::new(codec) 1298 + .apply_compression_config( 1299 + accept_compression_encodings, 1300 + send_compression_encodings, 1301 + ) 1302 + .apply_max_message_size_config( 1303 + max_decoding_message_size, 1304 + max_encoding_message_size, 1305 + ); 1306 + let res = grpc.unary(method, req).await; 1307 + Ok(res) 1308 + }; 1309 + Box::pin(fut) 1310 + } 1311 + "/rockbox.v1alpha1.LibraryService/LikeAlbum" => { 1312 + #[allow(non_camel_case_types)] 1313 + struct LikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1314 + impl<T: LibraryService> tonic::server::UnaryService<super::LikeAlbumRequest> for LikeAlbumSvc<T> { 1315 + type Response = super::LikeAlbumResponse; 1316 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1317 + fn call( 1318 + &mut self, 1319 + request: tonic::Request<super::LikeAlbumRequest>, 1320 + ) -> Self::Future { 1321 + let inner = Arc::clone(&self.0); 1322 + let fut = async move { 1323 + <T as LibraryService>::like_album(&inner, request).await 1324 + }; 1325 + Box::pin(fut) 1326 + } 1327 + } 1328 + let accept_compression_encodings = self.accept_compression_encodings; 1329 + let send_compression_encodings = self.send_compression_encodings; 1330 + let max_decoding_message_size = self.max_decoding_message_size; 1331 + let max_encoding_message_size = self.max_encoding_message_size; 1332 + let inner = self.inner.clone(); 1333 + let fut = async move { 1334 + let method = LikeAlbumSvc(inner); 1335 + let codec = tonic::codec::ProstCodec::default(); 1336 + let mut grpc = tonic::server::Grpc::new(codec) 1337 + .apply_compression_config( 1338 + accept_compression_encodings, 1339 + send_compression_encodings, 1340 + ) 1341 + .apply_max_message_size_config( 1342 + max_decoding_message_size, 1343 + max_encoding_message_size, 1344 + ); 1345 + let res = grpc.unary(method, req).await; 1346 + Ok(res) 1347 + }; 1348 + Box::pin(fut) 1349 + } 1350 + "/rockbox.v1alpha1.LibraryService/UnlikeAlbum" => { 1351 + #[allow(non_camel_case_types)] 1352 + struct UnlikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1353 + impl<T: LibraryService> tonic::server::UnaryService<super::UnlikeAlbumRequest> 1354 + for UnlikeAlbumSvc<T> 1355 + { 1356 + type Response = super::UnlikeAlbumResponse; 1357 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1358 + fn call( 1359 + &mut self, 1360 + request: tonic::Request<super::UnlikeAlbumRequest>, 1361 + ) -> Self::Future { 1362 + let inner = Arc::clone(&self.0); 1363 + let fut = async move { 1364 + <T as LibraryService>::unlike_album(&inner, request).await 1365 + }; 1366 + Box::pin(fut) 1367 + } 1368 + } 1369 + let accept_compression_encodings = self.accept_compression_encodings; 1370 + let send_compression_encodings = self.send_compression_encodings; 1371 + let max_decoding_message_size = self.max_decoding_message_size; 1372 + let max_encoding_message_size = self.max_encoding_message_size; 1373 + let inner = self.inner.clone(); 1374 + let fut = async move { 1375 + let method = UnlikeAlbumSvc(inner); 1376 + let codec = tonic::codec::ProstCodec::default(); 1377 + let mut grpc = tonic::server::Grpc::new(codec) 1378 + .apply_compression_config( 1379 + accept_compression_encodings, 1380 + send_compression_encodings, 1381 + ) 1382 + .apply_max_message_size_config( 1383 + max_decoding_message_size, 1384 + max_encoding_message_size, 1385 + ); 1386 + let res = grpc.unary(method, req).await; 1387 + Ok(res) 1388 + }; 1389 + Box::pin(fut) 1390 + } 1391 + "/rockbox.v1alpha1.LibraryService/GetLikedTracks" => { 1392 + #[allow(non_camel_case_types)] 1393 + struct GetLikedTracksSvc<T: LibraryService>(pub Arc<T>); 1394 + impl<T: LibraryService> 1395 + tonic::server::UnaryService<super::GetLikedTracksRequest> 1396 + for GetLikedTracksSvc<T> 1397 + { 1398 + type Response = super::GetLikedTracksResponse; 1399 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1400 + fn call( 1401 + &mut self, 1402 + request: tonic::Request<super::GetLikedTracksRequest>, 1403 + ) -> Self::Future { 1404 + let inner = Arc::clone(&self.0); 1405 + let fut = async move { 1406 + <T as LibraryService>::get_liked_tracks(&inner, request).await 1407 + }; 1408 + Box::pin(fut) 1409 + } 1410 + } 1411 + let accept_compression_encodings = self.accept_compression_encodings; 1412 + let send_compression_encodings = self.send_compression_encodings; 1413 + let max_decoding_message_size = self.max_decoding_message_size; 1414 + let max_encoding_message_size = self.max_encoding_message_size; 1415 + let inner = self.inner.clone(); 1416 + let fut = async move { 1417 + let method = GetLikedTracksSvc(inner); 1418 + let codec = tonic::codec::ProstCodec::default(); 1419 + let mut grpc = tonic::server::Grpc::new(codec) 1420 + .apply_compression_config( 1421 + accept_compression_encodings, 1422 + send_compression_encodings, 1423 + ) 1424 + .apply_max_message_size_config( 1425 + max_decoding_message_size, 1426 + max_encoding_message_size, 1427 + ); 1428 + let res = grpc.unary(method, req).await; 1429 + Ok(res) 1430 + }; 1431 + Box::pin(fut) 1432 + } 1433 + "/rockbox.v1alpha1.LibraryService/GetLikedAlbums" => { 1434 + #[allow(non_camel_case_types)] 1435 + struct GetLikedAlbumsSvc<T: LibraryService>(pub Arc<T>); 1436 + impl<T: LibraryService> 1437 + tonic::server::UnaryService<super::GetLikedAlbumsRequest> 1438 + for GetLikedAlbumsSvc<T> 1439 + { 1440 + type Response = super::GetLikedAlbumsResponse; 1441 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1442 + fn call( 1443 + &mut self, 1444 + request: tonic::Request<super::GetLikedAlbumsRequest>, 1445 + ) -> Self::Future { 1446 + let inner = Arc::clone(&self.0); 1447 + let fut = async move { 1448 + <T as LibraryService>::get_liked_albums(&inner, request).await 1449 + }; 1450 + Box::pin(fut) 1451 + } 1452 + } 1453 + let accept_compression_encodings = self.accept_compression_encodings; 1454 + let send_compression_encodings = self.send_compression_encodings; 1455 + let max_decoding_message_size = self.max_decoding_message_size; 1456 + let max_encoding_message_size = self.max_encoding_message_size; 1457 + let inner = self.inner.clone(); 1458 + let fut = async move { 1459 + let method = GetLikedAlbumsSvc(inner); 1460 + let codec = tonic::codec::ProstCodec::default(); 1461 + let mut grpc = tonic::server::Grpc::new(codec) 1462 + .apply_compression_config( 1463 + accept_compression_encodings, 1464 + send_compression_encodings, 1465 + ) 1466 + .apply_max_message_size_config( 1467 + max_decoding_message_size, 1468 + max_encoding_message_size, 1469 + ); 1470 + let res = grpc.unary(method, req).await; 1471 + Ok(res) 1472 + }; 1473 + Box::pin(fut) 1474 + } 1475 + "/rockbox.v1alpha1.LibraryService/ScanLibrary" => { 1476 + #[allow(non_camel_case_types)] 1477 + struct ScanLibrarySvc<T: LibraryService>(pub Arc<T>); 1478 + impl<T: LibraryService> tonic::server::UnaryService<super::ScanLibraryRequest> 1479 + for ScanLibrarySvc<T> 1480 + { 1481 + type Response = super::ScanLibraryResponse; 1482 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1483 + fn call( 1484 + &mut self, 1485 + request: tonic::Request<super::ScanLibraryRequest>, 1486 + ) -> Self::Future { 1487 + let inner = Arc::clone(&self.0); 1488 + let fut = async move { 1489 + <T as LibraryService>::scan_library(&inner, request).await 1490 + }; 1491 + Box::pin(fut) 1492 + } 1493 + } 1494 + let accept_compression_encodings = self.accept_compression_encodings; 1495 + let send_compression_encodings = self.send_compression_encodings; 1496 + let max_decoding_message_size = self.max_decoding_message_size; 1497 + let max_encoding_message_size = self.max_encoding_message_size; 1498 + let inner = self.inner.clone(); 1499 + let fut = async move { 1500 + let method = ScanLibrarySvc(inner); 1501 + let codec = tonic::codec::ProstCodec::default(); 1502 + let mut grpc = tonic::server::Grpc::new(codec) 1503 + .apply_compression_config( 1504 + accept_compression_encodings, 1505 + send_compression_encodings, 1506 + ) 1507 + .apply_max_message_size_config( 1508 + max_decoding_message_size, 1509 + max_encoding_message_size, 1510 + ); 1511 + let res = grpc.unary(method, req).await; 1512 + Ok(res) 1513 + }; 1514 + Box::pin(fut) 1515 + } 1516 + "/rockbox.v1alpha1.LibraryService/Search" => { 1517 + #[allow(non_camel_case_types)] 1518 + struct SearchSvc<T: LibraryService>(pub Arc<T>); 1519 + impl<T: LibraryService> tonic::server::UnaryService<super::SearchRequest> for SearchSvc<T> { 1520 + type Response = super::SearchResponse; 1521 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1522 + fn call( 1523 + &mut self, 1524 + request: tonic::Request<super::SearchRequest>, 1525 + ) -> Self::Future { 1526 + let inner = Arc::clone(&self.0); 1527 + let fut = 1528 + async move { <T as LibraryService>::search(&inner, request).await }; 1529 + Box::pin(fut) 1530 + } 1531 + } 1532 + let accept_compression_encodings = self.accept_compression_encodings; 1533 + let send_compression_encodings = self.send_compression_encodings; 1534 + let max_decoding_message_size = self.max_decoding_message_size; 1535 + let max_encoding_message_size = self.max_encoding_message_size; 1536 + let inner = self.inner.clone(); 1537 + let fut = async move { 1538 + let method = SearchSvc(inner); 1539 + let codec = tonic::codec::ProstCodec::default(); 1540 + let mut grpc = tonic::server::Grpc::new(codec) 1541 + .apply_compression_config( 1542 + accept_compression_encodings, 1543 + send_compression_encodings, 1544 + ) 1545 + .apply_max_message_size_config( 1546 + max_decoding_message_size, 1547 + max_encoding_message_size, 1548 + ); 1549 + let res = grpc.unary(method, req).await; 1550 + Ok(res) 1551 + }; 1552 + Box::pin(fut) 1553 + } 1554 + _ => Box::pin(async move { 1555 + let mut response = http::Response::new(empty_body()); 1556 + let headers = response.headers_mut(); 1557 + headers.insert( 1558 + tonic::Status::GRPC_STATUS, 1559 + (tonic::Code::Unimplemented as i32).into(), 1560 + ); 1561 + headers.insert( 1562 + http::header::CONTENT_TYPE, 1563 + tonic::metadata::GRPC_CONTENT_TYPE, 1564 + ); 1565 + Ok(response) 1566 + }), 1567 + } 1568 + } 1569 + } 1570 + impl<T> Clone for LibraryServiceServer<T> { 1571 + fn clone(&self) -> Self { 1572 + let inner = self.inner.clone(); 1573 + Self { 1574 + inner, 1575 + accept_compression_encodings: self.accept_compression_encodings, 1576 + send_compression_encodings: self.send_compression_encodings, 1577 + max_decoding_message_size: self.max_decoding_message_size, 1578 + max_encoding_message_size: self.max_encoding_message_size, 1579 + } 1580 + } 1581 + } 1582 + /// Generated gRPC service name 1583 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.LibraryService"; 1584 + impl<T> tonic::server::NamedService for LibraryServiceServer<T> { 1585 + const NAME: &'static str = SERVICE_NAME; 1586 + } 1587 + } 1588 + /// Generated client implementations. 1589 + pub mod metadata_service_client { 1590 + #![allow( 1591 + unused_variables, 1592 + dead_code, 1593 + missing_docs, 1594 + clippy::wildcard_imports, 1595 + clippy::let_unit_value 1596 + )] 1597 + use tonic::codegen::http::Uri; 1598 + use tonic::codegen::*; 1599 + #[derive(Debug, Clone)] 1600 + pub struct MetadataServiceClient<T> { 1601 + inner: tonic::client::Grpc<T>, 1602 + } 1603 + impl MetadataServiceClient<tonic::transport::Channel> { 1604 + /// Attempt to create a new client by connecting to a given endpoint. 1605 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 1606 + where 1607 + D: TryInto<tonic::transport::Endpoint>, 1608 + D::Error: Into<StdError>, 1609 + { 1610 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 1611 + Ok(Self::new(conn)) 1612 + } 1613 + } 1614 + impl<T> MetadataServiceClient<T> 1615 + where 1616 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 1617 + T::Error: Into<StdError>, 1618 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 1619 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 1620 + { 1621 + pub fn new(inner: T) -> Self { 1622 + let inner = tonic::client::Grpc::new(inner); 1623 + Self { inner } 1624 + } 1625 + pub fn with_origin(inner: T, origin: Uri) -> Self { 1626 + let inner = tonic::client::Grpc::with_origin(inner, origin); 1627 + Self { inner } 1628 + } 1629 + pub fn with_interceptor<F>( 1630 + inner: T, 1631 + interceptor: F, 1632 + ) -> MetadataServiceClient<InterceptedService<T, F>> 1633 + where 1634 + F: tonic::service::Interceptor, 1635 + T::ResponseBody: Default, 1636 + T: tonic::codegen::Service< 1637 + http::Request<tonic::body::BoxBody>, 1638 + Response = http::Response< 1639 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 1640 + >, 1641 + >, 1642 + <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 1643 + Into<StdError> + std::marker::Send + std::marker::Sync, 1644 + { 1645 + MetadataServiceClient::new(InterceptedService::new(inner, interceptor)) 1646 + } 1647 + /// Compress requests with the given encoding. 1648 + /// 1649 + /// This requires the server to support it otherwise it might respond with an 1650 + /// error. 1651 + #[must_use] 1652 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 1653 + self.inner = self.inner.send_compressed(encoding); 1654 + self 1655 + } 1656 + /// Enable decompressing responses. 1657 + #[must_use] 1658 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 1659 + self.inner = self.inner.accept_compressed(encoding); 1660 + self 1661 + } 1662 + /// Limits the maximum size of a decoded message. 1663 + /// 1664 + /// Default: `4MB` 1665 + #[must_use] 1666 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 1667 + self.inner = self.inner.max_decoding_message_size(limit); 1668 + self 1669 + } 1670 + /// Limits the maximum size of an encoded message. 1671 + /// 1672 + /// Default: `usize::MAX` 1673 + #[must_use] 1674 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 1675 + self.inner = self.inner.max_encoding_message_size(limit); 1676 + self 1677 + } 1678 + } 1679 + } 1680 + /// Generated server implementations. 1681 + pub mod metadata_service_server { 1682 + #![allow( 1683 + unused_variables, 1684 + dead_code, 1685 + missing_docs, 1686 + clippy::wildcard_imports, 1687 + clippy::let_unit_value 1688 + )] 1689 + use tonic::codegen::*; 1690 + /// Generated trait containing gRPC methods that should be implemented for use with MetadataServiceServer. 1691 + #[async_trait] 1692 + pub trait MetadataService: std::marker::Send + std::marker::Sync + 'static {} 1693 + #[derive(Debug)] 1694 + pub struct MetadataServiceServer<T> { 1695 + inner: Arc<T>, 1696 + accept_compression_encodings: EnabledCompressionEncodings, 1697 + send_compression_encodings: EnabledCompressionEncodings, 1698 + max_decoding_message_size: Option<usize>, 1699 + max_encoding_message_size: Option<usize>, 1700 + } 1701 + impl<T> MetadataServiceServer<T> { 1702 + pub fn new(inner: T) -> Self { 1703 + Self::from_arc(Arc::new(inner)) 1704 + } 1705 + pub fn from_arc(inner: Arc<T>) -> Self { 1706 + Self { 1707 + inner, 1708 + accept_compression_encodings: Default::default(), 1709 + send_compression_encodings: Default::default(), 1710 + max_decoding_message_size: None, 1711 + max_encoding_message_size: None, 1712 + } 1713 + } 1714 + pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 1715 + where 1716 + F: tonic::service::Interceptor, 1717 + { 1718 + InterceptedService::new(Self::new(inner), interceptor) 1719 + } 1720 + /// Enable decompressing requests with the given encoding. 1721 + #[must_use] 1722 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 1723 + self.accept_compression_encodings.enable(encoding); 1724 + self 1725 + } 1726 + /// Compress responses with the given encoding, if the client supports it. 1727 + #[must_use] 1728 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 1729 + self.send_compression_encodings.enable(encoding); 1730 + self 1731 + } 1732 + /// Limits the maximum size of a decoded message. 1733 + /// 1734 + /// Default: `4MB` 1735 + #[must_use] 1736 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 1737 + self.max_decoding_message_size = Some(limit); 1738 + self 1739 + } 1740 + /// Limits the maximum size of an encoded message. 1741 + /// 1742 + /// Default: `usize::MAX` 1743 + #[must_use] 1744 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 1745 + self.max_encoding_message_size = Some(limit); 1746 + self 1747 + } 1748 + } 1749 + impl<T, B> tonic::codegen::Service<http::Request<B>> for MetadataServiceServer<T> 1750 + where 1751 + T: MetadataService, 1752 + B: Body + std::marker::Send + 'static, 1753 + B::Error: Into<StdError> + std::marker::Send + 'static, 1754 + { 1755 + type Response = http::Response<tonic::body::BoxBody>; 1756 + type Error = std::convert::Infallible; 1757 + type Future = BoxFuture<Self::Response, Self::Error>; 1758 + fn poll_ready( 1759 + &mut self, 1760 + _cx: &mut Context<'_>, 1761 + ) -> Poll<std::result::Result<(), Self::Error>> { 1762 + Poll::Ready(Ok(())) 1763 + } 1764 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 1765 + match req.uri().path() { 1766 + _ => Box::pin(async move { 1767 + let mut response = http::Response::new(empty_body()); 1768 + let headers = response.headers_mut(); 1769 + headers.insert( 1770 + tonic::Status::GRPC_STATUS, 1771 + (tonic::Code::Unimplemented as i32).into(), 1772 + ); 1773 + headers.insert( 1774 + http::header::CONTENT_TYPE, 1775 + tonic::metadata::GRPC_CONTENT_TYPE, 1776 + ); 1777 + Ok(response) 1778 + }), 1779 + } 1780 + } 1781 + } 1782 + impl<T> Clone for MetadataServiceServer<T> { 1783 + fn clone(&self) -> Self { 1784 + let inner = self.inner.clone(); 1785 + Self { 1786 + inner, 1787 + accept_compression_encodings: self.accept_compression_encodings, 1788 + send_compression_encodings: self.send_compression_encodings, 1789 + max_decoding_message_size: self.max_decoding_message_size, 1790 + max_encoding_message_size: self.max_encoding_message_size, 1791 + } 1792 + } 1793 + } 1794 + /// Generated gRPC service name 1795 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.MetadataService"; 1796 + impl<T> tonic::server::NamedService for MetadataServiceServer<T> { 1797 + const NAME: &'static str = SERVICE_NAME; 1798 + } 1799 + } 1800 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1801 + pub struct PlayRequest { 1802 + #[prost(int64, tag = "1")] 1803 + pub elapsed: i64, 1804 + #[prost(int64, tag = "2")] 1805 + pub offset: i64, 1806 + } 1807 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1808 + pub struct PlayResponse {} 1809 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1810 + pub struct PauseRequest {} 1811 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1812 + pub struct PlayOrPauseRequest {} 1813 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1814 + pub struct PlayOrPauseResponse {} 1815 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1816 + pub struct PauseResponse {} 1817 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1818 + pub struct ResumeRequest {} 1819 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1820 + pub struct ResumeResponse {} 1821 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1822 + pub struct NextRequest {} 1823 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1824 + pub struct NextResponse {} 1825 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1826 + pub struct PreviousRequest {} 1827 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1828 + pub struct PreviousResponse {} 1829 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1830 + pub struct FastForwardRewindRequest { 1831 + #[prost(int32, tag = "1")] 1832 + pub new_time: i32, 1833 + } 1834 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1835 + pub struct FastForwardRewindResponse {} 1836 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1837 + pub struct StatusRequest {} 1838 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1839 + pub struct StreamStatusRequest {} 1840 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1841 + pub struct StatusResponse { 1842 + #[prost(int32, tag = "1")] 1843 + pub status: i32, 1844 + } 1845 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1846 + pub struct CurrentTrackRequest {} 1847 + #[derive(Clone, PartialEq, ::prost::Message)] 1848 + pub struct CurrentTrackResponse { 1849 + #[prost(string, tag = "1")] 1850 + pub title: ::prost::alloc::string::String, 1851 + #[prost(string, tag = "2")] 1852 + pub artist: ::prost::alloc::string::String, 1853 + #[prost(string, tag = "3")] 1854 + pub album: ::prost::alloc::string::String, 1855 + #[prost(string, tag = "4")] 1856 + pub genre: ::prost::alloc::string::String, 1857 + #[prost(string, tag = "5")] 1858 + pub disc: ::prost::alloc::string::String, 1859 + #[prost(string, tag = "6")] 1860 + pub track_string: ::prost::alloc::string::String, 1861 + #[prost(string, tag = "7")] 1862 + pub year_string: ::prost::alloc::string::String, 1863 + #[prost(string, tag = "8")] 1864 + pub composer: ::prost::alloc::string::String, 1865 + #[prost(string, tag = "9")] 1866 + pub comment: ::prost::alloc::string::String, 1867 + #[prost(string, tag = "10")] 1868 + pub album_artist: ::prost::alloc::string::String, 1869 + #[prost(string, tag = "11")] 1870 + pub grouping: ::prost::alloc::string::String, 1871 + #[prost(int32, tag = "12")] 1872 + pub discnum: i32, 1873 + #[prost(int32, tag = "13")] 1874 + pub tracknum: i32, 1875 + #[prost(int32, tag = "14")] 1876 + pub layer: i32, 1877 + #[prost(int32, tag = "15")] 1878 + pub year: i32, 1879 + #[prost(uint32, tag = "16")] 1880 + pub bitrate: u32, 1881 + #[prost(uint64, tag = "17")] 1882 + pub frequency: u64, 1883 + #[prost(uint64, tag = "18")] 1884 + pub filesize: u64, 1885 + #[prost(uint64, tag = "19")] 1886 + pub length: u64, 1887 + #[prost(uint64, tag = "20")] 1888 + pub elapsed: u64, 1889 + #[prost(string, tag = "21")] 1890 + pub path: ::prost::alloc::string::String, 1891 + #[prost(string, optional, tag = "22")] 1892 + pub album_art: ::core::option::Option<::prost::alloc::string::String>, 1893 + #[prost(string, tag = "23")] 1894 + pub album_id: ::prost::alloc::string::String, 1895 + #[prost(string, tag = "24")] 1896 + pub artist_id: ::prost::alloc::string::String, 1897 + #[prost(string, tag = "25")] 1898 + pub id: ::prost::alloc::string::String, 1899 + } 1900 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1901 + pub struct StreamCurrentTrackRequest {} 1902 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1903 + pub struct NextTrackRequest {} 1904 + #[derive(Clone, PartialEq, ::prost::Message)] 1905 + pub struct NextTrackResponse { 1906 + #[prost(string, tag = "1")] 1907 + pub title: ::prost::alloc::string::String, 1908 + #[prost(string, tag = "2")] 1909 + pub artist: ::prost::alloc::string::String, 1910 + #[prost(string, tag = "3")] 1911 + pub album: ::prost::alloc::string::String, 1912 + #[prost(string, tag = "4")] 1913 + pub genre: ::prost::alloc::string::String, 1914 + #[prost(string, tag = "5")] 1915 + pub disc: ::prost::alloc::string::String, 1916 + #[prost(string, tag = "6")] 1917 + pub track_string: ::prost::alloc::string::String, 1918 + #[prost(string, tag = "7")] 1919 + pub year_string: ::prost::alloc::string::String, 1920 + #[prost(string, tag = "8")] 1921 + pub composer: ::prost::alloc::string::String, 1922 + #[prost(string, tag = "9")] 1923 + pub comment: ::prost::alloc::string::String, 1924 + #[prost(string, tag = "10")] 1925 + pub album_artist: ::prost::alloc::string::String, 1926 + #[prost(string, tag = "11")] 1927 + pub grouping: ::prost::alloc::string::String, 1928 + #[prost(int32, tag = "12")] 1929 + pub discnum: i32, 1930 + #[prost(int32, tag = "13")] 1931 + pub tracknum: i32, 1932 + #[prost(int32, tag = "14")] 1933 + pub layer: i32, 1934 + #[prost(int32, tag = "15")] 1935 + pub year: i32, 1936 + #[prost(uint32, tag = "16")] 1937 + pub bitrate: u32, 1938 + #[prost(uint64, tag = "17")] 1939 + pub frequency: u64, 1940 + #[prost(uint64, tag = "18")] 1941 + pub filesize: u64, 1942 + #[prost(uint64, tag = "19")] 1943 + pub length: u64, 1944 + #[prost(uint64, tag = "20")] 1945 + pub elapsed: u64, 1946 + #[prost(string, tag = "21")] 1947 + pub path: ::prost::alloc::string::String, 1948 + } 1949 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1950 + pub struct FlushAndReloadTracksRequest {} 1951 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1952 + pub struct FlushAndReloadTracksResponse {} 1953 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1954 + pub struct GetFilePositionRequest {} 1955 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1956 + pub struct GetFilePositionResponse { 1957 + #[prost(int32, tag = "1")] 1958 + pub position: i32, 1959 + } 1960 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1961 + pub struct HardStopRequest {} 1962 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1963 + pub struct HardStopResponse {} 1964 + #[derive(Clone, PartialEq, ::prost::Message)] 1965 + pub struct PlayAlbumRequest { 1966 + #[prost(string, tag = "1")] 1967 + pub album_id: ::prost::alloc::string::String, 1968 + #[prost(bool, optional, tag = "2")] 1969 + pub shuffle: ::core::option::Option<bool>, 1970 + #[prost(int32, optional, tag = "3")] 1971 + pub position: ::core::option::Option<i32>, 1972 + } 1973 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1974 + pub struct PlayAlbumResponse {} 1975 + #[derive(Clone, PartialEq, ::prost::Message)] 1976 + pub struct PlayArtistTracksRequest { 1977 + #[prost(string, tag = "1")] 1978 + pub artist_id: ::prost::alloc::string::String, 1979 + #[prost(bool, optional, tag = "2")] 1980 + pub shuffle: ::core::option::Option<bool>, 1981 + #[prost(int32, optional, tag = "3")] 1982 + pub position: ::core::option::Option<i32>, 1983 + } 1984 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1985 + pub struct PlayArtistTracksResponse {} 1986 + #[derive(Clone, PartialEq, ::prost::Message)] 1987 + pub struct PlayPlaylistRequest { 1988 + #[prost(string, tag = "1")] 1989 + pub playlist_id: ::prost::alloc::string::String, 1990 + #[prost(bool, optional, tag = "2")] 1991 + pub shuffle: ::core::option::Option<bool>, 1992 + } 1993 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 1994 + pub struct PlayPlaylistResponse {} 1995 + #[derive(Clone, PartialEq, ::prost::Message)] 1996 + pub struct PlayDirectoryRequest { 1997 + #[prost(string, tag = "1")] 1998 + pub path: ::prost::alloc::string::String, 1999 + #[prost(bool, optional, tag = "2")] 2000 + pub shuffle: ::core::option::Option<bool>, 2001 + #[prost(bool, optional, tag = "3")] 2002 + pub recurse: ::core::option::Option<bool>, 2003 + #[prost(int32, optional, tag = "4")] 2004 + pub position: ::core::option::Option<i32>, 2005 + } 2006 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2007 + pub struct PlayDirectoryResponse {} 2008 + #[derive(Clone, PartialEq, ::prost::Message)] 2009 + pub struct PlayTrackRequest { 2010 + #[prost(string, tag = "1")] 2011 + pub path: ::prost::alloc::string::String, 2012 + } 2013 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2014 + pub struct PlayTrackResponse {} 2015 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2016 + pub struct PlayLikedTracksRequest { 2017 + #[prost(bool, optional, tag = "1")] 2018 + pub shuffle: ::core::option::Option<bool>, 2019 + #[prost(int32, optional, tag = "2")] 2020 + pub position: ::core::option::Option<i32>, 2021 + } 2022 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2023 + pub struct PlayLikedTracksResponse {} 2024 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2025 + pub struct PlayAllTracksRequest { 2026 + #[prost(bool, optional, tag = "1")] 2027 + pub shuffle: ::core::option::Option<bool>, 2028 + #[prost(int32, optional, tag = "2")] 2029 + pub position: ::core::option::Option<i32>, 2030 + } 2031 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2032 + pub struct PlayAllTracksResponse {} 2033 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2034 + pub struct StreamPlaylistRequest {} 2035 + #[derive(Clone, PartialEq, ::prost::Message)] 2036 + pub struct PlaylistResponse { 2037 + #[prost(int32, tag = "1")] 2038 + pub index: i32, 2039 + #[prost(int32, tag = "2")] 2040 + pub amount: i32, 2041 + #[prost(message, repeated, tag = "3")] 2042 + pub tracks: ::prost::alloc::vec::Vec<CurrentTrackResponse>, 2043 + } 2044 + /// Generated client implementations. 2045 + pub mod playback_service_client { 2046 + #![allow( 2047 + unused_variables, 2048 + dead_code, 2049 + missing_docs, 2050 + clippy::wildcard_imports, 2051 + clippy::let_unit_value 2052 + )] 2053 + use tonic::codegen::http::Uri; 2054 + use tonic::codegen::*; 2055 + #[derive(Debug, Clone)] 2056 + pub struct PlaybackServiceClient<T> { 2057 + inner: tonic::client::Grpc<T>, 2058 + } 2059 + impl PlaybackServiceClient<tonic::transport::Channel> { 2060 + /// Attempt to create a new client by connecting to a given endpoint. 2061 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 2062 + where 2063 + D: TryInto<tonic::transport::Endpoint>, 2064 + D::Error: Into<StdError>, 2065 + { 2066 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 2067 + Ok(Self::new(conn)) 2068 + } 2069 + } 2070 + impl<T> PlaybackServiceClient<T> 2071 + where 2072 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 2073 + T::Error: Into<StdError>, 2074 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 2075 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 2076 + { 2077 + pub fn new(inner: T) -> Self { 2078 + let inner = tonic::client::Grpc::new(inner); 2079 + Self { inner } 2080 + } 2081 + pub fn with_origin(inner: T, origin: Uri) -> Self { 2082 + let inner = tonic::client::Grpc::with_origin(inner, origin); 2083 + Self { inner } 2084 + } 2085 + pub fn with_interceptor<F>( 2086 + inner: T, 2087 + interceptor: F, 2088 + ) -> PlaybackServiceClient<InterceptedService<T, F>> 2089 + where 2090 + F: tonic::service::Interceptor, 2091 + T::ResponseBody: Default, 2092 + T: tonic::codegen::Service< 2093 + http::Request<tonic::body::BoxBody>, 2094 + Response = http::Response< 2095 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 2096 + >, 2097 + >, 2098 + <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 2099 + Into<StdError> + std::marker::Send + std::marker::Sync, 2100 + { 2101 + PlaybackServiceClient::new(InterceptedService::new(inner, interceptor)) 2102 + } 2103 + /// Compress requests with the given encoding. 2104 + /// 2105 + /// This requires the server to support it otherwise it might respond with an 2106 + /// error. 2107 + #[must_use] 2108 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 2109 + self.inner = self.inner.send_compressed(encoding); 2110 + self 2111 + } 2112 + /// Enable decompressing responses. 2113 + #[must_use] 2114 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 2115 + self.inner = self.inner.accept_compressed(encoding); 2116 + self 2117 + } 2118 + /// Limits the maximum size of a decoded message. 2119 + /// 2120 + /// Default: `4MB` 2121 + #[must_use] 2122 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 2123 + self.inner = self.inner.max_decoding_message_size(limit); 2124 + self 2125 + } 2126 + /// Limits the maximum size of an encoded message. 2127 + /// 2128 + /// Default: `usize::MAX` 2129 + #[must_use] 2130 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 2131 + self.inner = self.inner.max_encoding_message_size(limit); 2132 + self 2133 + } 2134 + pub async fn play( 2135 + &mut self, 2136 + request: impl tonic::IntoRequest<super::PlayRequest>, 2137 + ) -> std::result::Result<tonic::Response<super::PlayResponse>, tonic::Status> { 2138 + self.inner.ready().await.map_err(|e| { 2139 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2140 + })?; 2141 + let codec = tonic::codec::ProstCodec::default(); 2142 + let path = 2143 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Play"); 2144 + let mut req = request.into_request(); 2145 + req.extensions_mut() 2146 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Play")); 2147 + self.inner.unary(req, path, codec).await 2148 + } 2149 + pub async fn pause( 2150 + &mut self, 2151 + request: impl tonic::IntoRequest<super::PauseRequest>, 2152 + ) -> std::result::Result<tonic::Response<super::PauseResponse>, tonic::Status> { 2153 + self.inner.ready().await.map_err(|e| { 2154 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2155 + })?; 2156 + let codec = tonic::codec::ProstCodec::default(); 2157 + let path = 2158 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Pause"); 2159 + let mut req = request.into_request(); 2160 + req.extensions_mut() 2161 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Pause")); 2162 + self.inner.unary(req, path, codec).await 2163 + } 2164 + pub async fn play_or_pause( 2165 + &mut self, 2166 + request: impl tonic::IntoRequest<super::PlayOrPauseRequest>, 2167 + ) -> std::result::Result<tonic::Response<super::PlayOrPauseResponse>, tonic::Status> 2168 + { 2169 + self.inner.ready().await.map_err(|e| { 2170 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2171 + })?; 2172 + let codec = tonic::codec::ProstCodec::default(); 2173 + let path = http::uri::PathAndQuery::from_static( 2174 + "/rockbox.v1alpha1.PlaybackService/PlayOrPause", 2175 + ); 2176 + let mut req = request.into_request(); 2177 + req.extensions_mut().insert(GrpcMethod::new( 2178 + "rockbox.v1alpha1.PlaybackService", 2179 + "PlayOrPause", 2180 + )); 2181 + self.inner.unary(req, path, codec).await 2182 + } 2183 + pub async fn resume( 2184 + &mut self, 2185 + request: impl tonic::IntoRequest<super::ResumeRequest>, 2186 + ) -> std::result::Result<tonic::Response<super::ResumeResponse>, tonic::Status> { 2187 + self.inner.ready().await.map_err(|e| { 2188 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2189 + })?; 2190 + let codec = tonic::codec::ProstCodec::default(); 2191 + let path = 2192 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Resume"); 2193 + let mut req = request.into_request(); 2194 + req.extensions_mut().insert(GrpcMethod::new( 2195 + "rockbox.v1alpha1.PlaybackService", 2196 + "Resume", 2197 + )); 2198 + self.inner.unary(req, path, codec).await 2199 + } 2200 + pub async fn next( 2201 + &mut self, 2202 + request: impl tonic::IntoRequest<super::NextRequest>, 2203 + ) -> std::result::Result<tonic::Response<super::NextResponse>, tonic::Status> { 2204 + self.inner.ready().await.map_err(|e| { 2205 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2206 + })?; 2207 + let codec = tonic::codec::ProstCodec::default(); 2208 + let path = 2209 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Next"); 2210 + let mut req = request.into_request(); 2211 + req.extensions_mut() 2212 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Next")); 2213 + self.inner.unary(req, path, codec).await 2214 + } 2215 + pub async fn previous( 2216 + &mut self, 2217 + request: impl tonic::IntoRequest<super::PreviousRequest>, 2218 + ) -> std::result::Result<tonic::Response<super::PreviousResponse>, tonic::Status> { 2219 + self.inner.ready().await.map_err(|e| { 2220 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2221 + })?; 2222 + let codec = tonic::codec::ProstCodec::default(); 2223 + let path = 2224 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Previous"); 2225 + let mut req = request.into_request(); 2226 + req.extensions_mut().insert(GrpcMethod::new( 2227 + "rockbox.v1alpha1.PlaybackService", 2228 + "Previous", 2229 + )); 2230 + self.inner.unary(req, path, codec).await 2231 + } 2232 + pub async fn fast_forward_rewind( 2233 + &mut self, 2234 + request: impl tonic::IntoRequest<super::FastForwardRewindRequest>, 2235 + ) -> std::result::Result<tonic::Response<super::FastForwardRewindResponse>, tonic::Status> 2236 + { 2237 + self.inner.ready().await.map_err(|e| { 2238 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2239 + })?; 2240 + let codec = tonic::codec::ProstCodec::default(); 2241 + let path = http::uri::PathAndQuery::from_static( 2242 + "/rockbox.v1alpha1.PlaybackService/FastForwardRewind", 2243 + ); 2244 + let mut req = request.into_request(); 2245 + req.extensions_mut().insert(GrpcMethod::new( 2246 + "rockbox.v1alpha1.PlaybackService", 2247 + "FastForwardRewind", 2248 + )); 2249 + self.inner.unary(req, path, codec).await 2250 + } 2251 + pub async fn status( 2252 + &mut self, 2253 + request: impl tonic::IntoRequest<super::StatusRequest>, 2254 + ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status> { 2255 + self.inner.ready().await.map_err(|e| { 2256 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2257 + })?; 2258 + let codec = tonic::codec::ProstCodec::default(); 2259 + let path = 2260 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Status"); 2261 + let mut req = request.into_request(); 2262 + req.extensions_mut().insert(GrpcMethod::new( 2263 + "rockbox.v1alpha1.PlaybackService", 2264 + "Status", 2265 + )); 2266 + self.inner.unary(req, path, codec).await 2267 + } 2268 + pub async fn current_track( 2269 + &mut self, 2270 + request: impl tonic::IntoRequest<super::CurrentTrackRequest>, 2271 + ) -> std::result::Result<tonic::Response<super::CurrentTrackResponse>, tonic::Status> 2272 + { 2273 + self.inner.ready().await.map_err(|e| { 2274 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2275 + })?; 2276 + let codec = tonic::codec::ProstCodec::default(); 2277 + let path = http::uri::PathAndQuery::from_static( 2278 + "/rockbox.v1alpha1.PlaybackService/CurrentTrack", 2279 + ); 2280 + let mut req = request.into_request(); 2281 + req.extensions_mut().insert(GrpcMethod::new( 2282 + "rockbox.v1alpha1.PlaybackService", 2283 + "CurrentTrack", 2284 + )); 2285 + self.inner.unary(req, path, codec).await 2286 + } 2287 + pub async fn next_track( 2288 + &mut self, 2289 + request: impl tonic::IntoRequest<super::NextTrackRequest>, 2290 + ) -> std::result::Result<tonic::Response<super::NextTrackResponse>, tonic::Status> { 2291 + self.inner.ready().await.map_err(|e| { 2292 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2293 + })?; 2294 + let codec = tonic::codec::ProstCodec::default(); 2295 + let path = 2296 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/NextTrack"); 2297 + let mut req = request.into_request(); 2298 + req.extensions_mut().insert(GrpcMethod::new( 2299 + "rockbox.v1alpha1.PlaybackService", 2300 + "NextTrack", 2301 + )); 2302 + self.inner.unary(req, path, codec).await 2303 + } 2304 + pub async fn flush_and_reload_tracks( 2305 + &mut self, 2306 + request: impl tonic::IntoRequest<super::FlushAndReloadTracksRequest>, 2307 + ) -> std::result::Result<tonic::Response<super::FlushAndReloadTracksResponse>, tonic::Status> 2308 + { 2309 + self.inner.ready().await.map_err(|e| { 2310 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2311 + })?; 2312 + let codec = tonic::codec::ProstCodec::default(); 2313 + let path = http::uri::PathAndQuery::from_static( 2314 + "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks", 2315 + ); 2316 + let mut req = request.into_request(); 2317 + req.extensions_mut().insert(GrpcMethod::new( 2318 + "rockbox.v1alpha1.PlaybackService", 2319 + "FlushAndReloadTracks", 2320 + )); 2321 + self.inner.unary(req, path, codec).await 2322 + } 2323 + pub async fn get_file_position( 2324 + &mut self, 2325 + request: impl tonic::IntoRequest<super::GetFilePositionRequest>, 2326 + ) -> std::result::Result<tonic::Response<super::GetFilePositionResponse>, tonic::Status> 2327 + { 2328 + self.inner.ready().await.map_err(|e| { 2329 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2330 + })?; 2331 + let codec = tonic::codec::ProstCodec::default(); 2332 + let path = http::uri::PathAndQuery::from_static( 2333 + "/rockbox.v1alpha1.PlaybackService/GetFilePosition", 2334 + ); 2335 + let mut req = request.into_request(); 2336 + req.extensions_mut().insert(GrpcMethod::new( 2337 + "rockbox.v1alpha1.PlaybackService", 2338 + "GetFilePosition", 2339 + )); 2340 + self.inner.unary(req, path, codec).await 2341 + } 2342 + pub async fn hard_stop( 2343 + &mut self, 2344 + request: impl tonic::IntoRequest<super::HardStopRequest>, 2345 + ) -> std::result::Result<tonic::Response<super::HardStopResponse>, tonic::Status> { 2346 + self.inner.ready().await.map_err(|e| { 2347 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2348 + })?; 2349 + let codec = tonic::codec::ProstCodec::default(); 2350 + let path = 2351 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/HardStop"); 2352 + let mut req = request.into_request(); 2353 + req.extensions_mut().insert(GrpcMethod::new( 2354 + "rockbox.v1alpha1.PlaybackService", 2355 + "HardStop", 2356 + )); 2357 + self.inner.unary(req, path, codec).await 2358 + } 2359 + pub async fn play_album( 2360 + &mut self, 2361 + request: impl tonic::IntoRequest<super::PlayAlbumRequest>, 2362 + ) -> std::result::Result<tonic::Response<super::PlayAlbumResponse>, tonic::Status> { 2363 + self.inner.ready().await.map_err(|e| { 2364 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2365 + })?; 2366 + let codec = tonic::codec::ProstCodec::default(); 2367 + let path = 2368 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/PlayAlbum"); 2369 + let mut req = request.into_request(); 2370 + req.extensions_mut().insert(GrpcMethod::new( 2371 + "rockbox.v1alpha1.PlaybackService", 2372 + "PlayAlbum", 2373 + )); 2374 + self.inner.unary(req, path, codec).await 2375 + } 2376 + pub async fn play_artist_tracks( 2377 + &mut self, 2378 + request: impl tonic::IntoRequest<super::PlayArtistTracksRequest>, 2379 + ) -> std::result::Result<tonic::Response<super::PlayArtistTracksResponse>, tonic::Status> 2380 + { 2381 + self.inner.ready().await.map_err(|e| { 2382 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2383 + })?; 2384 + let codec = tonic::codec::ProstCodec::default(); 2385 + let path = http::uri::PathAndQuery::from_static( 2386 + "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks", 2387 + ); 2388 + let mut req = request.into_request(); 2389 + req.extensions_mut().insert(GrpcMethod::new( 2390 + "rockbox.v1alpha1.PlaybackService", 2391 + "PlayArtistTracks", 2392 + )); 2393 + self.inner.unary(req, path, codec).await 2394 + } 2395 + pub async fn play_playlist( 2396 + &mut self, 2397 + request: impl tonic::IntoRequest<super::PlayPlaylistRequest>, 2398 + ) -> std::result::Result<tonic::Response<super::PlayPlaylistResponse>, tonic::Status> 2399 + { 2400 + self.inner.ready().await.map_err(|e| { 2401 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2402 + })?; 2403 + let codec = tonic::codec::ProstCodec::default(); 2404 + let path = http::uri::PathAndQuery::from_static( 2405 + "/rockbox.v1alpha1.PlaybackService/PlayPlaylist", 2406 + ); 2407 + let mut req = request.into_request(); 2408 + req.extensions_mut().insert(GrpcMethod::new( 2409 + "rockbox.v1alpha1.PlaybackService", 2410 + "PlayPlaylist", 2411 + )); 2412 + self.inner.unary(req, path, codec).await 2413 + } 2414 + pub async fn play_directory( 2415 + &mut self, 2416 + request: impl tonic::IntoRequest<super::PlayDirectoryRequest>, 2417 + ) -> std::result::Result<tonic::Response<super::PlayDirectoryResponse>, tonic::Status> 2418 + { 2419 + self.inner.ready().await.map_err(|e| { 2420 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2421 + })?; 2422 + let codec = tonic::codec::ProstCodec::default(); 2423 + let path = http::uri::PathAndQuery::from_static( 2424 + "/rockbox.v1alpha1.PlaybackService/PlayDirectory", 2425 + ); 2426 + let mut req = request.into_request(); 2427 + req.extensions_mut().insert(GrpcMethod::new( 2428 + "rockbox.v1alpha1.PlaybackService", 2429 + "PlayDirectory", 2430 + )); 2431 + self.inner.unary(req, path, codec).await 2432 + } 2433 + pub async fn play_track( 2434 + &mut self, 2435 + request: impl tonic::IntoRequest<super::PlayTrackRequest>, 2436 + ) -> std::result::Result<tonic::Response<super::PlayTrackResponse>, tonic::Status> { 2437 + self.inner.ready().await.map_err(|e| { 2438 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2439 + })?; 2440 + let codec = tonic::codec::ProstCodec::default(); 2441 + let path = 2442 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/PlayTrack"); 2443 + let mut req = request.into_request(); 2444 + req.extensions_mut().insert(GrpcMethod::new( 2445 + "rockbox.v1alpha1.PlaybackService", 2446 + "PlayTrack", 2447 + )); 2448 + self.inner.unary(req, path, codec).await 2449 + } 2450 + pub async fn play_liked_tracks( 2451 + &mut self, 2452 + request: impl tonic::IntoRequest<super::PlayLikedTracksRequest>, 2453 + ) -> std::result::Result<tonic::Response<super::PlayLikedTracksResponse>, tonic::Status> 2454 + { 2455 + self.inner.ready().await.map_err(|e| { 2456 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2457 + })?; 2458 + let codec = tonic::codec::ProstCodec::default(); 2459 + let path = http::uri::PathAndQuery::from_static( 2460 + "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks", 2461 + ); 2462 + let mut req = request.into_request(); 2463 + req.extensions_mut().insert(GrpcMethod::new( 2464 + "rockbox.v1alpha1.PlaybackService", 2465 + "PlayLikedTracks", 2466 + )); 2467 + self.inner.unary(req, path, codec).await 2468 + } 2469 + pub async fn play_all_tracks( 2470 + &mut self, 2471 + request: impl tonic::IntoRequest<super::PlayAllTracksRequest>, 2472 + ) -> std::result::Result<tonic::Response<super::PlayAllTracksResponse>, tonic::Status> 2473 + { 2474 + self.inner.ready().await.map_err(|e| { 2475 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2476 + })?; 2477 + let codec = tonic::codec::ProstCodec::default(); 2478 + let path = http::uri::PathAndQuery::from_static( 2479 + "/rockbox.v1alpha1.PlaybackService/PlayAllTracks", 2480 + ); 2481 + let mut req = request.into_request(); 2482 + req.extensions_mut().insert(GrpcMethod::new( 2483 + "rockbox.v1alpha1.PlaybackService", 2484 + "PlayAllTracks", 2485 + )); 2486 + self.inner.unary(req, path, codec).await 2487 + } 2488 + pub async fn stream_current_track( 2489 + &mut self, 2490 + request: impl tonic::IntoRequest<super::StreamCurrentTrackRequest>, 2491 + ) -> std::result::Result< 2492 + tonic::Response<tonic::codec::Streaming<super::CurrentTrackResponse>>, 2493 + tonic::Status, 2494 + > { 2495 + self.inner.ready().await.map_err(|e| { 2496 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2497 + })?; 2498 + let codec = tonic::codec::ProstCodec::default(); 2499 + let path = http::uri::PathAndQuery::from_static( 2500 + "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack", 2501 + ); 2502 + let mut req = request.into_request(); 2503 + req.extensions_mut().insert(GrpcMethod::new( 2504 + "rockbox.v1alpha1.PlaybackService", 2505 + "StreamCurrentTrack", 2506 + )); 2507 + self.inner.server_streaming(req, path, codec).await 2508 + } 2509 + pub async fn stream_status( 2510 + &mut self, 2511 + request: impl tonic::IntoRequest<super::StreamStatusRequest>, 2512 + ) -> std::result::Result< 2513 + tonic::Response<tonic::codec::Streaming<super::StatusResponse>>, 2514 + tonic::Status, 2515 + > { 2516 + self.inner.ready().await.map_err(|e| { 2517 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2518 + })?; 2519 + let codec = tonic::codec::ProstCodec::default(); 2520 + let path = http::uri::PathAndQuery::from_static( 2521 + "/rockbox.v1alpha1.PlaybackService/StreamStatus", 2522 + ); 2523 + let mut req = request.into_request(); 2524 + req.extensions_mut().insert(GrpcMethod::new( 2525 + "rockbox.v1alpha1.PlaybackService", 2526 + "StreamStatus", 2527 + )); 2528 + self.inner.server_streaming(req, path, codec).await 2529 + } 2530 + pub async fn stream_playlist( 2531 + &mut self, 2532 + request: impl tonic::IntoRequest<super::StreamPlaylistRequest>, 2533 + ) -> std::result::Result< 2534 + tonic::Response<tonic::codec::Streaming<super::PlaylistResponse>>, 2535 + tonic::Status, 2536 + > { 2537 + self.inner.ready().await.map_err(|e| { 2538 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2539 + })?; 2540 + let codec = tonic::codec::ProstCodec::default(); 2541 + let path = http::uri::PathAndQuery::from_static( 2542 + "/rockbox.v1alpha1.PlaybackService/StreamPlaylist", 2543 + ); 2544 + let mut req = request.into_request(); 2545 + req.extensions_mut().insert(GrpcMethod::new( 2546 + "rockbox.v1alpha1.PlaybackService", 2547 + "StreamPlaylist", 2548 + )); 2549 + self.inner.server_streaming(req, path, codec).await 2550 + } 2551 + } 2552 + } 2553 + /// Generated server implementations. 2554 + pub mod playback_service_server { 2555 + #![allow( 2556 + unused_variables, 2557 + dead_code, 2558 + missing_docs, 2559 + clippy::wildcard_imports, 2560 + clippy::let_unit_value 2561 + )] 2562 + use tonic::codegen::*; 2563 + /// Generated trait containing gRPC methods that should be implemented for use with PlaybackServiceServer. 2564 + #[async_trait] 2565 + pub trait PlaybackService: std::marker::Send + std::marker::Sync + 'static { 2566 + async fn play( 2567 + &self, 2568 + request: tonic::Request<super::PlayRequest>, 2569 + ) -> std::result::Result<tonic::Response<super::PlayResponse>, tonic::Status>; 2570 + async fn pause( 2571 + &self, 2572 + request: tonic::Request<super::PauseRequest>, 2573 + ) -> std::result::Result<tonic::Response<super::PauseResponse>, tonic::Status>; 2574 + async fn play_or_pause( 2575 + &self, 2576 + request: tonic::Request<super::PlayOrPauseRequest>, 2577 + ) -> std::result::Result<tonic::Response<super::PlayOrPauseResponse>, tonic::Status>; 2578 + async fn resume( 2579 + &self, 2580 + request: tonic::Request<super::ResumeRequest>, 2581 + ) -> std::result::Result<tonic::Response<super::ResumeResponse>, tonic::Status>; 2582 + async fn next( 2583 + &self, 2584 + request: tonic::Request<super::NextRequest>, 2585 + ) -> std::result::Result<tonic::Response<super::NextResponse>, tonic::Status>; 2586 + async fn previous( 2587 + &self, 2588 + request: tonic::Request<super::PreviousRequest>, 2589 + ) -> std::result::Result<tonic::Response<super::PreviousResponse>, tonic::Status>; 2590 + async fn fast_forward_rewind( 2591 + &self, 2592 + request: tonic::Request<super::FastForwardRewindRequest>, 2593 + ) -> std::result::Result<tonic::Response<super::FastForwardRewindResponse>, tonic::Status>; 2594 + async fn status( 2595 + &self, 2596 + request: tonic::Request<super::StatusRequest>, 2597 + ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status>; 2598 + async fn current_track( 2599 + &self, 2600 + request: tonic::Request<super::CurrentTrackRequest>, 2601 + ) -> std::result::Result<tonic::Response<super::CurrentTrackResponse>, tonic::Status>; 2602 + async fn next_track( 2603 + &self, 2604 + request: tonic::Request<super::NextTrackRequest>, 2605 + ) -> std::result::Result<tonic::Response<super::NextTrackResponse>, tonic::Status>; 2606 + async fn flush_and_reload_tracks( 2607 + &self, 2608 + request: tonic::Request<super::FlushAndReloadTracksRequest>, 2609 + ) -> std::result::Result<tonic::Response<super::FlushAndReloadTracksResponse>, tonic::Status>; 2610 + async fn get_file_position( 2611 + &self, 2612 + request: tonic::Request<super::GetFilePositionRequest>, 2613 + ) -> std::result::Result<tonic::Response<super::GetFilePositionResponse>, tonic::Status>; 2614 + async fn hard_stop( 2615 + &self, 2616 + request: tonic::Request<super::HardStopRequest>, 2617 + ) -> std::result::Result<tonic::Response<super::HardStopResponse>, tonic::Status>; 2618 + async fn play_album( 2619 + &self, 2620 + request: tonic::Request<super::PlayAlbumRequest>, 2621 + ) -> std::result::Result<tonic::Response<super::PlayAlbumResponse>, tonic::Status>; 2622 + async fn play_artist_tracks( 2623 + &self, 2624 + request: tonic::Request<super::PlayArtistTracksRequest>, 2625 + ) -> std::result::Result<tonic::Response<super::PlayArtistTracksResponse>, tonic::Status>; 2626 + async fn play_playlist( 2627 + &self, 2628 + request: tonic::Request<super::PlayPlaylistRequest>, 2629 + ) -> std::result::Result<tonic::Response<super::PlayPlaylistResponse>, tonic::Status>; 2630 + async fn play_directory( 2631 + &self, 2632 + request: tonic::Request<super::PlayDirectoryRequest>, 2633 + ) -> std::result::Result<tonic::Response<super::PlayDirectoryResponse>, tonic::Status>; 2634 + async fn play_track( 2635 + &self, 2636 + request: tonic::Request<super::PlayTrackRequest>, 2637 + ) -> std::result::Result<tonic::Response<super::PlayTrackResponse>, tonic::Status>; 2638 + async fn play_liked_tracks( 2639 + &self, 2640 + request: tonic::Request<super::PlayLikedTracksRequest>, 2641 + ) -> std::result::Result<tonic::Response<super::PlayLikedTracksResponse>, tonic::Status>; 2642 + async fn play_all_tracks( 2643 + &self, 2644 + request: tonic::Request<super::PlayAllTracksRequest>, 2645 + ) -> std::result::Result<tonic::Response<super::PlayAllTracksResponse>, tonic::Status>; 2646 + /// Server streaming response type for the StreamCurrentTrack method. 2647 + type StreamCurrentTrackStream: tonic::codegen::tokio_stream::Stream< 2648 + Item = std::result::Result<super::CurrentTrackResponse, tonic::Status>, 2649 + > + std::marker::Send 2650 + + 'static; 2651 + async fn stream_current_track( 2652 + &self, 2653 + request: tonic::Request<super::StreamCurrentTrackRequest>, 2654 + ) -> std::result::Result<tonic::Response<Self::StreamCurrentTrackStream>, tonic::Status>; 2655 + /// Server streaming response type for the StreamStatus method. 2656 + type StreamStatusStream: tonic::codegen::tokio_stream::Stream< 2657 + Item = std::result::Result<super::StatusResponse, tonic::Status>, 2658 + > + std::marker::Send 2659 + + 'static; 2660 + async fn stream_status( 2661 + &self, 2662 + request: tonic::Request<super::StreamStatusRequest>, 2663 + ) -> std::result::Result<tonic::Response<Self::StreamStatusStream>, tonic::Status>; 2664 + /// Server streaming response type for the StreamPlaylist method. 2665 + type StreamPlaylistStream: tonic::codegen::tokio_stream::Stream< 2666 + Item = std::result::Result<super::PlaylistResponse, tonic::Status>, 2667 + > + std::marker::Send 2668 + + 'static; 2669 + async fn stream_playlist( 2670 + &self, 2671 + request: tonic::Request<super::StreamPlaylistRequest>, 2672 + ) -> std::result::Result<tonic::Response<Self::StreamPlaylistStream>, tonic::Status>; 2673 + } 2674 + #[derive(Debug)] 2675 + pub struct PlaybackServiceServer<T> { 2676 + inner: Arc<T>, 2677 + accept_compression_encodings: EnabledCompressionEncodings, 2678 + send_compression_encodings: EnabledCompressionEncodings, 2679 + max_decoding_message_size: Option<usize>, 2680 + max_encoding_message_size: Option<usize>, 2681 + } 2682 + impl<T> PlaybackServiceServer<T> { 2683 + pub fn new(inner: T) -> Self { 2684 + Self::from_arc(Arc::new(inner)) 2685 + } 2686 + pub fn from_arc(inner: Arc<T>) -> Self { 2687 + Self { 2688 + inner, 2689 + accept_compression_encodings: Default::default(), 2690 + send_compression_encodings: Default::default(), 2691 + max_decoding_message_size: None, 2692 + max_encoding_message_size: None, 2693 + } 2694 + } 2695 + pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 2696 + where 2697 + F: tonic::service::Interceptor, 2698 + { 2699 + InterceptedService::new(Self::new(inner), interceptor) 2700 + } 2701 + /// Enable decompressing requests with the given encoding. 2702 + #[must_use] 2703 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 2704 + self.accept_compression_encodings.enable(encoding); 2705 + self 2706 + } 2707 + /// Compress responses with the given encoding, if the client supports it. 2708 + #[must_use] 2709 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 2710 + self.send_compression_encodings.enable(encoding); 2711 + self 2712 + } 2713 + /// Limits the maximum size of a decoded message. 2714 + /// 2715 + /// Default: `4MB` 2716 + #[must_use] 2717 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 2718 + self.max_decoding_message_size = Some(limit); 2719 + self 2720 + } 2721 + /// Limits the maximum size of an encoded message. 2722 + /// 2723 + /// Default: `usize::MAX` 2724 + #[must_use] 2725 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 2726 + self.max_encoding_message_size = Some(limit); 2727 + self 2728 + } 2729 + } 2730 + impl<T, B> tonic::codegen::Service<http::Request<B>> for PlaybackServiceServer<T> 2731 + where 2732 + T: PlaybackService, 2733 + B: Body + std::marker::Send + 'static, 2734 + B::Error: Into<StdError> + std::marker::Send + 'static, 2735 + { 2736 + type Response = http::Response<tonic::body::BoxBody>; 2737 + type Error = std::convert::Infallible; 2738 + type Future = BoxFuture<Self::Response, Self::Error>; 2739 + fn poll_ready( 2740 + &mut self, 2741 + _cx: &mut Context<'_>, 2742 + ) -> Poll<std::result::Result<(), Self::Error>> { 2743 + Poll::Ready(Ok(())) 2744 + } 2745 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 2746 + match req.uri().path() { 2747 + "/rockbox.v1alpha1.PlaybackService/Play" => { 2748 + #[allow(non_camel_case_types)] 2749 + struct PlaySvc<T: PlaybackService>(pub Arc<T>); 2750 + impl<T: PlaybackService> tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> { 2751 + type Response = super::PlayResponse; 2752 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 2753 + fn call( 2754 + &mut self, 2755 + request: tonic::Request<super::PlayRequest>, 2756 + ) -> Self::Future { 2757 + let inner = Arc::clone(&self.0); 2758 + let fut = 2759 + async move { <T as PlaybackService>::play(&inner, request).await }; 2760 + Box::pin(fut) 2761 + } 2762 + } 2763 + let accept_compression_encodings = self.accept_compression_encodings; 2764 + let send_compression_encodings = self.send_compression_encodings; 2765 + let max_decoding_message_size = self.max_decoding_message_size; 2766 + let max_encoding_message_size = self.max_encoding_message_size; 2767 + let inner = self.inner.clone(); 2768 + let fut = async move { 2769 + let method = PlaySvc(inner); 2770 + let codec = tonic::codec::ProstCodec::default(); 2771 + let mut grpc = tonic::server::Grpc::new(codec) 2772 + .apply_compression_config( 2773 + accept_compression_encodings, 2774 + send_compression_encodings, 2775 + ) 2776 + .apply_max_message_size_config( 2777 + max_decoding_message_size, 2778 + max_encoding_message_size, 2779 + ); 2780 + let res = grpc.unary(method, req).await; 2781 + Ok(res) 2782 + }; 2783 + Box::pin(fut) 2784 + } 2785 + "/rockbox.v1alpha1.PlaybackService/Pause" => { 2786 + #[allow(non_camel_case_types)] 2787 + struct PauseSvc<T: PlaybackService>(pub Arc<T>); 2788 + impl<T: PlaybackService> tonic::server::UnaryService<super::PauseRequest> for PauseSvc<T> { 2789 + type Response = super::PauseResponse; 2790 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 2791 + fn call( 2792 + &mut self, 2793 + request: tonic::Request<super::PauseRequest>, 2794 + ) -> Self::Future { 2795 + let inner = Arc::clone(&self.0); 2796 + let fut = 2797 + async move { <T as PlaybackService>::pause(&inner, request).await }; 2798 + Box::pin(fut) 2799 + } 2800 + } 2801 + let accept_compression_encodings = self.accept_compression_encodings; 2802 + let send_compression_encodings = self.send_compression_encodings; 2803 + let max_decoding_message_size = self.max_decoding_message_size; 2804 + let max_encoding_message_size = self.max_encoding_message_size; 2805 + let inner = self.inner.clone(); 2806 + let fut = async move { 2807 + let method = PauseSvc(inner); 2808 + let codec = tonic::codec::ProstCodec::default(); 2809 + let mut grpc = tonic::server::Grpc::new(codec) 2810 + .apply_compression_config( 2811 + accept_compression_encodings, 2812 + send_compression_encodings, 2813 + ) 2814 + .apply_max_message_size_config( 2815 + max_decoding_message_size, 2816 + max_encoding_message_size, 2817 + ); 2818 + let res = grpc.unary(method, req).await; 2819 + Ok(res) 2820 + }; 2821 + Box::pin(fut) 2822 + } 2823 + "/rockbox.v1alpha1.PlaybackService/PlayOrPause" => { 2824 + #[allow(non_camel_case_types)] 2825 + struct PlayOrPauseSvc<T: PlaybackService>(pub Arc<T>); 2826 + impl<T: PlaybackService> tonic::server::UnaryService<super::PlayOrPauseRequest> 2827 + for PlayOrPauseSvc<T> 2828 + { 2829 + type Response = super::PlayOrPauseResponse; 2830 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 2831 + fn call( 2832 + &mut self, 2833 + request: tonic::Request<super::PlayOrPauseRequest>, 2834 + ) -> Self::Future { 2835 + let inner = Arc::clone(&self.0); 2836 + let fut = async move { 2837 + <T as PlaybackService>::play_or_pause(&inner, request).await 2838 + }; 2839 + Box::pin(fut) 2840 + } 2841 + } 2842 + let accept_compression_encodings = self.accept_compression_encodings; 2843 + let send_compression_encodings = self.send_compression_encodings; 2844 + let max_decoding_message_size = self.max_decoding_message_size; 2845 + let max_encoding_message_size = self.max_encoding_message_size; 2846 + let inner = self.inner.clone(); 2847 + let fut = async move { 2848 + let method = PlayOrPauseSvc(inner); 2849 + let codec = tonic::codec::ProstCodec::default(); 2850 + let mut grpc = tonic::server::Grpc::new(codec) 2851 + .apply_compression_config( 2852 + accept_compression_encodings, 2853 + send_compression_encodings, 2854 + ) 2855 + .apply_max_message_size_config( 2856 + max_decoding_message_size, 2857 + max_encoding_message_size, 2858 + ); 2859 + let res = grpc.unary(method, req).await; 2860 + Ok(res) 2861 + }; 2862 + Box::pin(fut) 2863 + } 2864 + "/rockbox.v1alpha1.PlaybackService/Resume" => { 2865 + #[allow(non_camel_case_types)] 2866 + struct ResumeSvc<T: PlaybackService>(pub Arc<T>); 2867 + impl<T: PlaybackService> tonic::server::UnaryService<super::ResumeRequest> for ResumeSvc<T> { 2868 + type Response = super::ResumeResponse; 2869 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 2870 + fn call( 2871 + &mut self, 2872 + request: tonic::Request<super::ResumeRequest>, 2873 + ) -> Self::Future { 2874 + let inner = Arc::clone(&self.0); 2875 + let fut = async move { 2876 + <T as PlaybackService>::resume(&inner, request).await 2877 + }; 2878 + Box::pin(fut) 2879 + } 2880 + } 2881 + let accept_compression_encodings = self.accept_compression_encodings; 2882 + let send_compression_encodings = self.send_compression_encodings; 2883 + let max_decoding_message_size = self.max_decoding_message_size; 2884 + let max_encoding_message_size = self.max_encoding_message_size; 2885 + let inner = self.inner.clone(); 2886 + let fut = async move { 2887 + let method = ResumeSvc(inner); 2888 + let codec = tonic::codec::ProstCodec::default(); 2889 + let mut grpc = tonic::server::Grpc::new(codec) 2890 + .apply_compression_config( 2891 + accept_compression_encodings, 2892 + send_compression_encodings, 2893 + ) 2894 + .apply_max_message_size_config( 2895 + max_decoding_message_size, 2896 + max_encoding_message_size, 2897 + ); 2898 + let res = grpc.unary(method, req).await; 2899 + Ok(res) 2900 + }; 2901 + Box::pin(fut) 2902 + } 2903 + "/rockbox.v1alpha1.PlaybackService/Next" => { 2904 + #[allow(non_camel_case_types)] 2905 + struct NextSvc<T: PlaybackService>(pub Arc<T>); 2906 + impl<T: PlaybackService> tonic::server::UnaryService<super::NextRequest> for NextSvc<T> { 2907 + type Response = super::NextResponse; 2908 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 2909 + fn call( 2910 + &mut self, 2911 + request: tonic::Request<super::NextRequest>, 2912 + ) -> Self::Future { 2913 + let inner = Arc::clone(&self.0); 2914 + let fut = 2915 + async move { <T as PlaybackService>::next(&inner, request).await }; 2916 + Box::pin(fut) 2917 + } 2918 + } 2919 + let accept_compression_encodings = self.accept_compression_encodings; 2920 + let send_compression_encodings = self.send_compression_encodings; 2921 + let max_decoding_message_size = self.max_decoding_message_size; 2922 + let max_encoding_message_size = self.max_encoding_message_size; 2923 + let inner = self.inner.clone(); 2924 + let fut = async move { 2925 + let method = NextSvc(inner); 2926 + let codec = tonic::codec::ProstCodec::default(); 2927 + let mut grpc = tonic::server::Grpc::new(codec) 2928 + .apply_compression_config( 2929 + accept_compression_encodings, 2930 + send_compression_encodings, 2931 + ) 2932 + .apply_max_message_size_config( 2933 + max_decoding_message_size, 2934 + max_encoding_message_size, 2935 + ); 2936 + let res = grpc.unary(method, req).await; 2937 + Ok(res) 2938 + }; 2939 + Box::pin(fut) 2940 + } 2941 + "/rockbox.v1alpha1.PlaybackService/Previous" => { 2942 + #[allow(non_camel_case_types)] 2943 + struct PreviousSvc<T: PlaybackService>(pub Arc<T>); 2944 + impl<T: PlaybackService> tonic::server::UnaryService<super::PreviousRequest> for PreviousSvc<T> { 2945 + type Response = super::PreviousResponse; 2946 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 2947 + fn call( 2948 + &mut self, 2949 + request: tonic::Request<super::PreviousRequest>, 2950 + ) -> Self::Future { 2951 + let inner = Arc::clone(&self.0); 2952 + let fut = async move { 2953 + <T as PlaybackService>::previous(&inner, request).await 2954 + }; 2955 + Box::pin(fut) 2956 + } 2957 + } 2958 + let accept_compression_encodings = self.accept_compression_encodings; 2959 + let send_compression_encodings = self.send_compression_encodings; 2960 + let max_decoding_message_size = self.max_decoding_message_size; 2961 + let max_encoding_message_size = self.max_encoding_message_size; 2962 + let inner = self.inner.clone(); 2963 + let fut = async move { 2964 + let method = PreviousSvc(inner); 2965 + let codec = tonic::codec::ProstCodec::default(); 2966 + let mut grpc = tonic::server::Grpc::new(codec) 2967 + .apply_compression_config( 2968 + accept_compression_encodings, 2969 + send_compression_encodings, 2970 + ) 2971 + .apply_max_message_size_config( 2972 + max_decoding_message_size, 2973 + max_encoding_message_size, 2974 + ); 2975 + let res = grpc.unary(method, req).await; 2976 + Ok(res) 2977 + }; 2978 + Box::pin(fut) 2979 + } 2980 + "/rockbox.v1alpha1.PlaybackService/FastForwardRewind" => { 2981 + #[allow(non_camel_case_types)] 2982 + struct FastForwardRewindSvc<T: PlaybackService>(pub Arc<T>); 2983 + impl<T: PlaybackService> 2984 + tonic::server::UnaryService<super::FastForwardRewindRequest> 2985 + for FastForwardRewindSvc<T> 2986 + { 2987 + type Response = super::FastForwardRewindResponse; 2988 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 2989 + fn call( 2990 + &mut self, 2991 + request: tonic::Request<super::FastForwardRewindRequest>, 2992 + ) -> Self::Future { 2993 + let inner = Arc::clone(&self.0); 2994 + let fut = async move { 2995 + <T as PlaybackService>::fast_forward_rewind(&inner, request).await 2996 + }; 2997 + Box::pin(fut) 2998 + } 2999 + } 3000 + let accept_compression_encodings = self.accept_compression_encodings; 3001 + let send_compression_encodings = self.send_compression_encodings; 3002 + let max_decoding_message_size = self.max_decoding_message_size; 3003 + let max_encoding_message_size = self.max_encoding_message_size; 3004 + let inner = self.inner.clone(); 3005 + let fut = async move { 3006 + let method = FastForwardRewindSvc(inner); 3007 + let codec = tonic::codec::ProstCodec::default(); 3008 + let mut grpc = tonic::server::Grpc::new(codec) 3009 + .apply_compression_config( 3010 + accept_compression_encodings, 3011 + send_compression_encodings, 3012 + ) 3013 + .apply_max_message_size_config( 3014 + max_decoding_message_size, 3015 + max_encoding_message_size, 3016 + ); 3017 + let res = grpc.unary(method, req).await; 3018 + Ok(res) 3019 + }; 3020 + Box::pin(fut) 3021 + } 3022 + "/rockbox.v1alpha1.PlaybackService/Status" => { 3023 + #[allow(non_camel_case_types)] 3024 + struct StatusSvc<T: PlaybackService>(pub Arc<T>); 3025 + impl<T: PlaybackService> tonic::server::UnaryService<super::StatusRequest> for StatusSvc<T> { 3026 + type Response = super::StatusResponse; 3027 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3028 + fn call( 3029 + &mut self, 3030 + request: tonic::Request<super::StatusRequest>, 3031 + ) -> Self::Future { 3032 + let inner = Arc::clone(&self.0); 3033 + let fut = async move { 3034 + <T as PlaybackService>::status(&inner, request).await 3035 + }; 3036 + Box::pin(fut) 3037 + } 3038 + } 3039 + let accept_compression_encodings = self.accept_compression_encodings; 3040 + let send_compression_encodings = self.send_compression_encodings; 3041 + let max_decoding_message_size = self.max_decoding_message_size; 3042 + let max_encoding_message_size = self.max_encoding_message_size; 3043 + let inner = self.inner.clone(); 3044 + let fut = async move { 3045 + let method = StatusSvc(inner); 3046 + let codec = tonic::codec::ProstCodec::default(); 3047 + let mut grpc = tonic::server::Grpc::new(codec) 3048 + .apply_compression_config( 3049 + accept_compression_encodings, 3050 + send_compression_encodings, 3051 + ) 3052 + .apply_max_message_size_config( 3053 + max_decoding_message_size, 3054 + max_encoding_message_size, 3055 + ); 3056 + let res = grpc.unary(method, req).await; 3057 + Ok(res) 3058 + }; 3059 + Box::pin(fut) 3060 + } 3061 + "/rockbox.v1alpha1.PlaybackService/CurrentTrack" => { 3062 + #[allow(non_camel_case_types)] 3063 + struct CurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 3064 + impl<T: PlaybackService> tonic::server::UnaryService<super::CurrentTrackRequest> 3065 + for CurrentTrackSvc<T> 3066 + { 3067 + type Response = super::CurrentTrackResponse; 3068 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3069 + fn call( 3070 + &mut self, 3071 + request: tonic::Request<super::CurrentTrackRequest>, 3072 + ) -> Self::Future { 3073 + let inner = Arc::clone(&self.0); 3074 + let fut = async move { 3075 + <T as PlaybackService>::current_track(&inner, request).await 3076 + }; 3077 + Box::pin(fut) 3078 + } 3079 + } 3080 + let accept_compression_encodings = self.accept_compression_encodings; 3081 + let send_compression_encodings = self.send_compression_encodings; 3082 + let max_decoding_message_size = self.max_decoding_message_size; 3083 + let max_encoding_message_size = self.max_encoding_message_size; 3084 + let inner = self.inner.clone(); 3085 + let fut = async move { 3086 + let method = CurrentTrackSvc(inner); 3087 + let codec = tonic::codec::ProstCodec::default(); 3088 + let mut grpc = tonic::server::Grpc::new(codec) 3089 + .apply_compression_config( 3090 + accept_compression_encodings, 3091 + send_compression_encodings, 3092 + ) 3093 + .apply_max_message_size_config( 3094 + max_decoding_message_size, 3095 + max_encoding_message_size, 3096 + ); 3097 + let res = grpc.unary(method, req).await; 3098 + Ok(res) 3099 + }; 3100 + Box::pin(fut) 3101 + } 3102 + "/rockbox.v1alpha1.PlaybackService/NextTrack" => { 3103 + #[allow(non_camel_case_types)] 3104 + struct NextTrackSvc<T: PlaybackService>(pub Arc<T>); 3105 + impl<T: PlaybackService> tonic::server::UnaryService<super::NextTrackRequest> for NextTrackSvc<T> { 3106 + type Response = super::NextTrackResponse; 3107 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3108 + fn call( 3109 + &mut self, 3110 + request: tonic::Request<super::NextTrackRequest>, 3111 + ) -> Self::Future { 3112 + let inner = Arc::clone(&self.0); 3113 + let fut = async move { 3114 + <T as PlaybackService>::next_track(&inner, request).await 3115 + }; 3116 + Box::pin(fut) 3117 + } 3118 + } 3119 + let accept_compression_encodings = self.accept_compression_encodings; 3120 + let send_compression_encodings = self.send_compression_encodings; 3121 + let max_decoding_message_size = self.max_decoding_message_size; 3122 + let max_encoding_message_size = self.max_encoding_message_size; 3123 + let inner = self.inner.clone(); 3124 + let fut = async move { 3125 + let method = NextTrackSvc(inner); 3126 + let codec = tonic::codec::ProstCodec::default(); 3127 + let mut grpc = tonic::server::Grpc::new(codec) 3128 + .apply_compression_config( 3129 + accept_compression_encodings, 3130 + send_compression_encodings, 3131 + ) 3132 + .apply_max_message_size_config( 3133 + max_decoding_message_size, 3134 + max_encoding_message_size, 3135 + ); 3136 + let res = grpc.unary(method, req).await; 3137 + Ok(res) 3138 + }; 3139 + Box::pin(fut) 3140 + } 3141 + "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks" => { 3142 + #[allow(non_camel_case_types)] 3143 + struct FlushAndReloadTracksSvc<T: PlaybackService>(pub Arc<T>); 3144 + impl<T: PlaybackService> 3145 + tonic::server::UnaryService<super::FlushAndReloadTracksRequest> 3146 + for FlushAndReloadTracksSvc<T> 3147 + { 3148 + type Response = super::FlushAndReloadTracksResponse; 3149 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3150 + fn call( 3151 + &mut self, 3152 + request: tonic::Request<super::FlushAndReloadTracksRequest>, 3153 + ) -> Self::Future { 3154 + let inner = Arc::clone(&self.0); 3155 + let fut = async move { 3156 + <T as PlaybackService>::flush_and_reload_tracks(&inner, request) 3157 + .await 3158 + }; 3159 + Box::pin(fut) 3160 + } 3161 + } 3162 + let accept_compression_encodings = self.accept_compression_encodings; 3163 + let send_compression_encodings = self.send_compression_encodings; 3164 + let max_decoding_message_size = self.max_decoding_message_size; 3165 + let max_encoding_message_size = self.max_encoding_message_size; 3166 + let inner = self.inner.clone(); 3167 + let fut = async move { 3168 + let method = FlushAndReloadTracksSvc(inner); 3169 + let codec = tonic::codec::ProstCodec::default(); 3170 + let mut grpc = tonic::server::Grpc::new(codec) 3171 + .apply_compression_config( 3172 + accept_compression_encodings, 3173 + send_compression_encodings, 3174 + ) 3175 + .apply_max_message_size_config( 3176 + max_decoding_message_size, 3177 + max_encoding_message_size, 3178 + ); 3179 + let res = grpc.unary(method, req).await; 3180 + Ok(res) 3181 + }; 3182 + Box::pin(fut) 3183 + } 3184 + "/rockbox.v1alpha1.PlaybackService/GetFilePosition" => { 3185 + #[allow(non_camel_case_types)] 3186 + struct GetFilePositionSvc<T: PlaybackService>(pub Arc<T>); 3187 + impl<T: PlaybackService> 3188 + tonic::server::UnaryService<super::GetFilePositionRequest> 3189 + for GetFilePositionSvc<T> 3190 + { 3191 + type Response = super::GetFilePositionResponse; 3192 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3193 + fn call( 3194 + &mut self, 3195 + request: tonic::Request<super::GetFilePositionRequest>, 3196 + ) -> Self::Future { 3197 + let inner = Arc::clone(&self.0); 3198 + let fut = async move { 3199 + <T as PlaybackService>::get_file_position(&inner, request).await 3200 + }; 3201 + Box::pin(fut) 3202 + } 3203 + } 3204 + let accept_compression_encodings = self.accept_compression_encodings; 3205 + let send_compression_encodings = self.send_compression_encodings; 3206 + let max_decoding_message_size = self.max_decoding_message_size; 3207 + let max_encoding_message_size = self.max_encoding_message_size; 3208 + let inner = self.inner.clone(); 3209 + let fut = async move { 3210 + let method = GetFilePositionSvc(inner); 3211 + let codec = tonic::codec::ProstCodec::default(); 3212 + let mut grpc = tonic::server::Grpc::new(codec) 3213 + .apply_compression_config( 3214 + accept_compression_encodings, 3215 + send_compression_encodings, 3216 + ) 3217 + .apply_max_message_size_config( 3218 + max_decoding_message_size, 3219 + max_encoding_message_size, 3220 + ); 3221 + let res = grpc.unary(method, req).await; 3222 + Ok(res) 3223 + }; 3224 + Box::pin(fut) 3225 + } 3226 + "/rockbox.v1alpha1.PlaybackService/HardStop" => { 3227 + #[allow(non_camel_case_types)] 3228 + struct HardStopSvc<T: PlaybackService>(pub Arc<T>); 3229 + impl<T: PlaybackService> tonic::server::UnaryService<super::HardStopRequest> for HardStopSvc<T> { 3230 + type Response = super::HardStopResponse; 3231 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3232 + fn call( 3233 + &mut self, 3234 + request: tonic::Request<super::HardStopRequest>, 3235 + ) -> Self::Future { 3236 + let inner = Arc::clone(&self.0); 3237 + let fut = async move { 3238 + <T as PlaybackService>::hard_stop(&inner, request).await 3239 + }; 3240 + Box::pin(fut) 3241 + } 3242 + } 3243 + let accept_compression_encodings = self.accept_compression_encodings; 3244 + let send_compression_encodings = self.send_compression_encodings; 3245 + let max_decoding_message_size = self.max_decoding_message_size; 3246 + let max_encoding_message_size = self.max_encoding_message_size; 3247 + let inner = self.inner.clone(); 3248 + let fut = async move { 3249 + let method = HardStopSvc(inner); 3250 + let codec = tonic::codec::ProstCodec::default(); 3251 + let mut grpc = tonic::server::Grpc::new(codec) 3252 + .apply_compression_config( 3253 + accept_compression_encodings, 3254 + send_compression_encodings, 3255 + ) 3256 + .apply_max_message_size_config( 3257 + max_decoding_message_size, 3258 + max_encoding_message_size, 3259 + ); 3260 + let res = grpc.unary(method, req).await; 3261 + Ok(res) 3262 + }; 3263 + Box::pin(fut) 3264 + } 3265 + "/rockbox.v1alpha1.PlaybackService/PlayAlbum" => { 3266 + #[allow(non_camel_case_types)] 3267 + struct PlayAlbumSvc<T: PlaybackService>(pub Arc<T>); 3268 + impl<T: PlaybackService> tonic::server::UnaryService<super::PlayAlbumRequest> for PlayAlbumSvc<T> { 3269 + type Response = super::PlayAlbumResponse; 3270 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3271 + fn call( 3272 + &mut self, 3273 + request: tonic::Request<super::PlayAlbumRequest>, 3274 + ) -> Self::Future { 3275 + let inner = Arc::clone(&self.0); 3276 + let fut = async move { 3277 + <T as PlaybackService>::play_album(&inner, request).await 3278 + }; 3279 + Box::pin(fut) 3280 + } 3281 + } 3282 + let accept_compression_encodings = self.accept_compression_encodings; 3283 + let send_compression_encodings = self.send_compression_encodings; 3284 + let max_decoding_message_size = self.max_decoding_message_size; 3285 + let max_encoding_message_size = self.max_encoding_message_size; 3286 + let inner = self.inner.clone(); 3287 + let fut = async move { 3288 + let method = PlayAlbumSvc(inner); 3289 + let codec = tonic::codec::ProstCodec::default(); 3290 + let mut grpc = tonic::server::Grpc::new(codec) 3291 + .apply_compression_config( 3292 + accept_compression_encodings, 3293 + send_compression_encodings, 3294 + ) 3295 + .apply_max_message_size_config( 3296 + max_decoding_message_size, 3297 + max_encoding_message_size, 3298 + ); 3299 + let res = grpc.unary(method, req).await; 3300 + Ok(res) 3301 + }; 3302 + Box::pin(fut) 3303 + } 3304 + "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks" => { 3305 + #[allow(non_camel_case_types)] 3306 + struct PlayArtistTracksSvc<T: PlaybackService>(pub Arc<T>); 3307 + impl<T: PlaybackService> 3308 + tonic::server::UnaryService<super::PlayArtistTracksRequest> 3309 + for PlayArtistTracksSvc<T> 3310 + { 3311 + type Response = super::PlayArtistTracksResponse; 3312 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3313 + fn call( 3314 + &mut self, 3315 + request: tonic::Request<super::PlayArtistTracksRequest>, 3316 + ) -> Self::Future { 3317 + let inner = Arc::clone(&self.0); 3318 + let fut = async move { 3319 + <T as PlaybackService>::play_artist_tracks(&inner, request).await 3320 + }; 3321 + Box::pin(fut) 3322 + } 3323 + } 3324 + let accept_compression_encodings = self.accept_compression_encodings; 3325 + let send_compression_encodings = self.send_compression_encodings; 3326 + let max_decoding_message_size = self.max_decoding_message_size; 3327 + let max_encoding_message_size = self.max_encoding_message_size; 3328 + let inner = self.inner.clone(); 3329 + let fut = async move { 3330 + let method = PlayArtistTracksSvc(inner); 3331 + let codec = tonic::codec::ProstCodec::default(); 3332 + let mut grpc = tonic::server::Grpc::new(codec) 3333 + .apply_compression_config( 3334 + accept_compression_encodings, 3335 + send_compression_encodings, 3336 + ) 3337 + .apply_max_message_size_config( 3338 + max_decoding_message_size, 3339 + max_encoding_message_size, 3340 + ); 3341 + let res = grpc.unary(method, req).await; 3342 + Ok(res) 3343 + }; 3344 + Box::pin(fut) 3345 + } 3346 + "/rockbox.v1alpha1.PlaybackService/PlayPlaylist" => { 3347 + #[allow(non_camel_case_types)] 3348 + struct PlayPlaylistSvc<T: PlaybackService>(pub Arc<T>); 3349 + impl<T: PlaybackService> tonic::server::UnaryService<super::PlayPlaylistRequest> 3350 + for PlayPlaylistSvc<T> 3351 + { 3352 + type Response = super::PlayPlaylistResponse; 3353 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3354 + fn call( 3355 + &mut self, 3356 + request: tonic::Request<super::PlayPlaylistRequest>, 3357 + ) -> Self::Future { 3358 + let inner = Arc::clone(&self.0); 3359 + let fut = async move { 3360 + <T as PlaybackService>::play_playlist(&inner, request).await 3361 + }; 3362 + Box::pin(fut) 3363 + } 3364 + } 3365 + let accept_compression_encodings = self.accept_compression_encodings; 3366 + let send_compression_encodings = self.send_compression_encodings; 3367 + let max_decoding_message_size = self.max_decoding_message_size; 3368 + let max_encoding_message_size = self.max_encoding_message_size; 3369 + let inner = self.inner.clone(); 3370 + let fut = async move { 3371 + let method = PlayPlaylistSvc(inner); 3372 + let codec = tonic::codec::ProstCodec::default(); 3373 + let mut grpc = tonic::server::Grpc::new(codec) 3374 + .apply_compression_config( 3375 + accept_compression_encodings, 3376 + send_compression_encodings, 3377 + ) 3378 + .apply_max_message_size_config( 3379 + max_decoding_message_size, 3380 + max_encoding_message_size, 3381 + ); 3382 + let res = grpc.unary(method, req).await; 3383 + Ok(res) 3384 + }; 3385 + Box::pin(fut) 3386 + } 3387 + "/rockbox.v1alpha1.PlaybackService/PlayDirectory" => { 3388 + #[allow(non_camel_case_types)] 3389 + struct PlayDirectorySvc<T: PlaybackService>(pub Arc<T>); 3390 + impl<T: PlaybackService> 3391 + tonic::server::UnaryService<super::PlayDirectoryRequest> 3392 + for PlayDirectorySvc<T> 3393 + { 3394 + type Response = super::PlayDirectoryResponse; 3395 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3396 + fn call( 3397 + &mut self, 3398 + request: tonic::Request<super::PlayDirectoryRequest>, 3399 + ) -> Self::Future { 3400 + let inner = Arc::clone(&self.0); 3401 + let fut = async move { 3402 + <T as PlaybackService>::play_directory(&inner, request).await 3403 + }; 3404 + Box::pin(fut) 3405 + } 3406 + } 3407 + let accept_compression_encodings = self.accept_compression_encodings; 3408 + let send_compression_encodings = self.send_compression_encodings; 3409 + let max_decoding_message_size = self.max_decoding_message_size; 3410 + let max_encoding_message_size = self.max_encoding_message_size; 3411 + let inner = self.inner.clone(); 3412 + let fut = async move { 3413 + let method = PlayDirectorySvc(inner); 3414 + let codec = tonic::codec::ProstCodec::default(); 3415 + let mut grpc = tonic::server::Grpc::new(codec) 3416 + .apply_compression_config( 3417 + accept_compression_encodings, 3418 + send_compression_encodings, 3419 + ) 3420 + .apply_max_message_size_config( 3421 + max_decoding_message_size, 3422 + max_encoding_message_size, 3423 + ); 3424 + let res = grpc.unary(method, req).await; 3425 + Ok(res) 3426 + }; 3427 + Box::pin(fut) 3428 + } 3429 + "/rockbox.v1alpha1.PlaybackService/PlayTrack" => { 3430 + #[allow(non_camel_case_types)] 3431 + struct PlayTrackSvc<T: PlaybackService>(pub Arc<T>); 3432 + impl<T: PlaybackService> tonic::server::UnaryService<super::PlayTrackRequest> for PlayTrackSvc<T> { 3433 + type Response = super::PlayTrackResponse; 3434 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3435 + fn call( 3436 + &mut self, 3437 + request: tonic::Request<super::PlayTrackRequest>, 3438 + ) -> Self::Future { 3439 + let inner = Arc::clone(&self.0); 3440 + let fut = async move { 3441 + <T as PlaybackService>::play_track(&inner, request).await 3442 + }; 3443 + Box::pin(fut) 3444 + } 3445 + } 3446 + let accept_compression_encodings = self.accept_compression_encodings; 3447 + let send_compression_encodings = self.send_compression_encodings; 3448 + let max_decoding_message_size = self.max_decoding_message_size; 3449 + let max_encoding_message_size = self.max_encoding_message_size; 3450 + let inner = self.inner.clone(); 3451 + let fut = async move { 3452 + let method = PlayTrackSvc(inner); 3453 + let codec = tonic::codec::ProstCodec::default(); 3454 + let mut grpc = tonic::server::Grpc::new(codec) 3455 + .apply_compression_config( 3456 + accept_compression_encodings, 3457 + send_compression_encodings, 3458 + ) 3459 + .apply_max_message_size_config( 3460 + max_decoding_message_size, 3461 + max_encoding_message_size, 3462 + ); 3463 + let res = grpc.unary(method, req).await; 3464 + Ok(res) 3465 + }; 3466 + Box::pin(fut) 3467 + } 3468 + "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks" => { 3469 + #[allow(non_camel_case_types)] 3470 + struct PlayLikedTracksSvc<T: PlaybackService>(pub Arc<T>); 3471 + impl<T: PlaybackService> 3472 + tonic::server::UnaryService<super::PlayLikedTracksRequest> 3473 + for PlayLikedTracksSvc<T> 3474 + { 3475 + type Response = super::PlayLikedTracksResponse; 3476 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3477 + fn call( 3478 + &mut self, 3479 + request: tonic::Request<super::PlayLikedTracksRequest>, 3480 + ) -> Self::Future { 3481 + let inner = Arc::clone(&self.0); 3482 + let fut = async move { 3483 + <T as PlaybackService>::play_liked_tracks(&inner, request).await 3484 + }; 3485 + Box::pin(fut) 3486 + } 3487 + } 3488 + let accept_compression_encodings = self.accept_compression_encodings; 3489 + let send_compression_encodings = self.send_compression_encodings; 3490 + let max_decoding_message_size = self.max_decoding_message_size; 3491 + let max_encoding_message_size = self.max_encoding_message_size; 3492 + let inner = self.inner.clone(); 3493 + let fut = async move { 3494 + let method = PlayLikedTracksSvc(inner); 3495 + let codec = tonic::codec::ProstCodec::default(); 3496 + let mut grpc = tonic::server::Grpc::new(codec) 3497 + .apply_compression_config( 3498 + accept_compression_encodings, 3499 + send_compression_encodings, 3500 + ) 3501 + .apply_max_message_size_config( 3502 + max_decoding_message_size, 3503 + max_encoding_message_size, 3504 + ); 3505 + let res = grpc.unary(method, req).await; 3506 + Ok(res) 3507 + }; 3508 + Box::pin(fut) 3509 + } 3510 + "/rockbox.v1alpha1.PlaybackService/PlayAllTracks" => { 3511 + #[allow(non_camel_case_types)] 3512 + struct PlayAllTracksSvc<T: PlaybackService>(pub Arc<T>); 3513 + impl<T: PlaybackService> 3514 + tonic::server::UnaryService<super::PlayAllTracksRequest> 3515 + for PlayAllTracksSvc<T> 3516 + { 3517 + type Response = super::PlayAllTracksResponse; 3518 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3519 + fn call( 3520 + &mut self, 3521 + request: tonic::Request<super::PlayAllTracksRequest>, 3522 + ) -> Self::Future { 3523 + let inner = Arc::clone(&self.0); 3524 + let fut = async move { 3525 + <T as PlaybackService>::play_all_tracks(&inner, request).await 3526 + }; 3527 + Box::pin(fut) 3528 + } 3529 + } 3530 + let accept_compression_encodings = self.accept_compression_encodings; 3531 + let send_compression_encodings = self.send_compression_encodings; 3532 + let max_decoding_message_size = self.max_decoding_message_size; 3533 + let max_encoding_message_size = self.max_encoding_message_size; 3534 + let inner = self.inner.clone(); 3535 + let fut = async move { 3536 + let method = PlayAllTracksSvc(inner); 3537 + let codec = tonic::codec::ProstCodec::default(); 3538 + let mut grpc = tonic::server::Grpc::new(codec) 3539 + .apply_compression_config( 3540 + accept_compression_encodings, 3541 + send_compression_encodings, 3542 + ) 3543 + .apply_max_message_size_config( 3544 + max_decoding_message_size, 3545 + max_encoding_message_size, 3546 + ); 3547 + let res = grpc.unary(method, req).await; 3548 + Ok(res) 3549 + }; 3550 + Box::pin(fut) 3551 + } 3552 + "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack" => { 3553 + #[allow(non_camel_case_types)] 3554 + struct StreamCurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 3555 + impl<T: PlaybackService> 3556 + tonic::server::ServerStreamingService<super::StreamCurrentTrackRequest> 3557 + for StreamCurrentTrackSvc<T> 3558 + { 3559 + type Response = super::CurrentTrackResponse; 3560 + type ResponseStream = T::StreamCurrentTrackStream; 3561 + type Future = 3562 + BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 3563 + fn call( 3564 + &mut self, 3565 + request: tonic::Request<super::StreamCurrentTrackRequest>, 3566 + ) -> Self::Future { 3567 + let inner = Arc::clone(&self.0); 3568 + let fut = async move { 3569 + <T as PlaybackService>::stream_current_track(&inner, request).await 3570 + }; 3571 + Box::pin(fut) 3572 + } 3573 + } 3574 + let accept_compression_encodings = self.accept_compression_encodings; 3575 + let send_compression_encodings = self.send_compression_encodings; 3576 + let max_decoding_message_size = self.max_decoding_message_size; 3577 + let max_encoding_message_size = self.max_encoding_message_size; 3578 + let inner = self.inner.clone(); 3579 + let fut = async move { 3580 + let method = StreamCurrentTrackSvc(inner); 3581 + let codec = tonic::codec::ProstCodec::default(); 3582 + let mut grpc = tonic::server::Grpc::new(codec) 3583 + .apply_compression_config( 3584 + accept_compression_encodings, 3585 + send_compression_encodings, 3586 + ) 3587 + .apply_max_message_size_config( 3588 + max_decoding_message_size, 3589 + max_encoding_message_size, 3590 + ); 3591 + let res = grpc.server_streaming(method, req).await; 3592 + Ok(res) 3593 + }; 3594 + Box::pin(fut) 3595 + } 3596 + "/rockbox.v1alpha1.PlaybackService/StreamStatus" => { 3597 + #[allow(non_camel_case_types)] 3598 + struct StreamStatusSvc<T: PlaybackService>(pub Arc<T>); 3599 + impl<T: PlaybackService> 3600 + tonic::server::ServerStreamingService<super::StreamStatusRequest> 3601 + for StreamStatusSvc<T> 3602 + { 3603 + type Response = super::StatusResponse; 3604 + type ResponseStream = T::StreamStatusStream; 3605 + type Future = 3606 + BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 3607 + fn call( 3608 + &mut self, 3609 + request: tonic::Request<super::StreamStatusRequest>, 3610 + ) -> Self::Future { 3611 + let inner = Arc::clone(&self.0); 3612 + let fut = async move { 3613 + <T as PlaybackService>::stream_status(&inner, request).await 3614 + }; 3615 + Box::pin(fut) 3616 + } 3617 + } 3618 + let accept_compression_encodings = self.accept_compression_encodings; 3619 + let send_compression_encodings = self.send_compression_encodings; 3620 + let max_decoding_message_size = self.max_decoding_message_size; 3621 + let max_encoding_message_size = self.max_encoding_message_size; 3622 + let inner = self.inner.clone(); 3623 + let fut = async move { 3624 + let method = StreamStatusSvc(inner); 3625 + let codec = tonic::codec::ProstCodec::default(); 3626 + let mut grpc = tonic::server::Grpc::new(codec) 3627 + .apply_compression_config( 3628 + accept_compression_encodings, 3629 + send_compression_encodings, 3630 + ) 3631 + .apply_max_message_size_config( 3632 + max_decoding_message_size, 3633 + max_encoding_message_size, 3634 + ); 3635 + let res = grpc.server_streaming(method, req).await; 3636 + Ok(res) 3637 + }; 3638 + Box::pin(fut) 3639 + } 3640 + "/rockbox.v1alpha1.PlaybackService/StreamPlaylist" => { 3641 + #[allow(non_camel_case_types)] 3642 + struct StreamPlaylistSvc<T: PlaybackService>(pub Arc<T>); 3643 + impl<T: PlaybackService> 3644 + tonic::server::ServerStreamingService<super::StreamPlaylistRequest> 3645 + for StreamPlaylistSvc<T> 3646 + { 3647 + type Response = super::PlaylistResponse; 3648 + type ResponseStream = T::StreamPlaylistStream; 3649 + type Future = 3650 + BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 3651 + fn call( 3652 + &mut self, 3653 + request: tonic::Request<super::StreamPlaylistRequest>, 3654 + ) -> Self::Future { 3655 + let inner = Arc::clone(&self.0); 3656 + let fut = async move { 3657 + <T as PlaybackService>::stream_playlist(&inner, request).await 3658 + }; 3659 + Box::pin(fut) 3660 + } 3661 + } 3662 + let accept_compression_encodings = self.accept_compression_encodings; 3663 + let send_compression_encodings = self.send_compression_encodings; 3664 + let max_decoding_message_size = self.max_decoding_message_size; 3665 + let max_encoding_message_size = self.max_encoding_message_size; 3666 + let inner = self.inner.clone(); 3667 + let fut = async move { 3668 + let method = StreamPlaylistSvc(inner); 3669 + let codec = tonic::codec::ProstCodec::default(); 3670 + let mut grpc = tonic::server::Grpc::new(codec) 3671 + .apply_compression_config( 3672 + accept_compression_encodings, 3673 + send_compression_encodings, 3674 + ) 3675 + .apply_max_message_size_config( 3676 + max_decoding_message_size, 3677 + max_encoding_message_size, 3678 + ); 3679 + let res = grpc.server_streaming(method, req).await; 3680 + Ok(res) 3681 + }; 3682 + Box::pin(fut) 3683 + } 3684 + _ => Box::pin(async move { 3685 + let mut response = http::Response::new(empty_body()); 3686 + let headers = response.headers_mut(); 3687 + headers.insert( 3688 + tonic::Status::GRPC_STATUS, 3689 + (tonic::Code::Unimplemented as i32).into(), 3690 + ); 3691 + headers.insert( 3692 + http::header::CONTENT_TYPE, 3693 + tonic::metadata::GRPC_CONTENT_TYPE, 3694 + ); 3695 + Ok(response) 3696 + }), 3697 + } 3698 + } 3699 + } 3700 + impl<T> Clone for PlaybackServiceServer<T> { 3701 + fn clone(&self) -> Self { 3702 + let inner = self.inner.clone(); 3703 + Self { 3704 + inner, 3705 + accept_compression_encodings: self.accept_compression_encodings, 3706 + send_compression_encodings: self.send_compression_encodings, 3707 + max_decoding_message_size: self.max_decoding_message_size, 3708 + max_encoding_message_size: self.max_encoding_message_size, 3709 + } 3710 + } 3711 + } 3712 + /// Generated gRPC service name 3713 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.PlaybackService"; 3714 + impl<T> tonic::server::NamedService for PlaybackServiceServer<T> { 3715 + const NAME: &'static str = SERVICE_NAME; 3716 + } 3717 + } 3718 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3719 + pub struct GetCurrentRequest {} 3720 + #[derive(Clone, PartialEq, ::prost::Message)] 3721 + pub struct GetCurrentResponse { 3722 + #[prost(int32, tag = "1")] 3723 + pub index: i32, 3724 + #[prost(int32, tag = "2")] 3725 + pub amount: i32, 3726 + #[prost(int32, tag = "3")] 3727 + pub max_playlist_size: i32, 3728 + #[prost(int32, tag = "4")] 3729 + pub first_index: i32, 3730 + #[prost(int32, tag = "5")] 3731 + pub last_insert_pos: i32, 3732 + #[prost(int32, tag = "6")] 3733 + pub seed: i32, 3734 + #[prost(int32, tag = "7")] 3735 + pub last_shuffled_start: i32, 3736 + #[prost(message, repeated, tag = "8")] 3737 + pub tracks: ::prost::alloc::vec::Vec<CurrentTrackResponse>, 3738 + } 3739 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3740 + pub struct GetResumeInfoRequest {} 3741 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3742 + pub struct GetResumeInfoResponse {} 3743 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3744 + pub struct GetTrackInfoRequest {} 3745 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3746 + pub struct GetTrackInfoResponse {} 3747 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3748 + pub struct GetFirstIndexRequest {} 3749 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3750 + pub struct GetFirstIndexResponse {} 3751 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3752 + pub struct GetDisplayIndexRequest {} 3753 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3754 + pub struct GetDisplayIndexResponse {} 3755 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3756 + pub struct AmountRequest {} 3757 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3758 + pub struct AmountResponse { 3759 + #[prost(int32, tag = "1")] 3760 + pub amount: i32, 3761 + } 3762 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3763 + pub struct PlaylistResumeRequest {} 3764 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3765 + pub struct PlaylistResumeResponse { 3766 + #[prost(int32, tag = "1")] 3767 + pub code: i32, 3768 + } 3769 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3770 + pub struct ResumeTrackRequest { 3771 + #[prost(int32, tag = "1")] 3772 + pub start_index: i32, 3773 + #[prost(uint32, tag = "2")] 3774 + pub crc: u32, 3775 + #[prost(uint64, tag = "3")] 3776 + pub elapsed: u64, 3777 + #[prost(uint64, tag = "4")] 3778 + pub offset: u64, 3779 + } 3780 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3781 + pub struct ResumeTrackResponse {} 3782 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3783 + pub struct SetModifiedRequest {} 3784 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3785 + pub struct SetModifiedResponse {} 3786 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3787 + pub struct StartRequest { 3788 + #[prost(int32, optional, tag = "1")] 3789 + pub start_index: ::core::option::Option<i32>, 3790 + #[prost(int32, optional, tag = "2")] 3791 + pub elapsed: ::core::option::Option<i32>, 3792 + #[prost(int32, optional, tag = "3")] 3793 + pub offset: ::core::option::Option<i32>, 3794 + } 3795 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3796 + pub struct StartResponse {} 3797 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3798 + pub struct SyncRequest {} 3799 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3800 + pub struct SyncResponse {} 3801 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3802 + pub struct RemoveAllTracksRequest {} 3803 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3804 + pub struct RemoveAllTracksResponse {} 3805 + #[derive(Clone, PartialEq, ::prost::Message)] 3806 + pub struct RemoveTracksRequest { 3807 + #[prost(int32, repeated, tag = "1")] 3808 + pub positions: ::prost::alloc::vec::Vec<i32>, 3809 + } 3810 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3811 + pub struct RemoveTracksResponse {} 3812 + #[derive(Clone, PartialEq, ::prost::Message)] 3813 + pub struct CreatePlaylistRequest { 3814 + #[prost(string, tag = "1")] 3815 + pub name: ::prost::alloc::string::String, 3816 + #[prost(string, repeated, tag = "2")] 3817 + pub tracks: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, 3818 + #[prost(string, optional, tag = "3")] 3819 + pub folder_id: ::core::option::Option<::prost::alloc::string::String>, 3820 + } 3821 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3822 + pub struct CreatePlaylistResponse { 3823 + #[prost(int32, tag = "1")] 3824 + pub start_index: i32, 3825 + } 3826 + #[derive(Clone, PartialEq, ::prost::Message)] 3827 + pub struct InsertTracksRequest { 3828 + #[prost(string, optional, tag = "1")] 3829 + pub playlist_id: ::core::option::Option<::prost::alloc::string::String>, 3830 + #[prost(int32, tag = "2")] 3831 + pub position: i32, 3832 + #[prost(string, repeated, tag = "3")] 3833 + pub tracks: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, 3834 + #[prost(bool, optional, tag = "4")] 3835 + pub shuffle: ::core::option::Option<bool>, 3836 + } 3837 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3838 + pub struct InsertTracksResponse {} 3839 + #[derive(Clone, PartialEq, ::prost::Message)] 3840 + pub struct InsertDirectoryRequest { 3841 + #[prost(string, optional, tag = "1")] 3842 + pub playlist_id: ::core::option::Option<::prost::alloc::string::String>, 3843 + #[prost(int32, tag = "2")] 3844 + pub position: i32, 3845 + #[prost(string, tag = "3")] 3846 + pub directory: ::prost::alloc::string::String, 3847 + #[prost(bool, optional, tag = "4")] 3848 + pub recurse: ::core::option::Option<bool>, 3849 + #[prost(bool, optional, tag = "5")] 3850 + pub shuffle: ::core::option::Option<bool>, 3851 + } 3852 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3853 + pub struct InsertDirectoryResponse {} 3854 + #[derive(Clone, PartialEq, ::prost::Message)] 3855 + pub struct InsertPlaylistRequest { 3856 + #[prost(int32, tag = "1")] 3857 + pub position: i32, 3858 + #[prost(string, tag = "2")] 3859 + pub target_playlist_id: ::prost::alloc::string::String, 3860 + #[prost(string, tag = "3")] 3861 + pub playlist_id: ::prost::alloc::string::String, 3862 + #[prost(bool, optional, tag = "4")] 3863 + pub shuffle: ::core::option::Option<bool>, 3864 + } 3865 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3866 + pub struct InsertPlaylistResponse {} 3867 + #[derive(Clone, PartialEq, ::prost::Message)] 3868 + pub struct InsertAlbumRequest { 3869 + #[prost(int32, tag = "1")] 3870 + pub position: i32, 3871 + #[prost(string, tag = "2")] 3872 + pub album_id: ::prost::alloc::string::String, 3873 + #[prost(bool, optional, tag = "3")] 3874 + pub shuffle: ::core::option::Option<bool>, 3875 + } 3876 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3877 + pub struct InsertAlbumResponse {} 3878 + #[derive(Clone, PartialEq, ::prost::Message)] 3879 + pub struct InsertArtistTracksRequest { 3880 + #[prost(int32, tag = "1")] 3881 + pub position: i32, 3882 + #[prost(string, tag = "2")] 3883 + pub artist_id: ::prost::alloc::string::String, 3884 + #[prost(bool, optional, tag = "3")] 3885 + pub shuffle: ::core::option::Option<bool>, 3886 + } 3887 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3888 + pub struct InsertArtistTracksResponse {} 3889 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3890 + pub struct ShufflePlaylistRequest { 3891 + #[prost(int32, tag = "1")] 3892 + pub start_index: i32, 3893 + } 3894 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3895 + pub struct ShufflePlaylistResponse {} 3896 + /// Generated client implementations. 3897 + pub mod playlist_service_client { 3898 + #![allow( 3899 + unused_variables, 3900 + dead_code, 3901 + missing_docs, 3902 + clippy::wildcard_imports, 3903 + clippy::let_unit_value 3904 + )] 3905 + use tonic::codegen::http::Uri; 3906 + use tonic::codegen::*; 3907 + #[derive(Debug, Clone)] 3908 + pub struct PlaylistServiceClient<T> { 3909 + inner: tonic::client::Grpc<T>, 3910 + } 3911 + impl PlaylistServiceClient<tonic::transport::Channel> { 3912 + /// Attempt to create a new client by connecting to a given endpoint. 3913 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 3914 + where 3915 + D: TryInto<tonic::transport::Endpoint>, 3916 + D::Error: Into<StdError>, 3917 + { 3918 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 3919 + Ok(Self::new(conn)) 3920 + } 3921 + } 3922 + impl<T> PlaylistServiceClient<T> 3923 + where 3924 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 3925 + T::Error: Into<StdError>, 3926 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 3927 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 3928 + { 3929 + pub fn new(inner: T) -> Self { 3930 + let inner = tonic::client::Grpc::new(inner); 3931 + Self { inner } 3932 + } 3933 + pub fn with_origin(inner: T, origin: Uri) -> Self { 3934 + let inner = tonic::client::Grpc::with_origin(inner, origin); 3935 + Self { inner } 3936 + } 3937 + pub fn with_interceptor<F>( 3938 + inner: T, 3939 + interceptor: F, 3940 + ) -> PlaylistServiceClient<InterceptedService<T, F>> 3941 + where 3942 + F: tonic::service::Interceptor, 3943 + T::ResponseBody: Default, 3944 + T: tonic::codegen::Service< 3945 + http::Request<tonic::body::BoxBody>, 3946 + Response = http::Response< 3947 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 3948 + >, 3949 + >, 3950 + <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 3951 + Into<StdError> + std::marker::Send + std::marker::Sync, 3952 + { 3953 + PlaylistServiceClient::new(InterceptedService::new(inner, interceptor)) 3954 + } 3955 + /// Compress requests with the given encoding. 3956 + /// 3957 + /// This requires the server to support it otherwise it might respond with an 3958 + /// error. 3959 + #[must_use] 3960 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 3961 + self.inner = self.inner.send_compressed(encoding); 3962 + self 3963 + } 3964 + /// Enable decompressing responses. 3965 + #[must_use] 3966 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 3967 + self.inner = self.inner.accept_compressed(encoding); 3968 + self 3969 + } 3970 + /// Limits the maximum size of a decoded message. 3971 + /// 3972 + /// Default: `4MB` 3973 + #[must_use] 3974 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 3975 + self.inner = self.inner.max_decoding_message_size(limit); 3976 + self 3977 + } 3978 + /// Limits the maximum size of an encoded message. 3979 + /// 3980 + /// Default: `usize::MAX` 3981 + #[must_use] 3982 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 3983 + self.inner = self.inner.max_encoding_message_size(limit); 3984 + self 3985 + } 3986 + pub async fn get_current( 3987 + &mut self, 3988 + request: impl tonic::IntoRequest<super::GetCurrentRequest>, 3989 + ) -> std::result::Result<tonic::Response<super::GetCurrentResponse>, tonic::Status> 3990 + { 3991 + self.inner.ready().await.map_err(|e| { 3992 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 3993 + })?; 3994 + let codec = tonic::codec::ProstCodec::default(); 3995 + let path = http::uri::PathAndQuery::from_static( 3996 + "/rockbox.v1alpha1.PlaylistService/GetCurrent", 3997 + ); 3998 + let mut req = request.into_request(); 3999 + req.extensions_mut().insert(GrpcMethod::new( 4000 + "rockbox.v1alpha1.PlaylistService", 4001 + "GetCurrent", 4002 + )); 4003 + self.inner.unary(req, path, codec).await 4004 + } 4005 + pub async fn get_resume_info( 4006 + &mut self, 4007 + request: impl tonic::IntoRequest<super::GetResumeInfoRequest>, 4008 + ) -> std::result::Result<tonic::Response<super::GetResumeInfoResponse>, tonic::Status> 4009 + { 4010 + self.inner.ready().await.map_err(|e| { 4011 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4012 + })?; 4013 + let codec = tonic::codec::ProstCodec::default(); 4014 + let path = http::uri::PathAndQuery::from_static( 4015 + "/rockbox.v1alpha1.PlaylistService/GetResumeInfo", 4016 + ); 4017 + let mut req = request.into_request(); 4018 + req.extensions_mut().insert(GrpcMethod::new( 4019 + "rockbox.v1alpha1.PlaylistService", 4020 + "GetResumeInfo", 4021 + )); 4022 + self.inner.unary(req, path, codec).await 4023 + } 4024 + pub async fn get_track_info( 4025 + &mut self, 4026 + request: impl tonic::IntoRequest<super::GetTrackInfoRequest>, 4027 + ) -> std::result::Result<tonic::Response<super::GetTrackInfoResponse>, tonic::Status> 4028 + { 4029 + self.inner.ready().await.map_err(|e| { 4030 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4031 + })?; 4032 + let codec = tonic::codec::ProstCodec::default(); 4033 + let path = http::uri::PathAndQuery::from_static( 4034 + "/rockbox.v1alpha1.PlaylistService/GetTrackInfo", 4035 + ); 4036 + let mut req = request.into_request(); 4037 + req.extensions_mut().insert(GrpcMethod::new( 4038 + "rockbox.v1alpha1.PlaylistService", 4039 + "GetTrackInfo", 4040 + )); 4041 + self.inner.unary(req, path, codec).await 4042 + } 4043 + pub async fn get_first_index( 4044 + &mut self, 4045 + request: impl tonic::IntoRequest<super::GetFirstIndexRequest>, 4046 + ) -> std::result::Result<tonic::Response<super::GetFirstIndexResponse>, tonic::Status> 4047 + { 4048 + self.inner.ready().await.map_err(|e| { 4049 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4050 + })?; 4051 + let codec = tonic::codec::ProstCodec::default(); 4052 + let path = http::uri::PathAndQuery::from_static( 4053 + "/rockbox.v1alpha1.PlaylistService/GetFirstIndex", 4054 + ); 4055 + let mut req = request.into_request(); 4056 + req.extensions_mut().insert(GrpcMethod::new( 4057 + "rockbox.v1alpha1.PlaylistService", 4058 + "GetFirstIndex", 4059 + )); 4060 + self.inner.unary(req, path, codec).await 4061 + } 4062 + pub async fn get_display_index( 4063 + &mut self, 4064 + request: impl tonic::IntoRequest<super::GetDisplayIndexRequest>, 4065 + ) -> std::result::Result<tonic::Response<super::GetDisplayIndexResponse>, tonic::Status> 4066 + { 4067 + self.inner.ready().await.map_err(|e| { 4068 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4069 + })?; 4070 + let codec = tonic::codec::ProstCodec::default(); 4071 + let path = http::uri::PathAndQuery::from_static( 4072 + "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex", 4073 + ); 4074 + let mut req = request.into_request(); 4075 + req.extensions_mut().insert(GrpcMethod::new( 4076 + "rockbox.v1alpha1.PlaylistService", 4077 + "GetDisplayIndex", 4078 + )); 4079 + self.inner.unary(req, path, codec).await 4080 + } 4081 + pub async fn amount( 4082 + &mut self, 4083 + request: impl tonic::IntoRequest<super::AmountRequest>, 4084 + ) -> std::result::Result<tonic::Response<super::AmountResponse>, tonic::Status> { 4085 + self.inner.ready().await.map_err(|e| { 4086 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4087 + })?; 4088 + let codec = tonic::codec::ProstCodec::default(); 4089 + let path = 4090 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Amount"); 4091 + let mut req = request.into_request(); 4092 + req.extensions_mut().insert(GrpcMethod::new( 4093 + "rockbox.v1alpha1.PlaylistService", 4094 + "Amount", 4095 + )); 4096 + self.inner.unary(req, path, codec).await 4097 + } 4098 + pub async fn playlist_resume( 4099 + &mut self, 4100 + request: impl tonic::IntoRequest<super::PlaylistResumeRequest>, 4101 + ) -> std::result::Result<tonic::Response<super::PlaylistResumeResponse>, tonic::Status> 4102 + { 4103 + self.inner.ready().await.map_err(|e| { 4104 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4105 + })?; 4106 + let codec = tonic::codec::ProstCodec::default(); 4107 + let path = http::uri::PathAndQuery::from_static( 4108 + "/rockbox.v1alpha1.PlaylistService/PlaylistResume", 4109 + ); 4110 + let mut req = request.into_request(); 4111 + req.extensions_mut().insert(GrpcMethod::new( 4112 + "rockbox.v1alpha1.PlaylistService", 4113 + "PlaylistResume", 4114 + )); 4115 + self.inner.unary(req, path, codec).await 4116 + } 4117 + pub async fn resume_track( 4118 + &mut self, 4119 + request: impl tonic::IntoRequest<super::ResumeTrackRequest>, 4120 + ) -> std::result::Result<tonic::Response<super::ResumeTrackResponse>, tonic::Status> 4121 + { 4122 + self.inner.ready().await.map_err(|e| { 4123 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4124 + })?; 4125 + let codec = tonic::codec::ProstCodec::default(); 4126 + let path = http::uri::PathAndQuery::from_static( 4127 + "/rockbox.v1alpha1.PlaylistService/ResumeTrack", 4128 + ); 4129 + let mut req = request.into_request(); 4130 + req.extensions_mut().insert(GrpcMethod::new( 4131 + "rockbox.v1alpha1.PlaylistService", 4132 + "ResumeTrack", 4133 + )); 4134 + self.inner.unary(req, path, codec).await 4135 + } 4136 + pub async fn set_modified( 4137 + &mut self, 4138 + request: impl tonic::IntoRequest<super::SetModifiedRequest>, 4139 + ) -> std::result::Result<tonic::Response<super::SetModifiedResponse>, tonic::Status> 4140 + { 4141 + self.inner.ready().await.map_err(|e| { 4142 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4143 + })?; 4144 + let codec = tonic::codec::ProstCodec::default(); 4145 + let path = http::uri::PathAndQuery::from_static( 4146 + "/rockbox.v1alpha1.PlaylistService/SetModified", 4147 + ); 4148 + let mut req = request.into_request(); 4149 + req.extensions_mut().insert(GrpcMethod::new( 4150 + "rockbox.v1alpha1.PlaylistService", 4151 + "SetModified", 4152 + )); 4153 + self.inner.unary(req, path, codec).await 4154 + } 4155 + pub async fn start( 4156 + &mut self, 4157 + request: impl tonic::IntoRequest<super::StartRequest>, 4158 + ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status> { 4159 + self.inner.ready().await.map_err(|e| { 4160 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4161 + })?; 4162 + let codec = tonic::codec::ProstCodec::default(); 4163 + let path = 4164 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Start"); 4165 + let mut req = request.into_request(); 4166 + req.extensions_mut() 4167 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Start")); 4168 + self.inner.unary(req, path, codec).await 4169 + } 4170 + pub async fn sync( 4171 + &mut self, 4172 + request: impl tonic::IntoRequest<super::SyncRequest>, 4173 + ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> { 4174 + self.inner.ready().await.map_err(|e| { 4175 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4176 + })?; 4177 + let codec = tonic::codec::ProstCodec::default(); 4178 + let path = 4179 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Sync"); 4180 + let mut req = request.into_request(); 4181 + req.extensions_mut() 4182 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Sync")); 4183 + self.inner.unary(req, path, codec).await 4184 + } 4185 + pub async fn remove_all_tracks( 4186 + &mut self, 4187 + request: impl tonic::IntoRequest<super::RemoveAllTracksRequest>, 4188 + ) -> std::result::Result<tonic::Response<super::RemoveAllTracksResponse>, tonic::Status> 4189 + { 4190 + self.inner.ready().await.map_err(|e| { 4191 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4192 + })?; 4193 + let codec = tonic::codec::ProstCodec::default(); 4194 + let path = http::uri::PathAndQuery::from_static( 4195 + "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks", 4196 + ); 4197 + let mut req = request.into_request(); 4198 + req.extensions_mut().insert(GrpcMethod::new( 4199 + "rockbox.v1alpha1.PlaylistService", 4200 + "RemoveAllTracks", 4201 + )); 4202 + self.inner.unary(req, path, codec).await 4203 + } 4204 + pub async fn remove_tracks( 4205 + &mut self, 4206 + request: impl tonic::IntoRequest<super::RemoveTracksRequest>, 4207 + ) -> std::result::Result<tonic::Response<super::RemoveTracksResponse>, tonic::Status> 4208 + { 4209 + self.inner.ready().await.map_err(|e| { 4210 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4211 + })?; 4212 + let codec = tonic::codec::ProstCodec::default(); 4213 + let path = http::uri::PathAndQuery::from_static( 4214 + "/rockbox.v1alpha1.PlaylistService/RemoveTracks", 4215 + ); 4216 + let mut req = request.into_request(); 4217 + req.extensions_mut().insert(GrpcMethod::new( 4218 + "rockbox.v1alpha1.PlaylistService", 4219 + "RemoveTracks", 4220 + )); 4221 + self.inner.unary(req, path, codec).await 4222 + } 4223 + pub async fn create_playlist( 4224 + &mut self, 4225 + request: impl tonic::IntoRequest<super::CreatePlaylistRequest>, 4226 + ) -> std::result::Result<tonic::Response<super::CreatePlaylistResponse>, tonic::Status> 4227 + { 4228 + self.inner.ready().await.map_err(|e| { 4229 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4230 + })?; 4231 + let codec = tonic::codec::ProstCodec::default(); 4232 + let path = http::uri::PathAndQuery::from_static( 4233 + "/rockbox.v1alpha1.PlaylistService/CreatePlaylist", 4234 + ); 4235 + let mut req = request.into_request(); 4236 + req.extensions_mut().insert(GrpcMethod::new( 4237 + "rockbox.v1alpha1.PlaylistService", 4238 + "CreatePlaylist", 4239 + )); 4240 + self.inner.unary(req, path, codec).await 4241 + } 4242 + pub async fn insert_tracks( 4243 + &mut self, 4244 + request: impl tonic::IntoRequest<super::InsertTracksRequest>, 4245 + ) -> std::result::Result<tonic::Response<super::InsertTracksResponse>, tonic::Status> 4246 + { 4247 + self.inner.ready().await.map_err(|e| { 4248 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4249 + })?; 4250 + let codec = tonic::codec::ProstCodec::default(); 4251 + let path = http::uri::PathAndQuery::from_static( 4252 + "/rockbox.v1alpha1.PlaylistService/InsertTracks", 4253 + ); 4254 + let mut req = request.into_request(); 4255 + req.extensions_mut().insert(GrpcMethod::new( 4256 + "rockbox.v1alpha1.PlaylistService", 4257 + "InsertTracks", 4258 + )); 4259 + self.inner.unary(req, path, codec).await 4260 + } 4261 + pub async fn insert_directory( 4262 + &mut self, 4263 + request: impl tonic::IntoRequest<super::InsertDirectoryRequest>, 4264 + ) -> std::result::Result<tonic::Response<super::InsertDirectoryResponse>, tonic::Status> 4265 + { 4266 + self.inner.ready().await.map_err(|e| { 4267 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4268 + })?; 4269 + let codec = tonic::codec::ProstCodec::default(); 4270 + let path = http::uri::PathAndQuery::from_static( 4271 + "/rockbox.v1alpha1.PlaylistService/InsertDirectory", 4272 + ); 4273 + let mut req = request.into_request(); 4274 + req.extensions_mut().insert(GrpcMethod::new( 4275 + "rockbox.v1alpha1.PlaylistService", 4276 + "InsertDirectory", 4277 + )); 4278 + self.inner.unary(req, path, codec).await 4279 + } 4280 + pub async fn insert_playlist( 4281 + &mut self, 4282 + request: impl tonic::IntoRequest<super::InsertPlaylistRequest>, 4283 + ) -> std::result::Result<tonic::Response<super::InsertPlaylistResponse>, tonic::Status> 4284 + { 4285 + self.inner.ready().await.map_err(|e| { 4286 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4287 + })?; 4288 + let codec = tonic::codec::ProstCodec::default(); 4289 + let path = http::uri::PathAndQuery::from_static( 4290 + "/rockbox.v1alpha1.PlaylistService/InsertPlaylist", 4291 + ); 4292 + let mut req = request.into_request(); 4293 + req.extensions_mut().insert(GrpcMethod::new( 4294 + "rockbox.v1alpha1.PlaylistService", 4295 + "InsertPlaylist", 4296 + )); 4297 + self.inner.unary(req, path, codec).await 4298 + } 4299 + pub async fn insert_album( 4300 + &mut self, 4301 + request: impl tonic::IntoRequest<super::InsertAlbumRequest>, 4302 + ) -> std::result::Result<tonic::Response<super::InsertAlbumResponse>, tonic::Status> 4303 + { 4304 + self.inner.ready().await.map_err(|e| { 4305 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4306 + })?; 4307 + let codec = tonic::codec::ProstCodec::default(); 4308 + let path = http::uri::PathAndQuery::from_static( 4309 + "/rockbox.v1alpha1.PlaylistService/InsertAlbum", 4310 + ); 4311 + let mut req = request.into_request(); 4312 + req.extensions_mut().insert(GrpcMethod::new( 4313 + "rockbox.v1alpha1.PlaylistService", 4314 + "InsertAlbum", 4315 + )); 4316 + self.inner.unary(req, path, codec).await 4317 + } 4318 + pub async fn insert_artist_tracks( 4319 + &mut self, 4320 + request: impl tonic::IntoRequest<super::InsertArtistTracksRequest>, 4321 + ) -> std::result::Result<tonic::Response<super::InsertArtistTracksResponse>, tonic::Status> 4322 + { 4323 + self.inner.ready().await.map_err(|e| { 4324 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4325 + })?; 4326 + let codec = tonic::codec::ProstCodec::default(); 4327 + let path = http::uri::PathAndQuery::from_static( 4328 + "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks", 4329 + ); 4330 + let mut req = request.into_request(); 4331 + req.extensions_mut().insert(GrpcMethod::new( 4332 + "rockbox.v1alpha1.PlaylistService", 4333 + "InsertArtistTracks", 4334 + )); 4335 + self.inner.unary(req, path, codec).await 4336 + } 4337 + pub async fn shuffle_playlist( 4338 + &mut self, 4339 + request: impl tonic::IntoRequest<super::ShufflePlaylistRequest>, 4340 + ) -> std::result::Result<tonic::Response<super::ShufflePlaylistResponse>, tonic::Status> 4341 + { 4342 + self.inner.ready().await.map_err(|e| { 4343 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4344 + })?; 4345 + let codec = tonic::codec::ProstCodec::default(); 4346 + let path = http::uri::PathAndQuery::from_static( 4347 + "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist", 4348 + ); 4349 + let mut req = request.into_request(); 4350 + req.extensions_mut().insert(GrpcMethod::new( 4351 + "rockbox.v1alpha1.PlaylistService", 4352 + "ShufflePlaylist", 4353 + )); 4354 + self.inner.unary(req, path, codec).await 4355 + } 4356 + } 4357 + } 4358 + /// Generated server implementations. 4359 + pub mod playlist_service_server { 4360 + #![allow( 4361 + unused_variables, 4362 + dead_code, 4363 + missing_docs, 4364 + clippy::wildcard_imports, 4365 + clippy::let_unit_value 4366 + )] 4367 + use tonic::codegen::*; 4368 + /// Generated trait containing gRPC methods that should be implemented for use with PlaylistServiceServer. 4369 + #[async_trait] 4370 + pub trait PlaylistService: std::marker::Send + std::marker::Sync + 'static { 4371 + async fn get_current( 4372 + &self, 4373 + request: tonic::Request<super::GetCurrentRequest>, 4374 + ) -> std::result::Result<tonic::Response<super::GetCurrentResponse>, tonic::Status>; 4375 + async fn get_resume_info( 4376 + &self, 4377 + request: tonic::Request<super::GetResumeInfoRequest>, 4378 + ) -> std::result::Result<tonic::Response<super::GetResumeInfoResponse>, tonic::Status>; 4379 + async fn get_track_info( 4380 + &self, 4381 + request: tonic::Request<super::GetTrackInfoRequest>, 4382 + ) -> std::result::Result<tonic::Response<super::GetTrackInfoResponse>, tonic::Status>; 4383 + async fn get_first_index( 4384 + &self, 4385 + request: tonic::Request<super::GetFirstIndexRequest>, 4386 + ) -> std::result::Result<tonic::Response<super::GetFirstIndexResponse>, tonic::Status>; 4387 + async fn get_display_index( 4388 + &self, 4389 + request: tonic::Request<super::GetDisplayIndexRequest>, 4390 + ) -> std::result::Result<tonic::Response<super::GetDisplayIndexResponse>, tonic::Status>; 4391 + async fn amount( 4392 + &self, 4393 + request: tonic::Request<super::AmountRequest>, 4394 + ) -> std::result::Result<tonic::Response<super::AmountResponse>, tonic::Status>; 4395 + async fn playlist_resume( 4396 + &self, 4397 + request: tonic::Request<super::PlaylistResumeRequest>, 4398 + ) -> std::result::Result<tonic::Response<super::PlaylistResumeResponse>, tonic::Status>; 4399 + async fn resume_track( 4400 + &self, 4401 + request: tonic::Request<super::ResumeTrackRequest>, 4402 + ) -> std::result::Result<tonic::Response<super::ResumeTrackResponse>, tonic::Status>; 4403 + async fn set_modified( 4404 + &self, 4405 + request: tonic::Request<super::SetModifiedRequest>, 4406 + ) -> std::result::Result<tonic::Response<super::SetModifiedResponse>, tonic::Status>; 4407 + async fn start( 4408 + &self, 4409 + request: tonic::Request<super::StartRequest>, 4410 + ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status>; 4411 + async fn sync( 4412 + &self, 4413 + request: tonic::Request<super::SyncRequest>, 4414 + ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>; 4415 + async fn remove_all_tracks( 4416 + &self, 4417 + request: tonic::Request<super::RemoveAllTracksRequest>, 4418 + ) -> std::result::Result<tonic::Response<super::RemoveAllTracksResponse>, tonic::Status>; 4419 + async fn remove_tracks( 4420 + &self, 4421 + request: tonic::Request<super::RemoveTracksRequest>, 4422 + ) -> std::result::Result<tonic::Response<super::RemoveTracksResponse>, tonic::Status>; 4423 + async fn create_playlist( 4424 + &self, 4425 + request: tonic::Request<super::CreatePlaylistRequest>, 4426 + ) -> std::result::Result<tonic::Response<super::CreatePlaylistResponse>, tonic::Status>; 4427 + async fn insert_tracks( 4428 + &self, 4429 + request: tonic::Request<super::InsertTracksRequest>, 4430 + ) -> std::result::Result<tonic::Response<super::InsertTracksResponse>, tonic::Status>; 4431 + async fn insert_directory( 4432 + &self, 4433 + request: tonic::Request<super::InsertDirectoryRequest>, 4434 + ) -> std::result::Result<tonic::Response<super::InsertDirectoryResponse>, tonic::Status>; 4435 + async fn insert_playlist( 4436 + &self, 4437 + request: tonic::Request<super::InsertPlaylistRequest>, 4438 + ) -> std::result::Result<tonic::Response<super::InsertPlaylistResponse>, tonic::Status>; 4439 + async fn insert_album( 4440 + &self, 4441 + request: tonic::Request<super::InsertAlbumRequest>, 4442 + ) -> std::result::Result<tonic::Response<super::InsertAlbumResponse>, tonic::Status>; 4443 + async fn insert_artist_tracks( 4444 + &self, 4445 + request: tonic::Request<super::InsertArtistTracksRequest>, 4446 + ) -> std::result::Result<tonic::Response<super::InsertArtistTracksResponse>, tonic::Status>; 4447 + async fn shuffle_playlist( 4448 + &self, 4449 + request: tonic::Request<super::ShufflePlaylistRequest>, 4450 + ) -> std::result::Result<tonic::Response<super::ShufflePlaylistResponse>, tonic::Status>; 4451 + } 4452 + #[derive(Debug)] 4453 + pub struct PlaylistServiceServer<T> { 4454 + inner: Arc<T>, 4455 + accept_compression_encodings: EnabledCompressionEncodings, 4456 + send_compression_encodings: EnabledCompressionEncodings, 4457 + max_decoding_message_size: Option<usize>, 4458 + max_encoding_message_size: Option<usize>, 4459 + } 4460 + impl<T> PlaylistServiceServer<T> { 4461 + pub fn new(inner: T) -> Self { 4462 + Self::from_arc(Arc::new(inner)) 4463 + } 4464 + pub fn from_arc(inner: Arc<T>) -> Self { 4465 + Self { 4466 + inner, 4467 + accept_compression_encodings: Default::default(), 4468 + send_compression_encodings: Default::default(), 4469 + max_decoding_message_size: None, 4470 + max_encoding_message_size: None, 4471 + } 4472 + } 4473 + pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 4474 + where 4475 + F: tonic::service::Interceptor, 4476 + { 4477 + InterceptedService::new(Self::new(inner), interceptor) 4478 + } 4479 + /// Enable decompressing requests with the given encoding. 4480 + #[must_use] 4481 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 4482 + self.accept_compression_encodings.enable(encoding); 4483 + self 4484 + } 4485 + /// Compress responses with the given encoding, if the client supports it. 4486 + #[must_use] 4487 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 4488 + self.send_compression_encodings.enable(encoding); 4489 + self 4490 + } 4491 + /// Limits the maximum size of a decoded message. 4492 + /// 4493 + /// Default: `4MB` 4494 + #[must_use] 4495 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 4496 + self.max_decoding_message_size = Some(limit); 4497 + self 4498 + } 4499 + /// Limits the maximum size of an encoded message. 4500 + /// 4501 + /// Default: `usize::MAX` 4502 + #[must_use] 4503 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 4504 + self.max_encoding_message_size = Some(limit); 4505 + self 4506 + } 4507 + } 4508 + impl<T, B> tonic::codegen::Service<http::Request<B>> for PlaylistServiceServer<T> 4509 + where 4510 + T: PlaylistService, 4511 + B: Body + std::marker::Send + 'static, 4512 + B::Error: Into<StdError> + std::marker::Send + 'static, 4513 + { 4514 + type Response = http::Response<tonic::body::BoxBody>; 4515 + type Error = std::convert::Infallible; 4516 + type Future = BoxFuture<Self::Response, Self::Error>; 4517 + fn poll_ready( 4518 + &mut self, 4519 + _cx: &mut Context<'_>, 4520 + ) -> Poll<std::result::Result<(), Self::Error>> { 4521 + Poll::Ready(Ok(())) 4522 + } 4523 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 4524 + match req.uri().path() { 4525 + "/rockbox.v1alpha1.PlaylistService/GetCurrent" => { 4526 + #[allow(non_camel_case_types)] 4527 + struct GetCurrentSvc<T: PlaylistService>(pub Arc<T>); 4528 + impl<T: PlaylistService> tonic::server::UnaryService<super::GetCurrentRequest> 4529 + for GetCurrentSvc<T> 4530 + { 4531 + type Response = super::GetCurrentResponse; 4532 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4533 + fn call( 4534 + &mut self, 4535 + request: tonic::Request<super::GetCurrentRequest>, 4536 + ) -> Self::Future { 4537 + let inner = Arc::clone(&self.0); 4538 + let fut = async move { 4539 + <T as PlaylistService>::get_current(&inner, request).await 4540 + }; 4541 + Box::pin(fut) 4542 + } 4543 + } 4544 + let accept_compression_encodings = self.accept_compression_encodings; 4545 + let send_compression_encodings = self.send_compression_encodings; 4546 + let max_decoding_message_size = self.max_decoding_message_size; 4547 + let max_encoding_message_size = self.max_encoding_message_size; 4548 + let inner = self.inner.clone(); 4549 + let fut = async move { 4550 + let method = GetCurrentSvc(inner); 4551 + let codec = tonic::codec::ProstCodec::default(); 4552 + let mut grpc = tonic::server::Grpc::new(codec) 4553 + .apply_compression_config( 4554 + accept_compression_encodings, 4555 + send_compression_encodings, 4556 + ) 4557 + .apply_max_message_size_config( 4558 + max_decoding_message_size, 4559 + max_encoding_message_size, 4560 + ); 4561 + let res = grpc.unary(method, req).await; 4562 + Ok(res) 4563 + }; 4564 + Box::pin(fut) 4565 + } 4566 + "/rockbox.v1alpha1.PlaylistService/GetResumeInfo" => { 4567 + #[allow(non_camel_case_types)] 4568 + struct GetResumeInfoSvc<T: PlaylistService>(pub Arc<T>); 4569 + impl<T: PlaylistService> 4570 + tonic::server::UnaryService<super::GetResumeInfoRequest> 4571 + for GetResumeInfoSvc<T> 4572 + { 4573 + type Response = super::GetResumeInfoResponse; 4574 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4575 + fn call( 4576 + &mut self, 4577 + request: tonic::Request<super::GetResumeInfoRequest>, 4578 + ) -> Self::Future { 4579 + let inner = Arc::clone(&self.0); 4580 + let fut = async move { 4581 + <T as PlaylistService>::get_resume_info(&inner, request).await 4582 + }; 4583 + Box::pin(fut) 4584 + } 4585 + } 4586 + let accept_compression_encodings = self.accept_compression_encodings; 4587 + let send_compression_encodings = self.send_compression_encodings; 4588 + let max_decoding_message_size = self.max_decoding_message_size; 4589 + let max_encoding_message_size = self.max_encoding_message_size; 4590 + let inner = self.inner.clone(); 4591 + let fut = async move { 4592 + let method = GetResumeInfoSvc(inner); 4593 + let codec = tonic::codec::ProstCodec::default(); 4594 + let mut grpc = tonic::server::Grpc::new(codec) 4595 + .apply_compression_config( 4596 + accept_compression_encodings, 4597 + send_compression_encodings, 4598 + ) 4599 + .apply_max_message_size_config( 4600 + max_decoding_message_size, 4601 + max_encoding_message_size, 4602 + ); 4603 + let res = grpc.unary(method, req).await; 4604 + Ok(res) 4605 + }; 4606 + Box::pin(fut) 4607 + } 4608 + "/rockbox.v1alpha1.PlaylistService/GetTrackInfo" => { 4609 + #[allow(non_camel_case_types)] 4610 + struct GetTrackInfoSvc<T: PlaylistService>(pub Arc<T>); 4611 + impl<T: PlaylistService> tonic::server::UnaryService<super::GetTrackInfoRequest> 4612 + for GetTrackInfoSvc<T> 4613 + { 4614 + type Response = super::GetTrackInfoResponse; 4615 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4616 + fn call( 4617 + &mut self, 4618 + request: tonic::Request<super::GetTrackInfoRequest>, 4619 + ) -> Self::Future { 4620 + let inner = Arc::clone(&self.0); 4621 + let fut = async move { 4622 + <T as PlaylistService>::get_track_info(&inner, request).await 4623 + }; 4624 + Box::pin(fut) 4625 + } 4626 + } 4627 + let accept_compression_encodings = self.accept_compression_encodings; 4628 + let send_compression_encodings = self.send_compression_encodings; 4629 + let max_decoding_message_size = self.max_decoding_message_size; 4630 + let max_encoding_message_size = self.max_encoding_message_size; 4631 + let inner = self.inner.clone(); 4632 + let fut = async move { 4633 + let method = GetTrackInfoSvc(inner); 4634 + let codec = tonic::codec::ProstCodec::default(); 4635 + let mut grpc = tonic::server::Grpc::new(codec) 4636 + .apply_compression_config( 4637 + accept_compression_encodings, 4638 + send_compression_encodings, 4639 + ) 4640 + .apply_max_message_size_config( 4641 + max_decoding_message_size, 4642 + max_encoding_message_size, 4643 + ); 4644 + let res = grpc.unary(method, req).await; 4645 + Ok(res) 4646 + }; 4647 + Box::pin(fut) 4648 + } 4649 + "/rockbox.v1alpha1.PlaylistService/GetFirstIndex" => { 4650 + #[allow(non_camel_case_types)] 4651 + struct GetFirstIndexSvc<T: PlaylistService>(pub Arc<T>); 4652 + impl<T: PlaylistService> 4653 + tonic::server::UnaryService<super::GetFirstIndexRequest> 4654 + for GetFirstIndexSvc<T> 4655 + { 4656 + type Response = super::GetFirstIndexResponse; 4657 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4658 + fn call( 4659 + &mut self, 4660 + request: tonic::Request<super::GetFirstIndexRequest>, 4661 + ) -> Self::Future { 4662 + let inner = Arc::clone(&self.0); 4663 + let fut = async move { 4664 + <T as PlaylistService>::get_first_index(&inner, request).await 4665 + }; 4666 + Box::pin(fut) 4667 + } 4668 + } 4669 + let accept_compression_encodings = self.accept_compression_encodings; 4670 + let send_compression_encodings = self.send_compression_encodings; 4671 + let max_decoding_message_size = self.max_decoding_message_size; 4672 + let max_encoding_message_size = self.max_encoding_message_size; 4673 + let inner = self.inner.clone(); 4674 + let fut = async move { 4675 + let method = GetFirstIndexSvc(inner); 4676 + let codec = tonic::codec::ProstCodec::default(); 4677 + let mut grpc = tonic::server::Grpc::new(codec) 4678 + .apply_compression_config( 4679 + accept_compression_encodings, 4680 + send_compression_encodings, 4681 + ) 4682 + .apply_max_message_size_config( 4683 + max_decoding_message_size, 4684 + max_encoding_message_size, 4685 + ); 4686 + let res = grpc.unary(method, req).await; 4687 + Ok(res) 4688 + }; 4689 + Box::pin(fut) 4690 + } 4691 + "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex" => { 4692 + #[allow(non_camel_case_types)] 4693 + struct GetDisplayIndexSvc<T: PlaylistService>(pub Arc<T>); 4694 + impl<T: PlaylistService> 4695 + tonic::server::UnaryService<super::GetDisplayIndexRequest> 4696 + for GetDisplayIndexSvc<T> 4697 + { 4698 + type Response = super::GetDisplayIndexResponse; 4699 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4700 + fn call( 4701 + &mut self, 4702 + request: tonic::Request<super::GetDisplayIndexRequest>, 4703 + ) -> Self::Future { 4704 + let inner = Arc::clone(&self.0); 4705 + let fut = async move { 4706 + <T as PlaylistService>::get_display_index(&inner, request).await 4707 + }; 4708 + Box::pin(fut) 4709 + } 4710 + } 4711 + let accept_compression_encodings = self.accept_compression_encodings; 4712 + let send_compression_encodings = self.send_compression_encodings; 4713 + let max_decoding_message_size = self.max_decoding_message_size; 4714 + let max_encoding_message_size = self.max_encoding_message_size; 4715 + let inner = self.inner.clone(); 4716 + let fut = async move { 4717 + let method = GetDisplayIndexSvc(inner); 4718 + let codec = tonic::codec::ProstCodec::default(); 4719 + let mut grpc = tonic::server::Grpc::new(codec) 4720 + .apply_compression_config( 4721 + accept_compression_encodings, 4722 + send_compression_encodings, 4723 + ) 4724 + .apply_max_message_size_config( 4725 + max_decoding_message_size, 4726 + max_encoding_message_size, 4727 + ); 4728 + let res = grpc.unary(method, req).await; 4729 + Ok(res) 4730 + }; 4731 + Box::pin(fut) 4732 + } 4733 + "/rockbox.v1alpha1.PlaylistService/Amount" => { 4734 + #[allow(non_camel_case_types)] 4735 + struct AmountSvc<T: PlaylistService>(pub Arc<T>); 4736 + impl<T: PlaylistService> tonic::server::UnaryService<super::AmountRequest> for AmountSvc<T> { 4737 + type Response = super::AmountResponse; 4738 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4739 + fn call( 4740 + &mut self, 4741 + request: tonic::Request<super::AmountRequest>, 4742 + ) -> Self::Future { 4743 + let inner = Arc::clone(&self.0); 4744 + let fut = async move { 4745 + <T as PlaylistService>::amount(&inner, request).await 4746 + }; 4747 + Box::pin(fut) 4748 + } 4749 + } 4750 + let accept_compression_encodings = self.accept_compression_encodings; 4751 + let send_compression_encodings = self.send_compression_encodings; 4752 + let max_decoding_message_size = self.max_decoding_message_size; 4753 + let max_encoding_message_size = self.max_encoding_message_size; 4754 + let inner = self.inner.clone(); 4755 + let fut = async move { 4756 + let method = AmountSvc(inner); 4757 + let codec = tonic::codec::ProstCodec::default(); 4758 + let mut grpc = tonic::server::Grpc::new(codec) 4759 + .apply_compression_config( 4760 + accept_compression_encodings, 4761 + send_compression_encodings, 4762 + ) 4763 + .apply_max_message_size_config( 4764 + max_decoding_message_size, 4765 + max_encoding_message_size, 4766 + ); 4767 + let res = grpc.unary(method, req).await; 4768 + Ok(res) 4769 + }; 4770 + Box::pin(fut) 4771 + } 4772 + "/rockbox.v1alpha1.PlaylistService/PlaylistResume" => { 4773 + #[allow(non_camel_case_types)] 4774 + struct PlaylistResumeSvc<T: PlaylistService>(pub Arc<T>); 4775 + impl<T: PlaylistService> 4776 + tonic::server::UnaryService<super::PlaylistResumeRequest> 4777 + for PlaylistResumeSvc<T> 4778 + { 4779 + type Response = super::PlaylistResumeResponse; 4780 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4781 + fn call( 4782 + &mut self, 4783 + request: tonic::Request<super::PlaylistResumeRequest>, 4784 + ) -> Self::Future { 4785 + let inner = Arc::clone(&self.0); 4786 + let fut = async move { 4787 + <T as PlaylistService>::playlist_resume(&inner, request).await 4788 + }; 4789 + Box::pin(fut) 4790 + } 4791 + } 4792 + let accept_compression_encodings = self.accept_compression_encodings; 4793 + let send_compression_encodings = self.send_compression_encodings; 4794 + let max_decoding_message_size = self.max_decoding_message_size; 4795 + let max_encoding_message_size = self.max_encoding_message_size; 4796 + let inner = self.inner.clone(); 4797 + let fut = async move { 4798 + let method = PlaylistResumeSvc(inner); 4799 + let codec = tonic::codec::ProstCodec::default(); 4800 + let mut grpc = tonic::server::Grpc::new(codec) 4801 + .apply_compression_config( 4802 + accept_compression_encodings, 4803 + send_compression_encodings, 4804 + ) 4805 + .apply_max_message_size_config( 4806 + max_decoding_message_size, 4807 + max_encoding_message_size, 4808 + ); 4809 + let res = grpc.unary(method, req).await; 4810 + Ok(res) 4811 + }; 4812 + Box::pin(fut) 4813 + } 4814 + "/rockbox.v1alpha1.PlaylistService/ResumeTrack" => { 4815 + #[allow(non_camel_case_types)] 4816 + struct ResumeTrackSvc<T: PlaylistService>(pub Arc<T>); 4817 + impl<T: PlaylistService> tonic::server::UnaryService<super::ResumeTrackRequest> 4818 + for ResumeTrackSvc<T> 4819 + { 4820 + type Response = super::ResumeTrackResponse; 4821 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4822 + fn call( 4823 + &mut self, 4824 + request: tonic::Request<super::ResumeTrackRequest>, 4825 + ) -> Self::Future { 4826 + let inner = Arc::clone(&self.0); 4827 + let fut = async move { 4828 + <T as PlaylistService>::resume_track(&inner, request).await 4829 + }; 4830 + Box::pin(fut) 4831 + } 4832 + } 4833 + let accept_compression_encodings = self.accept_compression_encodings; 4834 + let send_compression_encodings = self.send_compression_encodings; 4835 + let max_decoding_message_size = self.max_decoding_message_size; 4836 + let max_encoding_message_size = self.max_encoding_message_size; 4837 + let inner = self.inner.clone(); 4838 + let fut = async move { 4839 + let method = ResumeTrackSvc(inner); 4840 + let codec = tonic::codec::ProstCodec::default(); 4841 + let mut grpc = tonic::server::Grpc::new(codec) 4842 + .apply_compression_config( 4843 + accept_compression_encodings, 4844 + send_compression_encodings, 4845 + ) 4846 + .apply_max_message_size_config( 4847 + max_decoding_message_size, 4848 + max_encoding_message_size, 4849 + ); 4850 + let res = grpc.unary(method, req).await; 4851 + Ok(res) 4852 + }; 4853 + Box::pin(fut) 4854 + } 4855 + "/rockbox.v1alpha1.PlaylistService/SetModified" => { 4856 + #[allow(non_camel_case_types)] 4857 + struct SetModifiedSvc<T: PlaylistService>(pub Arc<T>); 4858 + impl<T: PlaylistService> tonic::server::UnaryService<super::SetModifiedRequest> 4859 + for SetModifiedSvc<T> 4860 + { 4861 + type Response = super::SetModifiedResponse; 4862 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4863 + fn call( 4864 + &mut self, 4865 + request: tonic::Request<super::SetModifiedRequest>, 4866 + ) -> Self::Future { 4867 + let inner = Arc::clone(&self.0); 4868 + let fut = async move { 4869 + <T as PlaylistService>::set_modified(&inner, request).await 4870 + }; 4871 + Box::pin(fut) 4872 + } 4873 + } 4874 + let accept_compression_encodings = self.accept_compression_encodings; 4875 + let send_compression_encodings = self.send_compression_encodings; 4876 + let max_decoding_message_size = self.max_decoding_message_size; 4877 + let max_encoding_message_size = self.max_encoding_message_size; 4878 + let inner = self.inner.clone(); 4879 + let fut = async move { 4880 + let method = SetModifiedSvc(inner); 4881 + let codec = tonic::codec::ProstCodec::default(); 4882 + let mut grpc = tonic::server::Grpc::new(codec) 4883 + .apply_compression_config( 4884 + accept_compression_encodings, 4885 + send_compression_encodings, 4886 + ) 4887 + .apply_max_message_size_config( 4888 + max_decoding_message_size, 4889 + max_encoding_message_size, 4890 + ); 4891 + let res = grpc.unary(method, req).await; 4892 + Ok(res) 4893 + }; 4894 + Box::pin(fut) 4895 + } 4896 + "/rockbox.v1alpha1.PlaylistService/Start" => { 4897 + #[allow(non_camel_case_types)] 4898 + struct StartSvc<T: PlaylistService>(pub Arc<T>); 4899 + impl<T: PlaylistService> tonic::server::UnaryService<super::StartRequest> for StartSvc<T> { 4900 + type Response = super::StartResponse; 4901 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4902 + fn call( 4903 + &mut self, 4904 + request: tonic::Request<super::StartRequest>, 4905 + ) -> Self::Future { 4906 + let inner = Arc::clone(&self.0); 4907 + let fut = 4908 + async move { <T as PlaylistService>::start(&inner, request).await }; 4909 + Box::pin(fut) 4910 + } 4911 + } 4912 + let accept_compression_encodings = self.accept_compression_encodings; 4913 + let send_compression_encodings = self.send_compression_encodings; 4914 + let max_decoding_message_size = self.max_decoding_message_size; 4915 + let max_encoding_message_size = self.max_encoding_message_size; 4916 + let inner = self.inner.clone(); 4917 + let fut = async move { 4918 + let method = StartSvc(inner); 4919 + let codec = tonic::codec::ProstCodec::default(); 4920 + let mut grpc = tonic::server::Grpc::new(codec) 4921 + .apply_compression_config( 4922 + accept_compression_encodings, 4923 + send_compression_encodings, 4924 + ) 4925 + .apply_max_message_size_config( 4926 + max_decoding_message_size, 4927 + max_encoding_message_size, 4928 + ); 4929 + let res = grpc.unary(method, req).await; 4930 + Ok(res) 4931 + }; 4932 + Box::pin(fut) 4933 + } 4934 + "/rockbox.v1alpha1.PlaylistService/Sync" => { 4935 + #[allow(non_camel_case_types)] 4936 + struct SyncSvc<T: PlaylistService>(pub Arc<T>); 4937 + impl<T: PlaylistService> tonic::server::UnaryService<super::SyncRequest> for SyncSvc<T> { 4938 + type Response = super::SyncResponse; 4939 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4940 + fn call( 4941 + &mut self, 4942 + request: tonic::Request<super::SyncRequest>, 4943 + ) -> Self::Future { 4944 + let inner = Arc::clone(&self.0); 4945 + let fut = 4946 + async move { <T as PlaylistService>::sync(&inner, request).await }; 4947 + Box::pin(fut) 4948 + } 4949 + } 4950 + let accept_compression_encodings = self.accept_compression_encodings; 4951 + let send_compression_encodings = self.send_compression_encodings; 4952 + let max_decoding_message_size = self.max_decoding_message_size; 4953 + let max_encoding_message_size = self.max_encoding_message_size; 4954 + let inner = self.inner.clone(); 4955 + let fut = async move { 4956 + let method = SyncSvc(inner); 4957 + let codec = tonic::codec::ProstCodec::default(); 4958 + let mut grpc = tonic::server::Grpc::new(codec) 4959 + .apply_compression_config( 4960 + accept_compression_encodings, 4961 + send_compression_encodings, 4962 + ) 4963 + .apply_max_message_size_config( 4964 + max_decoding_message_size, 4965 + max_encoding_message_size, 4966 + ); 4967 + let res = grpc.unary(method, req).await; 4968 + Ok(res) 4969 + }; 4970 + Box::pin(fut) 4971 + } 4972 + "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks" => { 4973 + #[allow(non_camel_case_types)] 4974 + struct RemoveAllTracksSvc<T: PlaylistService>(pub Arc<T>); 4975 + impl<T: PlaylistService> 4976 + tonic::server::UnaryService<super::RemoveAllTracksRequest> 4977 + for RemoveAllTracksSvc<T> 4978 + { 4979 + type Response = super::RemoveAllTracksResponse; 4980 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4981 + fn call( 4982 + &mut self, 4983 + request: tonic::Request<super::RemoveAllTracksRequest>, 4984 + ) -> Self::Future { 4985 + let inner = Arc::clone(&self.0); 4986 + let fut = async move { 4987 + <T as PlaylistService>::remove_all_tracks(&inner, request).await 4988 + }; 4989 + Box::pin(fut) 4990 + } 4991 + } 4992 + let accept_compression_encodings = self.accept_compression_encodings; 4993 + let send_compression_encodings = self.send_compression_encodings; 4994 + let max_decoding_message_size = self.max_decoding_message_size; 4995 + let max_encoding_message_size = self.max_encoding_message_size; 4996 + let inner = self.inner.clone(); 4997 + let fut = async move { 4998 + let method = RemoveAllTracksSvc(inner); 4999 + let codec = tonic::codec::ProstCodec::default(); 5000 + let mut grpc = tonic::server::Grpc::new(codec) 5001 + .apply_compression_config( 5002 + accept_compression_encodings, 5003 + send_compression_encodings, 5004 + ) 5005 + .apply_max_message_size_config( 5006 + max_decoding_message_size, 5007 + max_encoding_message_size, 5008 + ); 5009 + let res = grpc.unary(method, req).await; 5010 + Ok(res) 5011 + }; 5012 + Box::pin(fut) 5013 + } 5014 + "/rockbox.v1alpha1.PlaylistService/RemoveTracks" => { 5015 + #[allow(non_camel_case_types)] 5016 + struct RemoveTracksSvc<T: PlaylistService>(pub Arc<T>); 5017 + impl<T: PlaylistService> tonic::server::UnaryService<super::RemoveTracksRequest> 5018 + for RemoveTracksSvc<T> 5019 + { 5020 + type Response = super::RemoveTracksResponse; 5021 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5022 + fn call( 5023 + &mut self, 5024 + request: tonic::Request<super::RemoveTracksRequest>, 5025 + ) -> Self::Future { 5026 + let inner = Arc::clone(&self.0); 5027 + let fut = async move { 5028 + <T as PlaylistService>::remove_tracks(&inner, request).await 5029 + }; 5030 + Box::pin(fut) 5031 + } 5032 + } 5033 + let accept_compression_encodings = self.accept_compression_encodings; 5034 + let send_compression_encodings = self.send_compression_encodings; 5035 + let max_decoding_message_size = self.max_decoding_message_size; 5036 + let max_encoding_message_size = self.max_encoding_message_size; 5037 + let inner = self.inner.clone(); 5038 + let fut = async move { 5039 + let method = RemoveTracksSvc(inner); 5040 + let codec = tonic::codec::ProstCodec::default(); 5041 + let mut grpc = tonic::server::Grpc::new(codec) 5042 + .apply_compression_config( 5043 + accept_compression_encodings, 5044 + send_compression_encodings, 5045 + ) 5046 + .apply_max_message_size_config( 5047 + max_decoding_message_size, 5048 + max_encoding_message_size, 5049 + ); 5050 + let res = grpc.unary(method, req).await; 5051 + Ok(res) 5052 + }; 5053 + Box::pin(fut) 5054 + } 5055 + "/rockbox.v1alpha1.PlaylistService/CreatePlaylist" => { 5056 + #[allow(non_camel_case_types)] 5057 + struct CreatePlaylistSvc<T: PlaylistService>(pub Arc<T>); 5058 + impl<T: PlaylistService> 5059 + tonic::server::UnaryService<super::CreatePlaylistRequest> 5060 + for CreatePlaylistSvc<T> 5061 + { 5062 + type Response = super::CreatePlaylistResponse; 5063 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5064 + fn call( 5065 + &mut self, 5066 + request: tonic::Request<super::CreatePlaylistRequest>, 5067 + ) -> Self::Future { 5068 + let inner = Arc::clone(&self.0); 5069 + let fut = async move { 5070 + <T as PlaylistService>::create_playlist(&inner, request).await 5071 + }; 5072 + Box::pin(fut) 5073 + } 5074 + } 5075 + let accept_compression_encodings = self.accept_compression_encodings; 5076 + let send_compression_encodings = self.send_compression_encodings; 5077 + let max_decoding_message_size = self.max_decoding_message_size; 5078 + let max_encoding_message_size = self.max_encoding_message_size; 5079 + let inner = self.inner.clone(); 5080 + let fut = async move { 5081 + let method = CreatePlaylistSvc(inner); 5082 + let codec = tonic::codec::ProstCodec::default(); 5083 + let mut grpc = tonic::server::Grpc::new(codec) 5084 + .apply_compression_config( 5085 + accept_compression_encodings, 5086 + send_compression_encodings, 5087 + ) 5088 + .apply_max_message_size_config( 5089 + max_decoding_message_size, 5090 + max_encoding_message_size, 5091 + ); 5092 + let res = grpc.unary(method, req).await; 5093 + Ok(res) 5094 + }; 5095 + Box::pin(fut) 5096 + } 5097 + "/rockbox.v1alpha1.PlaylistService/InsertTracks" => { 5098 + #[allow(non_camel_case_types)] 5099 + struct InsertTracksSvc<T: PlaylistService>(pub Arc<T>); 5100 + impl<T: PlaylistService> tonic::server::UnaryService<super::InsertTracksRequest> 5101 + for InsertTracksSvc<T> 5102 + { 5103 + type Response = super::InsertTracksResponse; 5104 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5105 + fn call( 5106 + &mut self, 5107 + request: tonic::Request<super::InsertTracksRequest>, 5108 + ) -> Self::Future { 5109 + let inner = Arc::clone(&self.0); 5110 + let fut = async move { 5111 + <T as PlaylistService>::insert_tracks(&inner, request).await 5112 + }; 5113 + Box::pin(fut) 5114 + } 5115 + } 5116 + let accept_compression_encodings = self.accept_compression_encodings; 5117 + let send_compression_encodings = self.send_compression_encodings; 5118 + let max_decoding_message_size = self.max_decoding_message_size; 5119 + let max_encoding_message_size = self.max_encoding_message_size; 5120 + let inner = self.inner.clone(); 5121 + let fut = async move { 5122 + let method = InsertTracksSvc(inner); 5123 + let codec = tonic::codec::ProstCodec::default(); 5124 + let mut grpc = tonic::server::Grpc::new(codec) 5125 + .apply_compression_config( 5126 + accept_compression_encodings, 5127 + send_compression_encodings, 5128 + ) 5129 + .apply_max_message_size_config( 5130 + max_decoding_message_size, 5131 + max_encoding_message_size, 5132 + ); 5133 + let res = grpc.unary(method, req).await; 5134 + Ok(res) 5135 + }; 5136 + Box::pin(fut) 5137 + } 5138 + "/rockbox.v1alpha1.PlaylistService/InsertDirectory" => { 5139 + #[allow(non_camel_case_types)] 5140 + struct InsertDirectorySvc<T: PlaylistService>(pub Arc<T>); 5141 + impl<T: PlaylistService> 5142 + tonic::server::UnaryService<super::InsertDirectoryRequest> 5143 + for InsertDirectorySvc<T> 5144 + { 5145 + type Response = super::InsertDirectoryResponse; 5146 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5147 + fn call( 5148 + &mut self, 5149 + request: tonic::Request<super::InsertDirectoryRequest>, 5150 + ) -> Self::Future { 5151 + let inner = Arc::clone(&self.0); 5152 + let fut = async move { 5153 + <T as PlaylistService>::insert_directory(&inner, request).await 5154 + }; 5155 + Box::pin(fut) 5156 + } 5157 + } 5158 + let accept_compression_encodings = self.accept_compression_encodings; 5159 + let send_compression_encodings = self.send_compression_encodings; 5160 + let max_decoding_message_size = self.max_decoding_message_size; 5161 + let max_encoding_message_size = self.max_encoding_message_size; 5162 + let inner = self.inner.clone(); 5163 + let fut = async move { 5164 + let method = InsertDirectorySvc(inner); 5165 + let codec = tonic::codec::ProstCodec::default(); 5166 + let mut grpc = tonic::server::Grpc::new(codec) 5167 + .apply_compression_config( 5168 + accept_compression_encodings, 5169 + send_compression_encodings, 5170 + ) 5171 + .apply_max_message_size_config( 5172 + max_decoding_message_size, 5173 + max_encoding_message_size, 5174 + ); 5175 + let res = grpc.unary(method, req).await; 5176 + Ok(res) 5177 + }; 5178 + Box::pin(fut) 5179 + } 5180 + "/rockbox.v1alpha1.PlaylistService/InsertPlaylist" => { 5181 + #[allow(non_camel_case_types)] 5182 + struct InsertPlaylistSvc<T: PlaylistService>(pub Arc<T>); 5183 + impl<T: PlaylistService> 5184 + tonic::server::UnaryService<super::InsertPlaylistRequest> 5185 + for InsertPlaylistSvc<T> 5186 + { 5187 + type Response = super::InsertPlaylistResponse; 5188 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5189 + fn call( 5190 + &mut self, 5191 + request: tonic::Request<super::InsertPlaylistRequest>, 5192 + ) -> Self::Future { 5193 + let inner = Arc::clone(&self.0); 5194 + let fut = async move { 5195 + <T as PlaylistService>::insert_playlist(&inner, request).await 5196 + }; 5197 + Box::pin(fut) 5198 + } 5199 + } 5200 + let accept_compression_encodings = self.accept_compression_encodings; 5201 + let send_compression_encodings = self.send_compression_encodings; 5202 + let max_decoding_message_size = self.max_decoding_message_size; 5203 + let max_encoding_message_size = self.max_encoding_message_size; 5204 + let inner = self.inner.clone(); 5205 + let fut = async move { 5206 + let method = InsertPlaylistSvc(inner); 5207 + let codec = tonic::codec::ProstCodec::default(); 5208 + let mut grpc = tonic::server::Grpc::new(codec) 5209 + .apply_compression_config( 5210 + accept_compression_encodings, 5211 + send_compression_encodings, 5212 + ) 5213 + .apply_max_message_size_config( 5214 + max_decoding_message_size, 5215 + max_encoding_message_size, 5216 + ); 5217 + let res = grpc.unary(method, req).await; 5218 + Ok(res) 5219 + }; 5220 + Box::pin(fut) 5221 + } 5222 + "/rockbox.v1alpha1.PlaylistService/InsertAlbum" => { 5223 + #[allow(non_camel_case_types)] 5224 + struct InsertAlbumSvc<T: PlaylistService>(pub Arc<T>); 5225 + impl<T: PlaylistService> tonic::server::UnaryService<super::InsertAlbumRequest> 5226 + for InsertAlbumSvc<T> 5227 + { 5228 + type Response = super::InsertAlbumResponse; 5229 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5230 + fn call( 5231 + &mut self, 5232 + request: tonic::Request<super::InsertAlbumRequest>, 5233 + ) -> Self::Future { 5234 + let inner = Arc::clone(&self.0); 5235 + let fut = async move { 5236 + <T as PlaylistService>::insert_album(&inner, request).await 5237 + }; 5238 + Box::pin(fut) 5239 + } 5240 + } 5241 + let accept_compression_encodings = self.accept_compression_encodings; 5242 + let send_compression_encodings = self.send_compression_encodings; 5243 + let max_decoding_message_size = self.max_decoding_message_size; 5244 + let max_encoding_message_size = self.max_encoding_message_size; 5245 + let inner = self.inner.clone(); 5246 + let fut = async move { 5247 + let method = InsertAlbumSvc(inner); 5248 + let codec = tonic::codec::ProstCodec::default(); 5249 + let mut grpc = tonic::server::Grpc::new(codec) 5250 + .apply_compression_config( 5251 + accept_compression_encodings, 5252 + send_compression_encodings, 5253 + ) 5254 + .apply_max_message_size_config( 5255 + max_decoding_message_size, 5256 + max_encoding_message_size, 5257 + ); 5258 + let res = grpc.unary(method, req).await; 5259 + Ok(res) 5260 + }; 5261 + Box::pin(fut) 5262 + } 5263 + "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks" => { 5264 + #[allow(non_camel_case_types)] 5265 + struct InsertArtistTracksSvc<T: PlaylistService>(pub Arc<T>); 5266 + impl<T: PlaylistService> 5267 + tonic::server::UnaryService<super::InsertArtistTracksRequest> 5268 + for InsertArtistTracksSvc<T> 5269 + { 5270 + type Response = super::InsertArtistTracksResponse; 5271 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5272 + fn call( 5273 + &mut self, 5274 + request: tonic::Request<super::InsertArtistTracksRequest>, 5275 + ) -> Self::Future { 5276 + let inner = Arc::clone(&self.0); 5277 + let fut = async move { 5278 + <T as PlaylistService>::insert_artist_tracks(&inner, request).await 5279 + }; 5280 + Box::pin(fut) 5281 + } 5282 + } 5283 + let accept_compression_encodings = self.accept_compression_encodings; 5284 + let send_compression_encodings = self.send_compression_encodings; 5285 + let max_decoding_message_size = self.max_decoding_message_size; 5286 + let max_encoding_message_size = self.max_encoding_message_size; 5287 + let inner = self.inner.clone(); 5288 + let fut = async move { 5289 + let method = InsertArtistTracksSvc(inner); 5290 + let codec = tonic::codec::ProstCodec::default(); 5291 + let mut grpc = tonic::server::Grpc::new(codec) 5292 + .apply_compression_config( 5293 + accept_compression_encodings, 5294 + send_compression_encodings, 5295 + ) 5296 + .apply_max_message_size_config( 5297 + max_decoding_message_size, 5298 + max_encoding_message_size, 5299 + ); 5300 + let res = grpc.unary(method, req).await; 5301 + Ok(res) 5302 + }; 5303 + Box::pin(fut) 5304 + } 5305 + "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist" => { 5306 + #[allow(non_camel_case_types)] 5307 + struct ShufflePlaylistSvc<T: PlaylistService>(pub Arc<T>); 5308 + impl<T: PlaylistService> 5309 + tonic::server::UnaryService<super::ShufflePlaylistRequest> 5310 + for ShufflePlaylistSvc<T> 5311 + { 5312 + type Response = super::ShufflePlaylistResponse; 5313 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5314 + fn call( 5315 + &mut self, 5316 + request: tonic::Request<super::ShufflePlaylistRequest>, 5317 + ) -> Self::Future { 5318 + let inner = Arc::clone(&self.0); 5319 + let fut = async move { 5320 + <T as PlaylistService>::shuffle_playlist(&inner, request).await 5321 + }; 5322 + Box::pin(fut) 5323 + } 5324 + } 5325 + let accept_compression_encodings = self.accept_compression_encodings; 5326 + let send_compression_encodings = self.send_compression_encodings; 5327 + let max_decoding_message_size = self.max_decoding_message_size; 5328 + let max_encoding_message_size = self.max_encoding_message_size; 5329 + let inner = self.inner.clone(); 5330 + let fut = async move { 5331 + let method = ShufflePlaylistSvc(inner); 5332 + let codec = tonic::codec::ProstCodec::default(); 5333 + let mut grpc = tonic::server::Grpc::new(codec) 5334 + .apply_compression_config( 5335 + accept_compression_encodings, 5336 + send_compression_encodings, 5337 + ) 5338 + .apply_max_message_size_config( 5339 + max_decoding_message_size, 5340 + max_encoding_message_size, 5341 + ); 5342 + let res = grpc.unary(method, req).await; 5343 + Ok(res) 5344 + }; 5345 + Box::pin(fut) 5346 + } 5347 + _ => Box::pin(async move { 5348 + let mut response = http::Response::new(empty_body()); 5349 + let headers = response.headers_mut(); 5350 + headers.insert( 5351 + tonic::Status::GRPC_STATUS, 5352 + (tonic::Code::Unimplemented as i32).into(), 5353 + ); 5354 + headers.insert( 5355 + http::header::CONTENT_TYPE, 5356 + tonic::metadata::GRPC_CONTENT_TYPE, 5357 + ); 5358 + Ok(response) 5359 + }), 5360 + } 5361 + } 5362 + } 5363 + impl<T> Clone for PlaylistServiceServer<T> { 5364 + fn clone(&self) -> Self { 5365 + let inner = self.inner.clone(); 5366 + Self { 5367 + inner, 5368 + accept_compression_encodings: self.accept_compression_encodings, 5369 + send_compression_encodings: self.send_compression_encodings, 5370 + max_decoding_message_size: self.max_decoding_message_size, 5371 + max_encoding_message_size: self.max_encoding_message_size, 5372 + } 5373 + } 5374 + } 5375 + /// Generated gRPC service name 5376 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.PlaylistService"; 5377 + impl<T> tonic::server::NamedService for PlaylistServiceServer<T> { 5378 + const NAME: &'static str = SERVICE_NAME; 5379 + } 5380 + } 5381 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 5382 + pub struct GetSettingsListRequest { 5383 + #[prost(int32, tag = "1")] 5384 + pub count: i32, 5385 + } 5386 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 5387 + pub struct GetSettingsListResponse {} 5388 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 5389 + pub struct GetGlobalSettingsRequest {} 5390 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 5391 + pub struct ReplaygainSettings { 5392 + #[prost(bool, tag = "1")] 5393 + pub noclip: bool, 5394 + #[prost(int32, tag = "2")] 5395 + pub r#type: i32, 5396 + #[prost(int32, tag = "3")] 5397 + pub preamp: i32, 5398 + } 5399 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 5400 + pub struct EqBandSetting { 5401 + #[prost(int32, tag = "1")] 5402 + pub cutoff: i32, 5403 + #[prost(int32, tag = "2")] 5404 + pub q: i32, 5405 + #[prost(int32, tag = "3")] 5406 + pub gain: i32, 5407 + } 5408 + #[derive(Clone, PartialEq, ::prost::Message)] 5409 + pub struct SettingsList { 5410 + #[prost(uint32, tag = "1")] 5411 + pub flags: u32, 5412 + #[prost(int32, tag = "2")] 5413 + pub lang_id: i32, 5414 + #[prost(string, tag = "3")] 5415 + pub cfg_name: ::prost::alloc::string::String, 5416 + #[prost(string, tag = "4")] 5417 + pub cfg_vals: ::prost::alloc::string::String, 5418 + } 5419 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 5420 + pub struct CompressorSettings { 5421 + #[prost(int32, tag = "1")] 5422 + pub threshold: i32, 5423 + #[prost(int32, tag = "2")] 5424 + pub makeup_gain: i32, 5425 + #[prost(int32, tag = "3")] 5426 + pub ratio: i32, 5427 + #[prost(int32, tag = "4")] 5428 + pub knee: i32, 5429 + #[prost(int32, tag = "5")] 5430 + pub release_time: i32, 5431 + #[prost(int32, tag = "6")] 5432 + pub attack_time: i32, 5433 + } 5434 + #[derive(Clone, PartialEq, ::prost::Message)] 5435 + pub struct GetGlobalSettingsResponse { 5436 + #[prost(int32, tag = "1")] 5437 + pub volume: i32, 5438 + #[prost(int32, tag = "2")] 5439 + pub balance: i32, 5440 + #[prost(int32, tag = "3")] 5441 + pub bass: i32, 5442 + #[prost(int32, tag = "4")] 5443 + pub treble: i32, 5444 + #[prost(int32, tag = "5")] 5445 + pub channel_config: i32, 5446 + #[prost(int32, tag = "6")] 5447 + pub stereo_width: i32, 5448 + #[prost(int32, tag = "7")] 5449 + pub bass_cutoff: i32, 5450 + #[prost(int32, tag = "8")] 5451 + pub treble_cutoff: i32, 5452 + #[prost(int32, tag = "9")] 5453 + pub crossfade: i32, 5454 + #[prost(int32, tag = "10")] 5455 + pub crossfade_fade_in_delay: i32, 5456 + #[prost(int32, tag = "11")] 5457 + pub crossfade_fade_out_delay: i32, 5458 + #[prost(int32, tag = "12")] 5459 + pub crossfade_fade_in_duration: i32, 5460 + #[prost(int32, tag = "13")] 5461 + pub crossfade_fade_out_duration: i32, 5462 + #[prost(int32, tag = "14")] 5463 + pub crossfade_fade_out_mixmode: i32, 5464 + #[prost(message, optional, tag = "15")] 5465 + pub replaygain_settings: ::core::option::Option<ReplaygainSettings>, 5466 + #[prost(int32, tag = "16")] 5467 + pub crossfeed: i32, 5468 + #[prost(uint32, tag = "17")] 5469 + pub crossfeed_direct_gain: u32, 5470 + #[prost(uint32, tag = "18")] 5471 + pub crossfeed_cross_gain: u32, 5472 + #[prost(uint32, tag = "19")] 5473 + pub crossfeed_hf_attenuation: u32, 5474 + #[prost(uint32, tag = "20")] 5475 + pub crossfeed_hf_cutoff: u32, 5476 + #[prost(bool, tag = "21")] 5477 + pub eq_enabled: bool, 5478 + #[prost(uint32, tag = "22")] 5479 + pub eq_precut: u32, 5480 + #[prost(message, repeated, tag = "23")] 5481 + pub eq_band_settings: ::prost::alloc::vec::Vec<EqBandSetting>, 5482 + #[prost(int32, tag = "24")] 5483 + pub beep: i32, 5484 + #[prost(int32, tag = "25")] 5485 + pub keyclick: i32, 5486 + #[prost(int32, tag = "26")] 5487 + pub keyclick_repeats: i32, 5488 + #[prost(bool, tag = "27")] 5489 + pub dithering_enabled: bool, 5490 + #[prost(bool, tag = "28")] 5491 + pub timestretch_enabled: bool, 5492 + #[prost(int32, tag = "29")] 5493 + pub list_accel_start_delay: i32, 5494 + #[prost(int32, tag = "30")] 5495 + pub list_accel_wait: i32, 5496 + #[prost(int32, tag = "31")] 5497 + pub touchpad_sensitivity: i32, 5498 + #[prost(int32, tag = "32")] 5499 + pub touchpad_deadzone: i32, 5500 + #[prost(int32, tag = "33")] 5501 + pub pause_rewind: i32, 5502 + #[prost(int32, tag = "34")] 5503 + pub unplug_mode: i32, 5504 + #[prost(bool, tag = "35")] 5505 + pub unplug_autoresume: bool, 5506 + #[prost(int32, tag = "37")] 5507 + pub timeformat: i32, 5508 + #[prost(int32, tag = "38")] 5509 + pub disk_spindown: i32, 5510 + #[prost(int32, tag = "39")] 5511 + pub buffer_margin: i32, 5512 + #[prost(int32, tag = "40")] 5513 + pub dirfilter: i32, 5514 + #[prost(int32, tag = "41")] 5515 + pub show_filename_ext: i32, 5516 + #[prost(int32, tag = "42")] 5517 + pub default_codepage: i32, 5518 + #[prost(bool, tag = "43")] 5519 + pub hold_lr_for_scroll_in_list: bool, 5520 + #[prost(bool, tag = "44")] 5521 + pub play_selected: bool, 5522 + #[prost(int32, tag = "45")] 5523 + pub single_mode: i32, 5524 + #[prost(bool, tag = "46")] 5525 + pub party_mode: bool, 5526 + #[prost(bool, tag = "48")] 5527 + pub car_adapter_mode: bool, 5528 + #[prost(int32, tag = "49")] 5529 + pub car_adapter_mode_delay: i32, 5530 + #[prost(int32, tag = "50")] 5531 + pub start_in_screen: i32, 5532 + #[prost(int32, tag = "51")] 5533 + pub ff_rewind_min_step: i32, 5534 + #[prost(int32, tag = "52")] 5535 + pub ff_rewind_accel: i32, 5536 + #[prost(int32, tag = "53")] 5537 + pub peak_meter_release: i32, 5538 + #[prost(int32, tag = "54")] 5539 + pub peak_meter_hold: i32, 5540 + #[prost(int32, tag = "55")] 5541 + pub peak_meter_clip_hold: i32, 5542 + #[prost(bool, tag = "56")] 5543 + pub peak_meter_dbfs: bool, 5544 + #[prost(int32, tag = "57")] 5545 + pub peak_meter_min: i32, 5546 + #[prost(int32, tag = "58")] 5547 + pub peak_meter_max: i32, 5548 + #[prost(string, tag = "59")] 5549 + pub wps_file: ::prost::alloc::string::String, 5550 + #[prost(string, tag = "60")] 5551 + pub sbs_file: ::prost::alloc::string::String, 5552 + #[prost(string, tag = "61")] 5553 + pub lang_file: ::prost::alloc::string::String, 5554 + #[prost(string, tag = "62")] 5555 + pub playlist_catalog_dir: ::prost::alloc::string::String, 5556 + #[prost(int32, tag = "63")] 5557 + pub skip_length: i32, 5558 + #[prost(int32, tag = "64")] 5559 + pub max_files_in_dir: i32, 5560 + #[prost(int32, tag = "65")] 5561 + pub max_files_in_playlist: i32, 5562 + #[prost(int32, tag = "66")] 5563 + pub volume_type: i32, 5564 + #[prost(int32, tag = "67")] 5565 + pub battery_display: i32, 5566 + #[prost(bool, tag = "68")] 5567 + pub show_icons: bool, 5568 + #[prost(int32, tag = "69")] 5569 + pub statusbar: i32, 5570 + #[prost(int32, tag = "70")] 5571 + pub scrollbar: i32, 5572 + #[prost(int32, tag = "71")] 5573 + pub scrollbar_width: i32, 5574 + #[prost(int32, tag = "72")] 5575 + pub list_line_padding: i32, 5576 + #[prost(int32, tag = "73")] 5577 + pub list_separator_color: i32, 5578 + #[prost(bool, tag = "74")] 5579 + pub browse_current: bool, 5580 + #[prost(bool, tag = "75")] 5581 + pub scroll_paginated: bool, 5582 + #[prost(bool, tag = "76")] 5583 + pub list_wraparound: bool, 5584 + #[prost(int32, tag = "77")] 5585 + pub list_order: i32, 5586 + #[prost(int32, tag = "78")] 5587 + pub scroll_speed: i32, 5588 + #[prost(int32, tag = "79")] 5589 + pub bidir_limit: i32, 5590 + #[prost(int32, tag = "80")] 5591 + pub scroll_delay: i32, 5592 + #[prost(int32, tag = "81")] 5593 + pub scroll_step: i32, 5594 + #[prost(int32, tag = "82")] 5595 + pub autoloadbookmark: i32, 5596 + #[prost(int32, tag = "83")] 5597 + pub autocreatebookmark: i32, 5598 + #[prost(bool, tag = "84")] 5599 + pub autoupdatebookmark: bool, 5600 + #[prost(int32, tag = "85")] 5601 + pub usemrb: i32, 5602 + #[prost(bool, tag = "86")] 5603 + pub dircache: bool, 5604 + #[prost(int32, tag = "87")] 5605 + pub tagcache_ram: i32, 5606 + #[prost(bool, tag = "88")] 5607 + pub tagcache_autoupdate: bool, 5608 + #[prost(bool, tag = "89")] 5609 + pub autoresume_enable: bool, 5610 + #[prost(int32, tag = "90")] 5611 + pub autoresume_automatic: i32, 5612 + #[prost(string, tag = "91")] 5613 + pub autoresume_paths: ::prost::alloc::string::String, 5614 + #[prost(bool, tag = "92")] 5615 + pub runtimedb: bool, 5616 + #[prost(string, tag = "93")] 5617 + pub tagcache_scan_paths: ::prost::alloc::string::String, 5618 + #[prost(string, tag = "94")] 5619 + pub tagcache_db_path: ::prost::alloc::string::String, 5620 + #[prost(string, tag = "95")] 5621 + pub backdrop_file: ::prost::alloc::string::String, 5622 + #[prost(int32, tag = "96")] 5623 + pub bg_color: i32, 5624 + #[prost(int32, tag = "97")] 5625 + pub fg_color: i32, 5626 + #[prost(int32, tag = "98")] 5627 + pub lss_color: i32, 5628 + #[prost(int32, tag = "99")] 5629 + pub lse_color: i32, 5630 + #[prost(int32, tag = "100")] 5631 + pub lst_color: i32, 5632 + #[prost(string, tag = "101")] 5633 + pub colors_file: ::prost::alloc::string::String, 5634 + #[prost(int32, tag = "102")] 5635 + pub browser_default: i32, 5636 + #[prost(int32, tag = "103")] 5637 + pub repeat_mode: i32, 5638 + #[prost(int32, tag = "104")] 5639 + pub next_folder: i32, 5640 + #[prost(bool, tag = "105")] 5641 + pub constrain_next_folder: bool, 5642 + #[prost(int32, tag = "106")] 5643 + pub recursive_dir_insert: i32, 5644 + #[prost(bool, tag = "107")] 5645 + pub fade_on_stop: bool, 5646 + #[prost(bool, tag = "108")] 5647 + pub playlist_shuffle: bool, 5648 + #[prost(bool, tag = "109")] 5649 + pub warnon_erase_dynplaylist: bool, 5650 + #[prost(bool, tag = "110")] 5651 + pub keep_current_track_on_replace_playlist: bool, 5652 + #[prost(bool, tag = "111")] 5653 + pub show_shuffled_adding_options: bool, 5654 + #[prost(int32, tag = "112")] 5655 + pub show_queue_options: i32, 5656 + #[prost(int32, tag = "113")] 5657 + pub album_art: i32, 5658 + #[prost(bool, tag = "114")] 5659 + pub rewind_across_tracks: bool, 5660 + #[prost(bool, tag = "115")] 5661 + pub playlist_viewer_icons: bool, 5662 + #[prost(bool, tag = "116")] 5663 + pub playlist_viewer_indices: bool, 5664 + #[prost(int32, tag = "117")] 5665 + pub playlist_viewer_track_display: i32, 5666 + #[prost(bool, tag = "118")] 5667 + pub sort_case: bool, 5668 + #[prost(int32, tag = "119")] 5669 + pub sort_dir: i32, 5670 + #[prost(int32, tag = "120")] 5671 + pub sort_file: i32, 5672 + #[prost(int32, tag = "121")] 5673 + pub interpret_numbers: i32, 5674 + #[prost(int32, tag = "122")] 5675 + pub poweroff: i32, 5676 + #[prost(bool, tag = "123")] 5677 + pub spdif_enable: bool, 5678 + #[prost(int32, tag = "124")] 5679 + pub contrast: i32, 5680 + #[prost(bool, tag = "125")] 5681 + pub invert: bool, 5682 + #[prost(bool, tag = "126")] 5683 + pub flip_display: bool, 5684 + #[prost(int32, tag = "127")] 5685 + pub cursor_style: i32, 5686 + #[prost(int32, tag = "128")] 5687 + pub screen_scroll_step: i32, 5688 + #[prost(int32, tag = "129")] 5689 + pub show_path_in_browser: i32, 5690 + #[prost(bool, tag = "130")] 5691 + pub offset_out_of_view: bool, 5692 + #[prost(bool, tag = "131")] 5693 + pub disable_mainmenu_scrolling: bool, 5694 + #[prost(string, tag = "132")] 5695 + pub icon_file: ::prost::alloc::string::String, 5696 + #[prost(string, tag = "133")] 5697 + pub viewers_icon_file: ::prost::alloc::string::String, 5698 + #[prost(string, tag = "134")] 5699 + pub font_file: ::prost::alloc::string::String, 5700 + #[prost(int32, tag = "135")] 5701 + pub glyphs_to_cache: i32, 5702 + #[prost(string, tag = "136")] 5703 + pub kbd_file: ::prost::alloc::string::String, 5704 + #[prost(int32, tag = "137")] 5705 + pub backlight_timeout: i32, 5706 + #[prost(bool, tag = "138")] 5707 + pub caption_backlight: bool, 5708 + #[prost(bool, tag = "139")] 5709 + pub bl_filter_first_keypress: bool, 5710 + #[prost(int32, tag = "140")] 5711 + pub backlight_timeout_plugged: i32, 5712 + #[prost(bool, tag = "141")] 5713 + pub bt_selective_softlock_actions: bool, 5714 + #[prost(int32, tag = "142")] 5715 + pub bt_selective_softlock_actions_mask: i32, 5716 + #[prost(bool, tag = "143")] 5717 + pub bl_selective_actions: bool, 5718 + #[prost(int32, tag = "144")] 5719 + pub bl_selective_actions_mask: i32, 5720 + #[prost(int32, tag = "145")] 5721 + pub backlight_on_button_hold: i32, 5722 + #[prost(int32, tag = "146")] 5723 + pub lcd_sleep_after_backlight_off: i32, 5724 + #[prost(int32, tag = "147")] 5725 + pub brightness: i32, 5726 + #[prost(int32, tag = "148")] 5727 + pub speaker_mode: i32, 5728 + #[prost(bool, tag = "149")] 5729 + pub prevent_skip: bool, 5730 + #[prost(int32, tag = "150")] 5731 + pub touch_mode: i32, 5732 + #[prost(bool, tag = "151")] 5733 + pub pitch_mode_semitone: bool, 5734 + #[prost(bool, tag = "152")] 5735 + pub pitch_mode_timestretch: bool, 5736 + #[prost(string, tag = "153")] 5737 + pub player_name: ::prost::alloc::string::String, 5738 + #[prost(message, optional, tag = "154")] 5739 + pub compressor_settings: ::core::option::Option<CompressorSettings>, 5740 + #[prost(int32, tag = "155")] 5741 + pub sleeptimer_duration: i32, 5742 + #[prost(bool, tag = "156")] 5743 + pub sleeptimer_on_startup: bool, 5744 + #[prost(bool, tag = "157")] 5745 + pub keypress_restarts_sleeptimer: bool, 5746 + #[prost(bool, tag = "158")] 5747 + pub show_shutdown_message: bool, 5748 + #[prost(int32, tag = "159")] 5749 + pub hotkey_wps: i32, 5750 + #[prost(int32, tag = "160")] 5751 + pub hotkey_tree: i32, 5752 + #[prost(int32, tag = "161")] 5753 + pub resume_rewind: i32, 5754 + #[prost(int32, tag = "162")] 5755 + pub depth_3d: i32, 5756 + #[prost(int32, tag = "163")] 5757 + pub roll_off: i32, 5758 + #[prost(int32, tag = "164")] 5759 + pub power_mode: i32, 5760 + #[prost(bool, tag = "165")] 5761 + pub keyclick_hardware: bool, 5762 + #[prost(string, tag = "166")] 5763 + pub start_directory: ::prost::alloc::string::String, 5764 + #[prost(bool, tag = "167")] 5765 + pub root_menu_customized: bool, 5766 + #[prost(bool, tag = "168")] 5767 + pub shortcuts_replaces_qs: bool, 5768 + #[prost(int32, tag = "169")] 5769 + pub play_frequency: i32, 5770 + #[prost(int32, tag = "170")] 5771 + pub volume_limit: i32, 5772 + #[prost(int32, tag = "171")] 5773 + pub volume_adjust_mode: i32, 5774 + #[prost(int32, tag = "172")] 5775 + pub volume_adjust_norm_steps: i32, 5776 + #[prost(int32, tag = "173")] 5777 + pub surround_enabled: i32, 5778 + #[prost(int32, tag = "174")] 5779 + pub surround_balance: i32, 5780 + #[prost(int32, tag = "175")] 5781 + pub surround_fx1: i32, 5782 + #[prost(int32, tag = "176")] 5783 + pub surround_fx2: i32, 5784 + #[prost(bool, tag = "177")] 5785 + pub surround_method2: bool, 5786 + #[prost(int32, tag = "178")] 5787 + pub surround_mix: i32, 5788 + #[prost(int32, tag = "179")] 5789 + pub pbe: i32, 5790 + #[prost(int32, tag = "180")] 5791 + pub pbe_precut: i32, 5792 + #[prost(int32, tag = "181")] 5793 + pub afr_enabled: i32, 5794 + #[prost(int32, tag = "182")] 5795 + pub governor: i32, 5796 + #[prost(int32, tag = "183")] 5797 + pub stereosw_mode: i32, 5798 + #[prost(string, tag = "184")] 5799 + pub music_dir: ::prost::alloc::string::String, 5800 + } 5801 + #[derive(Clone, PartialEq, ::prost::Message)] 5802 + pub struct SaveSettingsRequest { 5803 + #[prost(string, optional, tag = "1")] 5804 + pub music_dir: ::core::option::Option<::prost::alloc::string::String>, 5805 + #[prost(bool, optional, tag = "2")] 5806 + pub playlist_shuffle: ::core::option::Option<bool>, 5807 + #[prost(int32, optional, tag = "3")] 5808 + pub repeat_mode: ::core::option::Option<i32>, 5809 + #[prost(int32, optional, tag = "4")] 5810 + pub bass: ::core::option::Option<i32>, 5811 + #[prost(int32, optional, tag = "5")] 5812 + pub treble: ::core::option::Option<i32>, 5813 + #[prost(int32, optional, tag = "6")] 5814 + pub bass_cutoff: ::core::option::Option<i32>, 5815 + #[prost(int32, optional, tag = "7")] 5816 + pub treble_cutoff: ::core::option::Option<i32>, 5817 + #[prost(int32, optional, tag = "8")] 5818 + pub crossfade: ::core::option::Option<i32>, 5819 + #[prost(bool, optional, tag = "9")] 5820 + pub fade_on_stop: ::core::option::Option<bool>, 5821 + #[prost(int32, optional, tag = "10")] 5822 + pub fade_in_delay: ::core::option::Option<i32>, 5823 + #[prost(int32, optional, tag = "11")] 5824 + pub fade_in_duration: ::core::option::Option<i32>, 5825 + #[prost(int32, optional, tag = "12")] 5826 + pub fade_out_delay: ::core::option::Option<i32>, 5827 + #[prost(int32, optional, tag = "13")] 5828 + pub fade_out_duration: ::core::option::Option<i32>, 5829 + #[prost(int32, optional, tag = "14")] 5830 + pub fade_out_mixmode: ::core::option::Option<i32>, 5831 + #[prost(int32, optional, tag = "15")] 5832 + pub balance: ::core::option::Option<i32>, 5833 + #[prost(int32, optional, tag = "16")] 5834 + pub stereo_width: ::core::option::Option<i32>, 5835 + #[prost(int32, optional, tag = "17")] 5836 + pub stereosw_mode: ::core::option::Option<i32>, 5837 + #[prost(int32, optional, tag = "18")] 5838 + pub surround_enabled: ::core::option::Option<i32>, 5839 + #[prost(int32, optional, tag = "19")] 5840 + pub surround_balance: ::core::option::Option<i32>, 5841 + #[prost(int32, optional, tag = "20")] 5842 + pub surround_fx1: ::core::option::Option<i32>, 5843 + #[prost(int32, optional, tag = "21")] 5844 + pub surround_fx2: ::core::option::Option<i32>, 5845 + #[prost(bool, optional, tag = "22")] 5846 + pub party_mode: ::core::option::Option<bool>, 5847 + #[prost(int32, optional, tag = "23")] 5848 + pub channel_config: ::core::option::Option<i32>, 5849 + #[prost(string, optional, tag = "24")] 5850 + pub player_name: ::core::option::Option<::prost::alloc::string::String>, 5851 + #[prost(bool, optional, tag = "25")] 5852 + pub eq_enabled: ::core::option::Option<bool>, 5853 + #[prost(message, repeated, tag = "26")] 5854 + pub eq_band_settings: ::prost::alloc::vec::Vec<EqBandSetting>, 5855 + #[prost(message, optional, tag = "27")] 5856 + pub replaygain_settings: ::core::option::Option<ReplaygainSettings>, 5857 + } 5858 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 5859 + pub struct SaveSettingsResponse {} 5860 + /// Generated client implementations. 5861 + pub mod settings_service_client { 5862 + #![allow( 5863 + unused_variables, 5864 + dead_code, 5865 + missing_docs, 5866 + clippy::wildcard_imports, 5867 + clippy::let_unit_value 5868 + )] 5869 + use tonic::codegen::http::Uri; 5870 + use tonic::codegen::*; 5871 + #[derive(Debug, Clone)] 5872 + pub struct SettingsServiceClient<T> { 5873 + inner: tonic::client::Grpc<T>, 5874 + } 5875 + impl SettingsServiceClient<tonic::transport::Channel> { 5876 + /// Attempt to create a new client by connecting to a given endpoint. 5877 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 5878 + where 5879 + D: TryInto<tonic::transport::Endpoint>, 5880 + D::Error: Into<StdError>, 5881 + { 5882 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 5883 + Ok(Self::new(conn)) 5884 + } 5885 + } 5886 + impl<T> SettingsServiceClient<T> 5887 + where 5888 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 5889 + T::Error: Into<StdError>, 5890 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 5891 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 5892 + { 5893 + pub fn new(inner: T) -> Self { 5894 + let inner = tonic::client::Grpc::new(inner); 5895 + Self { inner } 5896 + } 5897 + pub fn with_origin(inner: T, origin: Uri) -> Self { 5898 + let inner = tonic::client::Grpc::with_origin(inner, origin); 5899 + Self { inner } 5900 + } 5901 + pub fn with_interceptor<F>( 5902 + inner: T, 5903 + interceptor: F, 5904 + ) -> SettingsServiceClient<InterceptedService<T, F>> 5905 + where 5906 + F: tonic::service::Interceptor, 5907 + T::ResponseBody: Default, 5908 + T: tonic::codegen::Service< 5909 + http::Request<tonic::body::BoxBody>, 5910 + Response = http::Response< 5911 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 5912 + >, 5913 + >, 5914 + <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 5915 + Into<StdError> + std::marker::Send + std::marker::Sync, 5916 + { 5917 + SettingsServiceClient::new(InterceptedService::new(inner, interceptor)) 5918 + } 5919 + /// Compress requests with the given encoding. 5920 + /// 5921 + /// This requires the server to support it otherwise it might respond with an 5922 + /// error. 5923 + #[must_use] 5924 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 5925 + self.inner = self.inner.send_compressed(encoding); 5926 + self 5927 + } 5928 + /// Enable decompressing responses. 5929 + #[must_use] 5930 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 5931 + self.inner = self.inner.accept_compressed(encoding); 5932 + self 5933 + } 5934 + /// Limits the maximum size of a decoded message. 5935 + /// 5936 + /// Default: `4MB` 5937 + #[must_use] 5938 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 5939 + self.inner = self.inner.max_decoding_message_size(limit); 5940 + self 5941 + } 5942 + /// Limits the maximum size of an encoded message. 5943 + /// 5944 + /// Default: `usize::MAX` 5945 + #[must_use] 5946 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 5947 + self.inner = self.inner.max_encoding_message_size(limit); 5948 + self 5949 + } 5950 + pub async fn get_settings_list( 5951 + &mut self, 5952 + request: impl tonic::IntoRequest<super::GetSettingsListRequest>, 5953 + ) -> std::result::Result<tonic::Response<super::GetSettingsListResponse>, tonic::Status> 5954 + { 5955 + self.inner.ready().await.map_err(|e| { 5956 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 5957 + })?; 5958 + let codec = tonic::codec::ProstCodec::default(); 5959 + let path = http::uri::PathAndQuery::from_static( 5960 + "/rockbox.v1alpha1.SettingsService/GetSettingsList", 5961 + ); 5962 + let mut req = request.into_request(); 5963 + req.extensions_mut().insert(GrpcMethod::new( 5964 + "rockbox.v1alpha1.SettingsService", 5965 + "GetSettingsList", 5966 + )); 5967 + self.inner.unary(req, path, codec).await 5968 + } 5969 + pub async fn get_global_settings( 5970 + &mut self, 5971 + request: impl tonic::IntoRequest<super::GetGlobalSettingsRequest>, 5972 + ) -> std::result::Result<tonic::Response<super::GetGlobalSettingsResponse>, tonic::Status> 5973 + { 5974 + self.inner.ready().await.map_err(|e| { 5975 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 5976 + })?; 5977 + let codec = tonic::codec::ProstCodec::default(); 5978 + let path = http::uri::PathAndQuery::from_static( 5979 + "/rockbox.v1alpha1.SettingsService/GetGlobalSettings", 5980 + ); 5981 + let mut req = request.into_request(); 5982 + req.extensions_mut().insert(GrpcMethod::new( 5983 + "rockbox.v1alpha1.SettingsService", 5984 + "GetGlobalSettings", 5985 + )); 5986 + self.inner.unary(req, path, codec).await 5987 + } 5988 + pub async fn save_settings( 5989 + &mut self, 5990 + request: impl tonic::IntoRequest<super::SaveSettingsRequest>, 5991 + ) -> std::result::Result<tonic::Response<super::SaveSettingsResponse>, tonic::Status> 5992 + { 5993 + self.inner.ready().await.map_err(|e| { 5994 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 5995 + })?; 5996 + let codec = tonic::codec::ProstCodec::default(); 5997 + let path = http::uri::PathAndQuery::from_static( 5998 + "/rockbox.v1alpha1.SettingsService/SaveSettings", 5999 + ); 6000 + let mut req = request.into_request(); 6001 + req.extensions_mut().insert(GrpcMethod::new( 6002 + "rockbox.v1alpha1.SettingsService", 6003 + "SaveSettings", 6004 + )); 6005 + self.inner.unary(req, path, codec).await 6006 + } 6007 + } 6008 + } 6009 + /// Generated server implementations. 6010 + pub mod settings_service_server { 6011 + #![allow( 6012 + unused_variables, 6013 + dead_code, 6014 + missing_docs, 6015 + clippy::wildcard_imports, 6016 + clippy::let_unit_value 6017 + )] 6018 + use tonic::codegen::*; 6019 + /// Generated trait containing gRPC methods that should be implemented for use with SettingsServiceServer. 6020 + #[async_trait] 6021 + pub trait SettingsService: std::marker::Send + std::marker::Sync + 'static { 6022 + async fn get_settings_list( 6023 + &self, 6024 + request: tonic::Request<super::GetSettingsListRequest>, 6025 + ) -> std::result::Result<tonic::Response<super::GetSettingsListResponse>, tonic::Status>; 6026 + async fn get_global_settings( 6027 + &self, 6028 + request: tonic::Request<super::GetGlobalSettingsRequest>, 6029 + ) -> std::result::Result<tonic::Response<super::GetGlobalSettingsResponse>, tonic::Status>; 6030 + async fn save_settings( 6031 + &self, 6032 + request: tonic::Request<super::SaveSettingsRequest>, 6033 + ) -> std::result::Result<tonic::Response<super::SaveSettingsResponse>, tonic::Status>; 6034 + } 6035 + #[derive(Debug)] 6036 + pub struct SettingsServiceServer<T> { 6037 + inner: Arc<T>, 6038 + accept_compression_encodings: EnabledCompressionEncodings, 6039 + send_compression_encodings: EnabledCompressionEncodings, 6040 + max_decoding_message_size: Option<usize>, 6041 + max_encoding_message_size: Option<usize>, 6042 + } 6043 + impl<T> SettingsServiceServer<T> { 6044 + pub fn new(inner: T) -> Self { 6045 + Self::from_arc(Arc::new(inner)) 6046 + } 6047 + pub fn from_arc(inner: Arc<T>) -> Self { 6048 + Self { 6049 + inner, 6050 + accept_compression_encodings: Default::default(), 6051 + send_compression_encodings: Default::default(), 6052 + max_decoding_message_size: None, 6053 + max_encoding_message_size: None, 6054 + } 6055 + } 6056 + pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 6057 + where 6058 + F: tonic::service::Interceptor, 6059 + { 6060 + InterceptedService::new(Self::new(inner), interceptor) 6061 + } 6062 + /// Enable decompressing requests with the given encoding. 6063 + #[must_use] 6064 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 6065 + self.accept_compression_encodings.enable(encoding); 6066 + self 6067 + } 6068 + /// Compress responses with the given encoding, if the client supports it. 6069 + #[must_use] 6070 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 6071 + self.send_compression_encodings.enable(encoding); 6072 + self 6073 + } 6074 + /// Limits the maximum size of a decoded message. 6075 + /// 6076 + /// Default: `4MB` 6077 + #[must_use] 6078 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 6079 + self.max_decoding_message_size = Some(limit); 6080 + self 6081 + } 6082 + /// Limits the maximum size of an encoded message. 6083 + /// 6084 + /// Default: `usize::MAX` 6085 + #[must_use] 6086 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 6087 + self.max_encoding_message_size = Some(limit); 6088 + self 6089 + } 6090 + } 6091 + impl<T, B> tonic::codegen::Service<http::Request<B>> for SettingsServiceServer<T> 6092 + where 6093 + T: SettingsService, 6094 + B: Body + std::marker::Send + 'static, 6095 + B::Error: Into<StdError> + std::marker::Send + 'static, 6096 + { 6097 + type Response = http::Response<tonic::body::BoxBody>; 6098 + type Error = std::convert::Infallible; 6099 + type Future = BoxFuture<Self::Response, Self::Error>; 6100 + fn poll_ready( 6101 + &mut self, 6102 + _cx: &mut Context<'_>, 6103 + ) -> Poll<std::result::Result<(), Self::Error>> { 6104 + Poll::Ready(Ok(())) 6105 + } 6106 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 6107 + match req.uri().path() { 6108 + "/rockbox.v1alpha1.SettingsService/GetSettingsList" => { 6109 + #[allow(non_camel_case_types)] 6110 + struct GetSettingsListSvc<T: SettingsService>(pub Arc<T>); 6111 + impl<T: SettingsService> 6112 + tonic::server::UnaryService<super::GetSettingsListRequest> 6113 + for GetSettingsListSvc<T> 6114 + { 6115 + type Response = super::GetSettingsListResponse; 6116 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6117 + fn call( 6118 + &mut self, 6119 + request: tonic::Request<super::GetSettingsListRequest>, 6120 + ) -> Self::Future { 6121 + let inner = Arc::clone(&self.0); 6122 + let fut = async move { 6123 + <T as SettingsService>::get_settings_list(&inner, request).await 6124 + }; 6125 + Box::pin(fut) 6126 + } 6127 + } 6128 + let accept_compression_encodings = self.accept_compression_encodings; 6129 + let send_compression_encodings = self.send_compression_encodings; 6130 + let max_decoding_message_size = self.max_decoding_message_size; 6131 + let max_encoding_message_size = self.max_encoding_message_size; 6132 + let inner = self.inner.clone(); 6133 + let fut = async move { 6134 + let method = GetSettingsListSvc(inner); 6135 + let codec = tonic::codec::ProstCodec::default(); 6136 + let mut grpc = tonic::server::Grpc::new(codec) 6137 + .apply_compression_config( 6138 + accept_compression_encodings, 6139 + send_compression_encodings, 6140 + ) 6141 + .apply_max_message_size_config( 6142 + max_decoding_message_size, 6143 + max_encoding_message_size, 6144 + ); 6145 + let res = grpc.unary(method, req).await; 6146 + Ok(res) 6147 + }; 6148 + Box::pin(fut) 6149 + } 6150 + "/rockbox.v1alpha1.SettingsService/GetGlobalSettings" => { 6151 + #[allow(non_camel_case_types)] 6152 + struct GetGlobalSettingsSvc<T: SettingsService>(pub Arc<T>); 6153 + impl<T: SettingsService> 6154 + tonic::server::UnaryService<super::GetGlobalSettingsRequest> 6155 + for GetGlobalSettingsSvc<T> 6156 + { 6157 + type Response = super::GetGlobalSettingsResponse; 6158 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6159 + fn call( 6160 + &mut self, 6161 + request: tonic::Request<super::GetGlobalSettingsRequest>, 6162 + ) -> Self::Future { 6163 + let inner = Arc::clone(&self.0); 6164 + let fut = async move { 6165 + <T as SettingsService>::get_global_settings(&inner, request).await 6166 + }; 6167 + Box::pin(fut) 6168 + } 6169 + } 6170 + let accept_compression_encodings = self.accept_compression_encodings; 6171 + let send_compression_encodings = self.send_compression_encodings; 6172 + let max_decoding_message_size = self.max_decoding_message_size; 6173 + let max_encoding_message_size = self.max_encoding_message_size; 6174 + let inner = self.inner.clone(); 6175 + let fut = async move { 6176 + let method = GetGlobalSettingsSvc(inner); 6177 + let codec = tonic::codec::ProstCodec::default(); 6178 + let mut grpc = tonic::server::Grpc::new(codec) 6179 + .apply_compression_config( 6180 + accept_compression_encodings, 6181 + send_compression_encodings, 6182 + ) 6183 + .apply_max_message_size_config( 6184 + max_decoding_message_size, 6185 + max_encoding_message_size, 6186 + ); 6187 + let res = grpc.unary(method, req).await; 6188 + Ok(res) 6189 + }; 6190 + Box::pin(fut) 6191 + } 6192 + "/rockbox.v1alpha1.SettingsService/SaveSettings" => { 6193 + #[allow(non_camel_case_types)] 6194 + struct SaveSettingsSvc<T: SettingsService>(pub Arc<T>); 6195 + impl<T: SettingsService> tonic::server::UnaryService<super::SaveSettingsRequest> 6196 + for SaveSettingsSvc<T> 6197 + { 6198 + type Response = super::SaveSettingsResponse; 6199 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6200 + fn call( 6201 + &mut self, 6202 + request: tonic::Request<super::SaveSettingsRequest>, 6203 + ) -> Self::Future { 6204 + let inner = Arc::clone(&self.0); 6205 + let fut = async move { 6206 + <T as SettingsService>::save_settings(&inner, request).await 6207 + }; 6208 + Box::pin(fut) 6209 + } 6210 + } 6211 + let accept_compression_encodings = self.accept_compression_encodings; 6212 + let send_compression_encodings = self.send_compression_encodings; 6213 + let max_decoding_message_size = self.max_decoding_message_size; 6214 + let max_encoding_message_size = self.max_encoding_message_size; 6215 + let inner = self.inner.clone(); 6216 + let fut = async move { 6217 + let method = SaveSettingsSvc(inner); 6218 + let codec = tonic::codec::ProstCodec::default(); 6219 + let mut grpc = tonic::server::Grpc::new(codec) 6220 + .apply_compression_config( 6221 + accept_compression_encodings, 6222 + send_compression_encodings, 6223 + ) 6224 + .apply_max_message_size_config( 6225 + max_decoding_message_size, 6226 + max_encoding_message_size, 6227 + ); 6228 + let res = grpc.unary(method, req).await; 6229 + Ok(res) 6230 + }; 6231 + Box::pin(fut) 6232 + } 6233 + _ => Box::pin(async move { 6234 + let mut response = http::Response::new(empty_body()); 6235 + let headers = response.headers_mut(); 6236 + headers.insert( 6237 + tonic::Status::GRPC_STATUS, 6238 + (tonic::Code::Unimplemented as i32).into(), 6239 + ); 6240 + headers.insert( 6241 + http::header::CONTENT_TYPE, 6242 + tonic::metadata::GRPC_CONTENT_TYPE, 6243 + ); 6244 + Ok(response) 6245 + }), 6246 + } 6247 + } 6248 + } 6249 + impl<T> Clone for SettingsServiceServer<T> { 6250 + fn clone(&self) -> Self { 6251 + let inner = self.inner.clone(); 6252 + Self { 6253 + inner, 6254 + accept_compression_encodings: self.accept_compression_encodings, 6255 + send_compression_encodings: self.send_compression_encodings, 6256 + max_decoding_message_size: self.max_decoding_message_size, 6257 + max_encoding_message_size: self.max_encoding_message_size, 6258 + } 6259 + } 6260 + } 6261 + /// Generated gRPC service name 6262 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.SettingsService"; 6263 + impl<T> tonic::server::NamedService for SettingsServiceServer<T> { 6264 + const NAME: &'static str = SERVICE_NAME; 6265 + } 6266 + } 6267 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6268 + pub struct AdjustVolumeRequest { 6269 + #[prost(int32, tag = "1")] 6270 + pub steps: i32, 6271 + } 6272 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6273 + pub struct AdjustVolumeResponse {} 6274 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6275 + pub struct SoundSetRequest { 6276 + #[prost(int32, tag = "1")] 6277 + pub setting: i32, 6278 + #[prost(int32, tag = "2")] 6279 + pub value: i32, 6280 + } 6281 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6282 + pub struct SoundSetResponse {} 6283 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6284 + pub struct SoundCurrentRequest { 6285 + #[prost(int32, tag = "1")] 6286 + pub setting: i32, 6287 + } 6288 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6289 + pub struct SoundCurrentResponse { 6290 + #[prost(int32, tag = "1")] 6291 + pub value: i32, 6292 + } 6293 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6294 + pub struct SoundDefaultRequest { 6295 + #[prost(int32, tag = "1")] 6296 + pub setting: i32, 6297 + } 6298 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6299 + pub struct SoundDefaultResponse { 6300 + #[prost(int32, tag = "1")] 6301 + pub value: i32, 6302 + } 6303 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6304 + pub struct SoundMinRequest { 6305 + #[prost(int32, tag = "1")] 6306 + pub setting: i32, 6307 + } 6308 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6309 + pub struct SoundMinResponse { 6310 + #[prost(int32, tag = "1")] 6311 + pub value: i32, 6312 + } 6313 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6314 + pub struct SoundMaxRequest { 6315 + #[prost(int32, tag = "1")] 6316 + pub setting: i32, 6317 + } 6318 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6319 + pub struct SoundMaxResponse { 6320 + #[prost(int32, tag = "1")] 6321 + pub value: i32, 6322 + } 6323 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6324 + pub struct SoundUnitRequest {} 6325 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6326 + pub struct SoundUnitResponse {} 6327 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6328 + pub struct SoundVal2PhysRequest { 6329 + #[prost(int32, tag = "1")] 6330 + pub setting: i32, 6331 + #[prost(int32, tag = "2")] 6332 + pub value: i32, 6333 + } 6334 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6335 + pub struct SoundVal2PhysResponse { 6336 + #[prost(int32, tag = "1")] 6337 + pub value: i32, 6338 + } 6339 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6340 + pub struct GetPitchRequest {} 6341 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6342 + pub struct GetPitchResponse { 6343 + #[prost(int32, tag = "1")] 6344 + pub value: i32, 6345 + } 6346 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6347 + pub struct SetPitchRequest { 6348 + #[prost(int32, tag = "1")] 6349 + pub value: i32, 6350 + } 6351 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6352 + pub struct SetPitchResponse {} 6353 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6354 + pub struct BeepPlayRequest { 6355 + #[prost(uint32, tag = "1")] 6356 + pub frequency: u32, 6357 + #[prost(uint32, tag = "2")] 6358 + pub duration: u32, 6359 + #[prost(uint32, tag = "3")] 6360 + pub amplitude: u32, 6361 + } 6362 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6363 + pub struct BeepPlayResponse {} 6364 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6365 + pub struct PcmbufFadeRequest { 6366 + #[prost(int32, tag = "1")] 6367 + pub fade: i32, 6368 + #[prost(bool, tag = "2")] 6369 + pub r#in: bool, 6370 + } 6371 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6372 + pub struct PcmbufFadeResponse {} 6373 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6374 + pub struct PcmbufSetLowLatencyRequest { 6375 + #[prost(bool, tag = "1")] 6376 + pub state: bool, 6377 + } 6378 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6379 + pub struct PcmbufSetLowLatencyResponse {} 6380 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6381 + pub struct SystemSoundPlayRequest { 6382 + #[prost(uint32, tag = "1")] 6383 + pub sound: u32, 6384 + } 6385 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6386 + pub struct SystemSoundPlayResponse {} 6387 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6388 + pub struct KeyclickClickRequest { 6389 + #[prost(bool, tag = "1")] 6390 + pub rawbutton: bool, 6391 + #[prost(int32, tag = "2")] 6392 + pub action: i32, 6393 + } 6394 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6395 + pub struct KeyclickClickResponse {} 6396 + /// Generated client implementations. 6397 + pub mod sound_service_client { 6398 + #![allow( 6399 + unused_variables, 6400 + dead_code, 6401 + missing_docs, 6402 + clippy::wildcard_imports, 6403 + clippy::let_unit_value 6404 + )] 6405 + use tonic::codegen::http::Uri; 6406 + use tonic::codegen::*; 6407 + #[derive(Debug, Clone)] 6408 + pub struct SoundServiceClient<T> { 6409 + inner: tonic::client::Grpc<T>, 6410 + } 6411 + impl SoundServiceClient<tonic::transport::Channel> { 6412 + /// Attempt to create a new client by connecting to a given endpoint. 6413 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 6414 + where 6415 + D: TryInto<tonic::transport::Endpoint>, 6416 + D::Error: Into<StdError>, 6417 + { 6418 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 6419 + Ok(Self::new(conn)) 6420 + } 6421 + } 6422 + impl<T> SoundServiceClient<T> 6423 + where 6424 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 6425 + T::Error: Into<StdError>, 6426 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 6427 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 6428 + { 6429 + pub fn new(inner: T) -> Self { 6430 + let inner = tonic::client::Grpc::new(inner); 6431 + Self { inner } 6432 + } 6433 + pub fn with_origin(inner: T, origin: Uri) -> Self { 6434 + let inner = tonic::client::Grpc::with_origin(inner, origin); 6435 + Self { inner } 6436 + } 6437 + pub fn with_interceptor<F>( 6438 + inner: T, 6439 + interceptor: F, 6440 + ) -> SoundServiceClient<InterceptedService<T, F>> 6441 + where 6442 + F: tonic::service::Interceptor, 6443 + T::ResponseBody: Default, 6444 + T: tonic::codegen::Service< 6445 + http::Request<tonic::body::BoxBody>, 6446 + Response = http::Response< 6447 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 6448 + >, 6449 + >, 6450 + <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 6451 + Into<StdError> + std::marker::Send + std::marker::Sync, 6452 + { 6453 + SoundServiceClient::new(InterceptedService::new(inner, interceptor)) 6454 + } 6455 + /// Compress requests with the given encoding. 6456 + /// 6457 + /// This requires the server to support it otherwise it might respond with an 6458 + /// error. 6459 + #[must_use] 6460 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 6461 + self.inner = self.inner.send_compressed(encoding); 6462 + self 6463 + } 6464 + /// Enable decompressing responses. 6465 + #[must_use] 6466 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 6467 + self.inner = self.inner.accept_compressed(encoding); 6468 + self 6469 + } 6470 + /// Limits the maximum size of a decoded message. 6471 + /// 6472 + /// Default: `4MB` 6473 + #[must_use] 6474 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 6475 + self.inner = self.inner.max_decoding_message_size(limit); 6476 + self 6477 + } 6478 + /// Limits the maximum size of an encoded message. 6479 + /// 6480 + /// Default: `usize::MAX` 6481 + #[must_use] 6482 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 6483 + self.inner = self.inner.max_encoding_message_size(limit); 6484 + self 6485 + } 6486 + pub async fn adjust_volume( 6487 + &mut self, 6488 + request: impl tonic::IntoRequest<super::AdjustVolumeRequest>, 6489 + ) -> std::result::Result<tonic::Response<super::AdjustVolumeResponse>, tonic::Status> 6490 + { 6491 + self.inner.ready().await.map_err(|e| { 6492 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6493 + })?; 6494 + let codec = tonic::codec::ProstCodec::default(); 6495 + let path = 6496 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/AdjustVolume"); 6497 + let mut req = request.into_request(); 6498 + req.extensions_mut().insert(GrpcMethod::new( 6499 + "rockbox.v1alpha1.SoundService", 6500 + "AdjustVolume", 6501 + )); 6502 + self.inner.unary(req, path, codec).await 6503 + } 6504 + pub async fn sound_set( 6505 + &mut self, 6506 + request: impl tonic::IntoRequest<super::SoundSetRequest>, 6507 + ) -> std::result::Result<tonic::Response<super::SoundSetResponse>, tonic::Status> { 6508 + self.inner.ready().await.map_err(|e| { 6509 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6510 + })?; 6511 + let codec = tonic::codec::ProstCodec::default(); 6512 + let path = 6513 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundSet"); 6514 + let mut req = request.into_request(); 6515 + req.extensions_mut() 6516 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundSet")); 6517 + self.inner.unary(req, path, codec).await 6518 + } 6519 + pub async fn sound_current( 6520 + &mut self, 6521 + request: impl tonic::IntoRequest<super::SoundCurrentRequest>, 6522 + ) -> std::result::Result<tonic::Response<super::SoundCurrentResponse>, tonic::Status> 6523 + { 6524 + self.inner.ready().await.map_err(|e| { 6525 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6526 + })?; 6527 + let codec = tonic::codec::ProstCodec::default(); 6528 + let path = 6529 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundCurrent"); 6530 + let mut req = request.into_request(); 6531 + req.extensions_mut().insert(GrpcMethod::new( 6532 + "rockbox.v1alpha1.SoundService", 6533 + "SoundCurrent", 6534 + )); 6535 + self.inner.unary(req, path, codec).await 6536 + } 6537 + pub async fn sound_default( 6538 + &mut self, 6539 + request: impl tonic::IntoRequest<super::SoundDefaultRequest>, 6540 + ) -> std::result::Result<tonic::Response<super::SoundDefaultResponse>, tonic::Status> 6541 + { 6542 + self.inner.ready().await.map_err(|e| { 6543 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6544 + })?; 6545 + let codec = tonic::codec::ProstCodec::default(); 6546 + let path = 6547 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundDefault"); 6548 + let mut req = request.into_request(); 6549 + req.extensions_mut().insert(GrpcMethod::new( 6550 + "rockbox.v1alpha1.SoundService", 6551 + "SoundDefault", 6552 + )); 6553 + self.inner.unary(req, path, codec).await 6554 + } 6555 + pub async fn sound_min( 6556 + &mut self, 6557 + request: impl tonic::IntoRequest<super::SoundMinRequest>, 6558 + ) -> std::result::Result<tonic::Response<super::SoundMinResponse>, tonic::Status> { 6559 + self.inner.ready().await.map_err(|e| { 6560 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6561 + })?; 6562 + let codec = tonic::codec::ProstCodec::default(); 6563 + let path = 6564 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundMin"); 6565 + let mut req = request.into_request(); 6566 + req.extensions_mut() 6567 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMin")); 6568 + self.inner.unary(req, path, codec).await 6569 + } 6570 + pub async fn sound_max( 6571 + &mut self, 6572 + request: impl tonic::IntoRequest<super::SoundMaxRequest>, 6573 + ) -> std::result::Result<tonic::Response<super::SoundMaxResponse>, tonic::Status> { 6574 + self.inner.ready().await.map_err(|e| { 6575 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6576 + })?; 6577 + let codec = tonic::codec::ProstCodec::default(); 6578 + let path = 6579 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundMax"); 6580 + let mut req = request.into_request(); 6581 + req.extensions_mut() 6582 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMax")); 6583 + self.inner.unary(req, path, codec).await 6584 + } 6585 + pub async fn sound_unit( 6586 + &mut self, 6587 + request: impl tonic::IntoRequest<super::SoundUnitRequest>, 6588 + ) -> std::result::Result<tonic::Response<super::SoundUnitResponse>, tonic::Status> { 6589 + self.inner.ready().await.map_err(|e| { 6590 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6591 + })?; 6592 + let codec = tonic::codec::ProstCodec::default(); 6593 + let path = 6594 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundUnit"); 6595 + let mut req = request.into_request(); 6596 + req.extensions_mut().insert(GrpcMethod::new( 6597 + "rockbox.v1alpha1.SoundService", 6598 + "SoundUnit", 6599 + )); 6600 + self.inner.unary(req, path, codec).await 6601 + } 6602 + pub async fn sound_val2_phys( 6603 + &mut self, 6604 + request: impl tonic::IntoRequest<super::SoundVal2PhysRequest>, 6605 + ) -> std::result::Result<tonic::Response<super::SoundVal2PhysResponse>, tonic::Status> 6606 + { 6607 + self.inner.ready().await.map_err(|e| { 6608 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6609 + })?; 6610 + let codec = tonic::codec::ProstCodec::default(); 6611 + let path = http::uri::PathAndQuery::from_static( 6612 + "/rockbox.v1alpha1.SoundService/SoundVal2Phys", 6613 + ); 6614 + let mut req = request.into_request(); 6615 + req.extensions_mut().insert(GrpcMethod::new( 6616 + "rockbox.v1alpha1.SoundService", 6617 + "SoundVal2Phys", 6618 + )); 6619 + self.inner.unary(req, path, codec).await 6620 + } 6621 + pub async fn get_pitch( 6622 + &mut self, 6623 + request: impl tonic::IntoRequest<super::GetPitchRequest>, 6624 + ) -> std::result::Result<tonic::Response<super::GetPitchResponse>, tonic::Status> { 6625 + self.inner.ready().await.map_err(|e| { 6626 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6627 + })?; 6628 + let codec = tonic::codec::ProstCodec::default(); 6629 + let path = 6630 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/GetPitch"); 6631 + let mut req = request.into_request(); 6632 + req.extensions_mut() 6633 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "GetPitch")); 6634 + self.inner.unary(req, path, codec).await 6635 + } 6636 + pub async fn set_pitch( 6637 + &mut self, 6638 + request: impl tonic::IntoRequest<super::SetPitchRequest>, 6639 + ) -> std::result::Result<tonic::Response<super::SetPitchResponse>, tonic::Status> { 6640 + self.inner.ready().await.map_err(|e| { 6641 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6642 + })?; 6643 + let codec = tonic::codec::ProstCodec::default(); 6644 + let path = 6645 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SetPitch"); 6646 + let mut req = request.into_request(); 6647 + req.extensions_mut() 6648 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SetPitch")); 6649 + self.inner.unary(req, path, codec).await 6650 + } 6651 + pub async fn beep_play( 6652 + &mut self, 6653 + request: impl tonic::IntoRequest<super::BeepPlayRequest>, 6654 + ) -> std::result::Result<tonic::Response<super::BeepPlayResponse>, tonic::Status> { 6655 + self.inner.ready().await.map_err(|e| { 6656 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6657 + })?; 6658 + let codec = tonic::codec::ProstCodec::default(); 6659 + let path = 6660 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/BeepPlay"); 6661 + let mut req = request.into_request(); 6662 + req.extensions_mut() 6663 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "BeepPlay")); 6664 + self.inner.unary(req, path, codec).await 6665 + } 6666 + pub async fn pcmbuf_fade( 6667 + &mut self, 6668 + request: impl tonic::IntoRequest<super::PcmbufFadeRequest>, 6669 + ) -> std::result::Result<tonic::Response<super::PcmbufFadeResponse>, tonic::Status> 6670 + { 6671 + self.inner.ready().await.map_err(|e| { 6672 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6673 + })?; 6674 + let codec = tonic::codec::ProstCodec::default(); 6675 + let path = 6676 + http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/PcmbufFade"); 6677 + let mut req = request.into_request(); 6678 + req.extensions_mut().insert(GrpcMethod::new( 6679 + "rockbox.v1alpha1.SoundService", 6680 + "PcmbufFade", 6681 + )); 6682 + self.inner.unary(req, path, codec).await 6683 + } 6684 + pub async fn pcmbuf_set_low_latency( 6685 + &mut self, 6686 + request: impl tonic::IntoRequest<super::PcmbufSetLowLatencyRequest>, 6687 + ) -> std::result::Result<tonic::Response<super::PcmbufSetLowLatencyResponse>, tonic::Status> 6688 + { 6689 + self.inner.ready().await.map_err(|e| { 6690 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6691 + })?; 6692 + let codec = tonic::codec::ProstCodec::default(); 6693 + let path = http::uri::PathAndQuery::from_static( 6694 + "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency", 6695 + ); 6696 + let mut req = request.into_request(); 6697 + req.extensions_mut().insert(GrpcMethod::new( 6698 + "rockbox.v1alpha1.SoundService", 6699 + "PcmbufSetLowLatency", 6700 + )); 6701 + self.inner.unary(req, path, codec).await 6702 + } 6703 + pub async fn system_sound_play( 6704 + &mut self, 6705 + request: impl tonic::IntoRequest<super::SystemSoundPlayRequest>, 6706 + ) -> std::result::Result<tonic::Response<super::SystemSoundPlayResponse>, tonic::Status> 6707 + { 6708 + self.inner.ready().await.map_err(|e| { 6709 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6710 + })?; 6711 + let codec = tonic::codec::ProstCodec::default(); 6712 + let path = http::uri::PathAndQuery::from_static( 6713 + "/rockbox.v1alpha1.SoundService/SystemSoundPlay", 6714 + ); 6715 + let mut req = request.into_request(); 6716 + req.extensions_mut().insert(GrpcMethod::new( 6717 + "rockbox.v1alpha1.SoundService", 6718 + "SystemSoundPlay", 6719 + )); 6720 + self.inner.unary(req, path, codec).await 6721 + } 6722 + pub async fn keyclick_click( 6723 + &mut self, 6724 + request: impl tonic::IntoRequest<super::KeyclickClickRequest>, 6725 + ) -> std::result::Result<tonic::Response<super::KeyclickClickResponse>, tonic::Status> 6726 + { 6727 + self.inner.ready().await.map_err(|e| { 6728 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6729 + })?; 6730 + let codec = tonic::codec::ProstCodec::default(); 6731 + let path = http::uri::PathAndQuery::from_static( 6732 + "/rockbox.v1alpha1.SoundService/KeyclickClick", 6733 + ); 6734 + let mut req = request.into_request(); 6735 + req.extensions_mut().insert(GrpcMethod::new( 6736 + "rockbox.v1alpha1.SoundService", 6737 + "KeyclickClick", 6738 + )); 6739 + self.inner.unary(req, path, codec).await 6740 + } 6741 + } 6742 + } 6743 + /// Generated server implementations. 6744 + pub mod sound_service_server { 6745 + #![allow( 6746 + unused_variables, 6747 + dead_code, 6748 + missing_docs, 6749 + clippy::wildcard_imports, 6750 + clippy::let_unit_value 6751 + )] 6752 + use tonic::codegen::*; 6753 + /// Generated trait containing gRPC methods that should be implemented for use with SoundServiceServer. 6754 + #[async_trait] 6755 + pub trait SoundService: std::marker::Send + std::marker::Sync + 'static { 6756 + async fn adjust_volume( 6757 + &self, 6758 + request: tonic::Request<super::AdjustVolumeRequest>, 6759 + ) -> std::result::Result<tonic::Response<super::AdjustVolumeResponse>, tonic::Status>; 6760 + async fn sound_set( 6761 + &self, 6762 + request: tonic::Request<super::SoundSetRequest>, 6763 + ) -> std::result::Result<tonic::Response<super::SoundSetResponse>, tonic::Status>; 6764 + async fn sound_current( 6765 + &self, 6766 + request: tonic::Request<super::SoundCurrentRequest>, 6767 + ) -> std::result::Result<tonic::Response<super::SoundCurrentResponse>, tonic::Status>; 6768 + async fn sound_default( 6769 + &self, 6770 + request: tonic::Request<super::SoundDefaultRequest>, 6771 + ) -> std::result::Result<tonic::Response<super::SoundDefaultResponse>, tonic::Status>; 6772 + async fn sound_min( 6773 + &self, 6774 + request: tonic::Request<super::SoundMinRequest>, 6775 + ) -> std::result::Result<tonic::Response<super::SoundMinResponse>, tonic::Status>; 6776 + async fn sound_max( 6777 + &self, 6778 + request: tonic::Request<super::SoundMaxRequest>, 6779 + ) -> std::result::Result<tonic::Response<super::SoundMaxResponse>, tonic::Status>; 6780 + async fn sound_unit( 6781 + &self, 6782 + request: tonic::Request<super::SoundUnitRequest>, 6783 + ) -> std::result::Result<tonic::Response<super::SoundUnitResponse>, tonic::Status>; 6784 + async fn sound_val2_phys( 6785 + &self, 6786 + request: tonic::Request<super::SoundVal2PhysRequest>, 6787 + ) -> std::result::Result<tonic::Response<super::SoundVal2PhysResponse>, tonic::Status>; 6788 + async fn get_pitch( 6789 + &self, 6790 + request: tonic::Request<super::GetPitchRequest>, 6791 + ) -> std::result::Result<tonic::Response<super::GetPitchResponse>, tonic::Status>; 6792 + async fn set_pitch( 6793 + &self, 6794 + request: tonic::Request<super::SetPitchRequest>, 6795 + ) -> std::result::Result<tonic::Response<super::SetPitchResponse>, tonic::Status>; 6796 + async fn beep_play( 6797 + &self, 6798 + request: tonic::Request<super::BeepPlayRequest>, 6799 + ) -> std::result::Result<tonic::Response<super::BeepPlayResponse>, tonic::Status>; 6800 + async fn pcmbuf_fade( 6801 + &self, 6802 + request: tonic::Request<super::PcmbufFadeRequest>, 6803 + ) -> std::result::Result<tonic::Response<super::PcmbufFadeResponse>, tonic::Status>; 6804 + async fn pcmbuf_set_low_latency( 6805 + &self, 6806 + request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 6807 + ) -> std::result::Result<tonic::Response<super::PcmbufSetLowLatencyResponse>, tonic::Status>; 6808 + async fn system_sound_play( 6809 + &self, 6810 + request: tonic::Request<super::SystemSoundPlayRequest>, 6811 + ) -> std::result::Result<tonic::Response<super::SystemSoundPlayResponse>, tonic::Status>; 6812 + async fn keyclick_click( 6813 + &self, 6814 + request: tonic::Request<super::KeyclickClickRequest>, 6815 + ) -> std::result::Result<tonic::Response<super::KeyclickClickResponse>, tonic::Status>; 6816 + } 6817 + #[derive(Debug)] 6818 + pub struct SoundServiceServer<T> { 6819 + inner: Arc<T>, 6820 + accept_compression_encodings: EnabledCompressionEncodings, 6821 + send_compression_encodings: EnabledCompressionEncodings, 6822 + max_decoding_message_size: Option<usize>, 6823 + max_encoding_message_size: Option<usize>, 6824 + } 6825 + impl<T> SoundServiceServer<T> { 6826 + pub fn new(inner: T) -> Self { 6827 + Self::from_arc(Arc::new(inner)) 6828 + } 6829 + pub fn from_arc(inner: Arc<T>) -> Self { 6830 + Self { 6831 + inner, 6832 + accept_compression_encodings: Default::default(), 6833 + send_compression_encodings: Default::default(), 6834 + max_decoding_message_size: None, 6835 + max_encoding_message_size: None, 6836 + } 6837 + } 6838 + pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 6839 + where 6840 + F: tonic::service::Interceptor, 6841 + { 6842 + InterceptedService::new(Self::new(inner), interceptor) 6843 + } 6844 + /// Enable decompressing requests with the given encoding. 6845 + #[must_use] 6846 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 6847 + self.accept_compression_encodings.enable(encoding); 6848 + self 6849 + } 6850 + /// Compress responses with the given encoding, if the client supports it. 6851 + #[must_use] 6852 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 6853 + self.send_compression_encodings.enable(encoding); 6854 + self 6855 + } 6856 + /// Limits the maximum size of a decoded message. 6857 + /// 6858 + /// Default: `4MB` 6859 + #[must_use] 6860 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 6861 + self.max_decoding_message_size = Some(limit); 6862 + self 6863 + } 6864 + /// Limits the maximum size of an encoded message. 6865 + /// 6866 + /// Default: `usize::MAX` 6867 + #[must_use] 6868 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 6869 + self.max_encoding_message_size = Some(limit); 6870 + self 6871 + } 6872 + } 6873 + impl<T, B> tonic::codegen::Service<http::Request<B>> for SoundServiceServer<T> 6874 + where 6875 + T: SoundService, 6876 + B: Body + std::marker::Send + 'static, 6877 + B::Error: Into<StdError> + std::marker::Send + 'static, 6878 + { 6879 + type Response = http::Response<tonic::body::BoxBody>; 6880 + type Error = std::convert::Infallible; 6881 + type Future = BoxFuture<Self::Response, Self::Error>; 6882 + fn poll_ready( 6883 + &mut self, 6884 + _cx: &mut Context<'_>, 6885 + ) -> Poll<std::result::Result<(), Self::Error>> { 6886 + Poll::Ready(Ok(())) 6887 + } 6888 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 6889 + match req.uri().path() { 6890 + "/rockbox.v1alpha1.SoundService/AdjustVolume" => { 6891 + #[allow(non_camel_case_types)] 6892 + struct AdjustVolumeSvc<T: SoundService>(pub Arc<T>); 6893 + impl<T: SoundService> tonic::server::UnaryService<super::AdjustVolumeRequest> 6894 + for AdjustVolumeSvc<T> 6895 + { 6896 + type Response = super::AdjustVolumeResponse; 6897 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6898 + fn call( 6899 + &mut self, 6900 + request: tonic::Request<super::AdjustVolumeRequest>, 6901 + ) -> Self::Future { 6902 + let inner = Arc::clone(&self.0); 6903 + let fut = async move { 6904 + <T as SoundService>::adjust_volume(&inner, request).await 6905 + }; 6906 + Box::pin(fut) 6907 + } 6908 + } 6909 + let accept_compression_encodings = self.accept_compression_encodings; 6910 + let send_compression_encodings = self.send_compression_encodings; 6911 + let max_decoding_message_size = self.max_decoding_message_size; 6912 + let max_encoding_message_size = self.max_encoding_message_size; 6913 + let inner = self.inner.clone(); 6914 + let fut = async move { 6915 + let method = AdjustVolumeSvc(inner); 6916 + let codec = tonic::codec::ProstCodec::default(); 6917 + let mut grpc = tonic::server::Grpc::new(codec) 6918 + .apply_compression_config( 6919 + accept_compression_encodings, 6920 + send_compression_encodings, 6921 + ) 6922 + .apply_max_message_size_config( 6923 + max_decoding_message_size, 6924 + max_encoding_message_size, 6925 + ); 6926 + let res = grpc.unary(method, req).await; 6927 + Ok(res) 6928 + }; 6929 + Box::pin(fut) 6930 + } 6931 + "/rockbox.v1alpha1.SoundService/SoundSet" => { 6932 + #[allow(non_camel_case_types)] 6933 + struct SoundSetSvc<T: SoundService>(pub Arc<T>); 6934 + impl<T: SoundService> tonic::server::UnaryService<super::SoundSetRequest> for SoundSetSvc<T> { 6935 + type Response = super::SoundSetResponse; 6936 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6937 + fn call( 6938 + &mut self, 6939 + request: tonic::Request<super::SoundSetRequest>, 6940 + ) -> Self::Future { 6941 + let inner = Arc::clone(&self.0); 6942 + let fut = async move { 6943 + <T as SoundService>::sound_set(&inner, request).await 6944 + }; 6945 + Box::pin(fut) 6946 + } 6947 + } 6948 + let accept_compression_encodings = self.accept_compression_encodings; 6949 + let send_compression_encodings = self.send_compression_encodings; 6950 + let max_decoding_message_size = self.max_decoding_message_size; 6951 + let max_encoding_message_size = self.max_encoding_message_size; 6952 + let inner = self.inner.clone(); 6953 + let fut = async move { 6954 + let method = SoundSetSvc(inner); 6955 + let codec = tonic::codec::ProstCodec::default(); 6956 + let mut grpc = tonic::server::Grpc::new(codec) 6957 + .apply_compression_config( 6958 + accept_compression_encodings, 6959 + send_compression_encodings, 6960 + ) 6961 + .apply_max_message_size_config( 6962 + max_decoding_message_size, 6963 + max_encoding_message_size, 6964 + ); 6965 + let res = grpc.unary(method, req).await; 6966 + Ok(res) 6967 + }; 6968 + Box::pin(fut) 6969 + } 6970 + "/rockbox.v1alpha1.SoundService/SoundCurrent" => { 6971 + #[allow(non_camel_case_types)] 6972 + struct SoundCurrentSvc<T: SoundService>(pub Arc<T>); 6973 + impl<T: SoundService> tonic::server::UnaryService<super::SoundCurrentRequest> 6974 + for SoundCurrentSvc<T> 6975 + { 6976 + type Response = super::SoundCurrentResponse; 6977 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6978 + fn call( 6979 + &mut self, 6980 + request: tonic::Request<super::SoundCurrentRequest>, 6981 + ) -> Self::Future { 6982 + let inner = Arc::clone(&self.0); 6983 + let fut = async move { 6984 + <T as SoundService>::sound_current(&inner, request).await 6985 + }; 6986 + Box::pin(fut) 6987 + } 6988 + } 6989 + let accept_compression_encodings = self.accept_compression_encodings; 6990 + let send_compression_encodings = self.send_compression_encodings; 6991 + let max_decoding_message_size = self.max_decoding_message_size; 6992 + let max_encoding_message_size = self.max_encoding_message_size; 6993 + let inner = self.inner.clone(); 6994 + let fut = async move { 6995 + let method = SoundCurrentSvc(inner); 6996 + let codec = tonic::codec::ProstCodec::default(); 6997 + let mut grpc = tonic::server::Grpc::new(codec) 6998 + .apply_compression_config( 6999 + accept_compression_encodings, 7000 + send_compression_encodings, 7001 + ) 7002 + .apply_max_message_size_config( 7003 + max_decoding_message_size, 7004 + max_encoding_message_size, 7005 + ); 7006 + let res = grpc.unary(method, req).await; 7007 + Ok(res) 7008 + }; 7009 + Box::pin(fut) 7010 + } 7011 + "/rockbox.v1alpha1.SoundService/SoundDefault" => { 7012 + #[allow(non_camel_case_types)] 7013 + struct SoundDefaultSvc<T: SoundService>(pub Arc<T>); 7014 + impl<T: SoundService> tonic::server::UnaryService<super::SoundDefaultRequest> 7015 + for SoundDefaultSvc<T> 7016 + { 7017 + type Response = super::SoundDefaultResponse; 7018 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7019 + fn call( 7020 + &mut self, 7021 + request: tonic::Request<super::SoundDefaultRequest>, 7022 + ) -> Self::Future { 7023 + let inner = Arc::clone(&self.0); 7024 + let fut = async move { 7025 + <T as SoundService>::sound_default(&inner, request).await 7026 + }; 7027 + Box::pin(fut) 7028 + } 7029 + } 7030 + let accept_compression_encodings = self.accept_compression_encodings; 7031 + let send_compression_encodings = self.send_compression_encodings; 7032 + let max_decoding_message_size = self.max_decoding_message_size; 7033 + let max_encoding_message_size = self.max_encoding_message_size; 7034 + let inner = self.inner.clone(); 7035 + let fut = async move { 7036 + let method = SoundDefaultSvc(inner); 7037 + let codec = tonic::codec::ProstCodec::default(); 7038 + let mut grpc = tonic::server::Grpc::new(codec) 7039 + .apply_compression_config( 7040 + accept_compression_encodings, 7041 + send_compression_encodings, 7042 + ) 7043 + .apply_max_message_size_config( 7044 + max_decoding_message_size, 7045 + max_encoding_message_size, 7046 + ); 7047 + let res = grpc.unary(method, req).await; 7048 + Ok(res) 7049 + }; 7050 + Box::pin(fut) 7051 + } 7052 + "/rockbox.v1alpha1.SoundService/SoundMin" => { 7053 + #[allow(non_camel_case_types)] 7054 + struct SoundMinSvc<T: SoundService>(pub Arc<T>); 7055 + impl<T: SoundService> tonic::server::UnaryService<super::SoundMinRequest> for SoundMinSvc<T> { 7056 + type Response = super::SoundMinResponse; 7057 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7058 + fn call( 7059 + &mut self, 7060 + request: tonic::Request<super::SoundMinRequest>, 7061 + ) -> Self::Future { 7062 + let inner = Arc::clone(&self.0); 7063 + let fut = async move { 7064 + <T as SoundService>::sound_min(&inner, request).await 7065 + }; 7066 + Box::pin(fut) 7067 + } 7068 + } 7069 + let accept_compression_encodings = self.accept_compression_encodings; 7070 + let send_compression_encodings = self.send_compression_encodings; 7071 + let max_decoding_message_size = self.max_decoding_message_size; 7072 + let max_encoding_message_size = self.max_encoding_message_size; 7073 + let inner = self.inner.clone(); 7074 + let fut = async move { 7075 + let method = SoundMinSvc(inner); 7076 + let codec = tonic::codec::ProstCodec::default(); 7077 + let mut grpc = tonic::server::Grpc::new(codec) 7078 + .apply_compression_config( 7079 + accept_compression_encodings, 7080 + send_compression_encodings, 7081 + ) 7082 + .apply_max_message_size_config( 7083 + max_decoding_message_size, 7084 + max_encoding_message_size, 7085 + ); 7086 + let res = grpc.unary(method, req).await; 7087 + Ok(res) 7088 + }; 7089 + Box::pin(fut) 7090 + } 7091 + "/rockbox.v1alpha1.SoundService/SoundMax" => { 7092 + #[allow(non_camel_case_types)] 7093 + struct SoundMaxSvc<T: SoundService>(pub Arc<T>); 7094 + impl<T: SoundService> tonic::server::UnaryService<super::SoundMaxRequest> for SoundMaxSvc<T> { 7095 + type Response = super::SoundMaxResponse; 7096 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7097 + fn call( 7098 + &mut self, 7099 + request: tonic::Request<super::SoundMaxRequest>, 7100 + ) -> Self::Future { 7101 + let inner = Arc::clone(&self.0); 7102 + let fut = async move { 7103 + <T as SoundService>::sound_max(&inner, request).await 7104 + }; 7105 + Box::pin(fut) 7106 + } 7107 + } 7108 + let accept_compression_encodings = self.accept_compression_encodings; 7109 + let send_compression_encodings = self.send_compression_encodings; 7110 + let max_decoding_message_size = self.max_decoding_message_size; 7111 + let max_encoding_message_size = self.max_encoding_message_size; 7112 + let inner = self.inner.clone(); 7113 + let fut = async move { 7114 + let method = SoundMaxSvc(inner); 7115 + let codec = tonic::codec::ProstCodec::default(); 7116 + let mut grpc = tonic::server::Grpc::new(codec) 7117 + .apply_compression_config( 7118 + accept_compression_encodings, 7119 + send_compression_encodings, 7120 + ) 7121 + .apply_max_message_size_config( 7122 + max_decoding_message_size, 7123 + max_encoding_message_size, 7124 + ); 7125 + let res = grpc.unary(method, req).await; 7126 + Ok(res) 7127 + }; 7128 + Box::pin(fut) 7129 + } 7130 + "/rockbox.v1alpha1.SoundService/SoundUnit" => { 7131 + #[allow(non_camel_case_types)] 7132 + struct SoundUnitSvc<T: SoundService>(pub Arc<T>); 7133 + impl<T: SoundService> tonic::server::UnaryService<super::SoundUnitRequest> for SoundUnitSvc<T> { 7134 + type Response = super::SoundUnitResponse; 7135 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7136 + fn call( 7137 + &mut self, 7138 + request: tonic::Request<super::SoundUnitRequest>, 7139 + ) -> Self::Future { 7140 + let inner = Arc::clone(&self.0); 7141 + let fut = async move { 7142 + <T as SoundService>::sound_unit(&inner, request).await 7143 + }; 7144 + Box::pin(fut) 7145 + } 7146 + } 7147 + let accept_compression_encodings = self.accept_compression_encodings; 7148 + let send_compression_encodings = self.send_compression_encodings; 7149 + let max_decoding_message_size = self.max_decoding_message_size; 7150 + let max_encoding_message_size = self.max_encoding_message_size; 7151 + let inner = self.inner.clone(); 7152 + let fut = async move { 7153 + let method = SoundUnitSvc(inner); 7154 + let codec = tonic::codec::ProstCodec::default(); 7155 + let mut grpc = tonic::server::Grpc::new(codec) 7156 + .apply_compression_config( 7157 + accept_compression_encodings, 7158 + send_compression_encodings, 7159 + ) 7160 + .apply_max_message_size_config( 7161 + max_decoding_message_size, 7162 + max_encoding_message_size, 7163 + ); 7164 + let res = grpc.unary(method, req).await; 7165 + Ok(res) 7166 + }; 7167 + Box::pin(fut) 7168 + } 7169 + "/rockbox.v1alpha1.SoundService/SoundVal2Phys" => { 7170 + #[allow(non_camel_case_types)] 7171 + struct SoundVal2PhysSvc<T: SoundService>(pub Arc<T>); 7172 + impl<T: SoundService> tonic::server::UnaryService<super::SoundVal2PhysRequest> 7173 + for SoundVal2PhysSvc<T> 7174 + { 7175 + type Response = super::SoundVal2PhysResponse; 7176 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7177 + fn call( 7178 + &mut self, 7179 + request: tonic::Request<super::SoundVal2PhysRequest>, 7180 + ) -> Self::Future { 7181 + let inner = Arc::clone(&self.0); 7182 + let fut = async move { 7183 + <T as SoundService>::sound_val2_phys(&inner, request).await 7184 + }; 7185 + Box::pin(fut) 7186 + } 7187 + } 7188 + let accept_compression_encodings = self.accept_compression_encodings; 7189 + let send_compression_encodings = self.send_compression_encodings; 7190 + let max_decoding_message_size = self.max_decoding_message_size; 7191 + let max_encoding_message_size = self.max_encoding_message_size; 7192 + let inner = self.inner.clone(); 7193 + let fut = async move { 7194 + let method = SoundVal2PhysSvc(inner); 7195 + let codec = tonic::codec::ProstCodec::default(); 7196 + let mut grpc = tonic::server::Grpc::new(codec) 7197 + .apply_compression_config( 7198 + accept_compression_encodings, 7199 + send_compression_encodings, 7200 + ) 7201 + .apply_max_message_size_config( 7202 + max_decoding_message_size, 7203 + max_encoding_message_size, 7204 + ); 7205 + let res = grpc.unary(method, req).await; 7206 + Ok(res) 7207 + }; 7208 + Box::pin(fut) 7209 + } 7210 + "/rockbox.v1alpha1.SoundService/GetPitch" => { 7211 + #[allow(non_camel_case_types)] 7212 + struct GetPitchSvc<T: SoundService>(pub Arc<T>); 7213 + impl<T: SoundService> tonic::server::UnaryService<super::GetPitchRequest> for GetPitchSvc<T> { 7214 + type Response = super::GetPitchResponse; 7215 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7216 + fn call( 7217 + &mut self, 7218 + request: tonic::Request<super::GetPitchRequest>, 7219 + ) -> Self::Future { 7220 + let inner = Arc::clone(&self.0); 7221 + let fut = async move { 7222 + <T as SoundService>::get_pitch(&inner, request).await 7223 + }; 7224 + Box::pin(fut) 7225 + } 7226 + } 7227 + let accept_compression_encodings = self.accept_compression_encodings; 7228 + let send_compression_encodings = self.send_compression_encodings; 7229 + let max_decoding_message_size = self.max_decoding_message_size; 7230 + let max_encoding_message_size = self.max_encoding_message_size; 7231 + let inner = self.inner.clone(); 7232 + let fut = async move { 7233 + let method = GetPitchSvc(inner); 7234 + let codec = tonic::codec::ProstCodec::default(); 7235 + let mut grpc = tonic::server::Grpc::new(codec) 7236 + .apply_compression_config( 7237 + accept_compression_encodings, 7238 + send_compression_encodings, 7239 + ) 7240 + .apply_max_message_size_config( 7241 + max_decoding_message_size, 7242 + max_encoding_message_size, 7243 + ); 7244 + let res = grpc.unary(method, req).await; 7245 + Ok(res) 7246 + }; 7247 + Box::pin(fut) 7248 + } 7249 + "/rockbox.v1alpha1.SoundService/SetPitch" => { 7250 + #[allow(non_camel_case_types)] 7251 + struct SetPitchSvc<T: SoundService>(pub Arc<T>); 7252 + impl<T: SoundService> tonic::server::UnaryService<super::SetPitchRequest> for SetPitchSvc<T> { 7253 + type Response = super::SetPitchResponse; 7254 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7255 + fn call( 7256 + &mut self, 7257 + request: tonic::Request<super::SetPitchRequest>, 7258 + ) -> Self::Future { 7259 + let inner = Arc::clone(&self.0); 7260 + let fut = async move { 7261 + <T as SoundService>::set_pitch(&inner, request).await 7262 + }; 7263 + Box::pin(fut) 7264 + } 7265 + } 7266 + let accept_compression_encodings = self.accept_compression_encodings; 7267 + let send_compression_encodings = self.send_compression_encodings; 7268 + let max_decoding_message_size = self.max_decoding_message_size; 7269 + let max_encoding_message_size = self.max_encoding_message_size; 7270 + let inner = self.inner.clone(); 7271 + let fut = async move { 7272 + let method = SetPitchSvc(inner); 7273 + let codec = tonic::codec::ProstCodec::default(); 7274 + let mut grpc = tonic::server::Grpc::new(codec) 7275 + .apply_compression_config( 7276 + accept_compression_encodings, 7277 + send_compression_encodings, 7278 + ) 7279 + .apply_max_message_size_config( 7280 + max_decoding_message_size, 7281 + max_encoding_message_size, 7282 + ); 7283 + let res = grpc.unary(method, req).await; 7284 + Ok(res) 7285 + }; 7286 + Box::pin(fut) 7287 + } 7288 + "/rockbox.v1alpha1.SoundService/BeepPlay" => { 7289 + #[allow(non_camel_case_types)] 7290 + struct BeepPlaySvc<T: SoundService>(pub Arc<T>); 7291 + impl<T: SoundService> tonic::server::UnaryService<super::BeepPlayRequest> for BeepPlaySvc<T> { 7292 + type Response = super::BeepPlayResponse; 7293 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7294 + fn call( 7295 + &mut self, 7296 + request: tonic::Request<super::BeepPlayRequest>, 7297 + ) -> Self::Future { 7298 + let inner = Arc::clone(&self.0); 7299 + let fut = async move { 7300 + <T as SoundService>::beep_play(&inner, request).await 7301 + }; 7302 + Box::pin(fut) 7303 + } 7304 + } 7305 + let accept_compression_encodings = self.accept_compression_encodings; 7306 + let send_compression_encodings = self.send_compression_encodings; 7307 + let max_decoding_message_size = self.max_decoding_message_size; 7308 + let max_encoding_message_size = self.max_encoding_message_size; 7309 + let inner = self.inner.clone(); 7310 + let fut = async move { 7311 + let method = BeepPlaySvc(inner); 7312 + let codec = tonic::codec::ProstCodec::default(); 7313 + let mut grpc = tonic::server::Grpc::new(codec) 7314 + .apply_compression_config( 7315 + accept_compression_encodings, 7316 + send_compression_encodings, 7317 + ) 7318 + .apply_max_message_size_config( 7319 + max_decoding_message_size, 7320 + max_encoding_message_size, 7321 + ); 7322 + let res = grpc.unary(method, req).await; 7323 + Ok(res) 7324 + }; 7325 + Box::pin(fut) 7326 + } 7327 + "/rockbox.v1alpha1.SoundService/PcmbufFade" => { 7328 + #[allow(non_camel_case_types)] 7329 + struct PcmbufFadeSvc<T: SoundService>(pub Arc<T>); 7330 + impl<T: SoundService> tonic::server::UnaryService<super::PcmbufFadeRequest> for PcmbufFadeSvc<T> { 7331 + type Response = super::PcmbufFadeResponse; 7332 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7333 + fn call( 7334 + &mut self, 7335 + request: tonic::Request<super::PcmbufFadeRequest>, 7336 + ) -> Self::Future { 7337 + let inner = Arc::clone(&self.0); 7338 + let fut = async move { 7339 + <T as SoundService>::pcmbuf_fade(&inner, request).await 7340 + }; 7341 + Box::pin(fut) 7342 + } 7343 + } 7344 + let accept_compression_encodings = self.accept_compression_encodings; 7345 + let send_compression_encodings = self.send_compression_encodings; 7346 + let max_decoding_message_size = self.max_decoding_message_size; 7347 + let max_encoding_message_size = self.max_encoding_message_size; 7348 + let inner = self.inner.clone(); 7349 + let fut = async move { 7350 + let method = PcmbufFadeSvc(inner); 7351 + let codec = tonic::codec::ProstCodec::default(); 7352 + let mut grpc = tonic::server::Grpc::new(codec) 7353 + .apply_compression_config( 7354 + accept_compression_encodings, 7355 + send_compression_encodings, 7356 + ) 7357 + .apply_max_message_size_config( 7358 + max_decoding_message_size, 7359 + max_encoding_message_size, 7360 + ); 7361 + let res = grpc.unary(method, req).await; 7362 + Ok(res) 7363 + }; 7364 + Box::pin(fut) 7365 + } 7366 + "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency" => { 7367 + #[allow(non_camel_case_types)] 7368 + struct PcmbufSetLowLatencySvc<T: SoundService>(pub Arc<T>); 7369 + impl<T: SoundService> 7370 + tonic::server::UnaryService<super::PcmbufSetLowLatencyRequest> 7371 + for PcmbufSetLowLatencySvc<T> 7372 + { 7373 + type Response = super::PcmbufSetLowLatencyResponse; 7374 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7375 + fn call( 7376 + &mut self, 7377 + request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 7378 + ) -> Self::Future { 7379 + let inner = Arc::clone(&self.0); 7380 + let fut = async move { 7381 + <T as SoundService>::pcmbuf_set_low_latency(&inner, request).await 7382 + }; 7383 + Box::pin(fut) 7384 + } 7385 + } 7386 + let accept_compression_encodings = self.accept_compression_encodings; 7387 + let send_compression_encodings = self.send_compression_encodings; 7388 + let max_decoding_message_size = self.max_decoding_message_size; 7389 + let max_encoding_message_size = self.max_encoding_message_size; 7390 + let inner = self.inner.clone(); 7391 + let fut = async move { 7392 + let method = PcmbufSetLowLatencySvc(inner); 7393 + let codec = tonic::codec::ProstCodec::default(); 7394 + let mut grpc = tonic::server::Grpc::new(codec) 7395 + .apply_compression_config( 7396 + accept_compression_encodings, 7397 + send_compression_encodings, 7398 + ) 7399 + .apply_max_message_size_config( 7400 + max_decoding_message_size, 7401 + max_encoding_message_size, 7402 + ); 7403 + let res = grpc.unary(method, req).await; 7404 + Ok(res) 7405 + }; 7406 + Box::pin(fut) 7407 + } 7408 + "/rockbox.v1alpha1.SoundService/SystemSoundPlay" => { 7409 + #[allow(non_camel_case_types)] 7410 + struct SystemSoundPlaySvc<T: SoundService>(pub Arc<T>); 7411 + impl<T: SoundService> tonic::server::UnaryService<super::SystemSoundPlayRequest> 7412 + for SystemSoundPlaySvc<T> 7413 + { 7414 + type Response = super::SystemSoundPlayResponse; 7415 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7416 + fn call( 7417 + &mut self, 7418 + request: tonic::Request<super::SystemSoundPlayRequest>, 7419 + ) -> Self::Future { 7420 + let inner = Arc::clone(&self.0); 7421 + let fut = async move { 7422 + <T as SoundService>::system_sound_play(&inner, request).await 7423 + }; 7424 + Box::pin(fut) 7425 + } 7426 + } 7427 + let accept_compression_encodings = self.accept_compression_encodings; 7428 + let send_compression_encodings = self.send_compression_encodings; 7429 + let max_decoding_message_size = self.max_decoding_message_size; 7430 + let max_encoding_message_size = self.max_encoding_message_size; 7431 + let inner = self.inner.clone(); 7432 + let fut = async move { 7433 + let method = SystemSoundPlaySvc(inner); 7434 + let codec = tonic::codec::ProstCodec::default(); 7435 + let mut grpc = tonic::server::Grpc::new(codec) 7436 + .apply_compression_config( 7437 + accept_compression_encodings, 7438 + send_compression_encodings, 7439 + ) 7440 + .apply_max_message_size_config( 7441 + max_decoding_message_size, 7442 + max_encoding_message_size, 7443 + ); 7444 + let res = grpc.unary(method, req).await; 7445 + Ok(res) 7446 + }; 7447 + Box::pin(fut) 7448 + } 7449 + "/rockbox.v1alpha1.SoundService/KeyclickClick" => { 7450 + #[allow(non_camel_case_types)] 7451 + struct KeyclickClickSvc<T: SoundService>(pub Arc<T>); 7452 + impl<T: SoundService> tonic::server::UnaryService<super::KeyclickClickRequest> 7453 + for KeyclickClickSvc<T> 7454 + { 7455 + type Response = super::KeyclickClickResponse; 7456 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7457 + fn call( 7458 + &mut self, 7459 + request: tonic::Request<super::KeyclickClickRequest>, 7460 + ) -> Self::Future { 7461 + let inner = Arc::clone(&self.0); 7462 + let fut = async move { 7463 + <T as SoundService>::keyclick_click(&inner, request).await 7464 + }; 7465 + Box::pin(fut) 7466 + } 7467 + } 7468 + let accept_compression_encodings = self.accept_compression_encodings; 7469 + let send_compression_encodings = self.send_compression_encodings; 7470 + let max_decoding_message_size = self.max_decoding_message_size; 7471 + let max_encoding_message_size = self.max_encoding_message_size; 7472 + let inner = self.inner.clone(); 7473 + let fut = async move { 7474 + let method = KeyclickClickSvc(inner); 7475 + let codec = tonic::codec::ProstCodec::default(); 7476 + let mut grpc = tonic::server::Grpc::new(codec) 7477 + .apply_compression_config( 7478 + accept_compression_encodings, 7479 + send_compression_encodings, 7480 + ) 7481 + .apply_max_message_size_config( 7482 + max_decoding_message_size, 7483 + max_encoding_message_size, 7484 + ); 7485 + let res = grpc.unary(method, req).await; 7486 + Ok(res) 7487 + }; 7488 + Box::pin(fut) 7489 + } 7490 + _ => Box::pin(async move { 7491 + let mut response = http::Response::new(empty_body()); 7492 + let headers = response.headers_mut(); 7493 + headers.insert( 7494 + tonic::Status::GRPC_STATUS, 7495 + (tonic::Code::Unimplemented as i32).into(), 7496 + ); 7497 + headers.insert( 7498 + http::header::CONTENT_TYPE, 7499 + tonic::metadata::GRPC_CONTENT_TYPE, 7500 + ); 7501 + Ok(response) 7502 + }), 7503 + } 7504 + } 7505 + } 7506 + impl<T> Clone for SoundServiceServer<T> { 7507 + fn clone(&self) -> Self { 7508 + let inner = self.inner.clone(); 7509 + Self { 7510 + inner, 7511 + accept_compression_encodings: self.accept_compression_encodings, 7512 + send_compression_encodings: self.send_compression_encodings, 7513 + max_decoding_message_size: self.max_decoding_message_size, 7514 + max_encoding_message_size: self.max_encoding_message_size, 7515 + } 7516 + } 7517 + } 7518 + /// Generated gRPC service name 7519 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.SoundService"; 7520 + impl<T> tonic::server::NamedService for SoundServiceServer<T> { 7521 + const NAME: &'static str = SERVICE_NAME; 7522 + } 7523 + } 7524 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7525 + pub struct GetRockboxVersionRequest {} 7526 + #[derive(Clone, PartialEq, ::prost::Message)] 7527 + pub struct GetRockboxVersionResponse { 7528 + #[prost(string, tag = "1")] 7529 + pub version: ::prost::alloc::string::String, 7530 + } 7531 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7532 + pub struct GetGlobalStatusRequest {} 7533 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7534 + pub struct GetGlobalStatusResponse { 7535 + #[prost(int32, tag = "1")] 7536 + pub resume_index: i32, 7537 + #[prost(uint32, tag = "2")] 7538 + pub resume_crc32: u32, 7539 + #[prost(uint32, tag = "3")] 7540 + pub resume_elapsed: u32, 7541 + #[prost(uint32, tag = "4")] 7542 + pub resume_offset: u32, 7543 + #[prost(int32, tag = "5")] 7544 + pub runtime: i32, 7545 + #[prost(int32, tag = "6")] 7546 + pub topruntime: i32, 7547 + #[prost(int32, tag = "7")] 7548 + pub dircache_size: i32, 7549 + #[prost(int32, tag = "8")] 7550 + pub last_screen: i32, 7551 + #[prost(int32, tag = "9")] 7552 + pub viewer_icon_count: i32, 7553 + #[prost(int32, tag = "10")] 7554 + pub last_volume_change: i32, 7555 + } 7556 + /// Generated client implementations. 7557 + pub mod system_service_client { 7558 + #![allow( 7559 + unused_variables, 7560 + dead_code, 7561 + missing_docs, 7562 + clippy::wildcard_imports, 7563 + clippy::let_unit_value 7564 + )] 7565 + use tonic::codegen::http::Uri; 7566 + use tonic::codegen::*; 7567 + #[derive(Debug, Clone)] 7568 + pub struct SystemServiceClient<T> { 7569 + inner: tonic::client::Grpc<T>, 7570 + } 7571 + impl SystemServiceClient<tonic::transport::Channel> { 7572 + /// Attempt to create a new client by connecting to a given endpoint. 7573 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 7574 + where 7575 + D: TryInto<tonic::transport::Endpoint>, 7576 + D::Error: Into<StdError>, 7577 + { 7578 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 7579 + Ok(Self::new(conn)) 7580 + } 7581 + } 7582 + impl<T> SystemServiceClient<T> 7583 + where 7584 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 7585 + T::Error: Into<StdError>, 7586 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 7587 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 7588 + { 7589 + pub fn new(inner: T) -> Self { 7590 + let inner = tonic::client::Grpc::new(inner); 7591 + Self { inner } 7592 + } 7593 + pub fn with_origin(inner: T, origin: Uri) -> Self { 7594 + let inner = tonic::client::Grpc::with_origin(inner, origin); 7595 + Self { inner } 7596 + } 7597 + pub fn with_interceptor<F>( 7598 + inner: T, 7599 + interceptor: F, 7600 + ) -> SystemServiceClient<InterceptedService<T, F>> 7601 + where 7602 + F: tonic::service::Interceptor, 7603 + T::ResponseBody: Default, 7604 + T: tonic::codegen::Service< 7605 + http::Request<tonic::body::BoxBody>, 7606 + Response = http::Response< 7607 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 7608 + >, 7609 + >, 7610 + <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 7611 + Into<StdError> + std::marker::Send + std::marker::Sync, 7612 + { 7613 + SystemServiceClient::new(InterceptedService::new(inner, interceptor)) 7614 + } 7615 + /// Compress requests with the given encoding. 7616 + /// 7617 + /// This requires the server to support it otherwise it might respond with an 7618 + /// error. 7619 + #[must_use] 7620 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 7621 + self.inner = self.inner.send_compressed(encoding); 7622 + self 7623 + } 7624 + /// Enable decompressing responses. 7625 + #[must_use] 7626 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 7627 + self.inner = self.inner.accept_compressed(encoding); 7628 + self 7629 + } 7630 + /// Limits the maximum size of a decoded message. 7631 + /// 7632 + /// Default: `4MB` 7633 + #[must_use] 7634 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 7635 + self.inner = self.inner.max_decoding_message_size(limit); 7636 + self 7637 + } 7638 + /// Limits the maximum size of an encoded message. 7639 + /// 7640 + /// Default: `usize::MAX` 7641 + #[must_use] 7642 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 7643 + self.inner = self.inner.max_encoding_message_size(limit); 7644 + self 7645 + } 7646 + pub async fn get_rockbox_version( 7647 + &mut self, 7648 + request: impl tonic::IntoRequest<super::GetRockboxVersionRequest>, 7649 + ) -> std::result::Result<tonic::Response<super::GetRockboxVersionResponse>, tonic::Status> 7650 + { 7651 + self.inner.ready().await.map_err(|e| { 7652 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 7653 + })?; 7654 + let codec = tonic::codec::ProstCodec::default(); 7655 + let path = http::uri::PathAndQuery::from_static( 7656 + "/rockbox.v1alpha1.SystemService/GetRockboxVersion", 7657 + ); 7658 + let mut req = request.into_request(); 7659 + req.extensions_mut().insert(GrpcMethod::new( 7660 + "rockbox.v1alpha1.SystemService", 7661 + "GetRockboxVersion", 7662 + )); 7663 + self.inner.unary(req, path, codec).await 7664 + } 7665 + pub async fn get_global_status( 7666 + &mut self, 7667 + request: impl tonic::IntoRequest<super::GetGlobalStatusRequest>, 7668 + ) -> std::result::Result<tonic::Response<super::GetGlobalStatusResponse>, tonic::Status> 7669 + { 7670 + self.inner.ready().await.map_err(|e| { 7671 + tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 7672 + })?; 7673 + let codec = tonic::codec::ProstCodec::default(); 7674 + let path = http::uri::PathAndQuery::from_static( 7675 + "/rockbox.v1alpha1.SystemService/GetGlobalStatus", 7676 + ); 7677 + let mut req = request.into_request(); 7678 + req.extensions_mut().insert(GrpcMethod::new( 7679 + "rockbox.v1alpha1.SystemService", 7680 + "GetGlobalStatus", 7681 + )); 7682 + self.inner.unary(req, path, codec).await 7683 + } 7684 + } 7685 + } 7686 + /// Generated server implementations. 7687 + pub mod system_service_server { 7688 + #![allow( 7689 + unused_variables, 7690 + dead_code, 7691 + missing_docs, 7692 + clippy::wildcard_imports, 7693 + clippy::let_unit_value 7694 + )] 7695 + use tonic::codegen::*; 7696 + /// Generated trait containing gRPC methods that should be implemented for use with SystemServiceServer. 7697 + #[async_trait] 7698 + pub trait SystemService: std::marker::Send + std::marker::Sync + 'static { 7699 + async fn get_rockbox_version( 7700 + &self, 7701 + request: tonic::Request<super::GetRockboxVersionRequest>, 7702 + ) -> std::result::Result<tonic::Response<super::GetRockboxVersionResponse>, tonic::Status>; 7703 + async fn get_global_status( 7704 + &self, 7705 + request: tonic::Request<super::GetGlobalStatusRequest>, 7706 + ) -> std::result::Result<tonic::Response<super::GetGlobalStatusResponse>, tonic::Status>; 7707 + } 7708 + #[derive(Debug)] 7709 + pub struct SystemServiceServer<T> { 7710 + inner: Arc<T>, 7711 + accept_compression_encodings: EnabledCompressionEncodings, 7712 + send_compression_encodings: EnabledCompressionEncodings, 7713 + max_decoding_message_size: Option<usize>, 7714 + max_encoding_message_size: Option<usize>, 7715 + } 7716 + impl<T> SystemServiceServer<T> { 7717 + pub fn new(inner: T) -> Self { 7718 + Self::from_arc(Arc::new(inner)) 7719 + } 7720 + pub fn from_arc(inner: Arc<T>) -> Self { 7721 + Self { 7722 + inner, 7723 + accept_compression_encodings: Default::default(), 7724 + send_compression_encodings: Default::default(), 7725 + max_decoding_message_size: None, 7726 + max_encoding_message_size: None, 7727 + } 7728 + } 7729 + pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 7730 + where 7731 + F: tonic::service::Interceptor, 7732 + { 7733 + InterceptedService::new(Self::new(inner), interceptor) 7734 + } 7735 + /// Enable decompressing requests with the given encoding. 7736 + #[must_use] 7737 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 7738 + self.accept_compression_encodings.enable(encoding); 7739 + self 7740 + } 7741 + /// Compress responses with the given encoding, if the client supports it. 7742 + #[must_use] 7743 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 7744 + self.send_compression_encodings.enable(encoding); 7745 + self 7746 + } 7747 + /// Limits the maximum size of a decoded message. 7748 + /// 7749 + /// Default: `4MB` 7750 + #[must_use] 7751 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 7752 + self.max_decoding_message_size = Some(limit); 7753 + self 7754 + } 7755 + /// Limits the maximum size of an encoded message. 7756 + /// 7757 + /// Default: `usize::MAX` 7758 + #[must_use] 7759 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 7760 + self.max_encoding_message_size = Some(limit); 7761 + self 7762 + } 7763 + } 7764 + impl<T, B> tonic::codegen::Service<http::Request<B>> for SystemServiceServer<T> 7765 + where 7766 + T: SystemService, 7767 + B: Body + std::marker::Send + 'static, 7768 + B::Error: Into<StdError> + std::marker::Send + 'static, 7769 + { 7770 + type Response = http::Response<tonic::body::BoxBody>; 7771 + type Error = std::convert::Infallible; 7772 + type Future = BoxFuture<Self::Response, Self::Error>; 7773 + fn poll_ready( 7774 + &mut self, 7775 + _cx: &mut Context<'_>, 7776 + ) -> Poll<std::result::Result<(), Self::Error>> { 7777 + Poll::Ready(Ok(())) 7778 + } 7779 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 7780 + match req.uri().path() { 7781 + "/rockbox.v1alpha1.SystemService/GetRockboxVersion" => { 7782 + #[allow(non_camel_case_types)] 7783 + struct GetRockboxVersionSvc<T: SystemService>(pub Arc<T>); 7784 + impl<T: SystemService> 7785 + tonic::server::UnaryService<super::GetRockboxVersionRequest> 7786 + for GetRockboxVersionSvc<T> 7787 + { 7788 + type Response = super::GetRockboxVersionResponse; 7789 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7790 + fn call( 7791 + &mut self, 7792 + request: tonic::Request<super::GetRockboxVersionRequest>, 7793 + ) -> Self::Future { 7794 + let inner = Arc::clone(&self.0); 7795 + let fut = async move { 7796 + <T as SystemService>::get_rockbox_version(&inner, request).await 7797 + }; 7798 + Box::pin(fut) 7799 + } 7800 + } 7801 + let accept_compression_encodings = self.accept_compression_encodings; 7802 + let send_compression_encodings = self.send_compression_encodings; 7803 + let max_decoding_message_size = self.max_decoding_message_size; 7804 + let max_encoding_message_size = self.max_encoding_message_size; 7805 + let inner = self.inner.clone(); 7806 + let fut = async move { 7807 + let method = GetRockboxVersionSvc(inner); 7808 + let codec = tonic::codec::ProstCodec::default(); 7809 + let mut grpc = tonic::server::Grpc::new(codec) 7810 + .apply_compression_config( 7811 + accept_compression_encodings, 7812 + send_compression_encodings, 7813 + ) 7814 + .apply_max_message_size_config( 7815 + max_decoding_message_size, 7816 + max_encoding_message_size, 7817 + ); 7818 + let res = grpc.unary(method, req).await; 7819 + Ok(res) 7820 + }; 7821 + Box::pin(fut) 7822 + } 7823 + "/rockbox.v1alpha1.SystemService/GetGlobalStatus" => { 7824 + #[allow(non_camel_case_types)] 7825 + struct GetGlobalStatusSvc<T: SystemService>(pub Arc<T>); 7826 + impl<T: SystemService> 7827 + tonic::server::UnaryService<super::GetGlobalStatusRequest> 7828 + for GetGlobalStatusSvc<T> 7829 + { 7830 + type Response = super::GetGlobalStatusResponse; 7831 + type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7832 + fn call( 7833 + &mut self, 7834 + request: tonic::Request<super::GetGlobalStatusRequest>, 7835 + ) -> Self::Future { 7836 + let inner = Arc::clone(&self.0); 7837 + let fut = async move { 7838 + <T as SystemService>::get_global_status(&inner, request).await 7839 + }; 7840 + Box::pin(fut) 7841 + } 7842 + } 7843 + let accept_compression_encodings = self.accept_compression_encodings; 7844 + let send_compression_encodings = self.send_compression_encodings; 7845 + let max_decoding_message_size = self.max_decoding_message_size; 7846 + let max_encoding_message_size = self.max_encoding_message_size; 7847 + let inner = self.inner.clone(); 7848 + let fut = async move { 7849 + let method = GetGlobalStatusSvc(inner); 7850 + let codec = tonic::codec::ProstCodec::default(); 7851 + let mut grpc = tonic::server::Grpc::new(codec) 7852 + .apply_compression_config( 7853 + accept_compression_encodings, 7854 + send_compression_encodings, 7855 + ) 7856 + .apply_max_message_size_config( 7857 + max_decoding_message_size, 7858 + max_encoding_message_size, 7859 + ); 7860 + let res = grpc.unary(method, req).await; 7861 + Ok(res) 7862 + }; 7863 + Box::pin(fut) 7864 + } 7865 + _ => Box::pin(async move { 7866 + let mut response = http::Response::new(empty_body()); 7867 + let headers = response.headers_mut(); 7868 + headers.insert( 7869 + tonic::Status::GRPC_STATUS, 7870 + (tonic::Code::Unimplemented as i32).into(), 7871 + ); 7872 + headers.insert( 7873 + http::header::CONTENT_TYPE, 7874 + tonic::metadata::GRPC_CONTENT_TYPE, 7875 + ); 7876 + Ok(response) 7877 + }), 7878 + } 7879 + } 7880 + } 7881 + impl<T> Clone for SystemServiceServer<T> { 7882 + fn clone(&self) -> Self { 7883 + let inner = self.inner.clone(); 7884 + Self { 7885 + inner, 7886 + accept_compression_encodings: self.accept_compression_encodings, 7887 + send_compression_encodings: self.send_compression_encodings, 7888 + max_decoding_message_size: self.max_decoding_message_size, 7889 + max_encoding_message_size: self.max_encoding_message_size, 7890 + } 7891 + } 7892 + } 7893 + /// Generated gRPC service name 7894 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.SystemService"; 7895 + impl<T> tonic::server::NamedService for SystemServiceServer<T> { 7896 + const NAME: &'static str = SERVICE_NAME; 7897 + } 7898 + }
crates/controls/src/api/rockbox_descriptor.bin

This is a binary file and will not be displayed.

+448
crates/controls/src/lib.rs
··· 1 + use anyhow::Error; 2 + use souvlaki::{ 3 + MediaControlEvent, MediaControls, MediaMetadata, MediaPlayback, MediaPosition, PlatformConfig, 4 + }; 5 + use std::env; 6 + use std::sync::atomic::{AtomicBool, Ordering}; 7 + use std::sync::{mpsc, Arc}; 8 + use std::time::Duration; 9 + use tonic::transport::Channel; 10 + use winit::application::ApplicationHandler; 11 + use winit::event::WindowEvent; 12 + use winit::event_loop::{ActiveEventLoop, ControlFlow, EventLoop}; 13 + use winit::window::WindowId; 14 + 15 + use crate::api::rockbox::v1alpha1::playback_service_client::PlaybackServiceClient; 16 + use crate::api::rockbox::v1alpha1::playlist_service_client::PlaylistServiceClient; 17 + use crate::api::rockbox::v1alpha1::system_service_client::SystemServiceClient; 18 + use crate::api::rockbox::v1alpha1::{ 19 + GetGlobalStatusRequest, NextRequest, PauseRequest, PlayRequest, PlaylistResumeRequest, 20 + PreviousRequest, ResumeRequest, ResumeTrackRequest, StartRequest, StatusRequest, 21 + StreamCurrentTrackRequest, StreamStatusRequest, 22 + }; 23 + 24 + pub mod api { 25 + #[path = ""] 26 + pub mod rockbox { 27 + 28 + #[path = "rockbox.v1alpha1.rs"] 29 + pub mod v1alpha1; 30 + } 31 + } 32 + 33 + // Commands to send to the media controls from async tasks 34 + #[derive(Debug)] 35 + enum MediaCommand { 36 + SetMetadata { 37 + title: String, 38 + artist: String, 39 + album: String, 40 + duration: Duration, 41 + cover_url: Option<String>, 42 + }, 43 + Play, 44 + Pause, 45 + Next, 46 + Previous, 47 + SetMediaPosition((MediaPosition, bool)), 48 + } 49 + 50 + struct App { 51 + controls: MediaControls, 52 + command_receiver: mpsc::Receiver<MediaCommand>, 53 + _media_event_sender: tokio::sync::mpsc::UnboundedSender<MediaControlEvent>, 54 + } 55 + 56 + impl ApplicationHandler for App { 57 + fn resumed(&mut self, _event_loop: &ActiveEventLoop) { 58 + println!("App resumed, media controls ready!"); 59 + } 60 + 61 + fn window_event(&mut self, _event_loop: &ActiveEventLoop, _id: WindowId, _event: WindowEvent) {} 62 + 63 + fn about_to_wait(&mut self, _event_loop: &ActiveEventLoop) { 64 + // Process all pending commands from async tasks 65 + while let Ok(cmd) = self.command_receiver.try_recv() { 66 + match cmd { 67 + MediaCommand::SetMetadata { 68 + title, 69 + artist, 70 + album, 71 + duration, 72 + cover_url, 73 + } => { 74 + // Set playback state first 75 + if let Err(e) = self 76 + .controls 77 + .set_playback(MediaPlayback::Playing { progress: None }) 78 + { 79 + eprintln!("Failed to set playback state: {}", e); 80 + } 81 + 82 + // Then set metadata 83 + if let Err(e) = self.controls.set_metadata(MediaMetadata { 84 + title: Some(&title), 85 + artist: Some(&artist), 86 + album: Some(&album), 87 + duration: Some(duration), 88 + cover_url: cover_url.as_deref(), 89 + }) { 90 + eprintln!("Failed to set metadata: {}", e); 91 + } 92 + } 93 + MediaCommand::Play => { 94 + if let Err(e) = self 95 + .controls 96 + .set_playback(MediaPlayback::Playing { progress: None }) 97 + { 98 + eprintln!("Failed to set playback state: {}", e); 99 + } 100 + } 101 + MediaCommand::Pause => { 102 + if let Err(e) = self 103 + .controls 104 + .set_playback(MediaPlayback::Paused { progress: None }) 105 + { 106 + eprintln!("Failed to set playback state: {}", e); 107 + } 108 + } 109 + MediaCommand::SetMediaPosition((position, playing)) => { 110 + if let Err(e) = self.controls.set_playback(match playing { 111 + true => MediaPlayback::Playing { 112 + progress: Some(position), 113 + }, 114 + false => MediaPlayback::Paused { 115 + progress: Some(position), 116 + }, 117 + }) { 118 + eprintln!("Failed to set playback state: {}", e); 119 + } 120 + } 121 + _ => {} 122 + } 123 + } 124 + } 125 + } 126 + 127 + /// Start the media controls system. 128 + /// This function blocks and runs the event loop on the main thread. 129 + pub fn run_media_controls() -> Result<(), Box<dyn std::error::Error>> { 130 + // Channel for sending commands TO the media controls (from async tasks) 131 + let (command_sender, command_receiver) = mpsc::channel::<MediaCommand>(); 132 + 133 + // Channel for receiving events FROM the media controls (to async tasks) 134 + let (media_event_sender, media_event_receiver) = 135 + tokio::sync::mpsc::unbounded_channel::<MediaControlEvent>(); 136 + 137 + // Shared playing state between status and metadata tasks 138 + let is_playing = Arc::new(AtomicBool::new(false)); 139 + 140 + let sender = command_sender.clone(); 141 + let playing_state = Arc::clone(&is_playing); 142 + std::thread::spawn(move || { 143 + let runtime = tokio::runtime::Runtime::new().unwrap(); 144 + match runtime.block_on(spawn_metadata_update_task(sender.clone(), playing_state)) { 145 + Ok(_) => println!("Metadata update task completed"), 146 + Err(e) => eprintln!("Metadata update task failed: {}", e), 147 + } 148 + }); 149 + 150 + let sender = command_sender.clone(); 151 + std::thread::spawn(move || { 152 + let runtime = tokio::runtime::Runtime::new().unwrap(); 153 + match runtime.block_on(spawn_event_handler_task( 154 + sender.clone(), 155 + media_event_receiver, 156 + )) { 157 + Ok(()) => println!("Event handler task completed"), 158 + Err(e) => eprintln!("Event handler task failed: {}", e), 159 + } 160 + }); 161 + 162 + let sender = command_sender.clone(); 163 + let playing_state = Arc::clone(&is_playing); 164 + std::thread::spawn(move || { 165 + let runtime = tokio::runtime::Runtime::new().unwrap(); 166 + match runtime.block_on(spawn_status_update_task(sender.clone(), playing_state)) { 167 + Ok(_) => println!("Status update task completed"), 168 + Err(e) => eprintln!("Status update task failed: {}", e), 169 + } 170 + }); 171 + 172 + // Run the event loop on the main thread (required for macOS) 173 + let event_loop = EventLoop::new()?; 174 + event_loop.set_control_flow(ControlFlow::Poll); 175 + 176 + let mut controls = MediaControls::new(PlatformConfig { 177 + display_name: "Rockbox", 178 + dbus_name: "tsirysndr.rockbox", 179 + hwnd: None, 180 + })?; 181 + 182 + // Attach event handler - forward events to async task 183 + let event_sender = media_event_sender.clone(); 184 + controls.attach(move |event| { 185 + let _ = event_sender.send(event); 186 + })?; 187 + 188 + let mut app = App { 189 + controls, 190 + command_receiver, 191 + _media_event_sender: media_event_sender, 192 + }; 193 + 194 + event_loop.run_app(&mut app)?; 195 + 196 + Ok(()) 197 + } 198 + 199 + async fn build_client() -> Result<PlaybackServiceClient<Channel>, tonic::transport::Error> { 200 + let host = env::var("ROCKBOX_HOST").unwrap_or_else(|_| "localhost".to_string()); 201 + let port = env::var("ROCKBOX_PORT").unwrap_or_else(|_| "6061".to_string()); 202 + 203 + let url = format!("tcp://{}:{}", host, port); 204 + 205 + PlaybackServiceClient::connect(url).await 206 + } 207 + 208 + async fn build_system_client() -> Result<SystemServiceClient<Channel>, tonic::transport::Error> { 209 + let host = env::var("ROCKBOX_HOST").unwrap_or_else(|_| "localhost".to_string()); 210 + let port = env::var("ROCKBOX_PORT").unwrap_or_else(|_| "6061".to_string()); 211 + 212 + let url = format!("tcp://{}:{}", host, port); 213 + 214 + SystemServiceClient::connect(url).await 215 + } 216 + 217 + async fn build_playlist_client() -> Result<PlaylistServiceClient<Channel>, tonic::transport::Error> 218 + { 219 + let host = env::var("ROCKBOX_HOST").unwrap_or_else(|_| "localhost".to_string()); 220 + let port = env::var("ROCKBOX_PORT").unwrap_or_else(|_| "6061".to_string()); 221 + 222 + let url = format!("tcp://{}:{}", host, port); 223 + 224 + PlaylistServiceClient::connect(url).await 225 + } 226 + 227 + async fn spawn_metadata_update_task( 228 + command_sender: mpsc::Sender<MediaCommand>, 229 + is_playing: Arc<AtomicBool>, 230 + ) -> Result<(), Error> { 231 + let mut client = build_client().await?; 232 + let mut stream = client 233 + .stream_current_track(StreamCurrentTrackRequest {}) 234 + .await? 235 + .into_inner(); 236 + 237 + let asset_host = env::var("ROCKBOX_GRAPHQL_HOST").unwrap_or_else(|_| "localhost".to_string()); 238 + let asset_port = env::var("ROCKBOX_GRAPHQL_PORT").unwrap_or_else(|_| "6062".to_string()); 239 + 240 + let mut previous_album_art: Option<String> = None; 241 + let mut current_cover_url: Option<String> = None; 242 + 243 + // Track previous track information to detect changes 244 + let mut previous_title: Option<String> = None; 245 + let mut previous_artist: Option<String> = None; 246 + let mut previous_album: Option<String> = None; 247 + let mut previous_length: Option<u64> = None; 248 + 249 + // Track previous playing state 250 + let mut previous_playing: Option<bool> = None; 251 + 252 + while let Some(track) = stream.message().await? { 253 + // Check if track has changed 254 + let track_changed = previous_title.as_ref() != Some(&track.title) 255 + || previous_artist.as_ref() != Some(&track.artist) 256 + || previous_album.as_ref() != Some(&track.album) 257 + || previous_length != Some(track.length); 258 + 259 + // Only update cover_url if album_art has changed 260 + if track.album_art != previous_album_art { 261 + previous_album_art.clone_from(&track.album_art); 262 + current_cover_url = match &track.album_art { 263 + Some(album_art) => match album_art.starts_with("http") { 264 + true => Some(album_art.clone()), 265 + false => Some(format!( 266 + "http://{}:{}/covers/{}", 267 + asset_host, asset_port, album_art 268 + )), 269 + }, 270 + None => None, 271 + }; 272 + } 273 + 274 + // Only send metadata if track changed 275 + if track_changed { 276 + let cmd = MediaCommand::SetMetadata { 277 + title: track.title.clone(), 278 + artist: track.artist.clone(), 279 + album: track.album.clone(), 280 + duration: Duration::from_millis(track.length), 281 + cover_url: current_cover_url.clone(), 282 + }; 283 + 284 + command_sender.send(cmd)?; 285 + 286 + // Update previous track info 287 + previous_title = Some(track.title); 288 + previous_artist = Some(track.artist); 289 + previous_album = Some(track.album); 290 + previous_length = Some(track.length); 291 + } 292 + 293 + // Get current playing state 294 + let playing = is_playing.load(Ordering::Relaxed); 295 + let status_changed = previous_playing != Some(playing); 296 + 297 + // Only send position update if track changed or status changed 298 + if track_changed || status_changed { 299 + command_sender.send(MediaCommand::SetMediaPosition(( 300 + MediaPosition(Duration::from_millis(track.elapsed)), 301 + playing, 302 + )))?; 303 + 304 + previous_playing = Some(playing); 305 + } 306 + } 307 + 308 + Ok(()) 309 + } 310 + 311 + async fn spawn_event_handler_task( 312 + command_sender: std::sync::mpsc::Sender<MediaCommand>, 313 + mut receiver: tokio::sync::mpsc::UnboundedReceiver<MediaControlEvent>, 314 + ) -> Result<(), Error> { 315 + let mut client = build_client().await?; 316 + let mut system = build_system_client().await?; 317 + let mut playlist = build_playlist_client().await?; 318 + 319 + while let Some(event) = receiver.recv().await { 320 + match event { 321 + MediaControlEvent::Play => { 322 + println!("[MediaControl] Play"); 323 + command_sender.send(MediaCommand::Play)?; 324 + 325 + let status_resp = client.status(StatusRequest {}).await?.into_inner(); 326 + 327 + let global_status = system 328 + .get_global_status(GetGlobalStatusRequest {}) 329 + .await? 330 + .into_inner(); 331 + 332 + if global_status.resume_index > -1 && status_resp.status == 0 { 333 + playlist 334 + .resume_track(ResumeTrackRequest { 335 + ..Default::default() 336 + }) 337 + .await?; 338 + } else { 339 + client.resume(ResumeRequest {}).await?; 340 + } 341 + } 342 + MediaControlEvent::Pause => { 343 + println!("[MediaControl] Pause"); 344 + command_sender.send(MediaCommand::Pause)?; 345 + client.pause(PauseRequest {}).await?; 346 + } 347 + MediaControlEvent::Next => { 348 + println!("[MediaControl] Next"); 349 + command_sender.send(MediaCommand::Next)?; 350 + command_sender.send(MediaCommand::SetMediaPosition(( 351 + MediaPosition(Duration::from_millis(0)), 352 + true, 353 + )))?; 354 + client.next(NextRequest {}).await?; 355 + } 356 + MediaControlEvent::Previous => { 357 + println!("[MediaControl] Previous"); 358 + command_sender.send(MediaCommand::Previous)?; 359 + command_sender.send(MediaCommand::SetMediaPosition(( 360 + MediaPosition(Duration::from_millis(0)), 361 + true, 362 + )))?; 363 + client.previous(PreviousRequest {}).await?; 364 + } 365 + MediaControlEvent::Seek(_) => { 366 + println!("[MediaControl] Seek"); 367 + } 368 + MediaControlEvent::Toggle => { 369 + println!("[MediaControl] Toggle"); 370 + } 371 + MediaControlEvent::Stop => { 372 + println!("[MediaControl] Stop"); 373 + } 374 + MediaControlEvent::SeekBy(seek_direction, duration) => { 375 + println!("[MediaControl] SeekBy {:?} {:?}", seek_direction, duration); 376 + } 377 + MediaControlEvent::SetPosition(media_position) => { 378 + println!("[MediaControl] SetPosition {:?}", media_position); 379 + client 380 + .play(PlayRequest { 381 + elapsed: media_position.0.as_millis() as i64, 382 + offset: 0, 383 + }) 384 + .await?; 385 + } 386 + MediaControlEvent::SetVolume(volume) => { 387 + println!("[MediaControl] SetVolume {}", volume); 388 + } 389 + MediaControlEvent::OpenUri(uri) => { 390 + println!("[MediaControl] OpenUri {}", uri); 391 + } 392 + MediaControlEvent::Raise => { 393 + println!("[MediaControl] Raise"); 394 + } 395 + MediaControlEvent::Quit => { 396 + println!("[MediaControl] Quit"); 397 + } 398 + } 399 + } 400 + 401 + println!(">> Event receiver closed"); 402 + 403 + Ok(()) 404 + } 405 + 406 + async fn spawn_status_update_task( 407 + command_sender: mpsc::Sender<MediaCommand>, 408 + is_playing: Arc<AtomicBool>, 409 + ) -> Result<(), Error> { 410 + let host = env::var("ROCKBOX_HOST").unwrap_or_else(|_| "localhost".to_string()); 411 + let port = env::var("ROCKBOX_PORT").unwrap_or_else(|_| "6061".to_string()); 412 + 413 + let url = format!("tcp://{}:{}", host, port); 414 + 415 + let mut client = PlaybackServiceClient::connect(url).await?; 416 + 417 + let mut stream = client 418 + .stream_status(StreamStatusRequest {}) 419 + .await? 420 + .into_inner(); 421 + 422 + // Track previous status to only send updates when it changes 423 + let mut previous_status: Option<i32> = None; 424 + 425 + while let Some(response) = stream.message().await? { 426 + // Only send command if status actually changed 427 + if previous_status != Some(response.status) { 428 + match response.status { 429 + 1 => { 430 + is_playing.store(true, Ordering::Relaxed); 431 + command_sender.send(MediaCommand::Play)?; 432 + } 433 + 3 => { 434 + is_playing.store(false, Ordering::Relaxed); 435 + command_sender.send(MediaCommand::Pause)?; 436 + } 437 + _ => { 438 + is_playing.store(false, Ordering::Relaxed); 439 + command_sender.send(MediaCommand::Pause)?; 440 + } 441 + }; 442 + 443 + previous_status = Some(response.status); 444 + } 445 + } 446 + 447 + Ok(()) 448 + }
+1 -1
crates/mpd/src/lib.rs
··· 31 31 sound_service_client::SoundServiceClient, system_service_client::SystemServiceClient, 32 32 GetCurrentRequest, GetGlobalStatusRequest, PlaylistResumeRequest, 33 33 }; 34 - use rockbox_sys::{playback::current_track, types::user_settings::UserSettings}; 34 + use rockbox_sys::types::user_settings::UserSettings; 35 35 use sqlx::{Pool, Sqlite}; 36 36 use std::{env, sync::Arc, thread, time::Duration}; 37 37 use tokio::{