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

下面列出了怎么用javax.sound.sampled.Control的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: 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;
}
 
源代码2 项目: openjdk-jdk9   文件: 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");
}
 
源代码3 项目: 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");
}
 
源代码4 项目: Bytecoder   文件: 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;
}
 
源代码5 项目: TencentKona-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;
}
 
源代码6 项目: jdk8u60   文件: 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");
}
 
源代码7 项目: openjdk-jdk8u   文件: 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");
}
 
源代码8 项目: dragonwell8_jdk   文件: 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);
        }
    }
}
 
源代码9 项目: jdk8u-jdk   文件: AbstractLine.java
public final boolean isControlSupported(Control.Type controlType) {
    // protect against a NullPointerException
    if (controlType == null) {
        return false;
    }

    for (int i = 0; i < controls.length; i++) {
        if (controlType == controls[i].getType()) {
            return true;
        }
    }

    return false;
}
 
源代码10 项目: dragonwell8_jdk   文件: AbstractLine.java
public final Control getControl(Control.Type controlType) {
    // protect against a NullPointerException
    if (controlType != null) {

        for (int i = 0; i < controls.length; i++) {
            if (controlType == controls[i].getType()) {
                return controls[i];
            }
        }
    }

    throw new IllegalArgumentException("Unsupported control type: " + controlType);
}
 
源代码11 项目: dragonwell8_jdk   文件: SoftMixingDataLine.java
SoftMixingDataLine(SoftMixingMixer mixer, DataLine.Info info) {
    this.mixer = mixer;
    this.info = info;
    this.control_mutex = mixer.control_mutex;

    controls = new Control[] { gain_control, mute_control, balance_control,
            pan_control, reverbsend_control, chorussend_control,
            apply_reverb };
    calcVolume();
}
 
源代码12 项目: dragonwell8_jdk   文件: SoftMixingDataLine.java
public final Control getControl(Type control) {
    if (control != null) {
        for (int i = 0; i < controls.length; i++) {
            if (controls[i].getType() == control) {
                return controls[i];
            }
        }
    }
    throw new IllegalArgumentException("Unsupported control type : "
            + control);
}
 
源代码13 项目: Bytecoder   文件: AbstractLine.java
@Override
public final boolean isControlSupported(Control.Type controlType) {
    // protect against a NullPointerException
    if (controlType == null) {
        return false;
    }

    for (int i = 0; i < controls.length; i++) {
        if (controlType == controls[i].getType()) {
            return true;
        }
    }

    return false;
}