#ifndef OPTIONS_H
#define OPTIONS_H

/*
 * @(#)Options.h
 *
 * This file is part of webCDwriter - Network CD Writing.
 *
 * Copyright (C) 1999-2003 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 20030303
 * @author Jörg P. M. Haeger
 */
struct Options {
	enum Medium { CDR, CDRW, DVDplusRW, DVDplusR };

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

	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;
		DVDVideo = 0;
		format = 0;
		HFS = 0;
		hideContents = 0;
		laserOff = 0;
		medium = CDR;
		overburn = 0;
		speed = config.getDefaultSpeed();
		verify = 0;
		videoDVD = 0;
		warnIfNotEmpty = 0;
	}

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

#endif
