A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

gtk: add some screens

+11341 -55
+9
Cargo.lock
··· 6915 6915 name = "rockbox-gtk" 6916 6916 version = "0.1.0" 6917 6917 dependencies = [ 6918 + "anyhow", 6919 + "futures", 6918 6920 "gtk-blueprint", 6919 6921 "gtk4", 6920 6922 "libadwaita", 6923 + "prost 0.13.2", 6924 + "reqwest", 6925 + "tokio", 6926 + "tonic", 6927 + "tonic-build", 6928 + "tonic-reflection", 6929 + "tonic-web", 6921 6930 ] 6922 6931 6923 6932 [[package]]
assets/images/albumart.jpg

This is a binary file and will not be displayed.

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

This is a binary file and will not be displayed.

+12 -1
gtk/src/app.rs
··· 5 5 use gio::subclass::prelude::ApplicationImpl; 6 6 use glib::subclass::types::ObjectSubclass; 7 7 use glib::WeakRef; 8 - use gtk::{gio, glib}; 8 + use gtk::{gdk::Display, gio, glib, CssProvider, STYLE_PROVIDER_PRIORITY_APPLICATION}; 9 9 use std::cell::OnceCell; 10 10 11 11 mod imp { ··· 33 33 impl ApplicationImpl for RbApplication { 34 34 fn activate(&self) { 35 35 let app = self.obj(); 36 + load_css(); 36 37 37 38 if let Some(weak_window) = self.window.get() { 38 39 weak_window.upgrade().unwrap().present(); ··· 58 59 pub struct RbApplication(ObjectSubclass<imp::RbApplication>) 59 60 @extends gio::Application, gtk::Application, adw::Application, 60 61 @implements gio::ActionMap, gio::ActionGroup; 62 + } 63 + 64 + fn load_css() { 65 + let provider = CssProvider::new(); 66 + provider.load_from_string(include_str!("styles.css")); 67 + gtk::style_context_add_provider_for_display( 68 + &Display::default().expect("Error initializing gtk css provider."), 69 + &provider, 70 + STYLE_PROVIDER_PRIORITY_APPLICATION, 71 + ); 61 72 } 62 73 63 74 impl RbApplication {
+9
gtk/src/main.rs
··· 4 4 pub mod app; 5 5 pub mod ui; 6 6 7 + pub mod api { 8 + #[path = ""] 9 + pub mod rockbox { 10 + 11 + #[path = "rockbox.v1alpha1.rs"] 12 + pub mod v1alpha1; 13 + } 14 + } 15 + 7 16 fn main() -> glib::ExitCode { 8 17 // Initialize GTK 9 18 gtk::init().unwrap_or_else(|_| panic!("Failed to initialize GTK."));
+62
gtk/src/styles.css
··· 1 + .rounded-image { 2 + border-radius: 12px; 3 + overflow: hidden; 4 + } 5 + 6 + .album-label { 7 + font-weight: bold; 8 + } 9 + 10 + .media-control-button { 11 + background-color: transparent; 12 + } 13 + 14 + .media-title { 15 + font-weight: bold; 16 + } 17 + 18 + .media-time { 19 + font-size: 12px; 20 + } 21 + 22 + .media-album-art { 23 + max-width: 60px; 24 + max-height: 60px; 25 + border-radius: 4px; 26 + overflow: hidden; 27 + } 28 + 29 + .year-label { 30 + font-size: 12px; 31 + } 32 + 33 + .album-cover { 34 + max-width: 230px; 35 + max-height: 230px; 36 + margin-right: 20px; 37 + border-radius: 5px; 38 + overflow: hidden; 39 + } 40 + 41 + .album-title { 42 + font-weight: bold; 43 + font-size: 28px; 44 + } 45 + 46 + .album-artist { 47 + font-size: 15px; 48 + font-weight: bold; 49 + } 50 + 51 + .transparent-button { 52 + border-radius: 20px; 53 + background-color: transparent; 54 + } 55 + 56 + .album-track-list { 57 + background-color: transparent; 58 + } 59 + 60 + .track-title { 61 + font-weight: bold; 62 + }
+59
gtk/src/ui/media_controls.rs
··· 1 + use adw::subclass::prelude::*; 2 + use glib::subclass; 3 + use gtk::glib; 4 + use gtk::{Button, CompositeTemplate, Image}; 5 + 6 + mod imp { 7 + 8 + use super::*; 9 + 10 + #[derive(Debug, Default, CompositeTemplate)] 11 + #[template(file = "gtk/media_controls.ui")] 12 + pub struct MediaControls { 13 + #[template_child] 14 + pub shuffle_button: TemplateChild<Button>, 15 + #[template_child] 16 + pub previous_button: TemplateChild<Button>, 17 + #[template_child] 18 + pub play_pause_button: TemplateChild<Button>, 19 + #[template_child] 20 + pub next_button: TemplateChild<Button>, 21 + #[template_child] 22 + pub repeat_button: TemplateChild<Button>, 23 + #[template_child] 24 + pub album_art: TemplateChild<Image>, 25 + #[template_child] 26 + pub current_song_details: TemplateChild<gtk::Box>, 27 + } 28 + 29 + #[glib::object_subclass] 30 + impl ObjectSubclass for MediaControls { 31 + const NAME: &'static str = "MediaControls"; 32 + type ParentType = gtk::Box; 33 + type Type = super::MediaControls; 34 + 35 + fn class_init(klass: &mut Self::Class) { 36 + Self::bind_template(klass); 37 + } 38 + 39 + fn instance_init(obj: &subclass::InitializingObject<Self>) { 40 + obj.init_template(); 41 + } 42 + } 43 + 44 + impl ObjectImpl for MediaControls {} 45 + impl WidgetImpl for MediaControls {} 46 + impl BoxImpl for MediaControls {} 47 + } 48 + 49 + glib::wrapper! { 50 + pub struct MediaControls(ObjectSubclass<imp::MediaControls>) 51 + @extends gtk::Widget, adw::Bin; 52 + } 53 + 54 + #[gtk::template_callbacks] 55 + impl MediaControls { 56 + pub fn new() -> Self { 57 + glib::Object::new() 58 + } 59 + }
+2
gtk/src/ui/mod.rs
··· 1 + pub mod media_controls; 2 + pub mod pages; 1 3 pub mod window;
+44
gtk/src/ui/pages/album_details.rs
··· 1 + use adw::subclass::prelude::*; 2 + use glib::subclass; 3 + use gtk::glib; 4 + use gtk::CompositeTemplate; 5 + 6 + mod imp { 7 + 8 + use super::*; 9 + 10 + #[derive(Debug, Default, CompositeTemplate)] 11 + #[template(file = "../gtk/album_details.ui")] 12 + pub struct AlbumDetails {} 13 + 14 + #[glib::object_subclass] 15 + impl ObjectSubclass for AlbumDetails { 16 + const NAME: &'static str = "AlbumDetails"; 17 + type ParentType = gtk::Box; 18 + type Type = super::AlbumDetails; 19 + 20 + fn class_init(klass: &mut Self::Class) { 21 + Self::bind_template(klass); 22 + } 23 + 24 + fn instance_init(obj: &subclass::InitializingObject<Self>) { 25 + obj.init_template(); 26 + } 27 + } 28 + 29 + impl ObjectImpl for AlbumDetails {} 30 + impl WidgetImpl for AlbumDetails {} 31 + impl BoxImpl for AlbumDetails {} 32 + } 33 + 34 + glib::wrapper! { 35 + pub struct AlbumDetails(ObjectSubclass<imp::AlbumDetails>) 36 + @extends gtk::Widget, gtk::Box; 37 + } 38 + 39 + #[gtk::template_callbacks] 40 + impl AlbumDetails { 41 + pub fn new() -> Self { 42 + glib::Object::new() 43 + } 44 + }
+199
gtk/src/ui/pages/albums.rs
··· 1 + use std::{env, thread}; 2 + 3 + use crate::api::rockbox::v1alpha1::library_service_client::LibraryServiceClient; 4 + use crate::api::rockbox::v1alpha1::{GetAlbumsRequest, GetAlbumsResponse}; 5 + use adw::prelude::*; 6 + use adw::subclass::prelude::*; 7 + use anyhow::Error; 8 + use glib::subclass; 9 + use gtk::pango::EllipsizeMode; 10 + use gtk::prelude::WidgetExt; 11 + use gtk::CompositeTemplate; 12 + use gtk::{glib, Box, FlowBox, Image, Label, Orientation}; 13 + use std::cell::RefCell; 14 + 15 + mod imp { 16 + use super::*; 17 + 18 + #[derive(Debug, Default, CompositeTemplate)] 19 + #[template(file = "../gtk/albums.ui")] 20 + pub struct Albums { 21 + #[template_child] 22 + pub library: TemplateChild<FlowBox>, 23 + pub main_stack: RefCell<Option<adw::ViewStack>>, 24 + pub library_page: RefCell<Option<adw::NavigationPage>>, 25 + pub go_back_button: RefCell<Option<gtk::Button>>, 26 + } 27 + 28 + #[glib::object_subclass] 29 + impl ObjectSubclass for Albums { 30 + const NAME: &'static str = "Albums"; 31 + type ParentType = gtk::Box; 32 + type Type = super::Albums; 33 + 34 + fn class_init(klass: &mut Self::Class) { 35 + Self::bind_template(klass); 36 + } 37 + 38 + fn instance_init(obj: &subclass::InitializingObject<Self>) { 39 + obj.init_template(); 40 + } 41 + } 42 + 43 + impl ObjectImpl for Albums { 44 + fn constructed(&self) { 45 + self.parent_constructed(); 46 + 47 + let self_weak = self.downgrade(); 48 + glib::idle_add_local(move || { 49 + let self_ = match self_weak.upgrade() { 50 + Some(self_) => self_, 51 + None => return glib::ControlFlow::Continue, 52 + }; 53 + 54 + glib::MainContext::default().spawn_local(async move { 55 + let obj = self_.obj(); 56 + obj.load_pictures(); 57 + }); 58 + 59 + glib::ControlFlow::Break 60 + }); 61 + } 62 + } 63 + impl WidgetImpl for Albums {} 64 + impl BoxImpl for Albums {} 65 + 66 + impl Albums { 67 + pub fn set_main_stack(&self, main_stack: adw::ViewStack) { 68 + *self.main_stack.borrow_mut() = Some(main_stack); 69 + } 70 + 71 + pub fn set_library_page(&self, library_page: adw::NavigationPage) { 72 + *self.library_page.borrow_mut() = Some(library_page); 73 + } 74 + 75 + pub fn set_go_back_button(&self, go_back_button: gtk::Button) { 76 + *self.go_back_button.borrow_mut() = Some(go_back_button); 77 + } 78 + 79 + pub fn add_picture_to_library( 80 + &self, 81 + filename: Option<String>, 82 + title: &str, 83 + artist: &str, 84 + year: u32, 85 + ) { 86 + let home = std::env::var("HOME").unwrap(); 87 + let picture_path = match filename { 88 + Some(filename) => format!("{}/.config/rockbox.org/covers/{}", home, filename), 89 + None => format!("{}/.config/rockbox.org/covers/albumart.jpg", home), 90 + }; 91 + let image = Image::from_file(&picture_path); 92 + image.set_size_request(200, 200); 93 + let image_container = Box::new(Orientation::Vertical, 0); 94 + 95 + let self_weak = self.downgrade(); 96 + let title_ = title.to_string(); 97 + 98 + let gesture = gtk::GestureClick::new(); 99 + gesture.connect_released(move |_, _, _, _| { 100 + let self_ = match self_weak.upgrade() { 101 + Some(self_) => self_, 102 + None => return, 103 + }; 104 + let obj = self_.obj(); 105 + obj.navigate_to_details(&title_); 106 + }); 107 + 108 + image_container.append(&image); 109 + image_container.add_controller(gesture); 110 + image_container.add_css_class("rounded-image"); 111 + 112 + let title = Label::new(Some(title)); 113 + title.set_ellipsize(EllipsizeMode::End); 114 + title.set_max_width_chars(23); 115 + title.add_css_class("album-label"); 116 + title.set_halign(gtk::Align::Start); 117 + 118 + let artist = Label::new(Some(artist)); 119 + artist.set_ellipsize(EllipsizeMode::End); 120 + artist.set_max_width_chars(23); 121 + artist.set_halign(gtk::Align::Start); 122 + 123 + let year_u32 = year; 124 + let year = Label::new(Some(&year.to_string())); 125 + year.set_halign(gtk::Align::Start); 126 + year.add_css_class("year-label"); 127 + 128 + let infos = Box::new(Orientation::Vertical, 4); 129 + infos.append(&title); 130 + infos.append(&artist); 131 + 132 + if year_u32 != 0 { 133 + infos.append(&year); 134 + } 135 + 136 + infos.set_halign(gtk::Align::Start); 137 + 138 + let container = Box::new(Orientation::Vertical, 10); 139 + container.append(&image_container); 140 + container.append(&infos); 141 + container.set_margin_bottom(56); 142 + 143 + self.library.append(&container); 144 + } 145 + } 146 + } 147 + 148 + glib::wrapper! { 149 + pub struct Albums(ObjectSubclass<imp::Albums>) 150 + @extends gtk::Widget, gtk::Box; 151 + } 152 + 153 + #[gtk::template_callbacks] 154 + impl Albums { 155 + pub fn new() -> Self { 156 + glib::Object::new() 157 + } 158 + 159 + pub fn navigate_to_details(&self, _title: &str) { 160 + if let Some(main_stack) = self.imp().main_stack.borrow().as_ref() { 161 + main_stack.set_visible_child_name("album-details-page"); 162 + if let Some(library_page) = self.imp().library_page.borrow().as_ref() { 163 + library_page.set_title("Album"); 164 + } 165 + 166 + if let Some(go_back_button) = self.imp().go_back_button.borrow().as_ref() { 167 + go_back_button.set_visible(true); 168 + } 169 + } else { 170 + eprintln!("NavigationView not set!"); 171 + } 172 + } 173 + 174 + pub fn load_pictures(&self) { 175 + let handle = thread::spawn(move || { 176 + let rt = tokio::runtime::Runtime::new().unwrap(); 177 + rt.block_on(async { 178 + let host = env::var("ROCKBOX_HOST").unwrap_or_else(|_| "localhost".to_string()); 179 + let port = env::var("ROCKBOX_PORT").unwrap_or_else(|_| "6061".to_string()); 180 + 181 + let url = format!("tcp://{}:{}", host, port); 182 + let mut client = LibraryServiceClient::connect(url).await?; 183 + let request = tonic::Request::new(GetAlbumsRequest {}); 184 + let response = client.get_albums(request).await?; 185 + Ok::<GetAlbumsResponse, Error>(response.into_inner()) 186 + }) 187 + }); 188 + if let Ok(albums) = handle.join().unwrap() { 189 + for album in albums.albums { 190 + self.imp().add_picture_to_library( 191 + album.album_art, 192 + &album.title, 193 + &album.artist, 194 + album.year, 195 + ); 196 + } 197 + } 198 + } 199 + }
+44
gtk/src/ui/pages/artist_details.rs
··· 1 + use adw::subclass::prelude::*; 2 + use glib::subclass; 3 + use gtk::glib; 4 + use gtk::CompositeTemplate; 5 + 6 + mod imp { 7 + 8 + use super::*; 9 + 10 + #[derive(Debug, Default, CompositeTemplate)] 11 + #[template(file = "../gtk/artist_details.ui")] 12 + pub struct ArtistDetails {} 13 + 14 + #[glib::object_subclass] 15 + impl ObjectSubclass for ArtistDetails { 16 + const NAME: &'static str = "ArtistDetails"; 17 + type ParentType = gtk::Box; 18 + type Type = super::ArtistDetails; 19 + 20 + fn class_init(klass: &mut Self::Class) { 21 + Self::bind_template(klass); 22 + } 23 + 24 + fn instance_init(obj: &subclass::InitializingObject<Self>) { 25 + obj.init_template(); 26 + } 27 + } 28 + 29 + impl ObjectImpl for ArtistDetails {} 30 + impl WidgetImpl for ArtistDetails {} 31 + impl BoxImpl for ArtistDetails {} 32 + } 33 + 34 + glib::wrapper! { 35 + pub struct ArtistDetails(ObjectSubclass<imp::ArtistDetails>) 36 + @extends gtk::Widget, gtk::Box; 37 + } 38 + 39 + #[gtk::template_callbacks] 40 + impl ArtistDetails { 41 + pub fn new() -> Self { 42 + glib::Object::new() 43 + } 44 + }
+44
gtk/src/ui/pages/artists.rs
··· 1 + use adw::subclass::prelude::*; 2 + use glib::subclass; 3 + use gtk::glib; 4 + use gtk::CompositeTemplate; 5 + 6 + mod imp { 7 + 8 + use super::*; 9 + 10 + #[derive(Debug, Default, CompositeTemplate)] 11 + #[template(file = "../gtk/artists.ui")] 12 + pub struct Artists {} 13 + 14 + #[glib::object_subclass] 15 + impl ObjectSubclass for Artists { 16 + const NAME: &'static str = "Artists"; 17 + type ParentType = gtk::Box; 18 + type Type = super::Artists; 19 + 20 + fn class_init(klass: &mut Self::Class) { 21 + Self::bind_template(klass); 22 + } 23 + 24 + fn instance_init(obj: &subclass::InitializingObject<Self>) { 25 + obj.init_template(); 26 + } 27 + } 28 + 29 + impl ObjectImpl for Artists {} 30 + impl WidgetImpl for Artists {} 31 + impl BoxImpl for Artists {} 32 + } 33 + 34 + glib::wrapper! { 35 + pub struct Artists(ObjectSubclass<imp::Artists>) 36 + @extends gtk::Widget, gtk::Box; 37 + } 38 + 39 + #[gtk::template_callbacks] 40 + impl Artists { 41 + pub fn new() -> Self { 42 + glib::Object::new() 43 + } 44 + }
+44
gtk/src/ui/pages/files.rs
··· 1 + use adw::subclass::prelude::*; 2 + use glib::subclass; 3 + use gtk::glib; 4 + use gtk::CompositeTemplate; 5 + 6 + mod imp { 7 + 8 + use super::*; 9 + 10 + #[derive(Debug, Default, CompositeTemplate)] 11 + #[template(file = "../gtk/files.ui")] 12 + pub struct Files {} 13 + 14 + #[glib::object_subclass] 15 + impl ObjectSubclass for Files { 16 + const NAME: &'static str = "Files"; 17 + type ParentType = gtk::Box; 18 + type Type = super::Files; 19 + 20 + fn class_init(klass: &mut Self::Class) { 21 + Self::bind_template(klass); 22 + } 23 + 24 + fn instance_init(obj: &subclass::InitializingObject<Self>) { 25 + obj.init_template(); 26 + } 27 + } 28 + 29 + impl ObjectImpl for Files {} 30 + impl WidgetImpl for Files {} 31 + impl BoxImpl for Files {} 32 + } 33 + 34 + glib::wrapper! { 35 + pub struct Files(ObjectSubclass<imp::Files>) 36 + @extends gtk::Widget, gtk::Box; 37 + } 38 + 39 + #[gtk::template_callbacks] 40 + impl Files { 41 + pub fn new() -> Self { 42 + glib::Object::new() 43 + } 44 + }
+44
gtk/src/ui/pages/likes.rs
··· 1 + use adw::subclass::prelude::*; 2 + use glib::subclass; 3 + use gtk::glib; 4 + use gtk::CompositeTemplate; 5 + 6 + mod imp { 7 + 8 + use super::*; 9 + 10 + #[derive(Debug, Default, CompositeTemplate)] 11 + #[template(file = "../gtk/likes.ui")] 12 + pub struct Likes {} 13 + 14 + #[glib::object_subclass] 15 + impl ObjectSubclass for Likes { 16 + const NAME: &'static str = "Likes"; 17 + type ParentType = gtk::Box; 18 + type Type = super::Likes; 19 + 20 + fn class_init(klass: &mut Self::Class) { 21 + Self::bind_template(klass); 22 + } 23 + 24 + fn instance_init(obj: &subclass::InitializingObject<Self>) { 25 + obj.init_template(); 26 + } 27 + } 28 + 29 + impl ObjectImpl for Likes {} 30 + impl WidgetImpl for Likes {} 31 + impl BoxImpl for Likes {} 32 + } 33 + 34 + glib::wrapper! { 35 + pub struct Likes(ObjectSubclass<imp::Likes>) 36 + @extends gtk::Widget, gtk::Box; 37 + } 38 + 39 + #[gtk::template_callbacks] 40 + impl Likes { 41 + pub fn new() -> Self { 42 + glib::Object::new() 43 + } 44 + }
+7
gtk/src/ui/pages/mod.rs
··· 1 + pub mod album_details; 2 + pub mod albums; 3 + pub mod artist_details; 4 + pub mod artists; 5 + pub mod files; 6 + pub mod likes; 7 + pub mod songs;
+44
gtk/src/ui/pages/songs.rs
··· 1 + use adw::subclass::prelude::*; 2 + use glib::subclass; 3 + use gtk::glib; 4 + use gtk::CompositeTemplate; 5 + 6 + mod imp { 7 + 8 + use super::*; 9 + 10 + #[derive(Debug, Default, CompositeTemplate)] 11 + #[template(file = "../gtk/songs.ui")] 12 + pub struct Songs {} 13 + 14 + #[glib::object_subclass] 15 + impl ObjectSubclass for Songs { 16 + const NAME: &'static str = "Songs"; 17 + type ParentType = gtk::Box; 18 + type Type = super::Songs; 19 + 20 + fn class_init(klass: &mut Self::Class) { 21 + Self::bind_template(klass); 22 + } 23 + 24 + fn instance_init(obj: &subclass::InitializingObject<Self>) { 25 + obj.init_template(); 26 + } 27 + } 28 + 29 + impl ObjectImpl for Songs {} 30 + impl WidgetImpl for Songs {} 31 + impl BoxImpl for Songs {} 32 + } 33 + 34 + glib::wrapper! { 35 + pub struct Songs(ObjectSubclass<imp::Songs>) 36 + @extends gtk::Widget, gtk::Box; 37 + } 38 + 39 + #[gtk::template_callbacks] 40 + impl Songs { 41 + pub fn new() -> Self { 42 + glib::Object::new() 43 + } 44 + }
+193 -8
gtk/src/ui/window.rs
··· 1 + use crate::app::RbApplication; 2 + use crate::ui::media_controls::MediaControls; 3 + use crate::ui::pages::album_details::AlbumDetails; 4 + use crate::ui::pages::albums::Albums; 5 + use crate::ui::pages::songs::Songs; 1 6 use adw::prelude::*; 2 7 use adw::subclass::prelude::*; 8 + use adw::ViewStack; 9 + use adw::{NavigationPage, NavigationView, OverlaySplitView, ToastOverlay, ViewStackPage}; 3 10 use glib::subclass; 4 - use gtk::{gio, glib, CompositeTemplate}; 5 - 6 - use crate::app::RbApplication; 11 + use gtk::{ 12 + gio, glib, Box, Button, CompositeTemplate, Label, ListBox, MenuButton, Overlay, SearchBar, 13 + SearchEntry, ToggleButton, 14 + }; 7 15 8 16 mod imp { 9 17 10 18 use super::*; 11 19 12 20 #[derive(Debug, Default, CompositeTemplate)] 13 - #[template(file = "window.ui")] 14 - pub struct RbApplicationWindow {} 21 + #[template(file = "gtk/window.ui")] 22 + pub struct RbApplicationWindow { 23 + #[template_child] 24 + pub show_sidebar_button: TemplateChild<Button>, 25 + #[template_child] 26 + pub primary_menu_button: TemplateChild<MenuButton>, 27 + #[template_child] 28 + pub go_back_button: TemplateChild<Button>, 29 + 30 + #[template_child] 31 + pub search_bar: TemplateChild<SearchBar>, 32 + #[template_child] 33 + pub search_entry: TemplateChild<SearchEntry>, 34 + #[template_child] 35 + pub search_button: TemplateChild<ToggleButton>, 36 + 37 + #[template_child] 38 + pub overlay_split_view: TemplateChild<OverlaySplitView>, 39 + #[template_child] 40 + pub navigation_view: TemplateChild<NavigationView>, 41 + #[template_child] 42 + pub sidebar_navigation_page: TemplateChild<NavigationPage>, 43 + #[template_child] 44 + pub sidebar: TemplateChild<ListBox>, 45 + #[template_child] 46 + pub albums_row_box: TemplateChild<Box>, 47 + #[template_child] 48 + pub albums_no_label: TemplateChild<Label>, 49 + #[template_child] 50 + pub artists_row_box: TemplateChild<Box>, 51 + #[template_child] 52 + pub artists_no_label: TemplateChild<Label>, 53 + #[template_child] 54 + pub songs_row_box: TemplateChild<Box>, 55 + #[template_child] 56 + pub songs_no_label: TemplateChild<Label>, 57 + #[template_child] 58 + pub likes_row_box: TemplateChild<Box>, 59 + #[template_child] 60 + pub likes_no_label: TemplateChild<Label>, 61 + #[template_child] 62 + pub files_row_box: TemplateChild<Box>, 63 + #[template_child] 64 + pub files_no_label: TemplateChild<Label>, 65 + 66 + #[template_child] 67 + pub toast_overlay: TemplateChild<ToastOverlay>, 68 + #[template_child] 69 + pub details_view: TemplateChild<Overlay>, 70 + #[template_child] 71 + pub library_page: TemplateChild<NavigationPage>, 72 + #[template_child] 73 + pub main_stack: TemplateChild<ViewStack>, 74 + #[template_child] 75 + pub albums_page: TemplateChild<ViewStackPage>, 76 + #[template_child] 77 + pub albums: TemplateChild<Albums>, 78 + #[template_child] 79 + pub songs_page: TemplateChild<ViewStackPage>, 80 + #[template_child] 81 + pub songs: TemplateChild<Songs>, 82 + #[template_child] 83 + pub album_details_page: TemplateChild<ViewStackPage>, 84 + #[template_child] 85 + pub album_details: TemplateChild<AlbumDetails>, 86 + #[template_child] 87 + pub library_overlay: TemplateChild<Overlay>, 88 + #[template_child] 89 + pub media_control_bar: TemplateChild<MediaControls>, 90 + 91 + pub show_sidebar: std::cell::Cell<bool>, 92 + pub previous_page: String, 93 + } 15 94 16 95 #[glib::object_subclass] 17 96 impl ObjectSubclass for RbApplicationWindow { ··· 19 98 type ParentType = adw::ApplicationWindow; 20 99 type Type = super::RbApplicationWindow; 21 100 101 + fn new() -> Self { 102 + Self { 103 + show_sidebar: std::cell::Cell::new(true), 104 + previous_page: "Albums".to_string(), 105 + ..Default::default() 106 + } 107 + } 108 + 22 109 fn class_init(klass: &mut Self::Class) { 23 110 Self::bind_template(klass); 111 + 112 + klass.install_action("win.show_sidebar", None, move |win, _action, _parameter| { 113 + let self_ = imp::RbApplicationWindow::from_obj(win); 114 + self_.toggle_sidebar(); 115 + }); 116 + 117 + klass.install_action("win.go_back", None, move |win, _action, _parameter| { 118 + let self_ = imp::RbApplicationWindow::from_obj(win); 119 + self_.go_back(); 120 + let go_back_button = self_.go_back_button.get(); 121 + go_back_button.set_visible(false); 122 + }); 24 123 } 25 124 26 125 fn instance_init(obj: &subclass::InitializingObject<Self>) { ··· 28 127 } 29 128 } 30 129 31 - impl ObjectImpl for RbApplicationWindow {} 130 + impl ObjectImpl for RbApplicationWindow { 131 + fn constructed(&self) { 132 + self.parent_constructed(); 133 + 134 + let sidebar = self.sidebar.get(); 135 + sidebar.select_row(Some(&sidebar.row_at_index(0).unwrap())); 136 + let weak_self = self.downgrade(); 137 + sidebar.connect_row_selected(move |_, row| { 138 + let self_ = match weak_self.upgrade() { 139 + Some(self_) => self_, 140 + None => return, 141 + }; 142 + let row = row.unwrap(); 143 + let row = row.clone().downcast::<gtk::ListBoxRow>().unwrap(); 144 + let label = row 145 + .child() 146 + .unwrap() 147 + .downcast::<gtk::Box>() 148 + .unwrap() 149 + .first_child() 150 + .unwrap() 151 + .downcast::<gtk::Label>() 152 + .unwrap() 153 + .text() 154 + .to_string(); 155 + match label.as_str() { 156 + "Albums" => { 157 + let main_stack = self_.main_stack.get(); 158 + main_stack.set_visible_child_name("albums-page"); 159 + let library_page = self_.library_page.get(); 160 + library_page.set_title("Albums"); 161 + } 162 + "Artists" => { 163 + let main_stack = self_.main_stack.get(); 164 + main_stack.set_visible_child_name("artists-page"); 165 + let library_page = self_.library_page.get(); 166 + library_page.set_title("Artists"); 167 + } 168 + "Songs" => { 169 + let main_stack = self_.main_stack.get(); 170 + main_stack.set_visible_child_name("songs-page"); 171 + let library_page = self_.library_page.get(); 172 + library_page.set_title("Songs"); 173 + } 174 + "Likes" => { 175 + let main_stack = self_.main_stack.get(); 176 + main_stack.set_visible_child_name("likes-page"); 177 + let library_page = self_.library_page.get(); 178 + library_page.set_title("Likes"); 179 + } 180 + "Files" => { 181 + let main_stack = self_.main_stack.get(); 182 + main_stack.set_visible_child_name("files-page"); 183 + let library_page = self_.library_page.get(); 184 + library_page.set_title("Files"); 185 + } 186 + _ => {} 187 + } 188 + }); 189 + } 190 + } 32 191 33 192 impl WidgetImpl for RbApplicationWindow {} 34 193 impl WindowImpl for RbApplicationWindow {} 35 194 impl ApplicationWindowImpl for RbApplicationWindow {} 36 195 impl AdwApplicationWindowImpl for RbApplicationWindow {} 37 - impl RbApplicationWindow {} 196 + 197 + impl RbApplicationWindow { 198 + fn toggle_sidebar(&self) { 199 + let current_state = self.show_sidebar.get(); 200 + self.show_sidebar.set(!current_state); 201 + self.overlay_split_view.set_show_sidebar(!current_state); 202 + } 203 + 204 + fn go_back(&self) { 205 + let main_stack = self.main_stack.get(); 206 + main_stack.set_visible_child_name("albums-page"); 207 + let library_page = self.library_page.get(); 208 + library_page.set_title(self.previous_page.as_str()); 209 + } 210 + } 38 211 } 39 212 40 213 glib::wrapper! { ··· 46 219 47 220 impl RbApplicationWindow { 48 221 pub fn new() -> Self { 49 - glib::Object::new::<Self>() 222 + let window: Self = glib::Object::new::<Self>(); 223 + 224 + let main_stack = window.imp().main_stack.get(); 225 + let library_page = window.imp().library_page.get(); 226 + let albums = window.imp().albums.get(); 227 + 228 + albums.imp().set_main_stack(main_stack.clone()); 229 + albums.imp().set_library_page(library_page.clone()); 230 + albums 231 + .imp() 232 + .set_go_back_button(window.imp().go_back_button.get().clone()); 233 + 234 + window 50 235 } 51 236 } 52 237