Package org.jitsi.impl.neomedia.notify
Class AudioSystemClipImpl
- java.lang.Object
-
- org.jitsi.service.audionotifier.AbstractSCAudioClip
-
- org.jitsi.impl.neomedia.notify.AudioSystemClipImpl
-
- All Implemented Interfaces:
SCAudioClip
public class AudioSystemClipImpl extends AbstractSCAudioClip
Implementation of SCAudioClip using PortAudio.- Author:
- Damyian Minkov, Lyubomir Marinov
-
-
Field Summary
-
Fields inherited from class org.jitsi.service.audionotifier.AbstractSCAudioClip
audioNotifier, sync, uri
-
-
Constructor Summary
Constructors Constructor Description AudioSystemClipImpl(String url, AudioNotifierService audioNotifier, AudioSystem audioSystem, boolean playback)Creates the audio clip and initializes the listener used from the loop timer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidenterRunInPlayThread()Notifies this instance that its execution in its background/separate thread dedicated to the playback of this audio is about to start playing this audio for the first time.protected voidexitRunInPlayThread()Notifies this instance that its execution in its background/separate thread dedicated to the playback of this audio is about to stop playing this audio once.protected voidexitRunOnceInPlayThread()Notifies this instance that its execution in its background/separate thread dedicated to the playback of this audio is about to stop playing this audio.protected booleanrunOnceInPlayThread()Plays this audio once.-
Methods inherited from class org.jitsi.service.audionotifier.AbstractSCAudioClip
enterRunOnceInPlayThread, getLoopInterval, internalStop, isInvalid, isLooping, isStarted, play, play, setInvalid, setLooping, setLoopInterval, stop
-
-
-
-
Constructor Detail
-
AudioSystemClipImpl
public AudioSystemClipImpl(String url, AudioNotifierService audioNotifier, AudioSystem audioSystem, boolean playback) throws IOException
Creates the audio clip and initializes the listener used from the loop timer.- Parameters:
url- the URL pointing to the audio fileaudioNotifier- the audio notify serviceplayback- to use playback or notification device- Throws:
IOException- cannot audio clip with supplied URL.
-
-
Method Detail
-
enterRunInPlayThread
protected void enterRunInPlayThread()
Notifies this instance that its execution in its background/separate thread dedicated to the playback of this audio is about to start playing this audio for the first time. Regardless of whether this instance is to be played once or multiple times in a loop, the method is called once in order to allow extenders/implementers to perform one-time initialization before this audio starts playing. The AbstractSCAudioClip implementation does nothing.- Overrides:
enterRunInPlayThreadin classAbstractSCAudioClip
-
exitRunInPlayThread
protected void exitRunInPlayThread()
Notifies this instance that its execution in its background/separate thread dedicated to the playback of this audio is about to stop playing this audio once. Regardless of whether this instance is to be played once or multiple times in a loop, the method is called once in order to allow extenders/implementers to perform one-time cleanup after this audio stops playing. The AbstractSCAudioClip implementation does nothing.- Overrides:
exitRunInPlayThreadin classAbstractSCAudioClip
-
exitRunOnceInPlayThread
protected void exitRunOnceInPlayThread()
Notifies this instance that its execution in its background/separate thread dedicated to the playback of this audio is about to stop playing this audio. If this audio is to be played in a loop, the method is called at the end of each iteration of the loop. Allows extenders/implementers to perform per-loop iteraction cleanup. The AbstractSCAudioClip implementation does nothing.- Overrides:
exitRunOnceInPlayThreadin classAbstractSCAudioClip
-
runOnceInPlayThread
protected boolean runOnceInPlayThread()
Plays this audio once.- 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.
-
-