1
2 package org.freehep.graphicsio.swf;
3
4 import java.io.IOException;
5
6
7
8
9
10
11
12
13 public class SoundEnvelope {
14
15 private long pos44;
16
17 private int leftLevel, rightLevel;
18
19 public SoundEnvelope(long pos44, int leftLevel, int rightLevel) {
20 this.pos44 = pos44;
21 this.leftLevel = leftLevel;
22 this.rightLevel = rightLevel;
23 }
24
25 public SoundEnvelope(SWFInputStream input) throws IOException {
26 pos44 = input.readUnsignedInt();
27 leftLevel = input.readUnsignedShort();
28 rightLevel = input.readUnsignedShort();
29 }
30
31 public void write(SWFOutputStream swf) throws IOException {
32 swf.writeUnsignedInt(pos44);
33 swf.writeUnsignedShort(leftLevel);
34 swf.writeUnsignedShort(rightLevel);
35 }
36
37 public String toString() {
38 return "SoundEnvelope pos44: " + pos44 + ", level(L,R): " + leftLevel
39 + ", " + rightLevel;
40 }
41 }