private void buildDefaultControls() { sampleRate = new CheckedIntBinding(DEFAULT_SAMPLERATE); IntProperty srCtl = IntProperty.builder() .binding(sampleRate) .minimum(2000) .maximum(192000) .defaultValue(DEFAULT_SAMPLERATE) .suggestedValues(22050, 32000, 44100, 48000, 88200, 96000, 192000) .build(); registerControl("sample-rate", srCtl); blockSize = new CheckedIntBinding(DEFAULT_BLOCKSIZE); IntProperty brCtl = IntProperty.builder() .binding(blockSize) .minimum(1) .maximum(512) .defaultValue(DEFAULT_BLOCKSIZE) .build(); registerControl("block-size", brCtl); List<String> libs = new ArrayList<String>(libraries.keySet()); Collections.sort(libs); libs.add(0, ""); audioLib = new LibraryBinding(); StringProperty libCtl = StringProperty.builder() .binding(audioLib) .defaultValue("") .emptyIsDefault() .allowedValues(libs.toArray(new String[libs.size()])) .build(); registerControl("library", libCtl); audioCtxt = new AudioCtxt(); }
private void updateLibrary(String lib) { unregisterControl("device"); deviceName = null; unregisterControl("input-device"); inputDeviceName = null; unregisterControl("ext-buffer-size"); extBufferSize = null; if (lib.isEmpty()) { return; } LibraryInfo info = libraries.get(lib); if (info == null) { return; } if (!"JACK".equals(lib)) { deviceName = new DeviceBinding(); StringProperty devCtl = StringProperty.builder() .binding(deviceName) .defaultValue("") .emptyIsDefault() .suggestedValues(deviceNames(info.devices)) .build(); registerControl("device", devCtl); inputDeviceName = new DeviceBinding(); StringProperty inCtl = StringProperty.builder() .binding(inputDeviceName) .defaultValue("") .emptyIsDefault() .suggestedValues(deviceNames(info.inputDevices)) .build(); registerControl("input-device", inCtl); extBufferSize = new CheckedIntBinding(AudioSettings.getBuffersize()); IntProperty bsCtl = IntProperty.builder() .binding(extBufferSize) .suggestedValues(64, 128, 256, 512, 1024, 2048, 4096) .build(); registerControl("ext-buffer-size", bsCtl); } }