Removing Dead Code part 1 (#2234)

This commit is contained in:
Mauro
2023-12-13 09:51:57 +01:00
committed by GitHub
parent 09b276d94b
commit d99d26fcdc
88 changed files with 115 additions and 477 deletions
@@ -343,9 +343,9 @@ class AudioRecorder: AudioRecorderProtocol {
.store(in: &cancellables)
NotificationCenter.default.publisher(for: Notification.Name.AVAudioEngineConfigurationChange)
.sink { [weak self] notification in
.sink { [weak self] _ in
guard let self else { return }
self.handleConfigurationChange(notification: notification)
self.handleConfigurationChange()
}
.store(in: &cancellables)
@@ -396,7 +396,7 @@ class AudioRecorder: AudioRecorderProtocol {
}
}
func handleConfigurationChange(notification: Notification) {
func handleConfigurationChange() {
guard let audioEngine else { return }
MXLog.warning("Configuration changed: \(audioEngine.inputNode.inputFormat(forBus: 0))")
if internalState != .suspended {
@@ -24,7 +24,6 @@ enum AudioRecorderError: Error, Equatable {
case audioFileCreationFailure
case interrupted
case recordingCancelled
case recordingFailed
case recordPermissionNotGranted
}
@@ -57,7 +57,7 @@ class AudioRecorderState: ObservableObject, Identifiable {
recordingState = .stopped
}
func reportError(_ error: Error) {
func reportError() {
recordingState = .error
}
@@ -98,6 +98,7 @@ class AudioRecorderState: ObservableObject, Identifiable {
displayLink?.add(to: .current, forMode: .common)
}
// periphery:ignore:parameters displayLink - required for objc selector
@objc private func publishUpdate(displayLink: CADisplayLink) {
if let currentTime = audioRecorder?.currentTime {
duration = currentTime