/* * Formats.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; /** * * @author Vreixo Formoso * @since 0.1 */ /* * TODO I really don't like this way of wrapping the burn_disc_get_formats * return value, maybe an internal class of Burn would be a better idea. */ public class Formats { private FormatStatus status; private long size; private int blSas; private int numFormats; /* to be called from JNI code */ Formats(int status, long size, int blSas, int numFormats) { super(); this.status = FormatStatus.values()[status-1]; this.size = size; this.blSas = blSas; this.numFormats = numFormats; } /** * Additional info "Block Length/Spare Area Size". * Expected to be constantly 2048 for non-BD media. * * @return */ public int getBlSas() { return blSas; } /** * The number of available formats. To be used with * burn_disc_get_format_descr() to obtain such a format * and eventually with burn_disc_format() to select one. * * @return */ public int getNumFormats() { return numFormats; } /** * The size in bytes associated with status. * unformatted: the maximum achievable size of the media * formatted: the currently formatted capacity * unknown: maximum capacity of drive or of media * @return */ public long getSize() { return size; } /** * The current formatting status of the inserted media. * * @return * The format status. Note: {@link FormatStatus#UNKNOWN} is the * legal status for quick formatted, yet unwritten DVD-RW. */ public FormatStatus getStatus() { return status; } }