src/share/classes/sun/audio/AudioDevice.java
Print this page
@@ -56,14 +56,11 @@
public final class AudioDevice {
private boolean DEBUG = false /*true*/ ;
- /** Hashtable of audio clips / input streams. */
- private Hashtable clipStreams;
-
- private Vector infos;
+ private Vector<Info> infos;
/** Are we currently playing audio? */
private boolean playing = false;
/** Handle to the JS audio mixer. */
@@ -79,13 +76,11 @@
/**
* Create an AudioDevice instance.
*/
private AudioDevice() {
-
- clipStreams = new Hashtable();
- infos = new Vector();
+ infos = new Vector<>();
}
private synchronized void startSampled( AudioInputStream as,
InputStream in ) throws UnsupportedAudioFileException,
@@ -159,11 +154,11 @@
Info info = null;
// is this already playing? if so, then just return
for(int i=0; i<infos.size(); i++) {
- info = (AudioDevice.Info)infos.elementAt(i);
+ info = infos.elementAt(i);
if( info.in == in ) {
return;
}
}
@@ -288,11 +283,11 @@
Info info;
for(int i=0; i<infos.size(); i++) {
- info = (AudioDevice.Info)infos.elementAt(i);
+ info = infos.elementAt(i);
if( info.in == in ) {
if( info.sequencer != null ) {
@@ -353,11 +348,11 @@
Info info;
for(int i=0; i<infos.size(); i++) {
- info = (AudioDevice.Info)infos.elementAt(i);
+ info = infos.elementAt(i);
if( info.sequencer != null ) {
info.sequencer.stop();
info.sequencer.close();
@@ -373,12 +368,11 @@
if (DEBUG) {
System.err.println("Audio Device: Streams all closed.");
}
// Empty the hash table.
- clipStreams = new Hashtable();
- infos = new Vector();
+ infos = new Vector<>();
}
/**
* Number of channels currently open.
*/