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