Пример #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);
 }