Skip to content

Commit

Permalink
JNI driver: Add setAudioEnabled hook
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Nov 20, 2024
1 parent b78450c commit 1baf8a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/emulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/jni_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1baf8a1

Please sign in to comment.