diff options
author | Björn Stenberg <bjorn@haxx.se> | 2007-01-08 23:53:00 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2007-01-08 23:53:00 +0000 |
commit | 7039a05147b8bbfc829babea1c65bd436450b505 (patch) | |
tree | 4ba555eb84ed97b72b0575034d5b0530a393713e /songdbj/de/jarnbjo/vorbis/SetupHeader.java | |
parent | 6d4c19707ef95942e323cbdc89fbbfdbe45e7cc5 (diff) | |
download | rockbox-7039a05147b8bbfc829babea1c65bd436450b505.tar.gz rockbox-7039a05147b8bbfc829babea1c65bd436450b505.zip |
Splitting out songdbj
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11953 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'songdbj/de/jarnbjo/vorbis/SetupHeader.java')
-rw-r--r-- | songdbj/de/jarnbjo/vorbis/SetupHeader.java | 131 |
1 files changed, 0 insertions, 131 deletions
diff --git a/songdbj/de/jarnbjo/vorbis/SetupHeader.java b/songdbj/de/jarnbjo/vorbis/SetupHeader.java deleted file mode 100644 index 56e400f348..0000000000 --- a/songdbj/de/jarnbjo/vorbis/SetupHeader.java +++ /dev/null | |||
@@ -1,131 +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.1.1.1 2004/04/04 22:09:12 shred | ||
22 | * First Import | ||
23 | * | ||
24 | * Revision 1.2 2003/03/16 01:11:12 jarnbjo | ||
25 | * no message | ||
26 | * | ||
27 | * | ||
28 | */ | ||
29 | |||
30 | package de.jarnbjo.vorbis; | ||
31 | |||
32 | import java.io.*; | ||
33 | |||
34 | import de.jarnbjo.util.io.*; | ||
35 | |||
36 | class SetupHeader { | ||
37 | |||
38 | private static final long HEADER = 0x736962726f76L; // 'vorbis' | ||
39 | |||
40 | private CodeBook[] codeBooks; | ||
41 | private Floor[] floors; | ||
42 | private Residue[] residues; | ||
43 | private Mapping[] mappings; | ||
44 | private Mode[] modes; | ||
45 | |||
46 | public SetupHeader(VorbisStream vorbis, BitInputStream source) throws VorbisFormatException, IOException { | ||
47 | |||
48 | if(source.getLong(48)!=HEADER) { | ||
49 | throw new VorbisFormatException("The setup header has an illegal leading."); | ||
50 | } | ||
51 | |||
52 | // read code books | ||
53 | |||
54 | int codeBookCount=source.getInt(8)+1; | ||
55 | codeBooks=new CodeBook[codeBookCount]; | ||
56 | |||
57 | for(int i=0; i<codeBooks.length; i++) { | ||
58 | codeBooks[i]=new CodeBook(source); | ||
59 | } | ||
60 | |||
61 | // read the time domain transformations, | ||
62 | // these should all be 0 | ||
63 | |||
64 | int timeCount=source.getInt(6)+1; | ||
65 | for(int i=0; i<timeCount; i++) { | ||
66 | if(source.getInt(16)!=0) { | ||
67 | throw new VorbisFormatException("Time domain transformation != 0"); | ||
68 | } | ||
69 | } | ||
70 | |||
71 | // read floor entries | ||
72 | |||
73 | int floorCount=source.getInt(6)+1; | ||
74 | floors=new Floor[floorCount]; | ||
75 | |||
76 | for(int i=0; i<floorCount; i++) { | ||
77 | floors[i]=Floor.createInstance(source, this); | ||
78 | } | ||
79 | |||
80 | // read residue entries | ||
81 | |||
82 | int residueCount=source.getInt(6)+1; | ||
83 | residues=new Residue[residueCount]; | ||
84 | |||
85 | for(int i=0; i<residueCount; i++) { | ||
86 | residues[i]=Residue.createInstance(source, this); | ||
87 | } | ||
88 | |||
89 | // read mapping entries | ||
90 | |||
91 | int mappingCount=source.getInt(6)+1; | ||
92 | mappings=new Mapping[mappingCount]; | ||
93 | |||
94 | for(int i=0; i<mappingCount; i++) { | ||
95 | mappings[i]=Mapping.createInstance(vorbis, source, this); | ||
96 | } | ||
97 | |||
98 | // read mode entries | ||
99 | |||
100 | int modeCount=source.getInt(6)+1; | ||
101 | modes=new Mode[modeCount]; | ||
102 | |||
103 | for(int i=0; i<modeCount; i++) { | ||
104 | modes[i]=new Mode(source, this); | ||
105 | } | ||
106 | |||
107 | if(!source.getBit()) { | ||
108 | throw new VorbisFormatException("The setup header framing bit is incorrect."); | ||
109 | } | ||
110 | } | ||
111 | |||
112 | public CodeBook[] getCodeBooks() { | ||
113 | return codeBooks; | ||
114 | } | ||
115 | |||
116 | public Floor[] getFloors() { | ||
117 | return floors; | ||
118 | } | ||
119 | |||
120 | public Residue[] getResidues() { | ||
121 | return residues; | ||
122 | } | ||
123 | |||
124 | public Mapping[] getMappings() { | ||
125 | return mappings; | ||
126 | } | ||
127 | |||
128 | public Mode[] getModes() { | ||
129 | return modes; | ||
130 | } | ||
131 | } \ No newline at end of file | ||