javax.sound.sampled.BooleanControl Java Examples

The following examples show how to use javax.sound.sampled.BooleanControl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OGGSoundClip.java    From mars-sim with GNU General Public License v3.0 6 votes vote down vote up
public void setMute(boolean mute) {
		// Set mute value.
		this.mute = mute;

		if (outputLine == null) {
			return;
		} else if (outputLine.isControlSupported(BooleanControl.Type.MUTE)) {
			BooleanControl muteControl = (BooleanControl) outputLine.getControl(BooleanControl.Type.MUTE);
			muteControl.setValue(mute);

			 if (mute)
				 paused = true;
			 else
				 paused = false;
			 
//			 if (!mute)
//			 setGain(oldGain);
		}

	}
 
Example #2
Source File: PortMixer.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #3
Source File: JavaMixer.java    From Spark with Apache License 2.0 5 votes vote down vote up
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);
        }
    }
}
 
Example #4
Source File: PortMixer.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #5
Source File: PortMixer.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #6
Source File: JavaMixer.java    From Spark with Apache License 2.0 5 votes vote down vote up
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);
        }
    }
}
 
Example #7
Source File: JavaMixer.java    From Spark with Apache License 2.0 5 votes vote down vote up
public ControlNode(Control control) {
    super(control.getType(), true);
    this.control = control;
    if (control instanceof BooleanControl) {
        component = createControlComponent((BooleanControl) control);
    } else if (control instanceof EnumControl) {
        component = createControlComponent((EnumControl) control);
    } else if (control instanceof FloatControl) {
        component = createControlComponent((FloatControl) control);
    } else {
        component = null;
    }
}
 
Example #8
Source File: PortMixer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #9
Source File: PortMixer.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #10
Source File: PortMixer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #11
Source File: PortMixer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #12
Source File: PortMixer.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #13
Source File: JavaMixer.java    From Spark with Apache License 2.0 5 votes vote down vote up
public BooleanControlButtonModel(BooleanControl control) {
    this.control = control;
    this.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            setSelected(!isSelected());
        }
    });
}
 
Example #14
Source File: PortMixer.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #15
Source File: PortMixer.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #16
Source File: PortMixer.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #17
Source File: PortMixer.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #18
Source File: PortMixer.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #19
Source File: PortMixer.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static BooleanControl.Type createType(String name) {
    if (name.equals("Mute")) {
        return BooleanControl.Type.MUTE;
    }
    else if (name.equals("Select")) {
        // $$fb add as new static type?
        //return BooleanControl.Type.SELECT;
    }
    return new BCT(name);
}
 
Example #20
Source File: AudioThread.java    From open-ig with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Mute or unmute the current playback.
 * @param mute the mute status
 */
public void setMute(boolean mute) {
	BooleanControl bc = (BooleanControl)sdl.getControl(BooleanControl.Type.MUTE);
	if (bc != null) {
		bc.setValue(mute);
	}
}
 
Example #21
Source File: SoftMixingDataLine.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private Mute() {
    super(BooleanControl.Type.MUTE, false, "True", "False");
}
 
Example #22
Source File: PortMixer.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private BoolCtrl(long controlID, BooleanControl.Type typ) {
    super(typ, false);
    this.controlID = controlID;
}
 
Example #23
Source File: SoftMixingDataLine.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private ApplyReverb() {
    super(BooleanControl.Type.APPLY_REVERB, false, "True", "False");
}
 
Example #24
Source File: SoftMixingDataLine.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private Mute() {
    super(BooleanControl.Type.MUTE, false, "True", "False");
}
 
Example #25
Source File: SoftMixingDataLine.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private Mute() {
    super(BooleanControl.Type.MUTE, false, "True", "False");
}
 
Example #26
Source File: SoftMixingDataLine.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private ApplyReverb() {
    super(BooleanControl.Type.APPLY_REVERB, false, "True", "False");
}
 
Example #27
Source File: PortMixer.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private BoolCtrl(long controlID, BooleanControl.Type typ) {
    super(typ, false);
    this.controlID = controlID;
}
 
Example #28
Source File: SoftMixingDataLine.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private ApplyReverb() {
    super(BooleanControl.Type.APPLY_REVERB, false, "True", "False");
}
 
Example #29
Source File: SoftMixingDataLine.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private ApplyReverb() {
    super(BooleanControl.Type.APPLY_REVERB, false, "True", "False");
}
 
Example #30
Source File: PortMixer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
private BoolCtrl(long controlID, BooleanControl.Type typ) {
    super(typ, false);
    this.controlID = controlID;
}