⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manager.html

📁 J2ME MIDP2.0 final specification
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="TONE_DEVICE_LOCATOR"><!-- --></A><H3>TONE_DEVICE_LOCATOR</H3><PRE>public static final String <B>TONE_DEVICE_LOCATOR</B></PRE><DL><DD>The locator to create a tone <code>Player</code> to play back tone sequences. e.g.  <pre> try {     Player p = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR);     p.realize();     ToneControl tc = (ToneControl)p.getControl("ToneControl");     tc.setSequence(mySequence);     p.start(); } catch (IOException ioe) { } catch (MediaException me) {} </pre> If a tone sequence is not set on the tone  <code>Player</code> via its <code>ToneControl</code>,  the <code>Player</code> does not carry any  sequence.  <code>getDuration</code> returns 0 for this <code>Player</code>. <p> The content type of the <code>Player</code> created from this locator is <code>audio/x-tone-seq</code>. <p> A <code>Player</code> for this locator may not be supported  for all implementations. <p> Value "device://tone" is assigned to <code>TONE_DEVICE_LOCATOR</code>.</DL><!-- ========= 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="getSupportedContentTypes(java.lang.String)"><!-- --></A><H3>getSupportedContentTypes</H3><PRE>public static String[] <B>getSupportedContentTypes</B>(String&nbsp;protocol)</PRE><DL><DD>Return the list of supported content types for the given protocol. <p> See <a href="#content-type">content types</a> for the syntax of the content types returned. See <a href="#media-protocol">protocol name</a> for the syntax of the protocol used.  <p> For example, if the given <code>protocol</code>  is <code>"http"</code>, then the supported content types that can be played back with the <code>http</code> protocol will be returned. <p> If <code>null</code> is passed in as the <code>protocol</code>,  all the supported content types for this implementation  will be returned.  The returned array must be non-empty. <p> If the given <code>protocol</code> is an invalid or unsupported protocol, then an empty array will be returned.<DD><DL><DT><B>Parameters:</B><DD><CODE>protocol</CODE> - The input protocol for the supported content types.<DT><B>Returns:</B><DD>The list of supported content types for the given protocol.</DL></DD></DL><HR><A NAME="getSupportedProtocols(java.lang.String)"><!-- --></A><H3>getSupportedProtocols</H3><PRE>public static String[] <B>getSupportedProtocols</B>(String&nbsp;content_type)</PRE><DL><DD>Return the list of supported protocols given the content type.  The protocols are returned as strings which identify what locators can be used for creating  <code>Player</code>'s. <p> See <a href="#media-protocol">protocol name</a> for the syntax of the protocols returned.  See <a href="#content-type">content types</a> for the syntax of the content type used. <p> For example, if the given <code>content_type</code> is <code>"audio/x-wav"</code>, then the supported protocols that can be used to play back <code>audio/x-wav</code> will be returned. <p> If <code>null</code> is passed in as the  <code>content_type</code>,  all the supported protocols for this implementation  will be returned.  The returned array must be non-empty. <p> If the given <code>content_type</code> is an invalid or unsupported content type, then an empty array will be returned.<DD><DL><DT><B>Parameters:</B><DD><CODE>content_type</CODE> - The content type for the supported protocols.<DT><B>Returns:</B><DD>The list of supported protocols for the given content type.</DL></DD></DL><HR><A NAME="createPlayer(java.lang.String)"><!-- --></A><H3>createPlayer</H3><PRE>public static <A HREF="../../../javax/microedition/media/Player.html">Player</A> <B>createPlayer</B>(String&nbsp;locator)                           throws java.io.IOException,                                  <A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></PRE><DL><DD>Create a <code>Player</code> from an input locator.<DD><DL><DT><B>Parameters:</B><DD><CODE>locator</CODE> - A locator string in URI syntax that describes the media content.<DT><B>Returns:</B><DD>A new <code>Player</code>.<DT><B>Throws:</B><DD><CODE>IllegalArgumentException</CODE> - Thrown if <code>locator</code> is <code>null</code>.<DD><CODE><A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></CODE> - Thrown if a <code>Player</code> cannot be created for the given locator.<DD><CODE>java.io.IOException</CODE> - Thrown if there was a problem connecting with the source pointed to by the <code>locator</code>.<DD><CODE>SecurityException</CODE> - Thrown if the caller does not have security permission to create the <code>Player</code>.</DL></DD></DL><HR><A NAME="createPlayer(java.io.InputStream, java.lang.String)"><!-- --></A><H3>createPlayer</H3><PRE>public static <A HREF="../../../javax/microedition/media/Player.html">Player</A> <B>createPlayer</B>(java.io.InputStream&nbsp;stream,                                  String&nbsp;type)                           throws java.io.IOException,                                  <A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></PRE><DL><DD>Create a <code>Player</code> to play back media from an  <code>InputStream</code>.   <p> The <code>type</code> argument specifies the content-type of the input media.  If  <code>null</code> is given, <code>Manager</code> will attempt to determine the type.  However, since determining the media type is non-trivial for some media types, it may not be feasible in some cases.  The <code>Manager</code> may throw a <code>MediaException</code> to indicate that.<DD><DL><DT><B>Parameters:</B><DD><CODE>stream</CODE> - The <code>InputStream</code> that delivers the input media.<DD><CODE>type</CODE> - The <code>ContentType</code> of the media.<DT><B>Returns:</B><DD>A new <code>Player</code>.<DT><B>Throws:</B><DD><CODE>IllegalArgumentException</CODE> - Thrown if <code>stream</code> is <code>null</code>.<DD><CODE><A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></CODE> - Thrown if a <code>Player</code> cannot be created for the given stream and type.<DD><CODE>java.io.IOException</CODE> - Thrown if there was a problem reading data from the <code>InputStream</code>.<DD><CODE>SecurityException</CODE> - Thrown if the caller does not have security permission to create the <code>Player</code>.</DL></DD></DL><HR><A NAME="playTone(int, int, int)"><!-- --></A><H3>playTone</H3><PRE>public static void <B>playTone</B>(int&nbsp;note,                            int&nbsp;duration,                            int&nbsp;volume)                     throws <A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></PRE><DL><DD>Play back a tone as specified by a note and its duration. A note is given in the range of 0 to 127 inclusive.  The frequency  of the note can be calculated from the following formula: <pre>     SEMITONE_CONST = 17.31234049066755 = 1/(ln(2^(1/12)))     note = ln(freq/8.176)*SEMITONE_CONST     The musical note A = MIDI note 69 (0x45) = 440 Hz. </pre> This call is a non-blocking call. Notice that this method may utilize CPU resources significantly on devices that don't have hardware support for tone generation.<DD><DL><DT><B>Parameters:</B><DD><CODE>note</CODE> - Defines the tone of the note as specified by the  above formula.<DD><CODE>duration</CODE> - The duration of the tone in milli-seconds. Duration must be positive.<DD><CODE>volume</CODE> - Audio volume range from 0 to 100.  100 represents  the maximum volume at the current hardware level.  Setting the volume to a  value less than 0 will set the volume to 0.  Setting the volume to greater than 100 will set the volume to 100.<DT><B>Throws:</B><DD><CODE>IllegalArgumentException</CODE> - Thrown if the given note or  duration is out of range.<DD><CODE><A HREF="../../../javax/microedition/media/MediaException.html">MediaException</A></CODE> - Thrown if the tone cannot be played  due to a device-related problem.</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>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/Manager.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><strong>MIDP 2.0</strong></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;PREV CLASS&nbsp;&nbsp;NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Manager.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="mailto:jsr-118-comments@jcp.org">Send a comment or suggestion</a> Version 2.0 of Mobile Information Device Profile Specification<br>Java is a trademark or registered trademark of Sun Microsystems,  Inc. in the US and other countries. Copyright 1993-2002 Sun Microsystems, Inc. and Motorola, Inc. All Rights Reserved. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.</font></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -