I found a couple of suspicious things. The first most suspicious was this:
public int getTrackLength()
{
AudioFile af;
try {
af = AudioFileIO.read(location);
AudioHeader i = af.getAudioHeader();
return i.getTrackLength();
} catch (Exception e) {
System.err.println("Error: audio file not found? Stack trace: ");
e.printStackTrace();
}
return -1;
}
If this thing is doing a ton of file I/O every time you want to show a track length, that could be a problem. I am not sure how often that gets called, but I would comment it out and replace it with a constant integer and see what happens.
Another interesting bit was this:
public static String getString(String s)
{
int i = Collections.binarySearch(instance.data, s);
if(i >= 0)
{
return instance.data.get(i);
}
else
{
instance.data.add(s);
Collections.sort(instance.data);
return s;
}
}
I see that it adds something of it doesn't find it.
No idea if either of these is your problem, I just took a quick glance. I would trim down to the most basic implementation possible, step by step, and see if the problem goes away or not.