01: /*
02: * $Id: SoundStreamBlock.java,v 1.3 2002/07/12 07:43:41 skavish Exp $
03: *
04: * ===========================================================================
05: *
06: */
07:
08: package org.openlaszlo.iv.flash.api.sound;
09:
10: import java.io.PrintStream;
11: import org.openlaszlo.iv.flash.parser.*;
12: import org.openlaszlo.iv.flash.util.*;
13: import org.openlaszlo.iv.flash.api.*;
14:
15: public class SoundStreamBlock extends FlashObject {
16: public DataMarker data;
17:
18: public int getTag() {
19: return Tag.SOUNDSTREAMBLOCK;
20: }
21:
22: public static SoundStreamBlock parse(Parser p) {
23: SoundStreamBlock o = new SoundStreamBlock();
24:
25: o.data = new DataMarker(p.getBuf(), p.getPos(), p
26: .getTagEndPos());
27:
28: return o;
29: }
30:
31: public void write(FlashOutput fob) {
32: // sometimes sound does not play if we generate short tag
33: // it seems to be a player's bug
34: fob.writeLongTag(getTag(), data.length());
35:
36: data.write(fob);
37: }
38:
39: public boolean isConstant() {
40: return true;
41: }
42:
43: protected FlashItem copyInto(FlashItem item, ScriptCopier copier) {
44: super .copyInto(item, copier);
45:
46: ((SoundStreamBlock) item).data = data;
47:
48: return item;
49: }
50:
51: public FlashItem getCopy(ScriptCopier copier) {
52: return copyInto(new SoundStreamBlock(), copier);
53: }
54:
55: public void printContent(PrintStream out, String indent) {
56: out.println(indent + "SoundStreamBlock");
57: data.printContent(out);
58: }
59: }
|