コード例 #1
0
  /** Do the actual muting/unmuting. */
  private void doRun() {
    if (call != null) {
      OperationSetBasicTelephony<?> telephony =
          call.getProtocolProvider().getOperationSet(OperationSetBasicTelephony.class);

      mute = !mute;
      telephony.setMute(call, mute);

      // We make sure that the button state corresponds to the mute state.
      setSelected(mute);

      // If we unmute the microphone and the volume control is set to min,
      // make sure that the volume control is restored to the initial
      // state.
      if (!mute && volumeControl.getVolume() == volumeControl.getMinValue()) {
        volumeControl.setVolume((volumeControl.getMaxValue() - volumeControl.getMinValue()) / 2);
      }
    }
  }
コード例 #2
0
  /**
   * Volume control used by the button.
   *
   * @return volume control used by the button.
   */
  private VolumeControl getVolumeControl() {
    VolumeControl volumeControl = GuiActivator.getMediaService().getInputVolumeControl();

    volumeControl.addVolumeChangeListener(this);
    return volumeControl;
  }