// Path: src/main/java/de/jarnbjo/util/io/BitInputStream.java
// public interface BitInputStream {
// 	
// 	/**
// 	 *  constant for setting this stream's mode to little endian
// 	 *
// 	 *  @see #setEndian(int)
// 	 */
// 	 
//    public static final int LITTLE_ENDIAN = 0;
// 
// 	/**
// 	 *  constant for setting this stream's mode to big endian
// 	 *
// 	 *  @see #setEndian(int)
// 	 */
// 
//    public static final int BIG_ENDIAN = 1;
// 
// 	/**
// 	 *  reads one bit (as a boolean) from the input stream
// 	 *
// 	 *  @return <code>true</code> if the next bit is 1, 
// 	 *          <code>false</code> otherwise
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 	 
//    public boolean getBit() throws IOException;
// 
// 	/**
// 	 *  reads <code>bits</code> number of bits from the input
// 	 *  stream
// 	 *
// 	 *  @return the unsigned integer value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 	 
//    public int getInt(int bits) throws IOException;
// 
// 	/**
// 	 *  reads <code>bits</code> number of bits from the input
// 	 *  stream
// 	 *
// 	 *  @return the signed integer value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public int getSignedInt(int bits) throws IOException;
// 
// 	/**
// 	 *  reads a huffman codeword based on the <code>root</code> 
// 	 *  parameter and returns the decoded value
// 	 *
// 	 *  @param root the root of the Huffman tree used to decode the codeword
// 	 *  @return the decoded unsigned integer value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public int getInt(HuffmanNode root) throws IOException;
// 
// 	/**
// 	 *  reads an integer encoded as "signed rice" as described in
// 	 *  the FLAC audio format specification
// 	 *
// 	 *  @param order 
// 	 *  @return the decoded integer value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public int readSignedRice(int order) throws IOException;
// 
// 	/**
// 	 *  fills the array from <code>offset</code> with <code>len</code> 
// 	 *  integers encoded as "signed rice" as described in
// 	 *  the FLAC audio format specification
// 	 *
// 	 *  @param order 
// 	 *  @param buffer
// 	 *  @param offset
// 	 *  @param len 
// 	 *  @return the decoded integer value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public void readSignedRice(int order, int[] buffer, int offset, int len) throws IOException;
// 
// 	/**
// 	 *  reads <code>bits</code> number of bits from the input
// 	 *  stream
// 	 *
// 	 *  @return the unsigned long value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public long getLong(int bits) throws IOException;
// 
// 	/**
// 	 *  causes the read pointer to be moved to the beginning
// 	 *  of the next byte, remaining bits in the current byte
// 	 *  are discarded
// 	 *
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public void align();
// 
// 	/**
// 	 *  changes the endian mode used when reading bit-wise from
// 	 *  the stream, changing the mode mid-stream will cause the
// 	 *  read cursor to move to the beginning of the next byte
// 	 *  (as if calling the <code>allign</code> method
// 	 *
// 	 *  @see #align()
// 	 *
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public void setEndian(int endian);
// }


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
import de.jarnbjo.util.io.BitInputStream;
/*
 * $ProjectName$
 * $ProjectRevision$
 * -----------------------------------------------------------
 * $Id: IdentificationHeader.java,v 1.3 2003/03/31 00:20:16 jarnbjo Exp $
 * -----------------------------------------------------------
 *
 * $Author: jarnbjo $
 *
 * Description:
 *
 * Copyright 2002-2003 Tor-Einar Jarnbjo
 * -----------------------------------------------------------
 *
 * Change History
 * -----------------------------------------------------------
 * $Log: IdentificationHeader.java,v $
 * Revision 1.3  2003/03/31 00:20:16  jarnbjo
 * no message
 *
 * Revision 1.2  2003/03/16 01:11:12  jarnbjo
 * no message
 *
 *
 */

package de.jarnbjo.vorbis;




/**
 */

public class IdentificationHeader {

   private int version, channels, sampleRate, bitrateMaximum, bitrateNominal, bitrateMinimum, blockSize0, blockSize1;
   private boolean framingFlag;
   private MdctFloat[] mdct=new MdctFloat[2];
   //private MdctLong[] mdctInt=new MdctLong[2];

   private static final long HEADER = 0x736962726f76L; // 'vorbis'

// Path: src/main/java/de/jarnbjo/util/io/BitInputStream.java
// public interface BitInputStream {
// 	
// 	/**
// 	 *  constant for setting this stream's mode to little endian
// 	 *
// 	 *  @see #setEndian(int)
// 	 */
// 	 
//    public static final int LITTLE_ENDIAN = 0;
// 
// 	/**
// 	 *  constant for setting this stream's mode to big endian
// 	 *
// 	 *  @see #setEndian(int)
// 	 */
// 
//    public static final int BIG_ENDIAN = 1;
// 
// 	/**
// 	 *  reads one bit (as a boolean) from the input stream
// 	 *
// 	 *  @return <code>true</code> if the next bit is 1, 
// 	 *          <code>false</code> otherwise
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 	 
//    public boolean getBit() throws IOException;
// 
// 	/**
// 	 *  reads <code>bits</code> number of bits from the input
// 	 *  stream
// 	 *
// 	 *  @return the unsigned integer value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 	 
//    public int getInt(int bits) throws IOException;
// 
// 	/**
// 	 *  reads <code>bits</code> number of bits from the input
// 	 *  stream
// 	 *
// 	 *  @return the signed integer value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public int getSignedInt(int bits) throws IOException;
// 
// 	/**
// 	 *  reads a huffman codeword based on the <code>root</code> 
// 	 *  parameter and returns the decoded value
// 	 *
// 	 *  @param root the root of the Huffman tree used to decode the codeword
// 	 *  @return the decoded unsigned integer value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public int getInt(HuffmanNode root) throws IOException;
// 
// 	/**
// 	 *  reads an integer encoded as "signed rice" as described in
// 	 *  the FLAC audio format specification
// 	 *
// 	 *  @param order 
// 	 *  @return the decoded integer value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public int readSignedRice(int order) throws IOException;
// 
// 	/**
// 	 *  fills the array from <code>offset</code> with <code>len</code> 
// 	 *  integers encoded as "signed rice" as described in
// 	 *  the FLAC audio format specification
// 	 *
// 	 *  @param order 
// 	 *  @param buffer
// 	 *  @param offset
// 	 *  @param len 
// 	 *  @return the decoded integer value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public void readSignedRice(int order, int[] buffer, int offset, int len) throws IOException;
// 
// 	/**
// 	 *  reads <code>bits</code> number of bits from the input
// 	 *  stream
// 	 *
// 	 *  @return the unsigned long value read from the stream
// 	 *
// 	 *  @throws IOException if an I/O error occurs
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public long getLong(int bits) throws IOException;
// 
// 	/**
// 	 *  causes the read pointer to be moved to the beginning
// 	 *  of the next byte, remaining bits in the current byte
// 	 *  are discarded
// 	 *
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public void align();
// 
// 	/**
// 	 *  changes the endian mode used when reading bit-wise from
// 	 *  the stream, changing the mode mid-stream will cause the
// 	 *  read cursor to move to the beginning of the next byte
// 	 *  (as if calling the <code>allign</code> method
// 	 *
// 	 *  @see #align()
// 	 *
// 	 *  @throws UnsupportedOperationException if the method is not supported by the implementation
// 	 */
// 
//    public void setEndian(int endian);
// }


// Path: src/main/java/de/jarnbjo/vorbis/IdentificationHeader.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
import de.jarnbjo.util.io.BitInputStream;

/*
 * $ProjectName$
 * $ProjectRevision$
 * -----------------------------------------------------------
 * $Id: IdentificationHeader.java,v 1.3 2003/03/31 00:20:16 jarnbjo Exp $
 * -----------------------------------------------------------
 *
 * $Author: jarnbjo $
 *
 * Description:
 *
 * Copyright 2002-2003 Tor-Einar Jarnbjo
 * -----------------------------------------------------------
 *
 * Change History
 * -----------------------------------------------------------
 * $Log: IdentificationHeader.java,v $
 * Revision 1.3  2003/03/31 00:20:16  jarnbjo
 * no message
 *
 * Revision 1.2  2003/03/16 01:11:12  jarnbjo
 * no message
 *
 *
 */

package de.jarnbjo.vorbis;




/**
 */

public class IdentificationHeader {

   private int version, channels, sampleRate, bitrateMaximum, bitrateNominal, bitrateMinimum, blockSize0, blockSize1;
   private boolean framingFlag;
   private MdctFloat[] mdct=new MdctFloat[2];
   //private MdctLong[] mdctInt=new MdctLong[2];

   private static final long HEADER = 0x736962726f76L; // 'vorbis'

   public IdentificationHeader(BitInputStream source) throws VorbisFormatException, IOException {