@@ -12,35 +12,72 @@ public final class MicrophoneManager: ObservableObject, CallSettingsManager, @un
1212 /// The status of the microphone.
1313 @Published public internal( set) var status : CallSettingsStatus
1414 let state = CallSettingsState ( )
15-
15+
1616 init ( callController: CallController , initialStatus: CallSettingsStatus ) {
1717 self . callController = callController
1818 status = initialStatus
1919 }
20-
20+
2121 /// Toggles the microphone state.
22- public func toggle( ) async throws {
23- try await updateAudioStatus ( status. next)
22+ public func toggle(
23+ file: StaticString = #file,
24+ function: StaticString = #function,
25+ line: UInt = #line
26+ ) async throws {
27+ try await updateAudioStatus (
28+ status. next,
29+ file: file,
30+ function: function,
31+ line: line
32+ )
2433 }
25-
34+
2635 /// Enables the microphone.
27- public func enable( ) async throws {
28- try await updateAudioStatus ( . enabled)
36+ public func enable(
37+ file: StaticString = #file,
38+ function: StaticString = #function,
39+ line: UInt = #line
40+ ) async throws {
41+ try await updateAudioStatus (
42+ . enabled,
43+ file: file,
44+ function: function,
45+ line: line
46+ )
2947 }
30-
48+
3149 /// Disables the microphone.
32- public func disable( ) async throws {
33- try await updateAudioStatus ( . disabled)
50+ public func disable(
51+ file: StaticString = #file,
52+ function: StaticString = #function,
53+ line: UInt = #line
54+ ) async throws {
55+ try await updateAudioStatus (
56+ . disabled,
57+ file: file,
58+ function: function,
59+ line: line
60+ )
3461 }
3562
3663 // MARK: - private
3764
38- private func updateAudioStatus( _ status: CallSettingsStatus ) async throws {
65+ private func updateAudioStatus(
66+ _ status: CallSettingsStatus ,
67+ file: StaticString = #file,
68+ function: StaticString = #function,
69+ line: UInt = #line
70+ ) async throws {
3971 try await updateState (
4072 newState: status. boolValue,
4173 current: self . status. boolValue,
4274 action: { [ unowned self] state in
43- try await callController. changeAudioState ( isEnabled: state)
75+ try await callController. changeAudioState (
76+ isEnabled: state,
77+ file: file,
78+ function: function,
79+ line: line
80+ )
4481 } ,
4582 onUpdate: { _ in
4683 self . status = status
0 commit comments