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
public void run() {
try {
frame = frameQueue.take();
frameLength = Shape.totalLength(frame);
updateLengthIncrement();
if (sampleSource == null) {
frame = frameQueue.take();
frameLength = Shape.totalLength(frame);
updateLengthIncrement();
}
} catch (InterruptedException e) {
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.
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 final ArrayBlockingQueue<Vector2[]> buffer;

Wyświetl plik

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