Remove unused code, muting individual call peers.

cusax-fix
Damian Minkov 16 years ago
parent 161e8625ef
commit bf4d3f5ef6

@ -320,16 +320,6 @@ public static void putOnHold(CallPeer callPeer, boolean isOnHold)
new PutOnHoldCallPeerThread(callPeer, isOnHold).start();
}
/**
* Mutes the given <tt>callPeer</tt>.
* @param callPeer the peer to mute
* @param isMute indicates the action (disable or enable mute)
*/
public static void mute(CallPeer callPeer, boolean isMute)
{
new MuteCallPeerThread(callPeer, isMute).start();
}
/**
* Transfers the given <tt>peer</tt> to the given <tt>target</tt>.
* @param peer the <tt>CallPeer</tt> to transfer
@ -923,32 +913,6 @@ public void run()
}
}
/**
* Mutes the given <tt>CallPeer</tt>.
*/
private static class MuteCallPeerThread
extends Thread
{
private final CallPeer callPeer;
private final boolean isMute;
public MuteCallPeerThread(CallPeer callPeer, boolean isMute)
{
this.callPeer = callPeer;
this.isMute = isMute;
}
public void run()
{
OperationSetBasicTelephony telephony =
callPeer.getProtocolProvider()
.getOperationSet(OperationSetBasicTelephony.class);
telephony.setMute(callPeer, isMute);
}
}
/**
* Stops all telephony related sounds.
*/

@ -28,8 +28,7 @@
*/
public class CallPeerMenu
extends SIPCommMenu
implements CallPeerListener,
PropertyChangeListener
implements CallPeerListener
{
private final CallPeer callPeer;
@ -45,8 +44,6 @@ public class CallPeerMenu
private final String unmuteText = GuiActivator.getResources()
.getI18NString("service.gui.UNMUTE");
private final JMenuItem muteMenuItem = new JMenuItem(muteText);
/**
* Creates a <tt>CallPeerActionMenuBar</tt> by specifying the associated
* <tt>callPeer</tt>.
@ -86,12 +83,6 @@ public void actionPerformed(ActionEvent e)
// changes. We'll be using these notifications in order to update the
// hold menu item state.
peer.addCallPeerListener(this);
/* Disable per peer muting
initMuteMenuItem();
this.add(muteMenuItem);
peer.addPropertyChangeListener(this);
*/
}
/**
@ -118,30 +109,6 @@ public void actionPerformed(ActionEvent e)
});
}
/**
* Initializes the mute menu item.
*/
private void initMuteMenuItem()
{
muteMenuItem.addActionListener(
new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
if (muteMenuItem.getText().equals(muteText))
{
CallManager.mute(callPeer, true);
muteMenuItem.setText(unmuteText);
}
else
{
CallManager.mute(callPeer, false);
muteMenuItem.setText(muteText);
}
}
});
}
/**
* Implements <tt>{@link CallPeerListener#peerStateChanged
* (CallPeerChangeEvent)}</tt>
@ -174,28 +141,4 @@ public void peerDisplayNameChanged(CallPeerChangeEvent evt) {}
public void peerImageChanged(CallPeerChangeEvent evt) {}
public void peerTransportAddressChanged(CallPeerChangeEvent evt) {}
/**
* Implements <tt>
* {@link PropertyChangeListener#propertyChange(PropertyChangeEvent)}</tt>
* in order to update the "Mute/Unmute" menu item to fit the current state
* of the mute property for this call peer.
*
* @param evt the <tt>PropertyChangeEvent</tt> that notified us of the
* property change
*/
public void propertyChange(PropertyChangeEvent evt)
{
String propertyName = evt.getPropertyName();
if (propertyName.equals(CallPeer.MUTE_PROPERTY_NAME))
{
boolean isMute = (Boolean) evt.getNewValue();
if (isMute)
muteMenuItem.setText(unmuteText);
else
muteMenuItem.setText(muteText);
}
}
}

@ -1513,26 +1513,6 @@ public synchronized void shutdown()
}
}
/**
* Sets the mute state of the audio stream being sent to a specific
* <tt>CallPeer</tt>.
* <p>
* The implementation sends silence through the audio stream.
* </p>
*
* @param peer the <tt>CallPeer</tt> who receives the audio stream to have
* its mute state set
* @param mute <tt>true</tt> to mute the audio stream being sent to
* <tt>peer</tt>; otherwise, <tt>false</tt>
*/
@Override
public void setMute(CallPeer peer, boolean mute)
{
CallPeerSipImpl sipPeer = (CallPeerSipImpl) peer;
sipPeer.setMute(mute);
}
/**
* Sets the mute state of the <tt>Call</tt>.
* <p>

@ -102,27 +102,6 @@ public void removeCallListener(CallListener listener)
}
}
/**
* Sets the mute state of the audio stream being sent to a specific
* <tt>CallPeer</tt>.
* <p>
* The default implementation does nothing.
* </p>
*
* @param peer the <tt>CallPeer</tt> who receives the audio
* stream to have its mute state set
* @param mute <tt>true</tt> to mute the audio stream being sent to
* <tt>peer</tt>; otherwise, <tt>false</tt>
*/
public void setMute(CallPeer peer, boolean mute)
{
/*
* While throwing UnsupportedOperationException may be a possible
* approach, putOnHold/putOffHold just do nothing when not supported so
* this implementation takes inspiration from them.
*/
}
/**
* Sets the mute state of the <tt>Call</tt>.
* <p>

@ -135,21 +135,6 @@ public void hangupCallPeer(CallPeer peer)
*/
public Iterator<? extends Call> getActiveCalls();
/**
* Sets the mute state of the audio stream being sent to a specific
* <tt>CallPeer</tt>.
* <p>
* Muting an audio stream is implementation specific and one of the possible
* approaches to it is sending silence.
* </p>
*
* @param peer the <tt>CallPeer</tt> who receives the audio
* stream to have its mute state set
* @param mute <tt>true</tt> to mute the audio stream being sent to
* <tt>peer</tt>; otherwise, <tt>false</tt>
*/
public void setMute(CallPeer peer, boolean mute);
/**
* Sets the mute state of the <tt>Call</tt>.
* <p>

Loading…
Cancel
Save