@@ -2060,6 +2060,10 @@ pub struct PlayResponse {}
20602060#[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
20612061pub struct PauseRequest { }
20622062#[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
2063+ pub struct PlayOrPauseRequest { }
2064+ #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
2065+ pub struct PlayOrPauseResponse { }
2066+ #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
20632067pub struct PauseResponse { }
20642068#[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
20652069pub struct ResumeRequest { }
@@ -2421,6 +2425,32 @@ pub mod playback_service_client {
24212425 . insert ( GrpcMethod :: new ( "rockbox.v1alpha1.PlaybackService" , "Pause" ) ) ;
24222426 self . inner . unary ( req, path, codec) . await
24232427 }
2428+ pub async fn play_or_pause (
2429+ & mut self ,
2430+ request : impl tonic:: IntoRequest < super :: PlayOrPauseRequest > ,
2431+ ) -> std:: result:: Result <
2432+ tonic:: Response < super :: PlayOrPauseResponse > ,
2433+ tonic:: Status ,
2434+ > {
2435+ self . inner
2436+ . ready ( )
2437+ . await
2438+ . map_err ( |e| {
2439+ tonic:: Status :: unknown (
2440+ format ! ( "Service was not ready: {}" , e. into( ) ) ,
2441+ )
2442+ } ) ?;
2443+ let codec = tonic:: codec:: ProstCodec :: default ( ) ;
2444+ let path = http:: uri:: PathAndQuery :: from_static (
2445+ "/rockbox.v1alpha1.PlaybackService/PlayOrPause" ,
2446+ ) ;
2447+ let mut req = request. into_request ( ) ;
2448+ req. extensions_mut ( )
2449+ . insert (
2450+ GrpcMethod :: new ( "rockbox.v1alpha1.PlaybackService" , "PlayOrPause" ) ,
2451+ ) ;
2452+ self . inner . unary ( req, path, codec) . await
2453+ }
24242454 pub async fn resume (
24252455 & mut self ,
24262456 request : impl tonic:: IntoRequest < super :: ResumeRequest > ,
@@ -2963,6 +2993,13 @@ pub mod playback_service_server {
29632993 & self ,
29642994 request : tonic:: Request < super :: PauseRequest > ,
29652995 ) -> std:: result:: Result < tonic:: Response < super :: PauseResponse > , tonic:: Status > ;
2996+ async fn play_or_pause (
2997+ & self ,
2998+ request : tonic:: Request < super :: PlayOrPauseRequest > ,
2999+ ) -> std:: result:: Result <
3000+ tonic:: Response < super :: PlayOrPauseResponse > ,
3001+ tonic:: Status ,
3002+ > ;
29663003 async fn resume (
29673004 & self ,
29683005 request : tonic:: Request < super :: ResumeRequest > ,
@@ -3277,6 +3314,51 @@ pub mod playback_service_server {
32773314 } ;
32783315 Box :: pin ( fut)
32793316 }
3317+ "/rockbox.v1alpha1.PlaybackService/PlayOrPause" => {
3318+ #[ allow( non_camel_case_types) ]
3319+ struct PlayOrPauseSvc < T : PlaybackService > ( pub Arc < T > ) ;
3320+ impl <
3321+ T : PlaybackService ,
3322+ > tonic:: server:: UnaryService < super :: PlayOrPauseRequest >
3323+ for PlayOrPauseSvc < T > {
3324+ type Response = super :: PlayOrPauseResponse ;
3325+ type Future = BoxFuture <
3326+ tonic:: Response < Self :: Response > ,
3327+ tonic:: Status ,
3328+ > ;
3329+ fn call (
3330+ & mut self ,
3331+ request : tonic:: Request < super :: PlayOrPauseRequest > ,
3332+ ) -> Self :: Future {
3333+ let inner = Arc :: clone ( & self . 0 ) ;
3334+ let fut = async move {
3335+ <T as PlaybackService >:: play_or_pause ( & inner, request) . await
3336+ } ;
3337+ Box :: pin ( fut)
3338+ }
3339+ }
3340+ let accept_compression_encodings = self . accept_compression_encodings ;
3341+ let send_compression_encodings = self . send_compression_encodings ;
3342+ let max_decoding_message_size = self . max_decoding_message_size ;
3343+ let max_encoding_message_size = self . max_encoding_message_size ;
3344+ let inner = self . inner . clone ( ) ;
3345+ let fut = async move {
3346+ let method = PlayOrPauseSvc ( inner) ;
3347+ let codec = tonic:: codec:: ProstCodec :: default ( ) ;
3348+ let mut grpc = tonic:: server:: Grpc :: new ( codec)
3349+ . apply_compression_config (
3350+ accept_compression_encodings,
3351+ send_compression_encodings,
3352+ )
3353+ . apply_max_message_size_config (
3354+ max_decoding_message_size,
3355+ max_encoding_message_size,
3356+ ) ;
3357+ let res = grpc. unary ( method, req) . await ;
3358+ Ok ( res)
3359+ } ;
3360+ Box :: pin ( fut)
3361+ }
32803362 "/rockbox.v1alpha1.PlaybackService/Resume" => {
32813363 #[ allow( non_camel_case_types) ]
32823364 struct ResumeSvc < T : PlaybackService > ( pub Arc < T > ) ;
0 commit comments