diff options
author | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2013-01-20 16:00:40 +0000 |
---|---|---|
committer | Lyubomir Marinov <lyubomir.marinov@jitsi.org> | 2013-01-20 16:00:40 +0000 |
commit | 738efc329f8bbb1a5648afa4500e3312f8676310 (patch) | |
tree | 0171b476a01c8e2cd232544f07ef6a71618ffcb3 /src/net/java/sip/communicator/service/protocol | |
parent | 8a1075ed1effa0fec72cb46e3388cb33cd570c9e (diff) | |
download | jitsi-738efc329f8bbb1a5648afa4500e3312f8676310.zip jitsi-738efc329f8bbb1a5648afa4500e3312f8676310.tar.gz jitsi-738efc329f8bbb1a5648afa4500e3312f8676310.tar.bz2 |
Works on the user interface of video conference calls: allows toggling the display of the local video, removes buttons which are not applicable.
Diffstat (limited to 'src/net/java/sip/communicator/service/protocol')
4 files changed, 39 insertions, 44 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/CallConference.java b/src/net/java/sip/communicator/service/protocol/CallConference.java index f1c93ea..23674cc 100644 --- a/src/net/java/sip/communicator/service/protocol/CallConference.java +++ b/src/net/java/sip/communicator/service/protocol/CallConference.java @@ -795,7 +795,7 @@ public class CallConference * telephony conference changed as a result of the method call; otherwise, * <tt>false</tt> */ - public boolean removeCall(Call call) + boolean removeCall(Call call) { if (call == null) return false; diff --git a/src/net/java/sip/communicator/service/protocol/media/AbstractOperationSetTelephonyConferencing.java b/src/net/java/sip/communicator/service/protocol/media/AbstractOperationSetTelephonyConferencing.java index 9d6812c..948afc0 100644 --- a/src/net/java/sip/communicator/service/protocol/media/AbstractOperationSetTelephonyConferencing.java +++ b/src/net/java/sip/communicator/service/protocol/media/AbstractOperationSetTelephonyConferencing.java @@ -268,9 +268,9 @@ public abstract class AbstractOperationSetTelephonyConferencing< * @param event a <tt>CallPeerEvent</tt> which specifies the * <tt>CallPeer</tt> which has been removed from a <tt>Call</tt> */ - @SuppressWarnings("unchecked") public void callPeerRemoved(CallPeerEvent event) { + @SuppressWarnings("unchecked") MediaAwareCallPeerT callPeer = (MediaAwareCallPeerT) event.getSourceCallPeer(); @@ -467,17 +467,15 @@ public abstract class AbstractOperationSetTelephonyConferencing< */ private String getEndpointStatus(Node endpoint) { - NodeList endpointChildList = endpoint.getChildNodes(); - int endpoingChildCount = endpointChildList.getLength(); + NodeList childNodes = endpoint.getChildNodes(); + int childCount = childNodes.getLength(); - for (int endpointChildIndex = 0; - endpointChildIndex < endpoingChildCount; - endpointChildIndex++) + for (int i = 0; i < childCount; i++) { - Node endpointChild = endpointChildList.item(endpointChildIndex); + Node child = childNodes.item(i); - if (ELEMENT_STATUS.equals(endpointChild.getNodeName())) - return endpointChild.getTextContent(); + if (ELEMENT_STATUS.equals(child.getNodeName())) + return child.getTextContent(); } return null; } @@ -686,24 +684,19 @@ public abstract class AbstractOperationSetTelephonyConferencing< * old and new values of the property * @see PropertyChangeListener#propertyChange(PropertyChangeEvent) */ - @SuppressWarnings("unchecked") public void propertyChange(PropertyChangeEvent ev) { String propertyName = ev.getPropertyName(); - if (CallPeerMediaHandler.AUDIO_LOCAL_SSRC.equals( - propertyName) - || CallPeerMediaHandler.AUDIO_REMOTE_SSRC.equals( - propertyName) - || CallPeerMediaHandler.VIDEO_LOCAL_SSRC.equals( - propertyName) - || CallPeerMediaHandler.VIDEO_REMOTE_SSRC.equals( - propertyName)) + if (CallPeerMediaHandler.AUDIO_LOCAL_SSRC.equals(propertyName) + || CallPeerMediaHandler.AUDIO_REMOTE_SSRC.equals(propertyName) + || CallPeerMediaHandler.VIDEO_LOCAL_SSRC.equals(propertyName) + || CallPeerMediaHandler.VIDEO_REMOTE_SSRC.equals(propertyName)) { - Call call - = ((CallPeerMediaHandler<MediaAwareCallPeerT>) ev.getSource()) - .getPeer() - .getCall(); + @SuppressWarnings("unchecked") + CallPeerMediaHandler<MediaAwareCallPeerT> mediaHandler + = (CallPeerMediaHandler<MediaAwareCallPeerT>) ev.getSource(); + Call call = mediaHandler.getPeer().getCall(); if (call != null) notifyAll(call); @@ -798,23 +791,23 @@ public abstract class AbstractOperationSetTelephonyConferencing< continue; /* - * Determine the ConferenceMembers which are no longer in the - * list. + * Determine the ConferenceMembers who are no longer in the list + * i.e. are to be removed. */ - AbstractConferenceMember existingConferenceMember = null; + AbstractConferenceMember conferenceMember = null; for (int i = 0; i < toRemoveCount; i++) { - ConferenceMember conferenceMember + ConferenceMember aConferenceMember = toRemove[i]; - if ((conferenceMember != null) + if ((aConferenceMember != null) && address.equalsIgnoreCase( - conferenceMember.getAddress())) + aConferenceMember.getAddress())) { toRemove[i] = null; - existingConferenceMember - = (AbstractConferenceMember) conferenceMember; + conferenceMember + = (AbstractConferenceMember) aConferenceMember; break; } } @@ -822,9 +815,9 @@ public abstract class AbstractOperationSetTelephonyConferencing< // Create the new ones. boolean addConferenceMember; - if (existingConferenceMember == null) + if (conferenceMember == null) { - existingConferenceMember + conferenceMember = new AbstractConferenceMember(callPeer, address); addConferenceMember = true; } @@ -832,7 +825,7 @@ public abstract class AbstractOperationSetTelephonyConferencing< addConferenceMember = false; // Update the existing ones. - if (existingConferenceMember != null) + if (conferenceMember != null) { NodeList userChildList = user.getChildNodes(); int userChildCount = userChildList.getLength(); @@ -868,15 +861,15 @@ public abstract class AbstractOperationSetTelephonyConferencing< conferenceMemberProperties); } } - existingConferenceMember.setDisplayName(displayName); - existingConferenceMember.setEndpointStatus(endpointStatus); + conferenceMember.setDisplayName(displayName); + conferenceMember.setEndpointStatus(endpointStatus); changed - = existingConferenceMember.setProperties( + = conferenceMember.setProperties( conferenceMemberProperties); if (addConferenceMember) - callPeer.addConferenceMember(existingConferenceMember); + callPeer.addConferenceMember(conferenceMember); } } } diff --git a/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java b/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java index c8b9597..04d9556 100644 --- a/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java +++ b/src/net/java/sip/communicator/service/protocol/media/CallPeerMediaHandler.java @@ -195,6 +195,10 @@ public abstract class CallPeerMediaHandler /** * The <tt>PropertyChangeListener</tt> which listens to changes in the * values of the properties of the <tt>MediaStream</tt>s of this instance. + * Since <tt>CallPeerMediaHandler</tt> wraps around/shares a + * <tt>MediaHandler</tt>, <tt>streamPropertyChangeListener</tt> actually + * listens to <tt>PropertyChangeEvent</tt>s fired by the + * <tt>MediaHandler</tt> in question and forwards them as its own. */ private final PropertyChangeListener streamPropertyChangeListener = new PropertyChangeListener() diff --git a/src/net/java/sip/communicator/service/protocol/media/MediaHandler.java b/src/net/java/sip/communicator/service/protocol/media/MediaHandler.java index fad955d..081740d 100644 --- a/src/net/java/sip/communicator/service/protocol/media/MediaHandler.java +++ b/src/net/java/sip/communicator/service/protocol/media/MediaHandler.java @@ -1212,9 +1212,8 @@ public class MediaHandler this.audioStream.setStreamAudioLevelListener(null); } - this.audioStream - .removePropertyChangeListener( - streamPropertyChangeListener); + this.audioStream.removePropertyChangeListener( + streamPropertyChangeListener); this.audioStream.close(); } @@ -1225,9 +1224,8 @@ public class MediaHandler if (this.audioStream != null) { - this.audioStream - .addPropertyChangeListener( - streamPropertyChangeListener); + this.audioStream.addPropertyChangeListener( + streamPropertyChangeListener); audioLocalSSRC = this.audioStream.getLocalSourceID(); audioRemoteSSRC = this.audioStream.getRemoteSourceID(); |