/Users/lyon/j4p/src/sound/player/SoundList.java

1    package sound.player; 
2     
3    import javax.swing.*; 
4    import java.applet.AudioClip; 
5    import java.net.URL; 
6     
7    /** 
8     * Loads and holds a bunch of audio files whose locations are specified 
9     * relative to a fixed base URL. 
10    */ 
11   class SoundList extends java.util.Hashtable { 
12       JApplet applet; 
13       URL baseURL; 
14    
15       public SoundList(URL baseURL) { 
16           super(5); //Initialize Hashtable with capacity of 5 entries. 
17           this.baseURL = baseURL; 
18       } 
19    
20       public void startLoading(String relativeURL) { 
21           System.out.println("loading:" + relativeURL); 
22           new SoundLoader(this, baseURL, relativeURL); 
23       } 
24    
25       public AudioClip getClip(String relativeURL) { 
26           return (AudioClip) get(relativeURL); 
27       } 
28    
29       public void putClip(AudioClip clip, String relativeURL) { 
30           put(relativeURL, clip); 
31       } 
32   } 
33