Java 类javax.sound.sampled.Control 实例源码

项目:OpenJSharp    文件:PortMixer.java   
void implOpen() throws LineUnavailableException {
    if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
    long newID = ((PortMixer) mixer).getID();
    if ((id == 0) || (newID != id) || (controls.length == 0)) {
        id = newID;
        Vector vector = new Vector();
        synchronized (vector) {
            nGetControls(id, portIndex, vector);
            controls = new Control[vector.size()];
            for (int i = 0; i < controls.length; i++) {
                controls[i] = (Control) vector.elementAt(i);
            }
        }
    } else {
        enableControls(controls, true);
    }
    if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
项目:OpenJSharp    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:jdk8u-jdk    文件:PortMixer.java   
void implOpen() throws LineUnavailableException {
    if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
    long newID = ((PortMixer) mixer).getID();
    if ((id == 0) || (newID != id) || (controls.length == 0)) {
        id = newID;
        Vector vector = new Vector();
        synchronized (vector) {
            nGetControls(id, portIndex, vector);
            controls = new Control[vector.size()];
            for (int i = 0; i < controls.length; i++) {
                controls[i] = (Control) vector.elementAt(i);
            }
        }
    } else {
        enableControls(controls, true);
    }
    if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
项目:jdk8u-jdk    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:openjdk-jdk10    文件:PortMixer.java   
void implOpen() throws LineUnavailableException {
    if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
    long newID = ((PortMixer) mixer).getID();
    if ((id == 0) || (newID != id) || (controls.length == 0)) {
        id = newID;
        Vector<Control> vector = new Vector<>();
        synchronized (vector) {
            nGetControls(id, portIndex, vector);
            controls = new Control[vector.size()];
            for (int i = 0; i < controls.length; i++) {
                controls[i] = vector.elementAt(i);
            }
        }
    } else {
        enableControls(controls, true);
    }
    if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
项目:openjdk-jdk10    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixerInfo the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:openjdk9    文件:AbstractDataLine.java   
/**
 * Constructs a new AbstractLine.
 */
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {

    super(info, mixer, controls);

    // record the default values
    if (format != null) {
        defaultFormat = format;
    } else {
        // default CD-quality
        defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
    }
    if (bufferSize > 0) {
        defaultBufferSize = bufferSize;
    } else {
        // 0.5 seconds buffer
        defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
    }

    // set the initial values to the defaults
    this.format = defaultFormat;
    this.bufferSize = defaultBufferSize;
}
项目:openjdk9    文件:PortMixer.java   
void implOpen() throws LineUnavailableException {
    if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
    long newID = ((PortMixer) mixer).getID();
    if ((id == 0) || (newID != id) || (controls.length == 0)) {
        id = newID;
        Vector<Control> vector = new Vector<>();
        synchronized (vector) {
            nGetControls(id, portIndex, vector);
            controls = new Control[vector.size()];
            for (int i = 0; i < controls.length; i++) {
                controls[i] = vector.elementAt(i);
            }
        }
    } else {
        enableControls(controls, true);
    }
    if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
项目:openjdk9    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:jdk8u_jdk    文件:AbstractDataLine.java   
/**
 * Constructs a new AbstractLine.
 */
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {

    super(info, mixer, controls);

    // record the default values
    if (format != null) {
        defaultFormat = format;
    } else {
        // default CD-quality
        defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
    }
    if (bufferSize > 0) {
        defaultBufferSize = bufferSize;
    } else {
        // 0.5 seconds buffer
        defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
    }

    // set the initial values to the defaults
    this.format = defaultFormat;
    this.bufferSize = defaultBufferSize;
}
项目:jdk8u_jdk    文件:PortMixer.java   
void implOpen() throws LineUnavailableException {
    if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
    long newID = ((PortMixer) mixer).getID();
    if ((id == 0) || (newID != id) || (controls.length == 0)) {
        id = newID;
        Vector vector = new Vector();
        synchronized (vector) {
            nGetControls(id, portIndex, vector);
            controls = new Control[vector.size()];
            for (int i = 0; i < controls.length; i++) {
                controls[i] = (Control) vector.elementAt(i);
            }
        }
    } else {
        enableControls(controls, true);
    }
    if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
项目:jdk8u_jdk    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:lookaside_java-1.8.0-openjdk    文件:AbstractDataLine.java   
/**
 * Constructs a new AbstractLine.
 */
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {

    super(info, mixer, controls);

    // record the default values
    if (format != null) {
        defaultFormat = format;
    } else {
        // default CD-quality
        defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
    }
    if (bufferSize > 0) {
        defaultBufferSize = bufferSize;
    } else {
        // 0.5 seconds buffer
        defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
    }

    // set the initial values to the defaults
    this.format = defaultFormat;
    this.bufferSize = defaultBufferSize;
}
项目:lookaside_java-1.8.0-openjdk    文件:PortMixer.java   
void implOpen() throws LineUnavailableException {
    if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
    long newID = ((PortMixer) mixer).getID();
    if ((id == 0) || (newID != id) || (controls.length == 0)) {
        id = newID;
        Vector vector = new Vector();
        synchronized (vector) {
            nGetControls(id, portIndex, vector);
            controls = new Control[vector.size()];
            for (int i = 0; i < controls.length; i++) {
                controls[i] = (Control) vector.elementAt(i);
            }
        }
    } else {
        enableControls(controls, true);
    }
    if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
项目:lookaside_java-1.8.0-openjdk    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:Couch-Potato-Server    文件:LineDescription.java   
@Override
public final String toString()
{
    if (contents==null)
    {
        final StringBuilder contentBuilder=new StringBuilder();

        for (int loop=0; loop<indent; loop++)
            contentBuilder.append('\t');
        contentBuilder.append(subject.getLineInfo().toString());

        for (final Control control : subject.getControls())
        {
            contentBuilder.append(System.getProperty("line.separator"));
            contentBuilder.append(new ControlDescription(control, indent+1).toString());
        }

        contents=contentBuilder.toString();
    }
    return contents;
}
项目:Couch-Potato-Server    文件:ControlDescription.java   
@Override
public final String toString()
{
    if (contents==null)
    {
        final StringBuilder contentBuilder=new StringBuilder();

        for (int loop=0; loop<indent; loop++)
            contentBuilder.append('\t');
        contentBuilder.append(subject.toString());

        if (subject instanceof CompoundControl)
        {
            for (final Control member : ((CompoundControl)subject).getMemberControls())
            {
                contentBuilder.append(System.getProperty("line.separator"));
                contentBuilder.append(new ControlDescription(member, indent+1).toString());
            }
        }

        contents=contentBuilder.toString();
    }
    return contents;
}
项目:couch-potato-server    文件:LineDescription.java   
@Override
public final String toString()
{
    if (contents==null)
    {
        final StringBuilder contentBuilder=new StringBuilder();

        for (int loop=0; loop<indent; loop++)
            contentBuilder.append('\t');
        contentBuilder.append(subject.getLineInfo().toString());

        for (final Control control : subject.getControls())
        {
            contentBuilder.append(System.getProperty("line.separator"));
            contentBuilder.append(new ControlDescription(control, indent+1).toString());
        }

        contents=contentBuilder.toString();
    }
    return contents;
}
项目:couch-potato-server    文件:ControlDescription.java   
@Override
public final String toString()
{
    if (contents==null)
    {
        final StringBuilder contentBuilder=new StringBuilder();

        for (int loop=0; loop<indent; loop++)
            contentBuilder.append('\t');
        contentBuilder.append(subject.toString());

        if (subject instanceof CompoundControl)
        {
            for (final Control member : ((CompoundControl)subject).getMemberControls())
            {
                contentBuilder.append(System.getProperty("line.separator"));
                contentBuilder.append(new ControlDescription(member, indent+1).toString());
            }
        }

        contents=contentBuilder.toString();
    }
    return contents;
}
项目:infobip-open-jdk-8    文件:AbstractDataLine.java   
/**
 * Constructs a new AbstractLine.
 */
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {

    super(info, mixer, controls);

    // record the default values
    if (format != null) {
        defaultFormat = format;
    } else {
        // default CD-quality
        defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
    }
    if (bufferSize > 0) {
        defaultBufferSize = bufferSize;
    } else {
        // 0.5 seconds buffer
        defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
    }

    // set the initial values to the defaults
    this.format = defaultFormat;
    this.bufferSize = defaultBufferSize;
}
项目:infobip-open-jdk-8    文件:PortMixer.java   
void implOpen() throws LineUnavailableException {
    if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
    long newID = ((PortMixer) mixer).getID();
    if ((id == 0) || (newID != id) || (controls.length == 0)) {
        id = newID;
        Vector vector = new Vector();
        synchronized (vector) {
            nGetControls(id, portIndex, vector);
            controls = new Control[vector.size()];
            for (int i = 0; i < controls.length; i++) {
                controls[i] = (Control) vector.elementAt(i);
            }
        }
    } else {
        enableControls(controls, true);
    }
    if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
项目:infobip-open-jdk-8    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:jdk8u-dev-jdk    文件:AbstractDataLine.java   
/**
 * Constructs a new AbstractLine.
 */
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {

    super(info, mixer, controls);

    // record the default values
    if (format != null) {
        defaultFormat = format;
    } else {
        // default CD-quality
        defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
    }
    if (bufferSize > 0) {
        defaultBufferSize = bufferSize;
    } else {
        // 0.5 seconds buffer
        defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
    }

    // set the initial values to the defaults
    this.format = defaultFormat;
    this.bufferSize = defaultBufferSize;
}
项目:jdk8u-dev-jdk    文件:PortMixer.java   
void implOpen() throws LineUnavailableException {
    if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
    long newID = ((PortMixer) mixer).getID();
    if ((id == 0) || (newID != id) || (controls.length == 0)) {
        id = newID;
        Vector vector = new Vector();
        synchronized (vector) {
            nGetControls(id, portIndex, vector);
            controls = new Control[vector.size()];
            for (int i = 0; i < controls.length; i++) {
                controls[i] = (Control) vector.elementAt(i);
            }
        }
    } else {
        enableControls(controls, true);
    }
    if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
项目:jdk8u-dev-jdk    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:jdk7-jdk    文件:AbstractDataLine.java   
/**
 * Constructs a new AbstractLine.
 */
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {

    super(info, mixer, controls);

    // record the default values
    if (format != null) {
        defaultFormat = format;
    } else {
        // default CD-quality
        defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
    }
    if (bufferSize > 0) {
        defaultBufferSize = bufferSize;
    } else {
        // 0.5 seconds buffer
        defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
    }

    // set the initial values to the defaults
    this.format = defaultFormat;
    this.bufferSize = defaultBufferSize;
}
项目:jdk7-jdk    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:openjdk-source-code-learn    文件:AbstractDataLine.java   
/**
 * Constructs a new AbstractLine.
 */
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {

    super(info, mixer, controls);

    // record the default values
    if (format != null) {
        defaultFormat = format;
    } else {
        // default CD-quality
        defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
    }
    if (bufferSize > 0) {
        defaultBufferSize = bufferSize;
    } else {
        // 0.5 seconds buffer
        defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
    }

    // set the initial values to the defaults
    this.format = defaultFormat;
    this.bufferSize = defaultBufferSize;
}
项目:openjdk-source-code-learn    文件:PortMixer.java   
void implOpen() throws LineUnavailableException {
    if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
    long newID = ((PortMixer) mixer).getID();
    if ((id == 0) || (newID != id) || (controls.length == 0)) {
        id = newID;
        Vector vector = new Vector();
        synchronized (vector) {
            nGetControls(id, portIndex, vector);
            controls = new Control[vector.size()];
            for (int i = 0; i < controls.length; i++) {
                controls[i] = (Control) vector.elementAt(i);
            }
        }
    } else {
        enableControls(controls, true);
    }
    if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
项目:openjdk-source-code-learn    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:Couch-Potato-Server    文件:ControlDescription.java   
@Override
public final String toString()
{
    if (contents==null)
    {
        final StringBuilder contentBuilder=new StringBuilder();

        for (int loop=0; loop<indent; loop++)
            contentBuilder.append('\t');
        contentBuilder.append(subject.toString());

        if (subject instanceof CompoundControl)
        {
            for (final Control member : ((CompoundControl)subject).getMemberControls())
            {
                contentBuilder.append(System.getProperty("line.separator"));
                contentBuilder.append(new ControlDescription(member, indent+1).toString());
            }
        }

        contents=contentBuilder.toString();
    }
    return contents;
}
项目:OLD-OpenJDK8    文件:AbstractDataLine.java   
/**
 * Constructs a new AbstractLine.
 */
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {

    super(info, mixer, controls);

    // record the default values
    if (format != null) {
        defaultFormat = format;
    } else {
        // default CD-quality
        defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
    }
    if (bufferSize > 0) {
        defaultBufferSize = bufferSize;
    } else {
        // 0.5 seconds buffer
        defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
    }

    // set the initial values to the defaults
    this.format = defaultFormat;
    this.bufferSize = defaultBufferSize;
}
项目:OLD-OpenJDK8    文件:PortMixer.java   
void implOpen() throws LineUnavailableException {
    if (Printer.trace) Printer.trace(">> PortMixerPort: implOpen().");
    long newID = ((PortMixer) mixer).getID();
    if ((id == 0) || (newID != id) || (controls.length == 0)) {
        id = newID;
        Vector vector = new Vector();
        synchronized (vector) {
            nGetControls(id, portIndex, vector);
            controls = new Control[vector.size()];
            for (int i = 0; i < controls.length; i++) {
                controls[i] = (Control) vector.elementAt(i);
            }
        }
    } else {
        enableControls(controls, true);
    }
    if (Printer.trace) Printer.trace("<< PortMixerPort: implOpen() succeeded");
}
项目:OLD-OpenJDK8    文件:AbstractMixer.java   
/**
 * Constructs a new AbstractMixer.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractMixer(Mixer.Info mixerInfo,
                        Control[] controls,
                        Line.Info[] sourceLineInfo,
                        Line.Info[] targetLineInfo) {

    // Line.Info, AbstractMixer, Control[]
    super(new Line.Info(Mixer.class), null, controls);

    // setup the line part
    this.mixer = this;
    if (controls == null) {
        controls = new Control[0];
    }

    // setup the mixer part
    this.mixerInfo = mixerInfo;
    this.sourceLineInfo = sourceLineInfo;
    this.targetLineInfo = targetLineInfo;
}
项目:openjdk-jdk7u-jdk    文件:AbstractDataLine.java   
/**
 * Constructs a new AbstractLine.
 */
protected AbstractDataLine(DataLine.Info info, AbstractMixer mixer, Control[] controls, AudioFormat format, int bufferSize) {

    super(info, mixer, controls);

    // record the default values
    if (format != null) {
        defaultFormat = format;
    } else {
        // default CD-quality
        defaultFormat = new AudioFormat(44100.0f, 16, 2, true, Platform.isBigEndian());
    }
    if (bufferSize > 0) {
        defaultBufferSize = bufferSize;
    } else {
        // 0.5 seconds buffer
        defaultBufferSize = ((int) (defaultFormat.getFrameRate() / 2)) * defaultFormat.getFrameSize();
    }

    // set the initial values to the defaults
    this.format = defaultFormat;
    this.bufferSize = defaultBufferSize;
}
项目:romanov    文件:Controller.java   
/** @invisible
 * 
 * Prints the available controls and their ranges to the console. Not all
 * Controllers have all of the controls available on them so this is a way to find
 * out what is available.
 * 
 */
public void printControls()
{
  if (controls.length > 0)
  {
    System.out.println("Available controls are:");
    for (int i = 0; i < controls.length; i++)
    {
      Control.Type type = controls[i].getType();
      System.out.print("  " + type.toString());
      if (type == VOLUME || type == GAIN || type == BALANCE || type == PAN)
      {
        FloatControl fc = (FloatControl) controls[i];
        String shiftSupported = "does";
        if (fc.getUpdatePeriod() == -1)
        {
          shiftSupported = "doesn't";
        }
        System.out.println(", which has a range of " + fc.getMaximum() + " to "
            + fc.getMinimum() + " and " + shiftSupported
            + " support shifting.");
      }
      else
      {
        System.out.println("");
      }
    }
  }
  else
  {
    System.out.println("There are no controls available.");
  }
}
项目:romanov    文件:Controller.java   
@Deprecated
public Control getControl(Control.Type type)
{
  for(int i = 0; i < controls.length; i++)
  {
    if ( controls[i].getType().equals(type) )
    {
      return controls[i];
    }
  }
  return null;
}
项目:OpenJSharp    文件:PortMixer.java   
private void enableControls(Control[] controls, boolean enable) {
    for (int i = 0; i < controls.length; i++) {
        if (controls[i] instanceof BoolCtrl) {
            ((BoolCtrl) controls[i]).closed = !enable;
        }
        else if (controls[i] instanceof FloatCtrl) {
            ((FloatCtrl) controls[i]).closed = !enable;
        }
        else if (controls[i] instanceof CompoundControl) {
            enableControls(((CompoundControl) controls[i]).getMemberControls(), enable);
        }
    }
}
项目:OpenJSharp    文件:AbstractLine.java   
/**
 * Constructs a new AbstractLine.
 * @param mixer the mixer with which this line is associated
 * @param controls set of supported controls
 */
protected AbstractLine(Line.Info info, AbstractMixer mixer, Control[] controls) {

    if (controls == null) {
        controls = new Control[0];
    }

    this.info = info;
    this.mixer = mixer;
    this.controls = controls;
}
项目:OpenJSharp    文件:AbstractLine.java   
/**
 * Obtains the set of controls supported by the
 * line.  If no controls are supported, returns an
 * array of length 0.
 * @return control set
 */
public final Control[] getControls() {
    Control[] returnedArray = new Control[controls.length];

    for (int i = 0; i < controls.length; i++) {
        returnedArray[i] = controls[i];
    }

    return returnedArray;
}