public class LineEvent extends EventObject
LineEvent
类封装的信息,线将听众每当线打开,关闭,开始或停止。每一个这四个状态的变化是由一个相应的类型的事件表示。一位听众接收事件作为参数,其
update
方法。通过查询事件,侦听器可以学习事件的类型、事件的行和该事件发生时的数据的多少数据。
虽然这类实现了Serializable序列化一个对象,试图LineEvent
会失败。
Line
,
LineListener.update(javax.sound.sampled.LineEvent)
Modifier and Type | Class and Description |
---|---|
static class |
LineEvent.Type
的lineevent。型类内识别什么样的事件发生在一条线。
|
source
Constructor and Description |
---|
LineEvent(Line line, LineEvent.Type type, long position)
构造一个新的指定类型的事件,源于指定的行。
|
Modifier and Type | Method and Description |
---|---|
long |
getFramePosition()
在事件发生时获得行的音频数据中的位置,在示例帧中表示。
|
Line |
getLine()
获取此事件的源代码的音频线。
|
LineEvent.Type |
getType()
获得事件的类型。
|
String |
toString()
获取事件的字符串表示形式。
|
getSource
public LineEvent(Line line, LineEvent.Type type, long position)
line
-这一事件的源
type
-事件类型(
OPEN
,
CLOSE
,
START
,或
STOP
)
position
-,线已处理的事件发生时样品的帧的数目,或
AudioSystem.NOT_SPECIFIED
null
line
IllegalArgumentException
。
public final Line getLine()
public final LineEvent.Type getType()
LineEvent.Type.OPEN
,
LineEvent.Type.CLOSE
,
LineEvent.Type.START
,或
LineEvent.Type.STOP
)
public final long getFramePosition()
请注意,这场只对某些事件产生的相关数据线,如START
和STOP
。用线不计数抽样框生成的事件,和其他事件,这个值是不知道的,位置值应AudioSystem.NOT_SPECIFIED
。
public String toString()
toString
方法重写,继承类
EventObject
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.