JavaTM 2 Platform Std. Ed. v1.4.2
- All Implemented Interfaces:
- public class LineEvent
- extends EventObject
LineEvent class encapsulates information that a line sends its listeners
whenever the line opens, closes, starts, or stops. Each of these four state changes
is represented by a corresponding type of event. A listener receives the event as a parameter to its
update method. By querying the event, the listener can learn
the type of event, the line responsible for the event, and how much data the line had processed
when the event occurred.
- See Also:
Nested Class Summary
The LineEvent.Type inner class identifies what kind of event occurred on a line.
Constructs a new event of the specified type, originating from the specified line.
Obtains the position in the line's audio data when the event occurred, expressed in sample frames.
Obtains the audio line that is the source of this event.
Obtains the event's type.
Obtains a string representation of the event.
public LineEvent(Line line,
- Constructs a new event of the specified type, originating from the specified line.
line - the source of this event
type - the event type (
position - the number of sample frames that the line had already processed when the event occurred,
public final Line getLine()
- Obtains the audio line that is the source of this event.
- the line responsible for this event
public final LineEvent.Type getType()
- Obtains the event's type.
- this event's type (
public final long getFramePosition()
- Obtains the position in the line's audio data when the event occurred, expressed in sample frames.
For example, if a source line had already played back 14 sample frames at the time it was
paused, the pause event would report the line's position as 14. The next frame to be processed
would be frame number 14 using zero-based numbering, or 15 using one-based numbering.
Note that this field is relevant only to certain events generated by
data lines, such as
events generated by lines that do not count sample frames, and for any
other events for which this value is not known, the position value
- the line's position as a sample frame number
public String toString()
- Obtains a string representation of the event. The contents of the string may vary
between implementations of Java Sound.
toString in class
- a string describing the event.
Copyright 2003 Sun Microsystems, Inc. All rights reserved