本文整理汇总了Java中javax.sound.sampled.Control.Type类的典型用法代码示例。如果您正苦于以下问题:Java Type类的具体用法?Java Type怎么用?Java Type使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Type类属于javax.sound.sampled.Control包,在下文中一共展示了Type类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getControl
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
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);
}
示例2: isControlSupported
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
public final boolean isControlSupported(Type control) {
if (control != null) {
for (int i = 0; i < controls.length; i++) {
if (controls[i].getType() == control) {
return true;
}
}
}
return false;
}
示例3: getControl
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
@Override
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);
}
示例4: isControlSupported
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
@Override
public final boolean isControlSupported(Type control) {
if (control != null) {
for (int i = 0; i < controls.length; i++) {
if (controls[i].getType() == control) {
return true;
}
}
}
return false;
}
示例5: setPan
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
/**
* Sets Pan value. Line should be opened before calling this method. Linear scale : -1.0 ... +1.0
*
* @param fPan
* the new pan
*/
public void setPan(double fPan) {
if (!hasControl(FloatControl.Type.PAN, panControl) || fPan < -1.0 || fPan > 1.0)
return;
logger.info(() -> "Pan : " + fPan);
panControl.setValue((float) fPan);
generateEvent(Status.PAN, getEncodedStreamPosition(), null);
}
示例6: setBalance
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
/**
* Represents a control for the relative balance of a stereo signal between two stereo speakers. The valid range of values is -1.0 (left channel
* only) to 1.0 (right channel only). The default is 0.0 (centered).
*
* @param fBalance
* the new balance
*/
public void setBalance(float fBalance) {
if (hasControl(FloatControl.Type.BALANCE, balanceControl) && fBalance >= -1.0 && fBalance <= 1.0)
balanceControl.setValue(fBalance);
else
try {
throw new StreamPlayerException(StreamPlayerException.PlayerException.BALANCE_CONTROL_NOT_SUPPORTED);
} catch (StreamPlayerException ex) {
logger.log(Level.WARNING, ex.getMessage(), ex);
}
}
示例7: logControls
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
private void logControls(Control[] controls)
{
for (int i = 0; i < controls.length; i++)
{
Control control = controls[i];
logger.fine("control: " + control);
Type controlType = control.getType();
if (controlType instanceof CompoundControl.Type)
{
logControls(((CompoundControl) control).getMemberControls());
}
}
}
示例8: getControl
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
public Control getControl(Type type) {
if( this.controls != null ) {
for(Control control : this.controls) {
if( control.getType().toString().equals(type.toString()) ) {
return control;
}
}
}
return null;
}
示例9: getControl
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
public 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);
}
示例10: isControlSupported
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
public boolean isControlSupported(Type control) {
if (control != null) {
for (int i = 0; i < controls.length; i++) {
if (controls[i].getType() == control) {
return true;
}
}
}
return false;
}
示例11: getControl
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
public Control getControl(Type type){
initializeSource();
if (source == null) // Not yet initialized
return null;
return source.getControl(type);
}
示例12: Gain
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
private Gain() {
super(FloatControl.Type.MASTER_GAIN, -80f, 6.0206f, 80f / 128.0f,
-1, 0.0f, "dB", "Minimum", "", "Maximum");
}
示例13: Mute
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
private Mute() {
super(BooleanControl.Type.MUTE, false, "True", "False");
}
示例14: ApplyReverb
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
private ApplyReverb() {
super(BooleanControl.Type.APPLY_REVERB, false, "True", "False");
}
示例15: Balance
import javax.sound.sampled.Control.Type; //导入依赖的package包/类
private Balance() {
super(FloatControl.Type.BALANCE, -1.0f, 1.0f, (1.0f / 128.0f), -1,
0.0f, "", "Left", "Center", "Right");
}