#ifndef OPTIONS_H
#define OPTIONS_H

/*
 * @(#)Options.h
 *
 * This file is part of webCDwriter - Network CD Writing.
 *
 * Copyright (C) 1999-2002 Jörg P. M. Haeger
 *
 * webCDwriter is free software. See CDWserver.cpp for details.
 *
 * Jörg Haeger, 25.04.2001
 */

/**
 * A container for the writing options.
 *
 * @version 20021024
 * @author Jörg P. M. Haeger
 */
struct Options {
	enum Medium { CDR, CDRW, CDR80, CDRW80, DVDplusRW, DVDplusR };

	int protocolVersion;
	int blankTOC;
	const char *bootImage;
	int closeCD;
	int copies;
	int DAO;
	int format;
	int HFS;
	int joliet;
	int laserOff;
	enum Medium medium;
	int burnOffline;
	int rockRidge;
	int speed;
	int verify;
	const char *volumeID;

	Options() {
		protocolVersion = 1;
		bootImage = NULL;
		volumeID = NULL;
		reset();
	}

	~Options() {
		reset();
	}

	void reset() {
		if (protocolVersion == 1) {
			closeCD = 1;
			joliet = 1;
			rockRidge = 1;
		}
		else {
			closeCD = 0;
			joliet = 0;
			rockRidge = 0;
		}
		blankTOC = 0;
		if (bootImage != NULL) {
			delete[] bootImage;
			bootImage = NULL;
		}
		burnOffline = 0;
		copies = 1;
		DAO = 0;
		format = 0;
		HFS = 0;
		laserOff = 0;
		medium = CDR;
		speed = config.getDefaultSpeed();
		verify = 0;
		if (volumeID != NULL) {
			delete[] volumeID;
			volumeID = NULL;
		}
	}

	void setVolumeID(const char *ID) {
		if (volumeID != NULL) {
			delete[] volumeID;
			volumeID = NULL;
		}
		volumeID = strDup(ID);
	}
};

#endif
