legacy/extras/java/trunk/src/java/org/pykix/libburnia/libburn/BurnMode.java

102 lines
2.5 KiB
Java

/*
* BurnMode.java
*
* Copyright (c) 2007 Vreixo Formoso
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* See COPYING file for details.
*/
package org.pykix.libburnia.libburn;
/**
* Burn Mode options.
*
* TODO this is a bitmask on C, I prefer exposing it as a enum in Java
* for now, but I need to think about it. enum is typesafe and more java-like.
* A better option might be creation of 2 enums, one for track mode, another
* for track mode modifier.
*
* TODO comentar bem o uso desta classe
*
* @author Vreixo Formoso
* @since 0.1
*/
public enum BurnMode {
/**
* Track mode - mode 0 data
* 0 bytes of user data. it's all 0s. mode 0. get it? HAH
*/
MODE0(1 << 0),
/**
* Track mode - mode "raw" - all 2352 bytes supplied by app
* FOR DATA TRACKS ONLY!
*/
MODE_RAW(1 << 1),
/**
* Track mode - mode 1 data
* 2048 bytes user data, and all the LEC money can buy
*/
MODE1(1 << 2),
/**
* Track mode - mode 2 data
* defaults to formless, 2336 bytes of user data, unprotected
* | with a data form if required.
*/
MODE2(1 << 3),
/**
* Track mode modifier - Form 1, | with MODE2 for reasonable results
* 2048 bytes of user data, 4 bytes of subheader
*/
FORM1(1 << 4),
/**
* Track mode modifier - Form 2, | with MODE2 for reasonable results
* lots of user data. not much LEC.
*/
FORM2(1 << 5),
/**
* Track mode - audio
* 2352 bytes per sector. may be | with 4ch or preemphasis.
* NOT TO BE CONFUSED WITH {@link #MODE_RAW}
* Audio data must be 44100Hz 16bit stereo with no riff or other header at
* beginning. Extra header data will cause pops or clicks. Audio data should
* also be in little-endian byte order. Big-endian audio data causes static.
*/
AUDIO(1 << 6),
/** Track mode modifier - 4 channel audio. */
AUDIO_4CH(1 << 7),
/** Track mode modifier - Digital copy permitted, can be set on any track. */
COPY(1 << 8),
/** Track mode modifier - 50/15uS pre-emphasis. */
PREEMPHASIS(1 << 9),
/** Input mode modifier - subcodes present packed 16 */
SUBCODE_P16(1 << 10),
/** Input mode modifier - subcodes present packed 96 */
SUBCODE_P96(1 << 11),
/** Input mode modifier - subcodes present raw 96 */
SUBCODE_R96 (1 << 12);
/* for bitmak generation, package protected */
int bm;
private BurnMode(int bm) {
this.bm = bm;
}
}