jdk/src/java.desktop/share/classes/com/sun/media/sound/AbstractLine.java
author serb
Wed, 18 May 2016 20:40:17 +0300
changeset 38981 9521cb19e297
parent 25859 3317bb8137f4
child 40444 afabcfc2f3ef
permissions -rw-r--r--
8156169: Some sound tests rarely hangs because of incorrect synchronization Reviewed-by: prr, amenkov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
38981
9521cb19e297 8156169: Some sound tests rarely hangs because of incorrect synchronization
serb
parents: 25859
diff changeset
     2
 * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.media.sound;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    28
import java.util.Map;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.Vector;
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    30
import java.util.WeakHashMap;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import javax.sound.sampled.AudioSystem;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import javax.sound.sampled.Control;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import javax.sound.sampled.Line;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.sound.sampled.LineEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import javax.sound.sampled.LineListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import javax.sound.sampled.LineUnavailableException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * AbstractLine
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * @author Kara Kytle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
abstract class AbstractLine implements Line {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    47
    protected final Line.Info info;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    protected Control[] controls;
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    49
    AbstractMixer mixer;
38981
9521cb19e297 8156169: Some sound tests rarely hangs because of incorrect synchronization
serb
parents: 25859
diff changeset
    50
    private volatile boolean open;
24548
9c007a986347 8042256: Fix raw and unchecked lint warnings in com.sun.media.sound
darcy
parents: 18215
diff changeset
    51
    private final Vector<Object> listeners = new Vector<>();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    /**
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    54
     * Contains event dispatcher per thread group.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    56
    private static final Map<ThreadGroup, EventDispatcher> dispatchers =
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    57
            new WeakHashMap<>();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * Constructs a new AbstractLine.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * @param mixer the mixer with which this line is associated
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * @param controls set of supported controls
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    protected AbstractLine(Line.Info info, AbstractMixer mixer, Control[] controls) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
        if (controls == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
            controls = new Control[0];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        this.info = info;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        this.mixer = mixer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        this.controls = controls;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    // LINE METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    78
    public final Line.Info getLineInfo() {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        return info;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    83
    public final boolean isOpen() {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        return open;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    88
    public final void addLineListener(LineListener listener) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        synchronized(listeners) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
            if ( ! (listeners.contains(listener)) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                listeners.addElement(listener);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * Removes an audio listener.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @param listener listener to remove
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   101
    public final void removeLineListener(LineListener listener) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        listeners.removeElement(listener);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * Obtains the set of controls supported by the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * line.  If no controls are supported, returns an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * array of length 0.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * @return control set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   112
    public final Control[] getControls() {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        Control[] returnedArray = new Control[controls.length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        for (int i = 0; i < controls.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            returnedArray[i] = controls[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        return returnedArray;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   123
    public final boolean isControlSupported(Control.Type controlType) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        // protect against a NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        if (controlType == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        for (int i = 0; i < controls.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            if (controlType == controls[i].getType()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   139
    public final Control getControl(Control.Type controlType) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        // protect against a NullPointerException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        if (controlType != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
            for (int i = 0; i < controls.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                if (controlType == controls[i].getType()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                    return controls[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        throw new IllegalArgumentException("Unsupported control type: " + controlType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    // HELPER METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * This method sets the open state and generates
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * events if it changes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   161
    final void setOpen(boolean open) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        if (Printer.trace) Printer.trace("> "+getClass().getName()+" (AbstractLine): setOpen(" + open + ")  this.open: " + this.open);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        boolean sendEvents = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        long position = getLongFramePosition();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        synchronized (this) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            if (this.open != open) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                this.open = open;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                sendEvents = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        if (sendEvents) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            if (open) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                sendEvents(new LineEvent(this, LineEvent.Type.OPEN, position));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                sendEvents(new LineEvent(this, LineEvent.Type.CLOSE, position));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        if (Printer.trace) Printer.trace("< "+getClass().getName()+" (AbstractLine): setOpen(" + open + ")  this.open: " + this.open);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * Send line events.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   189
    final void sendEvents(LineEvent event) {
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   190
        getEventDispatcher().sendAudioEvents(event, listeners);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * This is an error in the API: getFramePosition
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * should return a long value. At CD quality,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * the int value wraps around after 13 hours.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    public final int getFramePosition() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        return (int) getLongFramePosition();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * Return the frame position in a long value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * This implementation returns AudioSystem.NOT_SPECIFIED.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    public long getLongFramePosition() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        return AudioSystem.NOT_SPECIFIED;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    // $$kk: 06.03.99: returns the mixer used in construction.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    // this is a hold-over from when there was a public method like
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    // this on line and should be fixed!!
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   216
    final AbstractMixer getMixer() {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        return mixer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   220
    final EventDispatcher getEventDispatcher() {
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   221
        // create and start the global event thread
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   222
        //TODO  need a way to stop this thread when the engine is done
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   223
        final ThreadGroup tg = Thread.currentThread().getThreadGroup();
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   224
        synchronized (dispatchers) {
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   225
            EventDispatcher eventDispatcher = dispatchers.get(tg);
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   226
            if (eventDispatcher == null) {
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   227
                eventDispatcher = new EventDispatcher();
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   228
                dispatchers.put(tg, eventDispatcher);
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   229
                eventDispatcher.start();
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   230
            }
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   231
            return eventDispatcher;
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   232
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    // ABSTRACT METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    public abstract void open() throws LineUnavailableException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    public abstract void close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
}