File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ final class ConfigService {
7070 set { data. dimOuterArea = newValue; save ( ) }
7171 }
7272
73+ var isMicrophoneOn : Bool {
74+ get { data. isMicrophoneOn }
75+ set { data. isMicrophoneOn = newValue; save ( ) }
76+ }
77+
7378 var appearance : String {
7479 get { data. appearance }
7580 set { data. appearance = newValue; save ( ) ; applyAppearance ( ) }
@@ -144,6 +149,7 @@ private struct ConfigData: Codable {
144149 var projectFolder : String = " ~/Reframed "
145150 var retinaCapture : Bool = false
146151 var dimOuterArea : Bool = true
152+ var isMicrophoneOn : Bool = false
147153 var appearance : String = " system "
148154 var shortcuts : [ String : KeyboardShortcut ] = [ : ]
149155}
Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ final class SessionState {
2727
2828 weak var statusItemButton : NSStatusBarButton ?
2929
30+ init ( ) {
31+ if ConfigService . shared. isMicrophoneOn, options. selectedMicrophone != nil {
32+ isMicrophoneOn = true
33+ }
34+ }
35+
3036 private let logger = Logger ( label: " eu.jankuri.reframed.session " )
3137 private var selectionCoordinator : SelectionCoordinator ?
3238 private var windowSelectionCoordinator : WindowSelectionCoordinator ?
@@ -60,6 +66,7 @@ final class SessionState {
6066 func toggleMicrophone( ) {
6167 guard options. selectedMicrophone != nil else { return }
6268 isMicrophoneOn. toggle ( )
69+ ConfigService . shared. isMicrophoneOn = isMicrophoneOn
6370 }
6471
6572 private func startCameraPreview( ) {
@@ -460,6 +467,7 @@ final class SessionState {
460467 captureTarget = nil
461468 captureMode = . none
462469 stopCameraPreview ( )
470+ isCameraOn = false
463471 transition ( to: . idle)
464472 showToolbar ( )
465473 return
@@ -468,6 +476,7 @@ final class SessionState {
468476 recordingCoordinator = nil
469477 captureTarget = nil
470478 stopCameraPreview ( )
479+ isCameraOn = false
471480 devicePreviewWindow? . close ( )
472481 devicePreviewWindow = nil
473482 deviceCapture? . stop ( )
You can’t perform that action at this time.
0 commit comments