kopia lustrzana https://github.com/jameshball/osci-render
Detect if on MacOS and ignore XtAudio if so
rodzic
e77d2a9287
commit
5283ceeb6a
2
pom.xml
2
pom.xml
|
@ -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>
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Ładowanie…
Reference in New Issue