SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.media.notify
Class JMFAudioClipImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.media.notify.SCAudioClipImpl
      extended by net.java.sip.communicator.impl.media.notify.JMFAudioClipImpl
All Implemented Interfaces:
ActionListener, EventListener, SCAudioClip

public class JMFAudioClipImpl
extends SCAudioClipImpl
implements ActionListener

Implementation of SCAudioClip.

Author:
Yana Stamcheva

Constructor Summary
JMFAudioClipImpl(URL url, AudioNotifierService audioNotifier)
          Creates the audio clip and initialize the listener used from the loop timer.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Plays an audio clip.
 void internalStop()
          Stops this audio without setting the isLooping property in the case of a looping audio.
 void play()
          Plays this audio.
 void playInLoop(int interval)
          Plays this audio in loop.
 void stop()
          Stops this audio.
 
Methods inherited from class net.java.sip.communicator.impl.media.notify.SCAudioClipImpl
getLoopInterval, isInvalid, isLooping, setInvalid, setIsInvalid, setIsLooping, setLoopInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMFAudioClipImpl

public JMFAudioClipImpl(URL url,
                        AudioNotifierService audioNotifier)
                 throws IOException
Creates the audio clip and initialize the listener used from the loop timer.

Parameters:
url - the url pointing to the audio file
audioNotifier - the audio notify service
Throws:
IOException - cannot audio clip with supplied url.
Method Detail

play

public void play()
Plays this audio.

Specified by:
play in interface SCAudioClip

playInLoop

public void playInLoop(int interval)
Plays this audio in loop.

Specified by:
playInLoop in interface SCAudioClip
Parameters:
interval - the loop interval

stop

public void stop()
Stops this audio.

Specified by:
stop in interface SCAudioClip

internalStop

public 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).

Specified by:
internalStop in class SCAudioClipImpl

actionPerformed

public void actionPerformed(ActionEvent e)
Plays an audio clip. Used in the playAudioTimer to play an audio in loop.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - the event.

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.