Set default audio resume delay to 0 seconds and rename to Resume Delay

This commit is contained in:
Beingpax 2025-12-31 19:21:13 +05:45
parent 9d0fc241ee
commit 0da24dc732
3 changed files with 10 additions and 13 deletions

View File

@ -18,10 +18,7 @@ class MediaController: ObservableObject {
}
}
@Published var audioResumptionDelay: Double = {
let value = UserDefaults.standard.double(forKey: "audioResumptionDelay")
return value < 1.0 ? 1.0 : value
}() {
@Published var audioResumptionDelay: Double = UserDefaults.standard.double(forKey: "audioResumptionDelay") {
didSet {
UserDefaults.standard.set(audioResumptionDelay, forKey: "audioResumptionDelay")
}
@ -33,9 +30,7 @@ class MediaController: ObservableObject {
}
if !UserDefaults.standard.contains(key: "audioResumptionDelay") {
UserDefaults.standard.set(1.0, forKey: "audioResumptionDelay")
} else if audioResumptionDelay < 1.0 {
audioResumptionDelay = 1.0
UserDefaults.standard.set(0.0, forKey: "audioResumptionDelay")
}
}

View File

@ -47,11 +47,12 @@ struct ExperimentalFeaturesSection: View {
expandedSections: $expandedSections
) {
HStack(spacing: 8) {
Text("Resumption Delay")
Text("Resume Delay")
.font(.system(size: 13, weight: .medium))
.foregroundColor(.secondary)
Picker("", selection: $mediaController.audioResumptionDelay) {
Text("0s").tag(0.0)
Text("1s").tag(1.0)
Text("2s").tag(2.0)
Text("3s").tag(3.0)
@ -62,8 +63,8 @@ struct ExperimentalFeaturesSection: View {
.frame(width: 80)
InfoTip(
title: "Audio Resumption Delay",
message: "Delay before resuming media playback after recording stops. Useful for Bluetooth headphones that need time to switch from microphone mode back to high-quality audio mode. Recommended: 2s for AirPods/Bluetooth headphones, 1s for wired headphones."
title: "Audio Resume Delay",
message: "Delay before resuming media playback after recording stops. Useful for Bluetooth headphones that need time to switch from microphone mode back to high-quality audio mode. Recommended: 2s for AirPods/Bluetooth headphones, 0s for wired headphones."
)
Spacer()

View File

@ -221,11 +221,12 @@ struct SettingsView: View {
expandedSections: $expandedSections
) {
HStack(spacing: 8) {
Text("Resumption Delay")
Text("Resume Delay")
.font(.system(size: 13, weight: .medium))
.foregroundColor(.secondary)
Picker("", selection: $mediaController.audioResumptionDelay) {
Text("0s").tag(0.0)
Text("1s").tag(1.0)
Text("2s").tag(2.0)
Text("3s").tag(3.0)
@ -236,8 +237,8 @@ struct SettingsView: View {
.frame(width: 80)
InfoTip(
title: "Audio Resumption Delay",
message: "Delay before unmuting system audio after recording stops. Useful for Bluetooth headphones that need time to switch from microphone mode back to high-quality audio mode. Recommended: 2s for AirPods/Bluetooth headphones, 1s for wired headphones."
title: "Audio Resume Delay",
message: "Delay before unmuting system audio after recording stops. Useful for Bluetooth headphones that need time to switch from microphone mode back to high-quality audio mode. Recommended: 2s for AirPods/Bluetooth headphones, 0s for wired headphones."
)
Spacer()