1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_media_audio_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
15pub struct EffectsControllerMarker;
16
17impl fidl::endpoints::ProtocolMarker for EffectsControllerMarker {
18 type Proxy = EffectsControllerProxy;
19 type RequestStream = EffectsControllerRequestStream;
20 #[cfg(target_os = "fuchsia")]
21 type SynchronousProxy = EffectsControllerSynchronousProxy;
22
23 const DEBUG_NAME: &'static str = "fuchsia.media.audio.EffectsController";
24}
25impl fidl::endpoints::DiscoverableProtocolMarker for EffectsControllerMarker {}
26pub type EffectsControllerUpdateEffectResult = Result<(), UpdateEffectError>;
27
28pub trait EffectsControllerProxyInterface: Send + Sync {
29 type UpdateEffectResponseFut: std::future::Future<Output = Result<EffectsControllerUpdateEffectResult, fidl::Error>>
30 + Send;
31 fn r#update_effect(&self, effect_name: &str, config: &str) -> Self::UpdateEffectResponseFut;
32}
33#[derive(Debug)]
34#[cfg(target_os = "fuchsia")]
35pub struct EffectsControllerSynchronousProxy {
36 client: fidl::client::sync::Client,
37}
38
39#[cfg(target_os = "fuchsia")]
40impl fidl::endpoints::SynchronousProxy for EffectsControllerSynchronousProxy {
41 type Proxy = EffectsControllerProxy;
42 type Protocol = EffectsControllerMarker;
43
44 fn from_channel(inner: fidl::Channel) -> Self {
45 Self::new(inner)
46 }
47
48 fn into_channel(self) -> fidl::Channel {
49 self.client.into_channel()
50 }
51
52 fn as_channel(&self) -> &fidl::Channel {
53 self.client.as_channel()
54 }
55}
56
57#[cfg(target_os = "fuchsia")]
58impl EffectsControllerSynchronousProxy {
59 pub fn new(channel: fidl::Channel) -> Self {
60 let protocol_name =
61 <EffectsControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
62 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
63 }
64
65 pub fn into_channel(self) -> fidl::Channel {
66 self.client.into_channel()
67 }
68
69 pub fn wait_for_event(
72 &self,
73 deadline: zx::MonotonicInstant,
74 ) -> Result<EffectsControllerEvent, fidl::Error> {
75 EffectsControllerEvent::decode(self.client.wait_for_event(deadline)?)
76 }
77
78 pub fn r#update_effect(
96 &self,
97 mut effect_name: &str,
98 mut config: &str,
99 ___deadline: zx::MonotonicInstant,
100 ) -> Result<EffectsControllerUpdateEffectResult, fidl::Error> {
101 let _response = self.client.send_query::<
102 EffectsControllerUpdateEffectRequest,
103 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UpdateEffectError>,
104 >(
105 (effect_name, config,),
106 0x4e39e4b5e6279125,
107 fidl::encoding::DynamicFlags::empty(),
108 ___deadline,
109 )?;
110 Ok(_response.map(|x| x))
111 }
112}
113
114#[derive(Debug, Clone)]
115pub struct EffectsControllerProxy {
116 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
117}
118
119impl fidl::endpoints::Proxy for EffectsControllerProxy {
120 type Protocol = EffectsControllerMarker;
121
122 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
123 Self::new(inner)
124 }
125
126 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
127 self.client.into_channel().map_err(|client| Self { client })
128 }
129
130 fn as_channel(&self) -> &::fidl::AsyncChannel {
131 self.client.as_channel()
132 }
133}
134
135impl EffectsControllerProxy {
136 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
138 let protocol_name =
139 <EffectsControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
140 Self { client: fidl::client::Client::new(channel, protocol_name) }
141 }
142
143 pub fn take_event_stream(&self) -> EffectsControllerEventStream {
149 EffectsControllerEventStream { event_receiver: self.client.take_event_receiver() }
150 }
151
152 pub fn r#update_effect(
170 &self,
171 mut effect_name: &str,
172 mut config: &str,
173 ) -> fidl::client::QueryResponseFut<
174 EffectsControllerUpdateEffectResult,
175 fidl::encoding::DefaultFuchsiaResourceDialect,
176 > {
177 EffectsControllerProxyInterface::r#update_effect(self, effect_name, config)
178 }
179}
180
181impl EffectsControllerProxyInterface for EffectsControllerProxy {
182 type UpdateEffectResponseFut = fidl::client::QueryResponseFut<
183 EffectsControllerUpdateEffectResult,
184 fidl::encoding::DefaultFuchsiaResourceDialect,
185 >;
186 fn r#update_effect(
187 &self,
188 mut effect_name: &str,
189 mut config: &str,
190 ) -> Self::UpdateEffectResponseFut {
191 fn _decode(
192 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
193 ) -> Result<EffectsControllerUpdateEffectResult, fidl::Error> {
194 let _response = fidl::client::decode_transaction_body::<
195 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UpdateEffectError>,
196 fidl::encoding::DefaultFuchsiaResourceDialect,
197 0x4e39e4b5e6279125,
198 >(_buf?)?;
199 Ok(_response.map(|x| x))
200 }
201 self.client.send_query_and_decode::<
202 EffectsControllerUpdateEffectRequest,
203 EffectsControllerUpdateEffectResult,
204 >(
205 (effect_name, config,),
206 0x4e39e4b5e6279125,
207 fidl::encoding::DynamicFlags::empty(),
208 _decode,
209 )
210 }
211}
212
213pub struct EffectsControllerEventStream {
214 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
215}
216
217impl std::marker::Unpin for EffectsControllerEventStream {}
218
219impl futures::stream::FusedStream for EffectsControllerEventStream {
220 fn is_terminated(&self) -> bool {
221 self.event_receiver.is_terminated()
222 }
223}
224
225impl futures::Stream for EffectsControllerEventStream {
226 type Item = Result<EffectsControllerEvent, fidl::Error>;
227
228 fn poll_next(
229 mut self: std::pin::Pin<&mut Self>,
230 cx: &mut std::task::Context<'_>,
231 ) -> std::task::Poll<Option<Self::Item>> {
232 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
233 &mut self.event_receiver,
234 cx
235 )?) {
236 Some(buf) => std::task::Poll::Ready(Some(EffectsControllerEvent::decode(buf))),
237 None => std::task::Poll::Ready(None),
238 }
239 }
240}
241
242#[derive(Debug)]
243pub enum EffectsControllerEvent {}
244
245impl EffectsControllerEvent {
246 fn decode(
248 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
249 ) -> Result<EffectsControllerEvent, fidl::Error> {
250 let (bytes, _handles) = buf.split_mut();
251 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
252 debug_assert_eq!(tx_header.tx_id, 0);
253 match tx_header.ordinal {
254 _ => Err(fidl::Error::UnknownOrdinal {
255 ordinal: tx_header.ordinal,
256 protocol_name:
257 <EffectsControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
258 }),
259 }
260 }
261}
262
263pub struct EffectsControllerRequestStream {
265 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
266 is_terminated: bool,
267}
268
269impl std::marker::Unpin for EffectsControllerRequestStream {}
270
271impl futures::stream::FusedStream for EffectsControllerRequestStream {
272 fn is_terminated(&self) -> bool {
273 self.is_terminated
274 }
275}
276
277impl fidl::endpoints::RequestStream for EffectsControllerRequestStream {
278 type Protocol = EffectsControllerMarker;
279 type ControlHandle = EffectsControllerControlHandle;
280
281 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
282 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
283 }
284
285 fn control_handle(&self) -> Self::ControlHandle {
286 EffectsControllerControlHandle { inner: self.inner.clone() }
287 }
288
289 fn into_inner(
290 self,
291 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
292 {
293 (self.inner, self.is_terminated)
294 }
295
296 fn from_inner(
297 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
298 is_terminated: bool,
299 ) -> Self {
300 Self { inner, is_terminated }
301 }
302}
303
304impl futures::Stream for EffectsControllerRequestStream {
305 type Item = Result<EffectsControllerRequest, fidl::Error>;
306
307 fn poll_next(
308 mut self: std::pin::Pin<&mut Self>,
309 cx: &mut std::task::Context<'_>,
310 ) -> std::task::Poll<Option<Self::Item>> {
311 let this = &mut *self;
312 if this.inner.check_shutdown(cx) {
313 this.is_terminated = true;
314 return std::task::Poll::Ready(None);
315 }
316 if this.is_terminated {
317 panic!("polled EffectsControllerRequestStream after completion");
318 }
319 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
320 |bytes, handles| {
321 match this.inner.channel().read_etc(cx, bytes, handles) {
322 std::task::Poll::Ready(Ok(())) => {}
323 std::task::Poll::Pending => return std::task::Poll::Pending,
324 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
325 this.is_terminated = true;
326 return std::task::Poll::Ready(None);
327 }
328 std::task::Poll::Ready(Err(e)) => {
329 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
330 e.into(),
331 ))))
332 }
333 }
334
335 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
337
338 std::task::Poll::Ready(Some(match header.ordinal {
339 0x4e39e4b5e6279125 => {
340 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
341 let mut req = fidl::new_empty!(
342 EffectsControllerUpdateEffectRequest,
343 fidl::encoding::DefaultFuchsiaResourceDialect
344 );
345 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EffectsControllerUpdateEffectRequest>(&header, _body_bytes, handles, &mut req)?;
346 let control_handle =
347 EffectsControllerControlHandle { inner: this.inner.clone() };
348 Ok(EffectsControllerRequest::UpdateEffect {
349 effect_name: req.effect_name,
350 config: req.config,
351
352 responder: EffectsControllerUpdateEffectResponder {
353 control_handle: std::mem::ManuallyDrop::new(control_handle),
354 tx_id: header.tx_id,
355 },
356 })
357 }
358 _ => Err(fidl::Error::UnknownOrdinal {
359 ordinal: header.ordinal,
360 protocol_name:
361 <EffectsControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
362 }),
363 }))
364 },
365 )
366 }
367}
368
369#[derive(Debug)]
370pub enum EffectsControllerRequest {
371 UpdateEffect {
389 effect_name: String,
390 config: String,
391 responder: EffectsControllerUpdateEffectResponder,
392 },
393}
394
395impl EffectsControllerRequest {
396 #[allow(irrefutable_let_patterns)]
397 pub fn into_update_effect(
398 self,
399 ) -> Option<(String, String, EffectsControllerUpdateEffectResponder)> {
400 if let EffectsControllerRequest::UpdateEffect { effect_name, config, responder } = self {
401 Some((effect_name, config, responder))
402 } else {
403 None
404 }
405 }
406
407 pub fn method_name(&self) -> &'static str {
409 match *self {
410 EffectsControllerRequest::UpdateEffect { .. } => "update_effect",
411 }
412 }
413}
414
415#[derive(Debug, Clone)]
416pub struct EffectsControllerControlHandle {
417 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
418}
419
420impl fidl::endpoints::ControlHandle for EffectsControllerControlHandle {
421 fn shutdown(&self) {
422 self.inner.shutdown()
423 }
424 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
425 self.inner.shutdown_with_epitaph(status)
426 }
427
428 fn is_closed(&self) -> bool {
429 self.inner.channel().is_closed()
430 }
431 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
432 self.inner.channel().on_closed()
433 }
434
435 #[cfg(target_os = "fuchsia")]
436 fn signal_peer(
437 &self,
438 clear_mask: zx::Signals,
439 set_mask: zx::Signals,
440 ) -> Result<(), zx_status::Status> {
441 use fidl::Peered;
442 self.inner.channel().signal_peer(clear_mask, set_mask)
443 }
444}
445
446impl EffectsControllerControlHandle {}
447
448#[must_use = "FIDL methods require a response to be sent"]
449#[derive(Debug)]
450pub struct EffectsControllerUpdateEffectResponder {
451 control_handle: std::mem::ManuallyDrop<EffectsControllerControlHandle>,
452 tx_id: u32,
453}
454
455impl std::ops::Drop for EffectsControllerUpdateEffectResponder {
459 fn drop(&mut self) {
460 self.control_handle.shutdown();
461 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
463 }
464}
465
466impl fidl::endpoints::Responder for EffectsControllerUpdateEffectResponder {
467 type ControlHandle = EffectsControllerControlHandle;
468
469 fn control_handle(&self) -> &EffectsControllerControlHandle {
470 &self.control_handle
471 }
472
473 fn drop_without_shutdown(mut self) {
474 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
476 std::mem::forget(self);
478 }
479}
480
481impl EffectsControllerUpdateEffectResponder {
482 pub fn send(self, mut result: Result<(), UpdateEffectError>) -> Result<(), fidl::Error> {
486 let _result = self.send_raw(result);
487 if _result.is_err() {
488 self.control_handle.shutdown();
489 }
490 self.drop_without_shutdown();
491 _result
492 }
493
494 pub fn send_no_shutdown_on_err(
496 self,
497 mut result: Result<(), UpdateEffectError>,
498 ) -> Result<(), fidl::Error> {
499 let _result = self.send_raw(result);
500 self.drop_without_shutdown();
501 _result
502 }
503
504 fn send_raw(&self, mut result: Result<(), UpdateEffectError>) -> Result<(), fidl::Error> {
505 self.control_handle.inner.send::<fidl::encoding::ResultType<
506 fidl::encoding::EmptyStruct,
507 UpdateEffectError,
508 >>(
509 result,
510 self.tx_id,
511 0x4e39e4b5e6279125,
512 fidl::encoding::DynamicFlags::empty(),
513 )
514 }
515}
516
517#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
518pub struct GainControlMarker;
519
520impl fidl::endpoints::ProtocolMarker for GainControlMarker {
521 type Proxy = GainControlProxy;
522 type RequestStream = GainControlRequestStream;
523 #[cfg(target_os = "fuchsia")]
524 type SynchronousProxy = GainControlSynchronousProxy;
525
526 const DEBUG_NAME: &'static str = "(anonymous) GainControl";
527}
528
529pub trait GainControlProxyInterface: Send + Sync {
530 fn r#set_gain(&self, gain_db: f32) -> Result<(), fidl::Error>;
531 fn r#set_gain_with_ramp(
532 &self,
533 gain_db: f32,
534 duration: i64,
535 ramp_type: RampType,
536 ) -> Result<(), fidl::Error>;
537 fn r#set_mute(&self, muted: bool) -> Result<(), fidl::Error>;
538}
539#[derive(Debug)]
540#[cfg(target_os = "fuchsia")]
541pub struct GainControlSynchronousProxy {
542 client: fidl::client::sync::Client,
543}
544
545#[cfg(target_os = "fuchsia")]
546impl fidl::endpoints::SynchronousProxy for GainControlSynchronousProxy {
547 type Proxy = GainControlProxy;
548 type Protocol = GainControlMarker;
549
550 fn from_channel(inner: fidl::Channel) -> Self {
551 Self::new(inner)
552 }
553
554 fn into_channel(self) -> fidl::Channel {
555 self.client.into_channel()
556 }
557
558 fn as_channel(&self) -> &fidl::Channel {
559 self.client.as_channel()
560 }
561}
562
563#[cfg(target_os = "fuchsia")]
564impl GainControlSynchronousProxy {
565 pub fn new(channel: fidl::Channel) -> Self {
566 let protocol_name = <GainControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
567 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
568 }
569
570 pub fn into_channel(self) -> fidl::Channel {
571 self.client.into_channel()
572 }
573
574 pub fn wait_for_event(
577 &self,
578 deadline: zx::MonotonicInstant,
579 ) -> Result<GainControlEvent, fidl::Error> {
580 GainControlEvent::decode(self.client.wait_for_event(deadline)?)
581 }
582
583 pub fn r#set_gain(&self, mut gain_db: f32) -> Result<(), fidl::Error> {
585 self.client.send::<GainControlSetGainRequest>(
586 (gain_db,),
587 0x2fc070871d033f64,
588 fidl::encoding::DynamicFlags::empty(),
589 )
590 }
591
592 pub fn r#set_gain_with_ramp(
629 &self,
630 mut gain_db: f32,
631 mut duration: i64,
632 mut ramp_type: RampType,
633 ) -> Result<(), fidl::Error> {
634 self.client.send::<GainControlSetGainWithRampRequest>(
635 (gain_db, duration, ramp_type),
636 0x3a175b2d6979e8ea,
637 fidl::encoding::DynamicFlags::empty(),
638 )
639 }
640
641 pub fn r#set_mute(&self, mut muted: bool) -> Result<(), fidl::Error> {
644 self.client.send::<GainControlSetMuteRequest>(
645 (muted,),
646 0x5415723c1e31448,
647 fidl::encoding::DynamicFlags::empty(),
648 )
649 }
650}
651
652#[derive(Debug, Clone)]
653pub struct GainControlProxy {
654 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
655}
656
657impl fidl::endpoints::Proxy for GainControlProxy {
658 type Protocol = GainControlMarker;
659
660 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
661 Self::new(inner)
662 }
663
664 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
665 self.client.into_channel().map_err(|client| Self { client })
666 }
667
668 fn as_channel(&self) -> &::fidl::AsyncChannel {
669 self.client.as_channel()
670 }
671}
672
673impl GainControlProxy {
674 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
676 let protocol_name = <GainControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
677 Self { client: fidl::client::Client::new(channel, protocol_name) }
678 }
679
680 pub fn take_event_stream(&self) -> GainControlEventStream {
686 GainControlEventStream { event_receiver: self.client.take_event_receiver() }
687 }
688
689 pub fn r#set_gain(&self, mut gain_db: f32) -> Result<(), fidl::Error> {
691 GainControlProxyInterface::r#set_gain(self, gain_db)
692 }
693
694 pub fn r#set_gain_with_ramp(
731 &self,
732 mut gain_db: f32,
733 mut duration: i64,
734 mut ramp_type: RampType,
735 ) -> Result<(), fidl::Error> {
736 GainControlProxyInterface::r#set_gain_with_ramp(self, gain_db, duration, ramp_type)
737 }
738
739 pub fn r#set_mute(&self, mut muted: bool) -> Result<(), fidl::Error> {
742 GainControlProxyInterface::r#set_mute(self, muted)
743 }
744}
745
746impl GainControlProxyInterface for GainControlProxy {
747 fn r#set_gain(&self, mut gain_db: f32) -> Result<(), fidl::Error> {
748 self.client.send::<GainControlSetGainRequest>(
749 (gain_db,),
750 0x2fc070871d033f64,
751 fidl::encoding::DynamicFlags::empty(),
752 )
753 }
754
755 fn r#set_gain_with_ramp(
756 &self,
757 mut gain_db: f32,
758 mut duration: i64,
759 mut ramp_type: RampType,
760 ) -> Result<(), fidl::Error> {
761 self.client.send::<GainControlSetGainWithRampRequest>(
762 (gain_db, duration, ramp_type),
763 0x3a175b2d6979e8ea,
764 fidl::encoding::DynamicFlags::empty(),
765 )
766 }
767
768 fn r#set_mute(&self, mut muted: bool) -> Result<(), fidl::Error> {
769 self.client.send::<GainControlSetMuteRequest>(
770 (muted,),
771 0x5415723c1e31448,
772 fidl::encoding::DynamicFlags::empty(),
773 )
774 }
775}
776
777pub struct GainControlEventStream {
778 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
779}
780
781impl std::marker::Unpin for GainControlEventStream {}
782
783impl futures::stream::FusedStream for GainControlEventStream {
784 fn is_terminated(&self) -> bool {
785 self.event_receiver.is_terminated()
786 }
787}
788
789impl futures::Stream for GainControlEventStream {
790 type Item = Result<GainControlEvent, fidl::Error>;
791
792 fn poll_next(
793 mut self: std::pin::Pin<&mut Self>,
794 cx: &mut std::task::Context<'_>,
795 ) -> std::task::Poll<Option<Self::Item>> {
796 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
797 &mut self.event_receiver,
798 cx
799 )?) {
800 Some(buf) => std::task::Poll::Ready(Some(GainControlEvent::decode(buf))),
801 None => std::task::Poll::Ready(None),
802 }
803 }
804}
805
806#[derive(Debug)]
807pub enum GainControlEvent {
808 OnGainMuteChanged { gain_db: f32, muted: bool },
809}
810
811impl GainControlEvent {
812 #[allow(irrefutable_let_patterns)]
813 pub fn into_on_gain_mute_changed(self) -> Option<(f32, bool)> {
814 if let GainControlEvent::OnGainMuteChanged { gain_db, muted } = self {
815 Some((gain_db, muted))
816 } else {
817 None
818 }
819 }
820
821 fn decode(
823 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
824 ) -> Result<GainControlEvent, fidl::Error> {
825 let (bytes, _handles) = buf.split_mut();
826 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
827 debug_assert_eq!(tx_header.tx_id, 0);
828 match tx_header.ordinal {
829 0x66d528cad4e0d753 => {
830 let mut out = fidl::new_empty!(
831 GainControlOnGainMuteChangedRequest,
832 fidl::encoding::DefaultFuchsiaResourceDialect
833 );
834 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GainControlOnGainMuteChangedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
835 Ok((GainControlEvent::OnGainMuteChanged { gain_db: out.gain_db, muted: out.muted }))
836 }
837 _ => Err(fidl::Error::UnknownOrdinal {
838 ordinal: tx_header.ordinal,
839 protocol_name: <GainControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
840 }),
841 }
842 }
843}
844
845pub struct GainControlRequestStream {
847 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
848 is_terminated: bool,
849}
850
851impl std::marker::Unpin for GainControlRequestStream {}
852
853impl futures::stream::FusedStream for GainControlRequestStream {
854 fn is_terminated(&self) -> bool {
855 self.is_terminated
856 }
857}
858
859impl fidl::endpoints::RequestStream for GainControlRequestStream {
860 type Protocol = GainControlMarker;
861 type ControlHandle = GainControlControlHandle;
862
863 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
864 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
865 }
866
867 fn control_handle(&self) -> Self::ControlHandle {
868 GainControlControlHandle { inner: self.inner.clone() }
869 }
870
871 fn into_inner(
872 self,
873 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
874 {
875 (self.inner, self.is_terminated)
876 }
877
878 fn from_inner(
879 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
880 is_terminated: bool,
881 ) -> Self {
882 Self { inner, is_terminated }
883 }
884}
885
886impl futures::Stream for GainControlRequestStream {
887 type Item = Result<GainControlRequest, fidl::Error>;
888
889 fn poll_next(
890 mut self: std::pin::Pin<&mut Self>,
891 cx: &mut std::task::Context<'_>,
892 ) -> std::task::Poll<Option<Self::Item>> {
893 let this = &mut *self;
894 if this.inner.check_shutdown(cx) {
895 this.is_terminated = true;
896 return std::task::Poll::Ready(None);
897 }
898 if this.is_terminated {
899 panic!("polled GainControlRequestStream after completion");
900 }
901 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
902 |bytes, handles| {
903 match this.inner.channel().read_etc(cx, bytes, handles) {
904 std::task::Poll::Ready(Ok(())) => {}
905 std::task::Poll::Pending => return std::task::Poll::Pending,
906 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
907 this.is_terminated = true;
908 return std::task::Poll::Ready(None);
909 }
910 std::task::Poll::Ready(Err(e)) => {
911 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
912 e.into(),
913 ))))
914 }
915 }
916
917 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
919
920 std::task::Poll::Ready(Some(match header.ordinal {
921 0x2fc070871d033f64 => {
922 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
923 let mut req = fidl::new_empty!(
924 GainControlSetGainRequest,
925 fidl::encoding::DefaultFuchsiaResourceDialect
926 );
927 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GainControlSetGainRequest>(&header, _body_bytes, handles, &mut req)?;
928 let control_handle = GainControlControlHandle { inner: this.inner.clone() };
929 Ok(GainControlRequest::SetGain { gain_db: req.gain_db, control_handle })
930 }
931 0x3a175b2d6979e8ea => {
932 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
933 let mut req = fidl::new_empty!(
934 GainControlSetGainWithRampRequest,
935 fidl::encoding::DefaultFuchsiaResourceDialect
936 );
937 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GainControlSetGainWithRampRequest>(&header, _body_bytes, handles, &mut req)?;
938 let control_handle = GainControlControlHandle { inner: this.inner.clone() };
939 Ok(GainControlRequest::SetGainWithRamp {
940 gain_db: req.gain_db,
941 duration: req.duration,
942 ramp_type: req.ramp_type,
943
944 control_handle,
945 })
946 }
947 0x5415723c1e31448 => {
948 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
949 let mut req = fidl::new_empty!(
950 GainControlSetMuteRequest,
951 fidl::encoding::DefaultFuchsiaResourceDialect
952 );
953 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GainControlSetMuteRequest>(&header, _body_bytes, handles, &mut req)?;
954 let control_handle = GainControlControlHandle { inner: this.inner.clone() };
955 Ok(GainControlRequest::SetMute { muted: req.muted, control_handle })
956 }
957 _ => Err(fidl::Error::UnknownOrdinal {
958 ordinal: header.ordinal,
959 protocol_name:
960 <GainControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
961 }),
962 }))
963 },
964 )
965 }
966}
967
968#[derive(Debug)]
973pub enum GainControlRequest {
974 SetGain { gain_db: f32, control_handle: GainControlControlHandle },
976 SetGainWithRamp {
1013 gain_db: f32,
1014 duration: i64,
1015 ramp_type: RampType,
1016 control_handle: GainControlControlHandle,
1017 },
1018 SetMute { muted: bool, control_handle: GainControlControlHandle },
1021}
1022
1023impl GainControlRequest {
1024 #[allow(irrefutable_let_patterns)]
1025 pub fn into_set_gain(self) -> Option<(f32, GainControlControlHandle)> {
1026 if let GainControlRequest::SetGain { gain_db, control_handle } = self {
1027 Some((gain_db, control_handle))
1028 } else {
1029 None
1030 }
1031 }
1032
1033 #[allow(irrefutable_let_patterns)]
1034 pub fn into_set_gain_with_ramp(self) -> Option<(f32, i64, RampType, GainControlControlHandle)> {
1035 if let GainControlRequest::SetGainWithRamp {
1036 gain_db,
1037 duration,
1038 ramp_type,
1039 control_handle,
1040 } = self
1041 {
1042 Some((gain_db, duration, ramp_type, control_handle))
1043 } else {
1044 None
1045 }
1046 }
1047
1048 #[allow(irrefutable_let_patterns)]
1049 pub fn into_set_mute(self) -> Option<(bool, GainControlControlHandle)> {
1050 if let GainControlRequest::SetMute { muted, control_handle } = self {
1051 Some((muted, control_handle))
1052 } else {
1053 None
1054 }
1055 }
1056
1057 pub fn method_name(&self) -> &'static str {
1059 match *self {
1060 GainControlRequest::SetGain { .. } => "set_gain",
1061 GainControlRequest::SetGainWithRamp { .. } => "set_gain_with_ramp",
1062 GainControlRequest::SetMute { .. } => "set_mute",
1063 }
1064 }
1065}
1066
1067#[derive(Debug, Clone)]
1068pub struct GainControlControlHandle {
1069 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1070}
1071
1072impl fidl::endpoints::ControlHandle for GainControlControlHandle {
1073 fn shutdown(&self) {
1074 self.inner.shutdown()
1075 }
1076 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1077 self.inner.shutdown_with_epitaph(status)
1078 }
1079
1080 fn is_closed(&self) -> bool {
1081 self.inner.channel().is_closed()
1082 }
1083 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1084 self.inner.channel().on_closed()
1085 }
1086
1087 #[cfg(target_os = "fuchsia")]
1088 fn signal_peer(
1089 &self,
1090 clear_mask: zx::Signals,
1091 set_mask: zx::Signals,
1092 ) -> Result<(), zx_status::Status> {
1093 use fidl::Peered;
1094 self.inner.channel().signal_peer(clear_mask, set_mask)
1095 }
1096}
1097
1098impl GainControlControlHandle {
1099 pub fn send_on_gain_mute_changed(
1100 &self,
1101 mut gain_db: f32,
1102 mut muted: bool,
1103 ) -> Result<(), fidl::Error> {
1104 self.inner.send::<GainControlOnGainMuteChangedRequest>(
1105 (gain_db, muted),
1106 0,
1107 0x66d528cad4e0d753,
1108 fidl::encoding::DynamicFlags::empty(),
1109 )
1110 }
1111}
1112
1113#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1114pub struct VolumeControlMarker;
1115
1116impl fidl::endpoints::ProtocolMarker for VolumeControlMarker {
1117 type Proxy = VolumeControlProxy;
1118 type RequestStream = VolumeControlRequestStream;
1119 #[cfg(target_os = "fuchsia")]
1120 type SynchronousProxy = VolumeControlSynchronousProxy;
1121
1122 const DEBUG_NAME: &'static str = "(anonymous) VolumeControl";
1123}
1124
1125pub trait VolumeControlProxyInterface: Send + Sync {
1126 fn r#set_volume(&self, volume: f32) -> Result<(), fidl::Error>;
1127 fn r#set_mute(&self, mute: bool) -> Result<(), fidl::Error>;
1128}
1129#[derive(Debug)]
1130#[cfg(target_os = "fuchsia")]
1131pub struct VolumeControlSynchronousProxy {
1132 client: fidl::client::sync::Client,
1133}
1134
1135#[cfg(target_os = "fuchsia")]
1136impl fidl::endpoints::SynchronousProxy for VolumeControlSynchronousProxy {
1137 type Proxy = VolumeControlProxy;
1138 type Protocol = VolumeControlMarker;
1139
1140 fn from_channel(inner: fidl::Channel) -> Self {
1141 Self::new(inner)
1142 }
1143
1144 fn into_channel(self) -> fidl::Channel {
1145 self.client.into_channel()
1146 }
1147
1148 fn as_channel(&self) -> &fidl::Channel {
1149 self.client.as_channel()
1150 }
1151}
1152
1153#[cfg(target_os = "fuchsia")]
1154impl VolumeControlSynchronousProxy {
1155 pub fn new(channel: fidl::Channel) -> Self {
1156 let protocol_name = <VolumeControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1157 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1158 }
1159
1160 pub fn into_channel(self) -> fidl::Channel {
1161 self.client.into_channel()
1162 }
1163
1164 pub fn wait_for_event(
1167 &self,
1168 deadline: zx::MonotonicInstant,
1169 ) -> Result<VolumeControlEvent, fidl::Error> {
1170 VolumeControlEvent::decode(self.client.wait_for_event(deadline)?)
1171 }
1172
1173 pub fn r#set_volume(&self, mut volume: f32) -> Result<(), fidl::Error> {
1177 self.client.send::<VolumeControlSetVolumeRequest>(
1178 (volume,),
1179 0x6ff4231809a697da,
1180 fidl::encoding::DynamicFlags::empty(),
1181 )
1182 }
1183
1184 pub fn r#set_mute(&self, mut mute: bool) -> Result<(), fidl::Error> {
1189 self.client.send::<VolumeControlSetMuteRequest>(
1190 (mute,),
1191 0x50c10c28bba46425,
1192 fidl::encoding::DynamicFlags::empty(),
1193 )
1194 }
1195}
1196
1197#[derive(Debug, Clone)]
1198pub struct VolumeControlProxy {
1199 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1200}
1201
1202impl fidl::endpoints::Proxy for VolumeControlProxy {
1203 type Protocol = VolumeControlMarker;
1204
1205 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1206 Self::new(inner)
1207 }
1208
1209 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1210 self.client.into_channel().map_err(|client| Self { client })
1211 }
1212
1213 fn as_channel(&self) -> &::fidl::AsyncChannel {
1214 self.client.as_channel()
1215 }
1216}
1217
1218impl VolumeControlProxy {
1219 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1221 let protocol_name = <VolumeControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1222 Self { client: fidl::client::Client::new(channel, protocol_name) }
1223 }
1224
1225 pub fn take_event_stream(&self) -> VolumeControlEventStream {
1231 VolumeControlEventStream { event_receiver: self.client.take_event_receiver() }
1232 }
1233
1234 pub fn r#set_volume(&self, mut volume: f32) -> Result<(), fidl::Error> {
1238 VolumeControlProxyInterface::r#set_volume(self, volume)
1239 }
1240
1241 pub fn r#set_mute(&self, mut mute: bool) -> Result<(), fidl::Error> {
1246 VolumeControlProxyInterface::r#set_mute(self, mute)
1247 }
1248}
1249
1250impl VolumeControlProxyInterface for VolumeControlProxy {
1251 fn r#set_volume(&self, mut volume: f32) -> Result<(), fidl::Error> {
1252 self.client.send::<VolumeControlSetVolumeRequest>(
1253 (volume,),
1254 0x6ff4231809a697da,
1255 fidl::encoding::DynamicFlags::empty(),
1256 )
1257 }
1258
1259 fn r#set_mute(&self, mut mute: bool) -> Result<(), fidl::Error> {
1260 self.client.send::<VolumeControlSetMuteRequest>(
1261 (mute,),
1262 0x50c10c28bba46425,
1263 fidl::encoding::DynamicFlags::empty(),
1264 )
1265 }
1266}
1267
1268pub struct VolumeControlEventStream {
1269 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1270}
1271
1272impl std::marker::Unpin for VolumeControlEventStream {}
1273
1274impl futures::stream::FusedStream for VolumeControlEventStream {
1275 fn is_terminated(&self) -> bool {
1276 self.event_receiver.is_terminated()
1277 }
1278}
1279
1280impl futures::Stream for VolumeControlEventStream {
1281 type Item = Result<VolumeControlEvent, fidl::Error>;
1282
1283 fn poll_next(
1284 mut self: std::pin::Pin<&mut Self>,
1285 cx: &mut std::task::Context<'_>,
1286 ) -> std::task::Poll<Option<Self::Item>> {
1287 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1288 &mut self.event_receiver,
1289 cx
1290 )?) {
1291 Some(buf) => std::task::Poll::Ready(Some(VolumeControlEvent::decode(buf))),
1292 None => std::task::Poll::Ready(None),
1293 }
1294 }
1295}
1296
1297#[derive(Debug)]
1298pub enum VolumeControlEvent {
1299 OnVolumeMuteChanged { new_volume: f32, new_muted: bool },
1300}
1301
1302impl VolumeControlEvent {
1303 #[allow(irrefutable_let_patterns)]
1304 pub fn into_on_volume_mute_changed(self) -> Option<(f32, bool)> {
1305 if let VolumeControlEvent::OnVolumeMuteChanged { new_volume, new_muted } = self {
1306 Some((new_volume, new_muted))
1307 } else {
1308 None
1309 }
1310 }
1311
1312 fn decode(
1314 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1315 ) -> Result<VolumeControlEvent, fidl::Error> {
1316 let (bytes, _handles) = buf.split_mut();
1317 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1318 debug_assert_eq!(tx_header.tx_id, 0);
1319 match tx_header.ordinal {
1320 0x9cea352bd86c171 => {
1321 let mut out = fidl::new_empty!(
1322 VolumeControlOnVolumeMuteChangedRequest,
1323 fidl::encoding::DefaultFuchsiaResourceDialect
1324 );
1325 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeControlOnVolumeMuteChangedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
1326 Ok((VolumeControlEvent::OnVolumeMuteChanged {
1327 new_volume: out.new_volume,
1328 new_muted: out.new_muted,
1329 }))
1330 }
1331 _ => Err(fidl::Error::UnknownOrdinal {
1332 ordinal: tx_header.ordinal,
1333 protocol_name: <VolumeControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1334 }),
1335 }
1336 }
1337}
1338
1339pub struct VolumeControlRequestStream {
1341 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1342 is_terminated: bool,
1343}
1344
1345impl std::marker::Unpin for VolumeControlRequestStream {}
1346
1347impl futures::stream::FusedStream for VolumeControlRequestStream {
1348 fn is_terminated(&self) -> bool {
1349 self.is_terminated
1350 }
1351}
1352
1353impl fidl::endpoints::RequestStream for VolumeControlRequestStream {
1354 type Protocol = VolumeControlMarker;
1355 type ControlHandle = VolumeControlControlHandle;
1356
1357 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1358 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1359 }
1360
1361 fn control_handle(&self) -> Self::ControlHandle {
1362 VolumeControlControlHandle { inner: self.inner.clone() }
1363 }
1364
1365 fn into_inner(
1366 self,
1367 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1368 {
1369 (self.inner, self.is_terminated)
1370 }
1371
1372 fn from_inner(
1373 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1374 is_terminated: bool,
1375 ) -> Self {
1376 Self { inner, is_terminated }
1377 }
1378}
1379
1380impl futures::Stream for VolumeControlRequestStream {
1381 type Item = Result<VolumeControlRequest, fidl::Error>;
1382
1383 fn poll_next(
1384 mut self: std::pin::Pin<&mut Self>,
1385 cx: &mut std::task::Context<'_>,
1386 ) -> std::task::Poll<Option<Self::Item>> {
1387 let this = &mut *self;
1388 if this.inner.check_shutdown(cx) {
1389 this.is_terminated = true;
1390 return std::task::Poll::Ready(None);
1391 }
1392 if this.is_terminated {
1393 panic!("polled VolumeControlRequestStream after completion");
1394 }
1395 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1396 |bytes, handles| {
1397 match this.inner.channel().read_etc(cx, bytes, handles) {
1398 std::task::Poll::Ready(Ok(())) => {}
1399 std::task::Poll::Pending => return std::task::Poll::Pending,
1400 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1401 this.is_terminated = true;
1402 return std::task::Poll::Ready(None);
1403 }
1404 std::task::Poll::Ready(Err(e)) => {
1405 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1406 e.into(),
1407 ))))
1408 }
1409 }
1410
1411 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1413
1414 std::task::Poll::Ready(Some(match header.ordinal {
1415 0x6ff4231809a697da => {
1416 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1417 let mut req = fidl::new_empty!(
1418 VolumeControlSetVolumeRequest,
1419 fidl::encoding::DefaultFuchsiaResourceDialect
1420 );
1421 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeControlSetVolumeRequest>(&header, _body_bytes, handles, &mut req)?;
1422 let control_handle =
1423 VolumeControlControlHandle { inner: this.inner.clone() };
1424 Ok(VolumeControlRequest::SetVolume { volume: req.volume, control_handle })
1425 }
1426 0x50c10c28bba46425 => {
1427 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1428 let mut req = fidl::new_empty!(
1429 VolumeControlSetMuteRequest,
1430 fidl::encoding::DefaultFuchsiaResourceDialect
1431 );
1432 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeControlSetMuteRequest>(&header, _body_bytes, handles, &mut req)?;
1433 let control_handle =
1434 VolumeControlControlHandle { inner: this.inner.clone() };
1435 Ok(VolumeControlRequest::SetMute { mute: req.mute, control_handle })
1436 }
1437 _ => Err(fidl::Error::UnknownOrdinal {
1438 ordinal: header.ordinal,
1439 protocol_name:
1440 <VolumeControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1441 }),
1442 }))
1443 },
1444 )
1445 }
1446}
1447
1448#[derive(Debug)]
1450pub enum VolumeControlRequest {
1451 SetVolume { volume: f32, control_handle: VolumeControlControlHandle },
1455 SetMute { mute: bool, control_handle: VolumeControlControlHandle },
1460}
1461
1462impl VolumeControlRequest {
1463 #[allow(irrefutable_let_patterns)]
1464 pub fn into_set_volume(self) -> Option<(f32, VolumeControlControlHandle)> {
1465 if let VolumeControlRequest::SetVolume { volume, control_handle } = self {
1466 Some((volume, control_handle))
1467 } else {
1468 None
1469 }
1470 }
1471
1472 #[allow(irrefutable_let_patterns)]
1473 pub fn into_set_mute(self) -> Option<(bool, VolumeControlControlHandle)> {
1474 if let VolumeControlRequest::SetMute { mute, control_handle } = self {
1475 Some((mute, control_handle))
1476 } else {
1477 None
1478 }
1479 }
1480
1481 pub fn method_name(&self) -> &'static str {
1483 match *self {
1484 VolumeControlRequest::SetVolume { .. } => "set_volume",
1485 VolumeControlRequest::SetMute { .. } => "set_mute",
1486 }
1487 }
1488}
1489
1490#[derive(Debug, Clone)]
1491pub struct VolumeControlControlHandle {
1492 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1493}
1494
1495impl fidl::endpoints::ControlHandle for VolumeControlControlHandle {
1496 fn shutdown(&self) {
1497 self.inner.shutdown()
1498 }
1499 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1500 self.inner.shutdown_with_epitaph(status)
1501 }
1502
1503 fn is_closed(&self) -> bool {
1504 self.inner.channel().is_closed()
1505 }
1506 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1507 self.inner.channel().on_closed()
1508 }
1509
1510 #[cfg(target_os = "fuchsia")]
1511 fn signal_peer(
1512 &self,
1513 clear_mask: zx::Signals,
1514 set_mask: zx::Signals,
1515 ) -> Result<(), zx_status::Status> {
1516 use fidl::Peered;
1517 self.inner.channel().signal_peer(clear_mask, set_mask)
1518 }
1519}
1520
1521impl VolumeControlControlHandle {
1522 pub fn send_on_volume_mute_changed(
1523 &self,
1524 mut new_volume: f32,
1525 mut new_muted: bool,
1526 ) -> Result<(), fidl::Error> {
1527 self.inner.send::<VolumeControlOnVolumeMuteChangedRequest>(
1528 (new_volume, new_muted),
1529 0,
1530 0x9cea352bd86c171,
1531 fidl::encoding::DynamicFlags::empty(),
1532 )
1533 }
1534}
1535
1536mod internal {
1537 use super::*;
1538}