Detect if on MacOS and ignore XtAudio if so

pull/35/head
James Ball 2021-07-04 20:24:26 +01:00
rodzic e77d2a9287
commit 5283ceeb6a
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

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

Wyświetl plik

@ -4,10 +4,14 @@ import sh.ball.shapes.Vector2;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.Callable;
public class ConglomerateAudioEngine implements AudioEngine {
private static final String OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
private static final boolean MAC_OS = OS.contains("mac") || OS.contains("darwin");
private final XtAudioEngine xtEngine = new XtAudioEngine();
private final JavaAudioEngine javaEngine = new JavaAudioEngine();
@ -42,7 +46,11 @@ public class ConglomerateAudioEngine implements AudioEngine {
@Override
public List<AudioDevice> devices() {
if (xtDevices == null) {
xtDevices = xtEngine.devices();
if (MAC_OS) {
xtDevices = new ArrayList<>();
} else {
xtDevices = xtEngine.devices();
}
}
if (javaDevice == null) {
javaDevice = javaEngine.getDefaultDevice();