From 6aeb2166eb1a3a7b0ac88a72fd0b525fcc0833bd Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Fri, 15 Sep 2023 09:18:04 +0200 Subject: [PATCH] early-access version 3873 --- README.md | 2 +- .../main/java/org/yuzu/yuzu_emu/NativeLibrary.kt | 15 --------------- .../yuzu/yuzu_emu/activities/EmulationActivity.kt | 8 ++++---- .../features/settings/model/BooleanSetting.kt | 1 + src/android/app/src/main/jni/native.cpp | 12 ------------ 5 files changed, 6 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index cd616d18b..d5fd69078 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3872. +This is the source code for early-access 3873. ## Legal Notice diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt index c8706d7a6..21f67f32a 100755 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/NativeLibrary.kt @@ -307,21 +307,6 @@ object NativeLibrary { */ external fun isPaused(): Boolean - /** - * Mutes emulation sound - */ - external fun muteAudio(): Boolean - - /** - * Unmutes emulation sound - */ - external fun unmuteAudio(): Boolean - - /** - * Returns true if emulation audio is muted. - */ - external fun isMuted(): Boolean - /** * Returns the performance stats for the current game */ diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt index bbd328c71..d4ae39661 100755 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/activities/EmulationActivity.kt @@ -332,7 +332,7 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { pictureInPictureActions.add(pauseRemoteAction) } - if (NativeLibrary.isMuted()) { + if (BooleanSetting.AUDIO_MUTED.boolean) { val unmuteIcon = Icon.createWithResource( this@EmulationActivity, R.drawable.ic_pip_unmute @@ -389,9 +389,9 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { if (!NativeLibrary.isPaused()) NativeLibrary.pauseEmulation() } if (intent.action == actionUnmute) { - if (NativeLibrary.isMuted()) NativeLibrary.unmuteAudio() + if (BooleanSetting.AUDIO_MUTED.boolean) BooleanSetting.AUDIO_MUTED.setBoolean(false) } else if (intent.action == actionMute) { - if (!NativeLibrary.isMuted()) NativeLibrary.muteAudio() + if (!BooleanSetting.AUDIO_MUTED.boolean) BooleanSetting.AUDIO_MUTED.setBoolean(true) } buildPictureInPictureParams() } @@ -417,7 +417,7 @@ class EmulationActivity : AppCompatActivity(), SensorEventListener { } catch (ignored: Exception) { } // Always resume audio, since there is no UI button - if (NativeLibrary.isMuted()) NativeLibrary.unmuteAudio() + if (BooleanSetting.AUDIO_MUTED.boolean) BooleanSetting.AUDIO_MUTED.setBoolean(false) } } diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt index e0c0538c7..8476ce867 100755 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/BooleanSetting.kt @@ -10,6 +10,7 @@ enum class BooleanSetting( override val category: Settings.Category, override val androidDefault: Boolean? = null ) : AbstractBooleanSetting { + AUDIO_MUTED("audio_muted", Settings.Category.Audio), CPU_DEBUG_MODE("cpu_debug_mode", Settings.Category.Cpu), FASTMEM("cpuopt_fastmem", Settings.Category.Cpu), FASTMEM_EXCLUSIVES("cpuopt_fastmem_exclusives", Settings.Category.Cpu), diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 8a2021ff0..f31fe054b 100755 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp @@ -670,18 +670,6 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isPaused(JNIEnv* env, jclass claz return static_cast(EmulationSession::GetInstance().IsPaused()); } -void Java_org_yuzu_yuzu_1emu_NativeLibrary_muteAduio(JNIEnv* env, jclass clazz) { - Settings::values.audio_muted = true; -} - -void Java_org_yuzu_yuzu_1emu_NativeLibrary_unmuteAudio(JNIEnv* env, jclass clazz) { - Settings::values.audio_muted = false; -} - -jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isMuted(JNIEnv* env, jclass clazz) { - return static_cast(Settings::values.audio_muted.GetValue()); -} - jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isHandheldOnly(JNIEnv* env, jclass clazz) { return EmulationSession::GetInstance().IsHandheldOnly(); }