KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > iv > flash > api > sound > SoundStreamBlock


1 /*
2  * $Id: SoundStreamBlock.java,v 1.3 2002/07/12 07:43:41 skavish Exp $
3  *
4  * ===========================================================================
5  *
6  */

7
8 package org.openlaszlo.iv.flash.api.sound;
9
10 import java.io.PrintStream JavaDoc;
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 {
17     public DataMarker data;
18
19     public int getTag()
20     {
21         return Tag.SOUNDSTREAMBLOCK;
22     }
23
24     public static SoundStreamBlock parse( Parser p )
25     {
26         SoundStreamBlock o = new SoundStreamBlock();
27
28         o.data = new DataMarker( p.getBuf(), p.getPos(), p.getTagEndPos() );
29
30         return o;
31     }
32
33     public void write( FlashOutput fob )
34     {
35         // sometimes sound does not play if we generate short tag
36
// it seems to be a player's bug
37
fob.writeLongTag( getTag(), data.length() );
38
39         data.write(fob);
40     }
41
42     public boolean isConstant()
43     {
44         return true;
45     }
46
47     protected FlashItem copyInto( FlashItem item, ScriptCopier copier )
48     {
49         super.copyInto( item, copier );
50
51         ( (SoundStreamBlock) item ).data = data;
52
53         return item;
54     }
55     public FlashItem getCopy( ScriptCopier copier )
56     {
57         return copyInto( new SoundStreamBlock(), copier );
58     }
59
60     public void printContent( PrintStream JavaDoc out, String JavaDoc indent )
61     {
62         out.println( indent + "SoundStreamBlock" );
63         data.printContent(out);
64     }
65 }
66
Popular Tags