Package org.jitsi.impl.neomedia.notify
Class JavaSoundClipImpl
- java.lang.Object
-
- org.jitsi.service.audionotifier.AbstractSCAudioClip
-
- org.jitsi.impl.neomedia.notify.JavaSoundClipImpl
-
- All Implemented Interfaces:
SCAudioClip
public class JavaSoundClipImpl extends AbstractSCAudioClip
Implementation of SCAudioClip.- Author:
- Yana Stamcheva
-
-
Field Summary
-
Fields inherited from class org.jitsi.service.audionotifier.AbstractSCAudioClip
audioNotifier, sync, uri
-
-
Constructor Summary
Constructors Constructor Description JavaSoundClipImpl(String uri, AudioNotifierService audioNotifier)Initializes a new JavaSoundClipImpl instance which is to play audio stored at a specific URL using java.applet.AudioClip.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinternalStop()Stops this audio without setting the isLooping property in the case of a looping audio.protected booleanrunOnceInPlayThread()Plays this audio once.-
Methods inherited from class org.jitsi.service.audionotifier.AbstractSCAudioClip
enterRunInPlayThread, enterRunOnceInPlayThread, exitRunInPlayThread, exitRunOnceInPlayThread, getLoopInterval, isInvalid, isLooping, isStarted, play, play, setInvalid, setLooping, setLoopInterval, stop
-
-
-
-
Constructor Detail
-
JavaSoundClipImpl
public JavaSoundClipImpl(String uri, AudioNotifierService audioNotifier) throws IOException
Initializes a new JavaSoundClipImpl instance which is to play audio stored at a specific URL using java.applet.AudioClip.- Parameters:
uri- the URL at which the audio is stored and which the new instance is to loadaudioNotifier- the AudioNotifierService which is initializing the new instance and whose mute property/state is to be monitored by the new instance- Throws:
IOException- if a java.applet.AudioClip could not be initialized or the audio at the specified url could not be read
-
-
Method Detail
-
internalStop
protected void internalStop()
Stops this audio without setting the isLooping property in the case of a looping audio. The AudioNotifier uses this method to stop the audio when setMute(true) is invoked. This allows us to restore all looping audios when the sound is restored by calling setMute(false). Stops the java.applet.AudioClip wrapped by this instance.- Overrides:
internalStopin classAbstractSCAudioClip
-
runOnceInPlayThread
protected boolean runOnceInPlayThread()
Plays this audio once. Plays the java.applet.AudioClip wrapped by this instance.- Specified by:
runOnceInPlayThreadin classAbstractSCAudioClip- Returns:
- true if subsequent plays of this audio and, respectively, the method are to be invoked if this audio is to be played in a loop; otherwise, false. The value reflects an implementation-specific loop condition, is not dependent on loopInterval and loopCondition and is combined with the latter in order to determine whether there will be a subsequent iteration of the playback loop.
-
-