swpchat.client
Class AudioActivator

java.lang.Object
  |
  +--swpchat.client.AudioActivator

public class AudioActivator
extends java.lang.Object

Class to play Sounds from a certain sender. Also provides the opportunity to enable/disable sound.

Since:
8.12.99
Author:
Dirk Hesse, David Kensche

Field Summary
(package private) static AudioMapper audioMapper
          Our Audio mapper.
(package private) static java.lang.String CLS
          String specifying the Class for use with Diag
private static boolean soundEnabled
          Whether sounds should actually be played.
(package private) static java.lang.String STR_AUDIO_PKEY_BEGIN
          The beginning of a Property key to an Audio URL
 
Constructor Summary
AudioActivator()
           
 
Method Summary
static void disablePlay()
          turns sound off
static void enablePlay()
          turns sound on
static boolean getPlayStatus()
          return status of sound
 boolean tryToPlay(java.lang.String channel, java.lang.String strFrom, java.lang.String strAudioKey)
          Tries to play an audio file with a certain key and a certain sender.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

CLS

static final java.lang.String CLS
String specifying the Class for use with Diag

STR_AUDIO_PKEY_BEGIN

static final java.lang.String STR_AUDIO_PKEY_BEGIN
The beginning of a Property key to an Audio URL

soundEnabled

private static boolean soundEnabled
Whether sounds should actually be played. This is initially true.

audioMapper

static AudioMapper audioMapper
Our Audio mapper.
Constructor Detail

AudioActivator

public AudioActivator()
Method Detail

tryToPlay

public boolean tryToPlay(java.lang.String channel,
                         java.lang.String strFrom,
                         java.lang.String strAudioKey)
Tries to play an audio file with a certain key and a certain sender. Sound can be enabled with enablePlay() and disabled with disablePlay().
Parameters:
strFrom - String specifying the person who sent the request to play the file.
strAudioKey - String specifying the Property with which the file is searched.
Returns:
true if the file has been played, else false.

enablePlay

public static void enablePlay()
turns sound on

disablePlay

public static void disablePlay()
turns sound off

getPlayStatus

public static boolean getPlayStatus()
return status of sound