* moved "binPlayers" into libEmbedVideo (more modular folder layout)
[lhc/web/wiklou.git] / js2 / mwEmbed / libEmbedVideo / binPlayers / omtk-fx / src / as / org / omtk / vorbis / IdentificationHeader.as
1 /*
2
3 Copyright 2008 Tor-Einar Jarnbjo
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16
17 */
18
19 package org.omtk.vorbis {
20
21 import flash.utils.ByteArray;
22
23 public class IdentificationHeader {
24
25 private var _version:uint;
26 private var _channels:uint;
27 private var _sampleRate:uint;
28 private var _bitrateMaximum:int;
29 private var _bitrateMinimum:int;
30 private var _bitrateNominal:int;
31 private var _blockSize0:uint;
32 private var _blockSize1:uint;
33
34 private var _mdct:Vector.<Mdct>;
35
36 public function IdentificationHeader(source:ByteArray) {
37
38 source.readByte();
39 source.readByte();
40 source.readByte();
41 source.readByte();
42 source.readByte();
43 source.readByte();
44
45 _version = source.readUnsignedInt();
46 _channels = source.readUnsignedByte();
47 _sampleRate = source.readUnsignedInt();
48 _bitrateMaximum = source.readUnsignedInt();
49 _bitrateNominal = source.readUnsignedInt();
50 _bitrateMinimum = source.readUnsignedInt();
51 var bs:int = source.readUnsignedByte();
52 _blockSize0 = 1<<(bs&0xf);
53 _blockSize1 = 1<<(bs>>4);
54
55 _mdct = new Vector.<Mdct>(2, false);
56 _mdct[0] = new Mdct(_blockSize0);
57 _mdct[1] = new Mdct(_blockSize1);
58 }
59
60 public function get channels():uint {
61 return _channels;
62 }
63
64 public function get sampleRate():uint {
65 return _sampleRate;
66 }
67
68 public function get blockSize0():uint {
69 return _blockSize0;
70 }
71
72 public function get blockSize1():uint {
73 return _blockSize1;
74 }
75
76 public function get mdct0():Mdct {
77 return _mdct[0];
78 }
79
80 public function get mdct1():Mdct {
81 return _mdct[1];
82 }
83
84 }
85
86
87 }