}
playerState = STOP;
}
if ((playerState == INIT) || (playerState == STOP) || (playerState == OPEN))
{
PlaylistItem pli = null;
// Local File.
if (modifiers == MouseEvent.BUTTON1_MASK)
{
File[] file = FileSelector.selectFile(loader, FileSelector.OPEN, false, config.getExtensions(), ui.getResource("button.eject.filedialog.filtername"), new File(config.getLastDir()));
if (FileSelector.getInstance().getDirectory() != null) config.setLastDir(FileSelector.getInstance().getDirectory().getPath());
if (file != null)
{
String fsFile = file[0].getName();
if (fsFile != null)
{
// Loads a new playlist.
if ((fsFile.toLowerCase().endsWith(ui.getResource("playlist.extension.m3u"))) || (fsFile.toLowerCase().endsWith(ui.getResource("playlist.extension.pls"))))
{
if (loadPlaylist(config.getLastDir() + fsFile))
{
config.setPlaylistFilename(config.getLastDir() + fsFile);
playlist.begin();
playlistUI.initPlayList();
setCurrentSong(playlist.getCursor());
playlistUI.repaint();
}
}
else if (fsFile.toLowerCase().endsWith(ui.getResource("skin.extension")))
{
ui.setPath(config.getLastDir() + fsFile);
loadSkin();
config.setDefaultSkin(ui.getPath());
}
else pli = new PlaylistItem(fsFile, config.getLastDir() + fsFile, -1, true);
}
}
}
// Remote File.
else if (modifiers == MouseEvent.BUTTON3_MASK)
{
UrlDialog UD = new UrlDialog(config.getTopParent(), ui.getResource("button.eject.urldialog.title"), loader.getLocation().x, loader.getLocation().y + 10, config.getLastURL());
UD.show();
if (UD.getFile() != null)
{
showTitle(ui.getResource("title.loading"));
// Remote playlist ?
if ((UD.getURL().toLowerCase().endsWith(ui.getResource("playlist.extension.m3u"))) || (UD.getURL().toLowerCase().endsWith(ui.getResource("playlist.extension.pls"))))
{
if (loadPlaylist(UD.getURL()))
{
config.setPlaylistFilename(UD.getURL());
playlist.begin();
playlistUI.initPlayList();
setCurrentSong(playlist.getCursor());
playlistUI.repaint();
}
}
// Remote file or stream.
else
{
pli = new PlaylistItem(UD.getFile(), UD.getURL(), -1, false);
}
config.setLastURL(UD.getURL());
}
}
if ((pli != null) && (playlist != null))