diff --git a/android/app/src/main/java/org/musicpd/Bridge.java b/android/app/src/main/java/org/musicpd/Bridge.java index 6ad49e2d4..0ca31ebe6 100644 --- a/android/app/src/main/java/org/musicpd/Bridge.java +++ b/android/app/src/main/java/org/musicpd/Bridge.java @@ -18,4 +18,6 @@ public class Bridge { public static native void run(Context context, LogListener logListener); public static native void shutdown(); public static native void pause(); + public static native void playNext(); + public static native void playPrevious(); } diff --git a/src/Main.cxx b/src/Main.cxx index 4a469bc4f..e66e7f277 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -614,6 +614,28 @@ Java_org_musicpd_Bridge_pause(JNIEnv *, jclass) partition.pc.LockSetPause(true); } +gcc_visibility_default +JNIEXPORT void JNICALL +Java_org_musicpd_Bridge_playNext(JNIEnv *, jclass) +{ + if (global_instance != nullptr) + BlockingCall(global_instance->event_loop, [&](){ + for (auto &partition : global_instance->partitions) + partition.PlayNext(); + }); +} + +gcc_visibility_default +JNIEXPORT void JNICALL +Java_org_musicpd_Bridge_playPrevious(JNIEnv *, jclass) +{ + if (global_instance != nullptr) + BlockingCall(global_instance->event_loop, [&](){ + for (auto &partition : global_instance->partitions) + partition.PlayPrevious(); + }); +} + #else static inline void