001 /* PAVLOV -- Multiple Choice Study System 002 * Copyright (C) 2000 - 2004 T.J. Willis 003 * 004 * This program is free software; you can redistribute it and/or 005 * modify it under the terms of the GNU General Public License 006 * as published by the Free Software Foundation; either version 2 007 * of the License, or (at your option) any later version. 008 * 009 * This program is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 012 * GNU General Public License for more details. 013 * 014 * You should have received a copy of the GNU General Public License 015 * along with this program; if not, write to the Free Software 016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. 017 * 018 * $Header: /cvsroot/pavlov/net/sourceforge/pavlov/randommedia/SoundPlayer.java,v 1.4 2004/05/10 14:58:54 tj_willis Exp $ 019 */ 020 package net.sourceforge.pavlov.randommedia; 021 022 import java.applet.*; 023 import org.apache.log4j.*; 024 025 /** 026 * Describe class <code>SoundPlayer</code> here. 027 * 028 * @author <a href="mailto:tj_willis@users.sourceforge.net">T.J. Willis</a> 029 * @version 1.0 030 */ 031 public class SoundPlayer extends Thread { 032 private AudioClip clip; 033 // FIXED: not a dead class, used by SoundList, used by RandomAudioFactory 034 private Category cat 035 = Category.getInstance(SoundPlayer.class.getName()); 036 037 038 /** 039 * Creates a new <code>SoundPlayer</code> instance. 040 * 041 * @param myClip an <code>AudioClip</code> value 042 */ 043 public SoundPlayer(AudioClip myClip) 044 { 045 //setPriority(priority); 046 clip = myClip; 047 //setPriority(MIN_PRIORITY); 048 cat.info("Player playing... "); 049 start(); 050 } 051 052 /** 053 * Describe <code>run</code> method here. 054 * 055 */ 056 public void run() { 057 //cat.info("Player running..."); 058 clip.play(); 059 //AudioClip audioClip = Applet.newAudioClip(url); 060 //soundList.add(audioClip); 061 cat.debug("Player thread played clip."); 062 } 063 }