Use JACK by default if available on linux

pull/103/head v1.27.2-SNAPSHOT
James Ball 2022-07-15 14:14:45 +01:00 zatwierdzone przez James H Ball
rodzic eeea1fd5a5
commit b510f68a4c
2 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -6,7 +6,7 @@
<groupId>sh.ball</groupId> <groupId>sh.ball</groupId>
<artifactId>osci-render</artifactId> <artifactId>osci-render</artifactId>
<version>1.27.2</version> <version>1.27.2-SNAPSHOT</version>
<name>osci-render</name> <name>osci-render</name>

Wyświetl plik

@ -1,5 +1,6 @@
package sh.ball.audio.engine; package sh.ball.audio.engine;
import com.sun.javafx.PlatformUtil;
import sh.ball.shapes.Vector2; import sh.ball.shapes.Vector2;
import xt.audio.*; import xt.audio.*;
@ -236,7 +237,13 @@ public class XtAudioEngine implements AudioEngine {
// connects to an XtAudio XtService in order of lowest latency to highest latency // connects to an XtAudio XtService in order of lowest latency to highest latency
private XtService getService(XtPlatform platform) { private XtService getService(XtPlatform platform) {
XtService service = platform.getService(platform.setupToSystem(Enums.XtSetup.SYSTEM_AUDIO)); XtService service = null;
if ((PlatformUtil.isLinux() || PlatformUtil.isUnix()) && !PlatformUtil.isMac()) {
service = platform.getService(Enums.XtSystem.JACK);
}
if (service == null) {
service = platform.getService(platform.setupToSystem(Enums.XtSetup.SYSTEM_AUDIO));
}
if (service == null) { if (service == null) {
service = platform.getService(platform.setupToSystem(Enums.XtSetup.PRO_AUDIO)); service = platform.getService(platform.setupToSystem(Enums.XtSetup.PRO_AUDIO));
} }