Added sound level indicators in the one-to-one call interface.

cusax-fix
Yana Stamcheva 16 years ago
parent 6710e1c850
commit 414659066f

@ -153,10 +153,10 @@ service.gui.buttons.HIDE_ACTIONS_BUTTON=resources/images/impl/gui/buttons/hideMo
service.gui.buttons.HIDE_ACTIONS_ROLLOVER_BUTTON=resources/images/impl/gui/buttons/hideMoreActionsRollover.png
# Sound level icons
service.gui.soundlevel.SOUND_LEVEL_ACTIVE = resources/images/impl/gui/common/soundlevel/soundActive.png
service.gui.soundlevel.SOUND_LEVEL_INACTIVE = resources/images/impl/gui/common/soundlevel/soundInactive.png
service.gui.soundlevel.MICROPHONE = resources/images/impl/gui/common/soundlevel/Microphone.png
service.gui.soundlevel.HEADPHONE = resources/images/impl/gui/common/soundlevel/Headphone.png
service.gui.soundlevel.SOUND_LEVEL_ACTIVE=resources/images/impl/gui/common/soundlevel/soundActive.png
service.gui.soundlevel.SOUND_LEVEL_INACTIVE=resources/images/impl/gui/common/soundlevel/soundInactive.png
service.gui.soundlevel.MICROPHONE=resources/images/impl/gui/common/soundlevel/Microphone.png
service.gui.soundlevel.HEADPHONE=resources/images/impl/gui/common/soundlevel/Headphone.png
# Smileys icons
service.gui.smileys.SMILEY1=resources/images/impl/gui/common/smileys/default/smiley1.gif

@ -12,9 +12,14 @@
import javax.swing.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.main.call.conference.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.neomedia.event.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.service.protocol.event.VideoEvent;
import net.java.sip.communicator.service.protocol.event.VideoListener;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
@ -67,6 +72,9 @@ public class OneToOneCallPeerPanel
= new JLabel(new ImageIcon(ImageLoader
.getImage(ImageLoader.DEFAULT_USER_PHOTO)));
/**
* The panel containing security related components.
*/
private SecurityPanel securityPanel;
/**
@ -168,6 +176,8 @@ public OneToOneCallPeerPanel( CallDialog callDialog,
add(statusBar, constraints);
}
this.createSoundLevelIndicators();
addVideoListener();
}
@ -279,6 +289,74 @@ private Component createStatusBar()
return statusPanel;
}
/**
* Creates sound level related components.
*/
private void createSoundLevelIndicators()
{
TransparentPanel localLevelPanel
= new TransparentPanel(new BorderLayout(5, 0));
TransparentPanel remoteLevelPanel
= new TransparentPanel(new BorderLayout(5, 0));
JLabel localLevelLabel
= new JLabel(new ImageIcon(
ImageLoader.getImage(ImageLoader.MICROPHONE)));
JLabel remoteLevelLabel
= new JLabel(new ImageIcon(
ImageLoader.getImage(ImageLoader.HEADPHONE)));
final SoundLevelIndicator localLevelIndicator
= new SoundLevelIndicator( LocalUserSoundLevelEvent.MIN_LEVEL,
LocalUserSoundLevelEvent.MAX_LEVEL);
final SoundLevelIndicator remoteLevelIndicator
= new SoundLevelIndicator( LocalUserSoundLevelEvent.MIN_LEVEL,
LocalUserSoundLevelEvent.MAX_LEVEL);
localLevelPanel.add(localLevelLabel, BorderLayout.WEST);
localLevelPanel.add(localLevelIndicator, BorderLayout.CENTER);
remoteLevelPanel.add(remoteLevelLabel, BorderLayout.WEST);
remoteLevelPanel.add(remoteLevelIndicator, BorderLayout.CENTER);
GridBagConstraints constraints = new GridBagConstraints();
constraints.fill = GridBagConstraints.NONE;
constraints.gridx = 0;
constraints.gridy = 4;
constraints.weightx = 0;
constraints.weighty = 0;
constraints.insets = new Insets(10, 0, 0, 0);
add(localLevelPanel, constraints);
constraints.fill = GridBagConstraints.NONE;
constraints.gridx = 0;
constraints.gridy = 5;
constraints.weightx = 0;
constraints.weighty = 0;
constraints.insets = new Insets(5, 0, 10, 0);
add(remoteLevelPanel, constraints);
this.callPeer.addStreamSoundLevelListener(new StreamSoundLevelListener()
{
public void streamSoundLevelChanged(StreamSoundLevelEvent event)
{
remoteLevelIndicator.updateSoundLevel(event.getLevel());
}
});
GuiActivator.getMediaService().
addLocalUserSoundLevelListener(new LocalUserSoundLevelListener()
{
public void localUserSoundLevelChanged(
LocalUserSoundLevelEvent event)
{
localLevelIndicator.updateSoundLevel(event.getLevel());
}
});
}
private class VideoTelephonyListener
implements PropertyChangeListener,
VideoListener

@ -125,11 +125,7 @@ private void addLocalCallPeer()
mainPanel.add(localPeerPanel, constraints);
OperationSetBasicTelephony telephonyOpSet = call.getProtocolProvider()
.getOperationSet(OperationSetBasicTelephony.class);
if (telephonyOpSet != null)
GuiActivator.getMediaService().
GuiActivator.getMediaService().
addLocalUserSoundLevelListener(localPeerPanel);
}

@ -39,6 +39,9 @@ public class SoundLevelIndicator
*/
private int soundBarNumber = 8;
/**
* Indicates if the component listener is added.
*/
private boolean isComponentListenerAdded = false;
/**

Loading…
Cancel
Save