public void connect() throws ConnectionException, IOException {
		BufferedReader bufferedReader = null;
		try {
			bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(playlist)));
		}
		catch(IOException e) {
			throw new ConnectionException(e);
		}
		String filename;
		while((filename = bufferedReader.readLine()) != null) {
			filename = filename.trim();
			// ignore comments
			if(!filename.startsWith("#")) {
				filenames.add(filename);
			}				
		}
		if(filenames.isEmpty())
			throw new ConnectionException("The playlist is empty");
		boolean noFileFound = true;
		while(noFileFound) {
			try {
				switchInputStream();
				noFileFound = false;
			}
			catch(IOException e) {
				Fluid.error(e);
			}
		}
		if(filenames.isEmpty())
			throw new ConnectionException("None of the files in the playlist could be found");
		connected = true;
	}