< prev index next >

src/java.desktop/share/classes/com/sun/media/sound/PortMixerProvider.java

Print this page

        

@@ -26,42 +26,32 @@
 package com.sun.media.sound;
 
 import javax.sound.sampled.Mixer;
 import javax.sound.sampled.spi.MixerProvider;
 
-
 /**
  * Port provider.
  *
  * @author Florian Bomers
  */
 public final class PortMixerProvider extends MixerProvider {
 
-    // STATIC VARIABLES
-
     /**
      * Set of info objects for all port input devices on the system.
      */
     private static PortMixerInfo[] infos;
 
     /**
      * Set of all port input devices on the system.
      */
     private static PortMixer[] devices;
 
-
-    // STATIC
-
     static {
         // initialize
         Platform.initialize();
     }
 
-
-    // CONSTRUCTOR
-
-
     /**
      * Required public no-arg constructor.
      */
     public PortMixerProvider() {
         synchronized (PortMixerProvider.class) {

@@ -91,18 +81,20 @@
             }
             if (Printer.trace) Printer.trace("PortMixerProvider: init(): found numDevices: " + numDevices);
         }
     }
 
+    @Override
     public Mixer.Info[] getMixerInfo() {
         synchronized (PortMixerProvider.class) {
             Mixer.Info[] localArray = new Mixer.Info[infos.length];
             System.arraycopy(infos, 0, localArray, 0, infos.length);
             return localArray;
         }
     }
 
+    @Override
     public Mixer getMixer(Mixer.Info info) {
         synchronized (PortMixerProvider.class) {
             for (int i = 0; i < infos.length; i++) {
                 if (infos[i].equals(info)) {
                     return getDevice(infos[i]);

@@ -111,22 +103,18 @@
         }
         throw new IllegalArgumentException(
                 String.format("Mixer %s not supported by this provider", info));
     }
 
-
     private static Mixer getDevice(PortMixerInfo info) {
         int index = info.getIndex();
         if (devices[index] == null) {
             devices[index] = new PortMixer(info);
         }
         return devices[index];
     }
 
-    // INNER CLASSES
-
-
     /**
      * Info class for PortMixers.  Adds an index value for
      * making native references to a particular device.
      * This constructor is called from native.
      */

@@ -142,9 +130,8 @@
             return index;
         }
 
     } // class PortMixerInfo
 
-    // NATIVE METHODS
     private static native int nGetNumDevices();
     private static native PortMixerInfo nNewPortMixerInfo(int mixerIndex);
 }
< prev index next >