Added a sound, played on hang up.

cusax-fix
Yana Stamcheva 15 years ago
parent 343d146e41
commit 01fcb4a2f9

Binary file not shown.

@ -17,6 +17,7 @@ DIAL_DIEZ=resources/sounds/one_1.wav
DIAL_STAR=resources/sounds/one_1.wav
BUSY=resources/sounds/busy.wav
DIAL=resources/sounds/dial.wav
HANG_UP=resources/sounds/hangup.wav
CALL_SECURITY_ON=resources/sounds/zrtpSecure.wav
CALL_SECURITY_ERROR=resources/sounds/zrtpAlert.wav

@ -6,7 +6,6 @@
*/
package net.java.sip.communicator.impl.audionotifier;
import net.java.sip.communicator.service.audionotifier.*;
import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.*;

@ -111,6 +111,9 @@ public void callEnded(CallEvent event)
// Stop all telephony related sounds.
stopAllSounds();
// Play the hangup sound.
NotificationManager.fireNotification(NotificationManager.HANG_UP);
if (activeCalls.get(sourceCall) != null)
{
CallDialog callDialog = activeCalls.get(sourceCall);
@ -201,6 +204,8 @@ public static void hangupCallPeer(final CallPeer callPeer)
{
stopAllSounds();
NotificationManager.fireNotification(NotificationManager.HANG_UP);
new HangupCallPeerThread(callPeer).start();
}

@ -14,23 +14,25 @@
public class NotificationManager
{
public static final String INCOMING_MESSAGE = "IncomingMessage";
public static final String INCOMING_CALL = "IncomingCall";
public static final String OUTGOING_CALL = "OutgoingCall";
public static final String BUSY_CALL = "BusyCall";
public static final String DIALING = "Dialing";
public static final String HANG_UP = "HangUp";
public static final String PROACTIVE_NOTIFICATION = "ProactiveNotification";
public static final String SECURITY_MESSAGE = "SecurityMessage";
public static final String CALL_SECURITY_ON = "CallSecurityOn";
public static final String CALL_SECURITY_ERROR = "CallSecurityError";
public static final String INCOMING_FILE = "IncomingFile";
public static final String CALL_SAVED = "CallSaved";
@ -104,6 +106,16 @@ public static void registerGuiNotifications()
NotificationService.ACTION_SOUND,
dialSoundHandler);
// Register the hangup sound notification.
SoundNotificationHandler hangupSoundHandler
= notificationService
.createSoundNotificationHandler(SoundProperties.HANG_UP, -1);
notificationService.registerDefaultNotificationForEvent(
HANG_UP,
NotificationService.ACTION_SOUND,
hangupSoundHandler);
// Register proactive notifications.
notificationService.registerDefaultNotificationForEvent(
PROACTIVE_NOTIFICATION,

@ -16,46 +16,111 @@
*/
public final class SoundProperties
{
/**
* The incoming message sound id.
*/
public static final String INCOMING_MESSAGE;
/**
* The incoming file sound id.
*/
public static final String INCOMING_FILE;
/**
* The outgoing call sound id.
*/
public static final String OUTGOING_CALL;
/**
* The incoming call sound id.
*/
public static final String INCOMING_CALL;
/**
* The zero tone sound id.
*/
public static final String DIAL_ZERO;
/**
* The one tone sound id.
*/
public static final String DIAL_ONE;
/**
* The two tone sound id.
*/
public static final String DIAL_TWO;
/**
* The three tone sound id.
*/
public static final String DIAL_THREE;
/**
* The four tone sound id.
*/
public static final String DIAL_FOUR;
/**
* The five tone sound id.
*/
public static final String DIAL_FIVE;
/**
* The six tone sound id.
*/
public static final String DIAL_SIX;
/**
* The seven tone sound id.
*/
public static final String DIAL_SEVEN;
/**
* The eight tone sound id.
*/
public static final String DIAL_EIGHT;
/**
* The nine tone sound id.
*/
public static final String DIAL_NINE;
/**
* The diez tone sound id.
*/
public static final String DIAL_DIEZ;
/**
* The star tone sound id.
*/
public static final String DIAL_STAR;
/**
* The busy sound id.
*/
public static final String BUSY;
/**
* The dialing sound id.
*/
public static final String DIALING;
/**
* The sound id of the sound played when call security is turned on.
*/
public static final String CALL_SECURITY_ON;
/**
* The sound id of the sound played when a call security error occurs.
*/
public static final String CALL_SECURITY_ERROR;
/**
* The hang up sound id.
*/
public static final String HANG_UP;
static
{
@ -89,6 +154,7 @@ public final class SoundProperties
DIALING = resources.getSoundPath("DIAL");
CALL_SECURITY_ON = resources.getSoundPath("CALL_SECURITY_ON");
CALL_SECURITY_ERROR = resources.getSoundPath("CALL_SECURITY_ERROR");
HANG_UP = resources.getSoundPath("HANG_UP");
}
private SoundProperties() {

@ -399,7 +399,7 @@ public void fireNotification(
while(actions.hasNext())
{
Action action = actions.next();
String actionType = action.getActionType();
NotificationActionHandler handler = action.getActionHandler();

@ -18,14 +18,20 @@ public class SoundNotificationHandlerImpl
implements SoundNotificationHandler
{
private String soundFileDescriptor;
/**
* By default we don't play sounds in loop.
*/
private int loopInterval = -1;
/**
* The audio clip that manages to play the sound.
*/
private SCAudioClip audio;
/**
* Indicates if this handler is enabled.
*/
private boolean isEnabled = true;
/**
@ -38,7 +44,7 @@ public SoundNotificationHandlerImpl(String soundDescriptor)
{
this.soundFileDescriptor = soundDescriptor;
}
/**
* Creates an instance of <tt>SoundNotificationHandlerImpl</tt> by
* specifying the sound file descriptor and the loop interval.
@ -51,8 +57,8 @@ public SoundNotificationHandlerImpl( String soundDescriptor,
{
this.soundFileDescriptor = soundDescriptor;
this.loopInterval = loopInterval;
}
}
/**
* Returns the loop interval. This is the interval of milliseconds to wait
* before repeating the sound, when playing a sound in loop. By default this
@ -70,7 +76,7 @@ public int getLoopInterval()
* sound is played in loop if the loopInterval is defined.
*/
public void start()
{
{
AudioNotifierService audioNotifService
= NotificationActivator.getAudioNotifier();

Loading…
Cancel
Save