@@ -32,6 +32,14 @@ pub enum DeepLinkAction {
3232 OpenSettings {
3333 page : Option < String > ,
3434 } ,
35+ PauseRecording ,
36+ ResumeRecording ,
37+ SwitchMicrophone {
38+ mic_label : Option < String > ,
39+ } ,
40+ SwitchCamera {
41+ camera : Option < DeviceOrModelID > ,
42+ } ,
3543}
3644
3745pub fn handle ( app_handle : & AppHandle , urls : Vec < Url > ) {
@@ -152,6 +160,32 @@ impl DeepLinkAction {
152160 DeepLinkAction :: OpenSettings { page } => {
153161 crate :: show_window ( app. clone ( ) , ShowCapWindow :: Settings { page } ) . await
154162 }
163+ DeepLinkAction :: PauseRecording => {
164+ let state = app. state :: < ArcLock < App > > ( ) ;
165+ let guard = state. read ( ) . await ;
166+ if let Some ( recording) = guard. current_recording ( ) {
167+ recording. pause ( ) . await . map_err ( |e| e. to_string ( ) )
168+ } else {
169+ Ok ( ( ) )
170+ }
171+ }
172+ DeepLinkAction :: ResumeRecording => {
173+ let state = app. state :: < ArcLock < App > > ( ) ;
174+ let guard = state. read ( ) . await ;
175+ if let Some ( recording) = guard. current_recording ( ) {
176+ recording. resume ( ) . await . map_err ( |e| e. to_string ( ) )
177+ } else {
178+ Ok ( ( ) )
179+ }
180+ }
181+ DeepLinkAction :: SwitchMicrophone { mic_label } => {
182+ let state = app. state :: < ArcLock < App > > ( ) ;
183+ crate :: set_mic_input ( state, mic_label) . await
184+ }
185+ DeepLinkAction :: SwitchCamera { camera } => {
186+ let state = app. state :: < ArcLock < App > > ( ) ;
187+ crate :: set_camera_input ( app. clone ( ) , state, camera) . await
188+ }
155189 }
156190 }
157191}
0 commit comments