本文整理汇总了Java中javax.sound.sampled.BooleanControl.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java BooleanControl.setValue方法的具体用法?Java BooleanControl.setValue怎么用?Java BooleanControl.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.sound.sampled.BooleanControl
的用法示例。
在下文中一共展示了BooleanControl.setValue方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setMute
import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
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)
// setGain(oldGain);
}
}
示例2: testEnumControl
import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
public void testEnumControl() {
BooleanControl control = new MyControl(BooleanControl.Type.MUTE, true,
"ON", "OFF");
assertTrue(control.getValue());
control.setValue(false);
assertFalse(control.getValue());
assertEquals("ON", control.getStateLabel(true));
assertEquals("OFF", control.getStateLabel(false));
assertEquals("Mute Control with current value: OFF", control
.toString());
control = new MyControl(BooleanControl.Type.APPLY_REVERB, false);
assertFalse(control.getValue());
control.setValue(true);
assertTrue(control.getValue());
assertEquals("true", control.getStateLabel(true));
assertEquals("false", control.getStateLabel(false));
assertEquals("Apply Reverb Control with current value: true", control
.toString());
}
示例3: setValue
import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
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.");
}
}
示例4: setMute
import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
@Override
public void setMute(boolean mute) {
BooleanControl control = (BooleanControl)this.controls.get("Mute");
boolean oldVal = control.getValue();
control.setValue(mute);
this.trigger(AudioEvent.Type.MUTE_CHANGED, oldVal, mute);
}
示例5: setMute
import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
/**
* 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);
}
}
示例6: setMuted
import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
/**
* Sets this audio player to muted.
* @param flag true to mute the audio
*/
public void setMuted(boolean flag) {
if (this.line != null) {
if (this.line.isControlSupported(BooleanControl.Type.MUTE)) {
BooleanControl control = (BooleanControl)this.line.getControl(BooleanControl.Type.MUTE);
control.setValue(flag);
}
}
}
示例7: setMicrophoneInput
import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
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);
}
}
}
示例8: setMuteForMicrophoneOutput
import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
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);
}
}
}
示例9: setMute
import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
public void setMute(boolean b) {
BooleanControl c = (BooleanControl) findControl(Type.MUTE, m_line.getControls());
c.setValue(b);
}
示例10: toggleMute
import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
public void toggleMute() {
BooleanControl c = (BooleanControl) findControl(Type.MUTE, m_line.getControls());
c.setValue(!c.getValue());
}