From ec44c4e4699e8e796389d45a1d78b873184f6c9c Mon Sep 17 00:00:00 2001 From: zhiayang Date: Mon, 7 Feb 2022 01:15:30 +0800 Subject: [PATCH] fix volume/mute bug for listen.moe backend --- MoeStreamer.xcodeproj/project.pbxproj | 4 ++-- MoeStreamer/src/audio/StreamAudioController.swift | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/MoeStreamer.xcodeproj/project.pbxproj b/MoeStreamer.xcodeproj/project.pbxproj index 0eb1426..44dc15e 100644 --- a/MoeStreamer.xcodeproj/project.pbxproj +++ b/MoeStreamer.xcodeproj/project.pbxproj @@ -653,7 +653,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.17.3; + MARKETING_VERSION = 0.17.4; PRODUCT_BUNDLE_IDENTIFIER = com.zhiayang.MoeStreamer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = ""; @@ -688,7 +688,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 0.17.3; + MARKETING_VERSION = 0.17.4; PRODUCT_BUNDLE_IDENTIFIER = com.zhiayang.MoeStreamer; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = ""; diff --git a/MoeStreamer/src/audio/StreamAudioController.swift b/MoeStreamer/src/audio/StreamAudioController.swift index 5e2c2d8..3fd1b34 100644 --- a/MoeStreamer/src/audio/StreamAudioController.swift +++ b/MoeStreamer/src/audio/StreamAudioController.swift @@ -67,18 +67,16 @@ class StreamAudioController : NSObject, AudioController, VLCMediaPlayerDelegate func mute() { - self.vlcMP.audio.volume = 0 self.muted = true + self.vlcMP.audio.volume = 0 Settings.set(.audioMuted(), value: true) } func unmute() { - let vol: Int = Settings.get(.audioVolume()) - - self.vlcMP.audio.volume = Int32(vol) self.muted = false + self.setVolume(volume: self.volume) Settings.set(.audioMuted(), value: false) }