kopia lustrzana https://github.com/jameshball/osci-render
Correctly initialise audio player when rendering from a sample source
rodzic
ad8f939ad5
commit
c3df42c949
|
@ -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.");
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue