2 * Copyright 1998-2001 Sun Microsystems, Inc.
4 * See the file "license.terms" for information on usage and
5 * redistribution of this file, and for a DISCLAIMER OF ALL
8 package com.sun.speech.engine;
10 import java.util.Collection;
12 import javax.speech.AudioListener;
13 import javax.speech.AudioManager;
16 * Supports the JSAPI 1.0 <code>AudioManager</code>
17 * interface. Actual JSAPI implementations might want to extend
18 * or modify this implementation.
20 public class BaseAudioManager implements AudioManager {
22 * List of <code>AudioListeners</code> registered for
23 * <code>AudioEvents</code> on this object.
25 protected Collection listeners;
30 public BaseAudioManager() {
31 listeners = new java.util.ArrayList();
35 * Requests notification of <code>AudioEvents</code> from the
36 * <code>AudioManager</code>.
38 * @param listener the listener to add
40 public void addAudioListener(AudioListener listener) {
41 if (!listeners.contains(listener)) {
42 listeners.add(listener);
47 * Removes an <code>AudioListener</code> from the list of
48 * <code>AudioListeners</code>.
50 * @param listener the listener to remove
52 public void removeAudioListener(AudioListener listener) {
53 listeners.remove(listener);