📄 line.html
字号:
Removes the specified listener from this line's list of listeners.</TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getLineInfo()"><!-- --></A><H3>getLineInfo</H3><PRE>public <A HREF="../../../javax/sound/sampled/Line.Info.html">Line.Info</A> <B>getLineInfo</B>()</PRE><DL><DD>Obtains the <code>Line.Info</code> object describing this line.<DD><DL><DT><B>Returns:</B><DD>description of the line</DL></DD></DL><HR><A NAME="open()"><!-- --></A><H3>open</H3><PRE>public void <B>open</B>() throws <A HREF="../../../javax/sound/sampled/LineUnavailableException.html">LineUnavailableException</A></PRE><DL><DD>Opens the line, indicating that it should acquire any required system resources and become operational. If this operation succeeds, the line is marked as open, and an <code>OPEN</code> event is dispatched to the line's listeners. <p> Note that some lines, once closed, cannot be reopened. Attempts to reopen such a line will always result in an <code>LineUnavailableException</code>. <p> Some types of lines have configurable properties that may affect resource allocation. For example, a <code>DataLine</code> must be opened with a particular format and buffer size. Such lines should provide a mechanism for configuring these properties, such as an additional <code>open</code> method or methods which allow an application to specify the desired settings. <p> This method takes no arguments, and opens the line with the current settings. For <code><A HREF="../../../javax/sound/sampled/SourceDataLine.html"><CODE>SourceDataLine</CODE></A></code> and <code><A HREF="../../../javax/sound/sampled/TargetDataLine.html"><CODE>TargetDataLine</CODE></A></code> objects, this means that the line is opened with default settings. For a <code><A HREF="../../../javax/sound/sampled/Clip.html"><CODE>Clip</CODE></A></code>, however, the buffer size is determined when data is loaded. Since this method does not allow the application to specify any data to load, it allocates resources for a clip with zero frames of data, and there is no means for subsequently loading data into that clip. Therefore, you should instead use one of the <code>open</code> methods provided in the <code>Clip</code> interface to load data into the <code>Clip</code>.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/sound/sampled/LineUnavailableException.html">LineUnavailableException</A></CODE> - if the line cannot be opened due to resource restrictions.<DD><CODE><A HREF="../../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the line cannot be opened due to security restrictions.<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Line.html#close()"><CODE>close()</CODE></A>, <A HREF="../../../javax/sound/sampled/Line.html#isOpen()"><CODE>isOpen()</CODE></A>, <A HREF="../../../javax/sound/sampled/LineEvent.html"><CODE>LineEvent</CODE></A>, <A HREF="../../../javax/sound/sampled/DataLine.html"><CODE>DataLine</CODE></A>, <A HREF="../../../javax/sound/sampled/Clip.html#open(javax.sound.sampled.AudioFormat, byte[], int, int)"><CODE>Clip.open(AudioFormat, byte[], int, int)</CODE></A>, <A HREF="../../../javax/sound/sampled/Clip.html#open(javax.sound.sampled.AudioInputStream)"><CODE>Clip.open(AudioInputStream)</CODE></A></DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>()</PRE><DL><DD>Closes the line, indicating that any system resources in use by the line can be released. If this operation succeeds, the line is marked closed and a <code>CLOSE</code> event is dispatched to the line's listeners.<DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/SecurityException.html">SecurityException</A></CODE> - if the line cannot be closed due to security restrictions.<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Line.html#open()"><CODE>open()</CODE></A>, <A HREF="../../../javax/sound/sampled/Line.html#isOpen()"><CODE>isOpen()</CODE></A>, <A HREF="../../../javax/sound/sampled/LineEvent.html"><CODE>LineEvent</CODE></A></DL></DD></DL><HR><A NAME="isOpen()"><!-- --></A><H3>isOpen</H3><PRE>public boolean <B>isOpen</B>()</PRE><DL><DD>Indicates whether the line is open, meaning that it has reserved system resources and is operational, although it might not currently be playing or capturing sound.<DD><DL><DT><B>Returns:</B><DD><code>true</code> if the line is open, otherwise <code>false</code><DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Line.html#open()"><CODE>open()</CODE></A>, <A HREF="../../../javax/sound/sampled/Line.html#close()"><CODE>close()</CODE></A></DL></DD></DL><HR><A NAME="getControls()"><!-- --></A><H3>getControls</H3><PRE>public <A HREF="../../../javax/sound/sampled/Control.html">Control</A>[] <B>getControls</B>()</PRE><DL><DD>Obtains the set of controls associated with this line. If there are no controls, this method returns an array of length 0.<DD><DL><DT><B>Returns:</B><DD>the array of controls<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Line.html#getControl(javax.sound.sampled.Control.Type)"><CODE>getControl(javax.sound.sampled.Control.Type)</CODE></A></DL></DD></DL><HR><A NAME="isControlSupported(javax.sound.sampled.Control.Type)"><!-- --></A><H3>isControlSupported</H3><PRE>public boolean <B>isControlSupported</B>(<A HREF="../../../javax/sound/sampled/Control.Type.html">Control.Type</A> control)</PRE><DL><DD>Indicates whether the line supports a control of the specified type.<DD><DL><DT><B>Parameters:</B><DD><CODE>control</CODE> - the type of the control for which support is queried<DT><B>Returns:</B><DD><code>true</code> if at least one control of the specified type is supported, otherwise <code>false</code>.</DL></DD></DL><HR><A NAME="getControl(javax.sound.sampled.Control.Type)"><!-- --></A><H3>getControl</H3><PRE>public <A HREF="../../../javax/sound/sampled/Control.html">Control</A> <B>getControl</B>(<A HREF="../../../javax/sound/sampled/Control.Type.html">Control.Type</A> control)</PRE><DL><DD>Obtains a control of the specified type, if there is any.<DD><DL><DT><B>Parameters:</B><DD><CODE>control</CODE> - the type of the requested control<DT><B>Returns:</B><DD>a control of the specified type<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if a control of the specified type is not supported<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Line.html#getControls()"><CODE>getControls()</CODE></A>, <A HREF="../../../javax/sound/sampled/Line.html#isControlSupported(javax.sound.sampled.Control.Type)"><CODE>isControlSupported(Control.Type control)</CODE></A></DL></DD></DL><HR><A NAME="addLineListener(javax.sound.sampled.LineListener)"><!-- --></A><H3>addLineListener</H3><PRE>public void <B>addLineListener</B>(<A HREF="../../../javax/sound/sampled/LineListener.html">LineListener</A> listener)</PRE><DL><DD>Adds a listener to this line. Whenever the line's status changes, the listener's <code>update()</code> method is called with a <code>LineEvent</code> object that describes the change.<DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - the object to add as a listener to this line<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Line.html#removeLineListener(javax.sound.sampled.LineListener)"><CODE>removeLineListener(javax.sound.sampled.LineListener)</CODE></A>, <A HREF="../../../javax/sound/sampled/LineListener.html#update(javax.sound.sampled.LineEvent)"><CODE>LineListener.update(javax.sound.sampled.LineEvent)</CODE></A>, <A HREF="../../../javax/sound/sampled/LineEvent.html"><CODE>LineEvent</CODE></A></DL></DD></DL><HR><A NAME="removeLineListener(javax.sound.sampled.LineListener)"><!-- --></A><H3>removeLineListener</H3><PRE>public void <B>removeLineListener</B>(<A HREF="../../../javax/sound/sampled/LineListener.html">LineListener</A> listener)</PRE><DL><DD>Removes the specified listener from this line's list of listeners.<DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - listener to remove<DT><B>See Also: </B><DD><A HREF="../../../javax/sound/sampled/Line.html#addLineListener(javax.sound.sampled.LineListener)"><CODE>addLineListener(javax.sound.sampled.LineListener)</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Line.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/sound/sampled/DataLine.html"><B>PREV CLASS</B></A> <A HREF="../../../javax/sound/sampled/LineListener.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Line.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#inner_class_summary">INNER</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A. All Rights Reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -