jdk/src/share/classes/javax/sound/sampled/LineEvent.java
author ohair
Tue, 25 May 2010 15:58:33 -0700
changeset 5506 202f599c92aa
parent 2 90ce3da70b43
child 22949 459e9fe0bbf8
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 1999, 2003, 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 javax.sound.sampled;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * The <code>LineEvent</code> class encapsulates information that a line
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 * sends its listeners whenever the line opens, closes, starts, or stops.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * Each of these four state changes is represented by a corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * type of event.  A listener receives the event as a parameter to its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * {@link LineListener#update update} method.  By querying the event,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * the listener can learn the type of event, the line responsible for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * the event, and how much data the line had processed when the event occurred.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * <p>Although this class implements Serializable, attempts to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * serialize a <code>LineEvent</code> object will fail.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * @author Kara Kytle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * @see Line
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * @see LineListener#update
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * @serial exclude
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
public class LineEvent extends java.util.EventObject {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    // INSTANCE VARIABLES
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * The kind of line event (<code>OPEN</code>, <code>CLOSE</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     * <code>START</code>, or <code>STOP</code>).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
     * @see #getType
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    private final Type type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * The media position when the event occurred, expressed in sample frames.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * Note that this field is only relevant to certain events generated by
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * data lines, such as <code>START</code> and <code>STOP</code>.  For
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     * events generated by lines that do not count sample frames, and for any
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * other events for which this value is not known, the position value
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * should be {@link AudioSystem#NOT_SPECIFIED}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * @see #getFramePosition
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    private final long position;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * Constructs a new event of the specified type, originating from the specified line.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * @param line the source of this event
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * @param type the event type (<code>OPEN</code>, <code>CLOSE</code>, <code>START</code>, or <code>STOP</code>)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * @param position the number of sample frames that the line had already processed when the event occurred,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * or {@link AudioSystem#NOT_SPECIFIED}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * @throws IllegalArgumentException if <code>line</code> is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    public LineEvent(Line line, Type type, long position) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        super(line);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        this.type = type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        this.position = position;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * Obtains the audio line that is the source of this event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * @return the line responsible for this event
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    public final Line getLine() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        return (Line)getSource();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * Obtains the event's type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * @return this event's type ({@link Type#OPEN}, {@link Type#CLOSE},
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * {@link Type#START}, or {@link Type#STOP})
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    public final Type getType() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        return type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * Obtains the position in the line's audio data when the event occurred, expressed in sample frames.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * For example, if a source line had already played back 14 sample frames at the time it was
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * paused, the pause event would report the line's position as 14.  The next frame to be processed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * would be frame number 14 using zero-based numbering, or 15 using one-based numbering.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * Note that this field is relevant only to certain events generated by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * data lines, such as <code>START</code> and <code>STOP</code>.  For
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * events generated by lines that do not count sample frames, and for any
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * other events for which this value is not known, the position value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * should be {@link AudioSystem#NOT_SPECIFIED}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * @return the line's position as a sample frame number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * $$kk: 04.20.99: note to myself: should make sure our implementation is consistent with this.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * which is a reasonable definition....
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    public final long getFramePosition() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        return position;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * Obtains a string representation of the event.  The contents of the string may vary
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * between implementations of Java Sound.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * @return a string describing the event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        String sType = "";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        if (type != null) sType = type.toString()+" ";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        String sLine;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        if (getLine() == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
            sLine = "null";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
            sLine = getLine().toString();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        return new String(sType + "event from line " + sLine);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * The LineEvent.Type inner class identifies what kind of event occurred on a line.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Static instances are provided for the common types (OPEN, CLOSE, START, and STOP).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @see LineEvent#getType()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    public static class Type {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
         * Type name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        // $$kk: 03.25.99: why can't this be final??
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        private /*final*/ String name;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
         * Constructs a new event type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
         * @param name name of the type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        protected Type(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            this.name = name;
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
        //$$fb 2002-11-26: fix for 4695001: SPEC: description of equals() method contains typo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
         * Indicates whether the specified object is equal to this event type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
         * returning <code>true</code> if the objects are identical.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
         * @param obj the reference object with which to compare
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
         * @return <code>true</code> if this event type is the same as
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
         * <code>obj</code>; <code>false</code> otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        public final boolean equals(Object obj) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            return super.equals(obj);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
         * Finalizes the hashcode method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        public final int hashCode() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            return super.hashCode();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
         * Returns the type name as the string representation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            return name;
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
        // LINE EVENT TYPE DEFINES
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
         * A type of event that is sent when a line opens, reserving system
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
         * resources for itself.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
         * @see #CLOSE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
         * @see Line#open
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        public static final Type OPEN   = new Type("Open");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
         * A type of event that is sent when a line closes, freeing the system
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
         * resources it had obtained when it was opened.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
         * @see #OPEN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
         * @see Line#close
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        public static final Type CLOSE  = new Type("Close");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
         * A type of event that is sent when a line begins to engage in active
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
         * input or output of audio data in response to a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
         * {@link DataLine#start start} request.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
         * @see #STOP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
         * @see DataLine#start
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        public static final Type START  = new Type("Start");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
         * A type of event that is sent when a line ceases active input or output
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
         * of audio data in response to a {@link DataLine#stop stop} request,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
         * or because the end of media has been reached.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
         * @see #START
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
         * @see DataLine#stop
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        public static final Type STOP   = new Type("Stop");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
         * A type of event that is sent when a line ceases to engage in active
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
         * input or output of audio data because the end of media has been reached.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
         * ISSUE: we may want to get rid of this.  Is JavaSound
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
         * responsible for reporting this??
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
         * [If it's decided to keep this API, the docs will need to be updated to include mention
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
         * of EOM events elsewhere.]
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
        //public static final Type EOM  = new Type("EOM");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
         * A type of event that is sent when a line begins to engage in active
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
         * input or output of audio data.  Examples of when this happens are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
         * when a source line begins or resumes writing data to its mixer, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
         * when a target line begins or resumes reading data from its mixer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
         * @see #STOP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
         * @see SourceDataLine#write
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
         * @see TargetDataLine#read
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
         * @see DataLine#start
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
        //public static final Type ACTIVE       = new Type("ACTIVE");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
         * A type of event that is sent when a line ceases active input or output
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
         * of audio data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
         * @see #START
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
         * @see DataLine#stop
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        //public static final Type INACTIVE     = new Type("INACTIVE");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    } // class Type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
} // class LineEvent