aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2006-12-20 17:06:48 +0000
committerYana Stamcheva <yana@jitsi.org>2006-12-20 17:06:48 +0000
commitd8a32a8eebf1896449eca5591b3235ea857bdaf1 (patch)
tree440c901c70687db638f8477e4a6ecc63331e2f04 /src/net/java
parentf677309ed01fd40d7e5068eacbd3a4eccdd19c80 (diff)
downloadjitsi-d8a32a8eebf1896449eca5591b3235ea857bdaf1.zip
jitsi-d8a32a8eebf1896449eca5591b3235ea857bdaf1.tar.gz
jitsi-d8a32a8eebf1896449eca5591b3235ea857bdaf1.tar.bz2
fix incoming and outgoing call sound interference
Diffstat (limited to 'src/net/java')
-rw-r--r--src/net/java/sip/communicator/impl/gui/utils/SoundLoader.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/utils/SoundLoader.java b/src/net/java/sip/communicator/impl/gui/utils/SoundLoader.java
index c971e14..f38ee18 100644
--- a/src/net/java/sip/communicator/impl/gui/utils/SoundLoader.java
+++ b/src/net/java/sip/communicator/impl/gui/utils/SoundLoader.java
@@ -45,6 +45,8 @@ public class SoundLoader
private static Timer playAudioTimer = new Timer(1000, null);
+ private static Hashtable audioListeners = new Hashtable();
+
/**
* Loads an audio for a given sound identifier.
* @param soundID The identifier of the sound.
@@ -104,13 +106,17 @@ public class SoundLoader
//first play the audio and then start the timer and wait
audio.play();
playAudioTimer.setDelay(interval);
- playAudioTimer.addActionListener(new PlayAudioListener(audio));
playAudioTimer.setRepeats(true);
+
+ ActionListener audioListener = new PlayAudioListener(audio);
+ audioListeners.put(audio, audioListener);
+
+ playAudioTimer.addActionListener(audioListener);
playAudioTimer.start();
}
}
- new NewThread(audio, interval).start();
+ new NewThread(audio, interval).start();
}
/**
@@ -120,6 +126,8 @@ public class SoundLoader
public static void stop(AudioClip audio)
{
playAudioTimer.stop();
+ playAudioTimer.removeActionListener(
+ (ActionListener)audioListeners.get(audio));
audio.stop();
}