File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1
1
mod app;
2
2
mod browser;
3
+ mod mic;
3
4
mod utils;
4
5
5
6
pub use app:: * ;
6
7
pub use browser:: * ;
8
+ pub use mic:: * ;
9
+
7
10
use utils:: * ;
8
11
9
12
pub type DetectCallback = std:: sync:: Arc < dyn Fn ( String ) + Send + Sync + ' static > ;
@@ -24,6 +27,7 @@ trait Observer: Send + Sync {
24
27
pub struct Detector {
25
28
app_detector : AppDetector ,
26
29
browser_detector : BrowserDetector ,
30
+ mic_detector : MicDetector ,
27
31
}
28
32
29
33
impl Detector {
Original file line number Diff line number Diff line change
1
+ #[ derive( Default ) ]
2
+ pub struct Detector { }
3
+
4
+ impl crate :: Observer for Detector {
5
+ fn start ( & mut self , f : crate :: DetectCallback ) { }
6
+ fn stop ( & mut self ) { }
7
+ }
Original file line number Diff line number Diff line change
1
+ #[ cfg( target_os = "macos" ) ]
2
+ mod macos;
3
+ #[ cfg( target_os = "macos" ) ]
4
+ type PlatformDetector = macos:: Detector ;
5
+
6
+ #[ cfg( target_os = "windows" ) ]
7
+ mod windows;
8
+ #[ cfg( target_os = "windows" ) ]
9
+ type PlatformDetector = windows:: Detector ;
10
+
11
+ #[ derive( Default ) ]
12
+ pub struct MicDetector {
13
+ inner : PlatformDetector ,
14
+ }
15
+
16
+ impl crate :: Observer for MicDetector {
17
+ fn start ( & mut self , f : crate :: DetectCallback ) {
18
+ self . inner . start ( f) ;
19
+ }
20
+ fn stop ( & mut self ) {
21
+ self . inner . stop ( ) ;
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ #[ derive( Default ) ]
2
+ pub struct Detector { }
3
+
4
+ impl crate :: Observer for Detector {
5
+ fn start ( & mut self , f : crate :: DetectCallback ) { }
6
+ fn stop ( & mut self ) { }
7
+ }
You can’t perform that action at this time.
0 commit comments