/*
 * @(#)BurnSession.java
 *
 * This file is part of webCDwriter - Network CD Writing.
 *
 * Copyright (C) 1999-2003 Jörg P. M. Haeger
 *
 * webCDwriter is free software. See CDcreator.java for details.
 */

/**
 * This class sets the options of a BurnSession command
 * on the server.
 *
 * @version 20030303
 * @author Jörg P. M. Haeger
 */
public class BurnSession extends Burn {
	protected void execBurnCommand() {
		execCommand("burnSession");
	}

	protected void execFileSystemOptions() {
		if (!Options.volumeID.equals(""))
			execCommand("setVolumeID "
				+ spaceToEsc(Options.volumeID));
		if (Options.joliet)
			execCommand("setJoliet");
		if (Options.rockRidge)
			execCommand("setRockRidge");
		if (Options.HFS)
			execCommand("setHFS");
		if (Options.bootImage != null)
			execCommand("setBootImage "
				+ spaceToEsc(Options.bootImage));
	}

	protected void execOptions() {
		if (Mode.makeISOImage())
			execFileSystemOptions();

		if (Options.simulate)
			execCommand("setLaserOff");
		if (Options.blankTOC)
			execCommand("setBlankTOC");
		if (Options.closeCD)
			execCommand("setCloseCD");
		if (Options.copies > 1)
			execCommand("setCopies " + Options.copies);
		if (Options.DAO)
			execCommand("setDAO");
		if (Options.hideContents)
			execCommand("setHideContents");
		if (Mode.mediumSize > 700)
			execCommand("setMedium "
				+ (Mode.isMedium(Mode.DVDPLUSRW)? "DVD+RW": "CD-R"));
		if (Options.overburn)
			execCommand("setOverburn");
		if (Options.verify)
			execCommand("setVerify");
		if (Options.warnIfNotEmpty)
			execCommand("setWarnIfNotEmpty");
	}
}
