public void setVolume(final float fVolume) {
   jsVolume.removeChangeListener(CommandJPanel.this);
   jsVolume.removeMouseWheelListener(CommandJPanel.this);
   // if user move the volume slider, unmute
   if (Player.isMuted()) {
     Player.mute(false);
   }
   Player.setVolume(fVolume);
   jsVolume.addChangeListener(CommandJPanel.this);
   jsVolume.addMouseWheelListener(CommandJPanel.this);
 }
예제 #2
0
 /* (non-Javadoc)
  * @see org.jajuk.ui.actions.JajukAction#perform(java.awt.event.ActionEvent)
  */
 @Override
 public void perform(ActionEvent evt) {
   Player.mute();
   SwingUtilities.invokeLater(
       new Runnable() {
         @Override
         public void run() {
           if (Player.isMuted()) {
             setName(Messages.getString("JajukWindow.1"));
           } else {
             setName(Messages.getString("JajukWindow.2"));
           }
           setVolumeIcon(100 * Player.getCurrentVolume());
         }
       });
 }