View Javadoc

1   // Copyright 2001, FreeHEP.
2   package org.freehep.graphicsio.swf;
3   
4   import java.io.IOException;
5   
6   /**
7    * StartSound TAG.
8    * 
9    * @author Mark Donszelmann
10   * @author Charles Loomis
11   * @version $Id: StartSound.java 8584 2006-08-10 23:06:37Z duns $
12   */
13  public class StartSound extends ControlTag {
14  
15      private int character;
16  
17      private SoundInfo info;
18  
19      public StartSound(int id, SoundInfo info) {
20          this();
21          character = id;
22          this.info = info;
23      }
24  
25      public StartSound() {
26          super(15, 1);
27      }
28  
29      public SWFTag read(int tagID, SWFInputStream swf, int len)
30              throws IOException {
31  
32          StartSound tag = new StartSound();
33          tag.character = swf.readUnsignedShort();
34          tag.info = new SoundInfo(swf);
35          return tag;
36      }
37  
38      public void write(int tagID, SWFOutputStream swf) throws IOException {
39          swf.writeUnsignedShort(character);
40          info.write(swf);
41      }
42  
43      public String toString() {
44          return super.toString() + "\n" + "  character: " + character + "\n"
45                  + "  soundinfo: " + info;
46      }
47  }