Correctly initialise audio player when rendering from a sample source

pull/82/head
James Ball 2022-06-11 19:16:33 +01:00 zatwierdzone przez James H Ball
rodzic ad8f939ad5
commit c3df42c949
3 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -345,9 +345,11 @@ public class ShapeAudioPlayer implements AudioPlayer<List<Shape>> {
@Override @Override
public void run() { public void run() {
try { try {
frame = frameQueue.take(); if (sampleSource == null) {
frameLength = Shape.totalLength(frame); frame = frameQueue.take();
updateLengthIncrement(); frameLength = Shape.totalLength(frame);
updateLengthIncrement();
}
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException("Initial frame not found. Cannot continue."); throw new RuntimeException("Initial frame not found. Cannot continue.");
} }

Wyświetl plik

@ -104,7 +104,7 @@ public class ConglomerateAudioEngine implements AudioEngine {
// potentially blocking on a buffer. // potentially blocking on a buffer.
private static class BufferedChannelGenerator implements Callable<Vector2>, Runnable { private static class BufferedChannelGenerator implements Callable<Vector2>, Runnable {
private static final int BLOCK_SIZE = 4096; private static final int BLOCK_SIZE = 1024;
private static final int BUFFER_SIZE = 2; private static final int BUFFER_SIZE = 2;
private final ArrayBlockingQueue<Vector2[]> buffer; private final ArrayBlockingQueue<Vector2[]> buffer;

Wyświetl plik

@ -684,12 +684,11 @@ public class MainController implements Initializable, FrequencyListener, MidiLis
} }
effectsController.restartEffects(); effectsController.restartEffects();
generalController.setFrameSourceName(frameSourcePaths.get(currentFrameSource));
generalController.updateFrameLabels();
String fileName = frameSourcePaths.get(index); String fileName = frameSourcePaths.get(index);
Platform.runLater(() -> { Platform.runLater(() -> {
generalController.setFrameSourceName(frameSourcePaths.get(currentFrameSource));
generalController.updateFrameLabels();
if (ObjParser.isObjFile(fileName)) { if (ObjParser.isObjFile(fileName)) {
objTitledPane.setVisible(true); objTitledPane.setVisible(true);
objTitledPane.setDisable(false); objTitledPane.setDisable(false);