Another interesting rotation

pull/35/head
James Ball 2020-01-26 22:45:07 +00:00
rodzic 9131c5618a
commit 2094d9a926
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -21,11 +21,11 @@ public class AudioPlayer extends Thread {
line.rotate(nextTheta(stream.getFormat().mix.rate, 0.000001));
int framesToDraw = (int) (line.length() * 100);
int neg = line.getX1() < line.getX2() || line.getY1() < line.getY2() ? 1 : -1;
//int neg = line.getX1() < line.getX2() || line.getY1() < line.getY2() ? 1 : -1;
for (int c = 0; c < format.outputs; c++) {
((float[]) output)[f * format.outputs] = line.getX1() + Math.abs(line.getX2() - line.getX1()) * (float) (neg * framesDrawn) / framesToDraw;
((float[]) output)[f * format.outputs + 1] = line.getY1() + Math.abs(line.getY2() - line.getY1()) * (float) (neg * framesDrawn) / framesToDraw;
((float[]) output)[f * format.outputs] = line.getX1() + Math.abs(line.getX2() - line.getX1()) * (float) (framesDrawn) / framesToDraw;
((float[]) output)[f * format.outputs + 1] = line.getY1() + Math.abs(line.getY2() - line.getY1()) * (float) (framesDrawn) / framesToDraw;
}
framesDrawn++;