当前位置: 首页>>代码示例>>Java>>正文


Java BooleanControl.setValue方法代码示例

本文整理汇总了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);
	}

}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:17,代码来源:OGGSoundClip.java

示例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());
    }
 
开发者ID:shannah,项目名称:cn1,代码行数:22,代码来源:BooleanControlTest.java

示例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.");
  }
}
 
开发者ID:JacobRoth,项目名称:romanov,代码行数:13,代码来源:Controller.java

示例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);
}
 
开发者ID:RalleYTN,项目名称:SimpleAudio,代码行数:9,代码来源:AbstractAudio.java

示例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);
	}
}
 
开发者ID:akarnokd,项目名称:open-ig,代码行数:11,代码来源:AudioThread.java

示例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);
		}
	}
}
 
开发者ID:wnbittle,项目名称:praisenter,代码行数:13,代码来源:XugglerAudioPlayerThread.java

示例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);
        }
    }
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:15,代码来源:JavaMixer.java

示例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);
        }
    }
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:15,代码来源:JavaMixer.java

示例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);
}
 
开发者ID:whamtet,项目名称:BasicPlayer,代码行数:5,代码来源:BasicPlayer.java

示例10: toggleMute

import javax.sound.sampled.BooleanControl; //导入方法依赖的package包/类
public void toggleMute() {
	BooleanControl c = (BooleanControl) findControl(Type.MUTE, m_line.getControls());
	c.setValue(!c.getValue());
}
 
开发者ID:whamtet,项目名称:BasicPlayer,代码行数:5,代码来源:BasicPlayer.java


注:本文中的javax.sound.sampled.BooleanControl.setValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。