home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 25 / nopv25.iso / 046A / COOBAR.ZIP / COOSOUND.CLA (.txt) < prev    next >
Encoding:
Java Class File  |  1997-06-28  |  871 b   |  32 lines

  1. import java.applet.AudioClip;
  2.  
  3. class coosound extends Thread {
  4.    AudioClip m_source;
  5.    String m_mode = "none";
  6.  
  7.    coosound(AudioClip source, String mode) {
  8.       this.m_source = source;
  9.       this.m_mode = mode;
  10.    }
  11.  
  12.    public void start() {
  13.       if (this.m_source != null) {
  14.          try {
  15.             if (this.m_mode.equals("play")) {
  16.                this.m_source.play();
  17.                return;
  18.             }
  19.  
  20.             if (this.m_mode.equals("loop")) {
  21.                this.m_source.loop();
  22.                return;
  23.             }
  24.          } catch (Exception var1) {
  25.             ((Thread)this).stop();
  26.             return;
  27.          }
  28.       }
  29.  
  30.    }
  31. }
  32.