summaryrefslogtreecommitdiff
path: root/songdbj/de/jarnbjo/vorbis/IdentificationHeader.java
diff options
context:
space:
mode:
Diffstat (limited to 'songdbj/de/jarnbjo/vorbis/IdentificationHeader.java')
-rw-r--r--songdbj/de/jarnbjo/vorbis/IdentificationHeader.java120
1 files changed, 0 insertions, 120 deletions
diff --git a/songdbj/de/jarnbjo/vorbis/IdentificationHeader.java b/songdbj/de/jarnbjo/vorbis/IdentificationHeader.java
deleted file mode 100644
index 1e18163385..0000000000
--- a/songdbj/de/jarnbjo/vorbis/IdentificationHeader.java
+++ /dev/null
@@ -1,120 +0,0 @@
1/*
2 * $ProjectName$
3 * $ProjectRevision$
4 * -----------------------------------------------------------
5 * $Id$
6 * -----------------------------------------------------------
7 *
8 * $Author$
9 *
10 * Description:
11 *
12 * Copyright 2002-2003 Tor-Einar Jarnbjo
13 * -----------------------------------------------------------
14 *
15 * Change History
16 * -----------------------------------------------------------
17 * $Log$
18 * Revision 1.1 2005/07/11 15:42:36 hcl
19 * Songdb java version, source. only 1.5 compatible
20 *
21 * Revision 1.2 2004/09/21 06:39:06 shred
22 * Importe reorganisiert, damit Eclipse Ruhe gibt. ;-)
23 *
24 * Revision 1.1.1.1 2004/04/04 22:09:12 shred
25 * First Import
26 *
27 * Revision 1.3 2003/03/31 00:20:16 jarnbjo
28 * no message
29 *
30 * Revision 1.2 2003/03/16 01:11:12 jarnbjo
31 * no message
32 *
33 *
34 */
35
36package de.jarnbjo.vorbis;
37
38import java.io.IOException;
39
40import de.jarnbjo.util.io.BitInputStream;
41
42/**
43 */
44
45public class IdentificationHeader {
46
47 private int version, channels, sampleRate, bitrateMaximum, bitrateNominal, bitrateMinimum, blockSize0, blockSize1;
48 private boolean framingFlag;
49 private MdctFloat[] mdct=new MdctFloat[2];
50 //private MdctLong[] mdctInt=new MdctLong[2];
51
52 private static final long HEADER = 0x736962726f76L; // 'vorbis'
53
54 public IdentificationHeader(BitInputStream source) throws VorbisFormatException, IOException {
55 //equalizer=new Equalizer();
56 //equalizer.pack();
57 //equalizer.show();
58
59 long leading=source.getLong(48);
60 if(leading!=HEADER) {
61 throw new VorbisFormatException("The identification header has an illegal leading.");
62 }
63 version=source.getInt(32);
64 channels=source.getInt(8);
65 sampleRate=source.getInt(32);
66 bitrateMaximum=source.getInt(32);
67 bitrateNominal=source.getInt(32);
68 bitrateMinimum=source.getInt(32);
69 int bs=source.getInt(8);
70 blockSize0=1<<(bs&0xf);
71 blockSize1=1<<(bs>>4);
72
73 mdct[0]=new MdctFloat(blockSize0);
74 mdct[1]=new MdctFloat(blockSize1);
75 //mdctInt[0]=new MdctLong(blockSize0);
76 //mdctInt[1]=new MdctLong(blockSize1);
77
78 framingFlag=source.getInt(8)!=0;
79 }
80
81 public int getSampleRate() {
82 return sampleRate;
83 }
84
85 public int getMaximumBitrate() {
86 return bitrateMaximum;
87 }
88
89 public int getNominalBitrate() {
90 return bitrateNominal;
91 }
92
93 public int getMinimumBitrate() {
94 return bitrateMinimum;
95 }
96
97 public int getChannels() {
98 return channels;
99 }
100
101 public int getBlockSize0() {
102 return blockSize0;
103 }
104
105 public int getBlockSize1() {
106 return blockSize1;
107 }
108
109 protected MdctFloat getMdct0() {
110 return mdct[0];
111 }
112
113 protected MdctFloat getMdct1() {
114 return mdct[1];
115 }
116
117 public int getVersion() {
118 return version;
119 }
120} \ No newline at end of file