}
if(i < files.size()) {
fCurrent = new File(files.get(i).getFilename());
fisAudioFile = new FileInputStream(fCurrent);
playing = true;
p1 = new AdvancedPlayer(fisAudioFile);
p1.setVolume(1);
p1.setPlayBackListener(playback);
p1.setAmplitudeListener(new AmplitudeListener() {
@Override
public void getAmplitude(short amplitude) {
byte bamp = 0;
if(amplitude < 10 && amplitude >= 0) {
bamp = 0;
} else if(amplitude < 6400) {
bamp = 1;
} else if(amplitude < 12800) {
bamp = 2;
} else if(amplitude < 19200) {
bamp = 3;
} else if(amplitude < 25600) {
bamp = 4;
} else if(amplitude < 32000) {
bamp = 5;
} else {
bamp = 6;
}
if(bamp != memAmp) {
if(ampChange != null) {
ampChange.amplitudeChange(bamp);
}
memAmp = bamp;
}
}
});
thPlay = new Thread(player);
thPlay.start();
thSlide = new Thread(slide);
thSlide.start();
if(i != currFile) {
currFile = i;
}
if(playChange != null) {
playChange.changePlay(i, files.get(currFile).getFilename() ,true);
}
if(playChangeNetwork != null) {
playChangeNetwork.changePlay(currFile, files.get(currFile).getFilename(), true,
currPosition, max_frames);
}
return files.get(i).getFilename();
} else if(repeat == true) {
currFile = 0;
fCurrent = new File(files.get(i).getFilename());
FileInputStream fis = new FileInputStream(fCurrent);
playing = true;
p1 = new AdvancedPlayer(fis, audio);
p1.setPlayBackListener(playback);
thPlay = new Thread(player);
thPlay.start();
thSlide = new Thread(slide);
thSlide.start();