int index = interludeElement.getAttribute("index").getIntValue();
boolean def = interludeElement.getAttribute("default").getBooleanValue();
if(def)
{
int defaultNumber = interludeElement.getAttribute("defaultNumber").getIntValue();
JPowerHourInterlude interlude;
try
{
interlude = new JPowerHourInterlude(defaultNumber);
interludes.add(interlude);
}
catch (BasicPlayerException e)
{
e.printStackTrace();
}
}
else
{
File file = new File(interludeElement.getAttribute("path").getValue());
if(!file.exists())
{
String message = "Interlude "+file.getName()+" does not exist, removing from playlist";
try
{
JOptionPane.showMessageDialog(null, message, "Error", JOptionPane.ERROR_MESSAGE);
}
catch(HeadlessException he)
{
System.err.println(message);
}
}
else
{
try
{
JPowerHourInterlude interlude = new JPowerHourInterlude(file);
interludes.add(index, interlude);
}
catch (BasicPlayerException e)
{
e.printStackTrace();