multiple order changes with notifiers and other method calls; added

copying of default music file to special directory;
This commit is contained in:
2018-08-07 23:53:48 -05:00
parent 56d0ac2f51
commit 324e3afe5a
6 changed files with 16 additions and 12 deletions

View File

@@ -63,6 +63,7 @@ public class PCMObtainer implements Observer, Disposable, PCMSystem {
PCM[sid] = chanVal;
}
}
System.out.println(PCM[0]);
PCM[sid] /= Short.MAX_VALUE + 1f;
}
@@ -140,7 +141,7 @@ public class PCMObtainer implements Observer, Disposable, PCMSystem {
@Override
public float[] getFrequencyBins() {
if (updated) {
synchronized (PCM) {
synchronized (this) {
fft.fft(PCM);
System.arraycopy(PCM, 1, frequencyBins, 0, frequencyBins.length);
}

View File

@@ -268,11 +268,7 @@ public class MusicSelectionPage extends Page implements Observer {
@Override
public void update(Observable o, Object arg) {
if (o == mc && arg.equals(mc.states.LOADED)) {
if (selectables.getChecked().getFileHandle() != mc.getCurrentMusicFileHandle()) {
selectables.setChecked(mc.getCurrentlyPlayingIndex());
}
} else if (o == mmc) {
if (o == mmc) {
thread.start();
}
}