From 1baf8a13ed1ae8882b8e419688f1fe196f419886 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:45:22 +0200 Subject: [PATCH] JNI driver: Add setAudioEnabled hook --- include/emulator.hpp | 2 +- src/jni_driver.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/emulator.hpp b/include/emulator.hpp index a668d6c11..abb74089b 100644 --- a/include/emulator.hpp +++ b/include/emulator.hpp @@ -66,7 +66,6 @@ class Emulator { #ifdef PANDA3DS_ENABLE_DISCORD_RPC Discord::RPC discordRpc; #endif - void setAudioEnabled(bool enable); void updateDiscord(); // Keep the handle for the ROM here to reload when necessary and to prevent deleting it @@ -99,6 +98,7 @@ class Emulator { void resume(); // Resume the emulator void pause(); // Pause the emulator void togglePause(); + void setAudioEnabled(bool enable); bool loadAmiibo(const std::filesystem::path& path); bool loadROM(const std::filesystem::path& path); diff --git a/src/jni_driver.cpp b/src/jni_driver.cpp index fbfae8ffd..60bbc6806 100644 --- a/src/jni_driver.cpp +++ b/src/jni_driver.cpp @@ -48,6 +48,11 @@ MAKE_SETTING(setAccurateShaderMulEnable, jboolean, accurateShaderMul) #undef MAKE_SETTING +AlberFunction(void, setAudioEnabled)(JNIEnv* env, jobject obj, jboolean value) { + emulator->getConfig().audioEnabled = value; + emulator->setAudioEnabled(value); +} + AlberFunction(void, Setup)(JNIEnv* env, jobject obj) { env->GetJavaVM(&jvm);