DeviceList.java

com.mojang.blaze3d.audio.DeviceList

信息

  • 全限定名:com.mojang.blaze3d.audio.DeviceList
  • 类型:public record
  • 包:com.mojang.blaze3d.audio
  • 源码路径:src/main/java/com/mojang/blaze3d/audio/DeviceList.java
  • 起始行号:L12
  • 职责:

    TODO

字段/常量

  • EMPTY
    • 类型: DeviceList
    • 修饰符: public static final
    • 源码定位: L13
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

下面的方法块按源码顺序生成。

public static DeviceList query() @ L15

  • 方法名:query
  • 源码定位:L15
  • 返回类型:DeviceList
  • 修饰符:public static

参数:

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public record DeviceList(@Nullable String defaultDevice, List<String> allDevices) {
    public static final DeviceList EMPTY = new DeviceList(null, List.of());
 
    public static DeviceList query() {
        if (!ALC10.alcIsExtensionPresent(0L, "ALC_ENUMERATE_ALL_EXT")) {
            return EMPTY;
        } else {
            List<String> allDevices = Objects.requireNonNullElse(ALUtil.getStringList(0L, 4115), List.of());
            String defaultDevice = ALC10.alcGetString(0L, 4114);
            return new DeviceList(defaultDevice, allDevices);
        }
    }
}

引用的其他类