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); }
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; }
@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); }
@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; }
/** * 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); }
/** * 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); } }
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()); } } }
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; }
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); }
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; }
public Control getControl(Type type){ initializeSource(); if (source == null) // Not yet initialized return null; return source.getControl(type); }
private Gain() { super(FloatControl.Type.MASTER_GAIN, -80f, 6.0206f, 80f / 128.0f, -1, 0.0f, "dB", "Minimum", "", "Maximum"); }
private Mute() { super(BooleanControl.Type.MUTE, false, "True", "False"); }
private ApplyReverb() { super(BooleanControl.Type.APPLY_REVERB, false, "True", "False"); }
private Balance() { super(FloatControl.Type.BALANCE, -1.0f, 1.0f, (1.0f / 128.0f), -1, 0.0f, "", "Left", "Center", "Right"); }
private Pan() { super(FloatControl.Type.PAN, -1.0f, 1.0f, (1.0f / 128.0f), -1, 0.0f, "", "Left", "Center", "Right"); }
private ReverbSend() { super(FloatControl.Type.REVERB_SEND, -80f, 6.0206f, 80f / 128.0f, -1, -80f, "dB", "Minimum", "", "Maximum"); }