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
|
@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.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Ładowanie…
Reference in New Issue