Search in sources :

Example 1 with BooleanControl

use of javax.sound.sampled.BooleanControl in project Minim by ddf.

the class Controller method setValue.

private void setValue(BooleanControl.Type type, boolean v) {
    if (hasControl(type)) {
        BooleanControl c = (BooleanControl) getControl(type);
        c.setValue(v);
    } else {
        Minim.error(type.toString() + " is not supported.");
    }
}
Also used : BooleanControl(javax.sound.sampled.BooleanControl)

Example 2 with BooleanControl

use of javax.sound.sampled.BooleanControl in project Minim by ddf.

the class Controller method getValue.

private boolean getValue(BooleanControl.Type type) {
    boolean v = false;
    if (hasControl(type)) {
        BooleanControl c = (BooleanControl) getControl(type);
        v = c.getValue();
    } else {
        Minim.error(type.toString() + " is not supported.");
    }
    return v;
}
Also used : BooleanControl(javax.sound.sampled.BooleanControl)

Example 3 with BooleanControl

use of javax.sound.sampled.BooleanControl in project Spark by igniterealtime.

the class JavaMixer method setMicrophoneInput.

public void setMicrophoneInput() {
    TreePath path = findByName(new TreePath(root), new String[] { "MICROPHONE", "Select" });
    if (path == null) {
        path = findByName(new TreePath(root), new String[] { "Capture source", "Capture", "Mute" });
    }
    if (path != null) {
        if (path.getLastPathComponent() instanceof JavaMixer.ControlNode) {
            BooleanControl bControl = (BooleanControl) (((JavaMixer.ControlNode) path.getLastPathComponent()).getControl());
            bControl.setValue(true);
        }
    }
}
Also used : TreePath(javax.swing.tree.TreePath) BooleanControl(javax.sound.sampled.BooleanControl)

Example 4 with BooleanControl

use of javax.sound.sampled.BooleanControl in project Spark by igniterealtime.

the class JavaMixer method setMuteForMicrophoneOutput.

public void setMuteForMicrophoneOutput() {
    TreePath path = findByName(new TreePath(root), new String[] { "SPEAKER", "Microfone", "Mute" });
    if (path == null) {
        path = findByName(new TreePath(root), new String[] { "MIC target", "mic", "Mute" });
    }
    if (path != null) {
        if (path.getLastPathComponent() instanceof JavaMixer.ControlNode) {
            BooleanControl bControl = (BooleanControl) (((JavaMixer.ControlNode) path.getLastPathComponent()).getControl());
            bControl.setValue(true);
        }
    }
}
Also used : TreePath(javax.swing.tree.TreePath) BooleanControl(javax.sound.sampled.BooleanControl)

Aggregations

BooleanControl (javax.sound.sampled.BooleanControl)4 TreePath (javax.swing.tree.TreePath)2