File tree Expand file tree Collapse file tree 5 files changed +50
-0
lines changed
Expand file tree Collapse file tree 5 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,16 @@ pub struct Device(Option<AudioDeviceInfo>);
117117
118118pub struct DuplexStream ( pub crate :: duplex:: UnsupportedDuplexStream ) ;
119119
120+ impl StreamTrait for DuplexStream {
121+ fn play ( & self ) -> Result < ( ) , PlayStreamError > {
122+ StreamTrait :: play ( & self . 0 )
123+ }
124+
125+ fn pause ( & self ) -> Result < ( ) , PauseStreamError > {
126+ StreamTrait :: pause ( & self . 0 )
127+ }
128+ }
129+
120130/// Stream wraps AudioStream in Arc<Mutex<>> to provide Send + Sync semantics.
121131///
122132/// While the underlying ndk::audio::AudioStream is neither Send nor Sync in ndk 0.9.0
Original file line number Diff line number Diff line change @@ -90,6 +90,16 @@ const LIBC_ENOTSUPP: libc::c_int = 524;
9090
9191pub struct DuplexStream ( pub crate :: duplex:: UnsupportedDuplexStream ) ;
9292
93+ impl crate :: traits:: StreamTrait for DuplexStream {
94+ fn play ( & self ) -> Result < ( ) , crate :: PlayStreamError > {
95+ crate :: traits:: StreamTrait :: play ( & self . 0 )
96+ }
97+
98+ fn pause ( & self ) -> Result < ( ) , crate :: PauseStreamError > {
99+ crate :: traits:: StreamTrait :: pause ( & self . 0 )
100+ }
101+ }
102+
93103/// The default Linux and BSD host type.
94104#[ derive( Debug , Clone ) ]
95105pub struct Host {
Original file line number Diff line number Diff line change @@ -23,6 +23,16 @@ mod stream;
2323
2424pub struct DuplexStream ( pub crate :: duplex:: UnsupportedDuplexStream ) ;
2525
26+ impl StreamTrait for DuplexStream {
27+ fn play ( & self ) -> Result < ( ) , PlayStreamError > {
28+ StreamTrait :: play ( & self . 0 )
29+ }
30+
31+ fn pause ( & self ) -> Result < ( ) , PauseStreamError > {
32+ StreamTrait :: pause ( & self . 0 )
33+ }
34+ }
35+
2636/// Global ASIO instance shared across all Host instances.
2737///
2838/// ASIO only supports loading a single driver at a time globally, so all Host instances
Original file line number Diff line number Diff line change @@ -29,6 +29,16 @@ crate::assert_stream_sync!(Stream);
2929
3030pub struct DuplexStream ( pub crate :: duplex:: UnsupportedDuplexStream ) ;
3131
32+ impl StreamTrait for DuplexStream {
33+ fn play ( & self ) -> Result < ( ) , PlayStreamError > {
34+ StreamTrait :: play ( & self . 0 )
35+ }
36+
37+ fn pause ( & self ) -> Result < ( ) , PauseStreamError > {
38+ StreamTrait :: pause ( & self . 0 )
39+ }
40+ }
41+
3242#[ derive( Clone ) ]
3343pub struct SupportedInputConfigs ;
3444#[ derive( Clone ) ]
Original file line number Diff line number Diff line change @@ -17,6 +17,16 @@ use windows::Win32::Media::Audio;
1717
1818pub struct DuplexStream ( pub crate :: duplex:: UnsupportedDuplexStream ) ;
1919
20+ impl StreamTrait for DuplexStream {
21+ fn play ( & self ) -> Result < ( ) , crate :: PlayStreamError > {
22+ StreamTrait :: play ( & self . 0 )
23+ }
24+
25+ fn pause ( & self ) -> Result < ( ) , crate :: PauseStreamError > {
26+ StreamTrait :: pause ( & self . 0 )
27+ }
28+ }
29+
2030mod com;
2131mod device;
2232mod stream;
You can’t perform that action at this time.
0 commit comments