示例#1
0
 public void unMute() {
   if (audioLine == null) {
     isMuted = false;
   } else {
     isMuted = false;
     if (!audioLine.isControlSupported(BooleanControl.Type.MUTE)) return;
     BooleanControl control = (BooleanControl) audioLine.getControl(BooleanControl.Type.MUTE);
     control.setValue(false);
   }
 }
示例#2
0
 public void mute() {
   if (audioLine == null) {
     isMuted = true;
   } else {
     // when requesting the same line you sometimes get different features
     isMuted = true;
     if (!audioLine.isControlSupported(BooleanControl.Type.MUTE)) return;
     BooleanControl control = (BooleanControl) audioLine.getControl(BooleanControl.Type.MUTE);
     control.setValue(true);
   }
 }
示例#3
0
  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);
      }
    }
  }
示例#4
0
  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);
      }
    }
  }
示例#5
0
  /** Current mute state for this audio output channel */
  public boolean isMuted() {
    if (mMuteControl != null) {
      return mMuteControl.getValue();
    }

    return false;
  }
示例#6
0
 /** Mute audio (playback continues) */
 public void mute() {
   if (!muted) {
     try {
       muteCtrl.setValue(true);
       muted = true;
     } catch (Exception e) {
       PApplet.println(e.getMessage());
     }
   } else {
     try {
       muteCtrl.setValue(false);
       muted = false;
     } catch (Exception e) {
       PApplet.println(e.getMessage());
     }
   }
 }
示例#7
0
 private JComponent createControlComponent(BooleanControl control) {
   AbstractButton button;
   String strControlName = control.getType().toString();
   ButtonModel model = new JavaMixer.BooleanControlButtonModel(control);
   button = new JCheckBox(strControlName);
   button.setModel(model);
   return button;
 }
示例#8
0
  /** Sets the mute state for this audio output channel */
  public void setMuted(boolean muted) {
    if (mMuteControl != null) {
      mMuteControl.setValue(muted);

      broadcast(
          new AudioEvent(
              muted ? AudioEvent.Type.AUDIO_MUTED : AudioEvent.Type.AUDIO_UNMUTED,
              getChannelName()));
    }
  }
示例#9
0
 /** Methode zum Muten der Sounds */
 public static void mutean() {
   BooleanControl muteControl = (BooleanControl) clip.getControl(BooleanControl.Type.MUTE);
   muteControl.setValue(true);
 }
示例#10
0
 public boolean isSelected() {
   return control.getValue();
 }
示例#11
0
 public void setSelected(boolean bSelected) {
   control.setValue(bSelected);
 }