Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JNI driver: Add setAudioEnabled hook #641

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading