diff --git a/Cores/DeltaCore b/Cores/DeltaCore index 79b370bf..cff3ba4f 160000 --- a/Cores/DeltaCore +++ b/Cores/DeltaCore @@ -1 +1 @@ -Subproject commit 79b370bf27a715ac7ac15eeaf0ff8102fa58626e +Subproject commit cff3ba4f99d3a389528e333331071ccfa1c89916 diff --git a/Ignited/Emulation/GameViewController.swift b/Ignited/Emulation/GameViewController.swift index 44d4386f..8588fc04 100644 --- a/Ignited/Emulation/GameViewController.swift +++ b/Ignited/Emulation/GameViewController.swift @@ -1329,6 +1329,8 @@ private extension GameViewController func updateEmulationSpeed() { self.emulatorCore?.rate = Settings.gameplayFeatures.quickSettings.fastForwardSpeed + + self.updateAudio() } func updateControllerSkinCustomization() @@ -1950,6 +1952,13 @@ private extension GameViewController self.emulatorCore?.audioManager.playWithOtherMedia = Settings.gameplayFeatures.gameAudio.playOver } + let isFastForwarding = self.emulatorCore?.rate != self.emulatorCore?.deltaCore.supportedRates.lowerBound + let mutedByFastForward = Settings.gameplayFeatures.gameAudio.fastForwardMutes && isFastForwarding + + if self.emulatorCore?.audioManager.mutedByFastForward != mutedByFastForward { + self.emulatorCore?.audioManager.mutedByFastForward = mutedByFastForward + } + self.emulatorCore?.audioManager.audioVolume = Float(Settings.gameplayFeatures.gameAudio.volume) } } @@ -2440,6 +2449,8 @@ extension GameViewController { self.presentToastView(text: text) } + + self.updateAudio() } func updateFastForwardSpeed(speed: Double) @@ -2452,6 +2463,8 @@ extension GameViewController { emulatorCore.rate = speed } + + self.updateAudio() } func performQuickSettingsAction() @@ -3194,7 +3207,7 @@ private extension GameViewController case Settings.snesFeatures.allowInvalidVRAMAccess.settingsKey: self.updateCoreSettings() - case Settings.gameplayFeatures.gameAudio.$respectSilent.settingsKey, Settings.gameplayFeatures.gameAudio.$playOver.settingsKey, Settings.gameplayFeatures.gameAudio.$volume.settingsKey: + case Settings.gameplayFeatures.gameAudio.$respectSilent.settingsKey, Settings.gameplayFeatures.gameAudio.$playOver.settingsKey, Settings.gameplayFeatures.gameAudio.$volume.settingsKey, Settings.gameplayFeatures.gameAudio.$fastForwardMutes.settingsKey: self.updateAudio() case Settings.touchFeedbackFeatures.touchAudio.$sound.settingsKey: diff --git a/Ignited/Features/Gameplay/GameAudioOptions.swift b/Ignited/Features/Gameplay/GameAudioOptions.swift index 315eba6f..c192321b 100644 --- a/Ignited/Features/Gameplay/GameAudioOptions.swift +++ b/Ignited/Features/Gameplay/GameAudioOptions.swift @@ -28,6 +28,10 @@ struct GameAudioOptions description: "Enable to play game audio over other media, such as voice chat or videos.") var playOver: Bool = true + @Option(name: "Mute During Fast Forward", + description: "Enable to mute game audio while fast forwarding.") + var fastForwardMutes: Bool = false + @Option(name: "Restore Defaults", description: "Reset all options to their default values.", detailView: { _ in diff --git a/Ignited/Quick Settings/QuickSettingsView.swift b/Ignited/Quick Settings/QuickSettingsView.swift index df89465b..d647fc03 100644 --- a/Ignited/Quick Settings/QuickSettingsView.swift +++ b/Ignited/Quick Settings/QuickSettingsView.swift @@ -201,6 +201,8 @@ struct QuickSettingsView: View .toggleStyle(SwitchToggleStyle(tint: .accentColor)) Toggle("Play Over Other Media", isOn: Settings.gameplayFeatures.gameAudio.$playOver.valueBinding) .toggleStyle(SwitchToggleStyle(tint: .accentColor)) + Toggle("Mute During Fast Forward", isOn: Settings.gameplayFeatures.gameAudio.$fastForwardMutes.valueBinding) + .toggleStyle(SwitchToggleStyle(tint: .accentColor)) } } } header: {