📄 volumecontrol.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Fri Sep 27 14:47:31 CDT 2002 --><TITLE>Mobile Information Device Profile 2.0: Interface VolumeControl</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_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/VolumeControl.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-all.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><strong>MIDP 2.0</strong></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../javax/microedition/media/control/ToneControl.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="VolumeControl.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | 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><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.microedition.media.control</FONT><BR>Interface VolumeControl</H2><DL><DT><B>All Superinterfaces:</B> <DD><A HREF="../../../../javax/microedition/media/Control.html">Control</A></DD></DL><HR><DL><DT>public interface <B>VolumeControl</B><DT>extends <A HREF="../../../../javax/microedition/media/Control.html">Control</A></DL><P><code>VolumeControl</code> is an interface for manipulating the audio volume of a <code>Player</code>. <h3>Volume Settings</h3> This interface allows the output volume to be specified using an integer value that varies between 0 and 100.<h4>Specifying Volume in the Level Scale</h4> The level scale specifies volume in a linear scale. It ranges from 0 to 100, where 0 represents silence and 100 represents the highest volume. The mapping for producing a linear multiplicative value is implementation dependent. <p> <h3>Mute</h3> Setting mute on or off doesn't change the volume level returned by getLevel. If mute is <CODE>true</CODE>, no audio signal is produced by this <code>Player</code>; if mute is <CODE>false</CODE> an audio signal is produced and the volume is restored. <h3>Volume Change Events</h3> When the state of the <code>VolumeControl</code> changes, a <code>VOLUME_CHANGED</code> event is delivered through the <code>PlayerListener</code>.<P><DL><DT><B>See Also: </B><DD><A HREF="../../../../javax/microedition/media/Control.html"><CODE>Control</CODE></A>, <A HREF="../../../../javax/microedition/media/Player.html"><CODE>Player</CODE></A>, <A HREF="../../../../javax/microedition/media/PlayerListener.html"><CODE>PlayerListener</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../javax/microedition/media/control/VolumeControl.html#getLevel()">getLevel</A></B>()</CODE><BR> Get the current volume level set.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../javax/microedition/media/control/VolumeControl.html#isMuted()">isMuted</A></B>()</CODE><BR> Get the mute state of the signal associated with this <code>VolumeControl</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../javax/microedition/media/control/VolumeControl.html#setLevel(int)">setLevel</A></B>(int level)</CODE><BR> Set the volume using a linear point scale with values between 0 and 100.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../javax/microedition/media/control/VolumeControl.html#setMute(boolean)">setMute</A></B>(boolean mute)</CODE><BR> Mute or unmute the <code>Player</code> associated with this <code>VolumeControl</code>.</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="setMute(boolean)"><!-- --></A><H3>setMute</H3><PRE>public void <B>setMute</B>(boolean mute)</PRE><DL><DD>Mute or unmute the <code>Player</code> associated with this <code>VolumeControl</code>. <p> Calling <code>setMute(true)</code> on the <code>Player</code> that is already muted is ignored, as is calling <code>setMute(false)</code> on the <code>Player</code> that is not currently muted. Setting mute on or off doesn't change the volume level returned by getLevel.</p> <p> When <code>setMute</code> results in a change in the muted state, a <code>VOLUME_CHANGED</code> event will be delivered through the <code>PlayerListener</code>.</p><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>mute</CODE> - Specify <CODE>true</CODE> to mute the signal, <CODE>false</CODE> to unmute the signal.<DT><B>See Also: </B><DD><A HREF="../../../../javax/microedition/media/control/VolumeControl.html#isMuted()"><CODE>isMuted()</CODE></A></DL></DD></DL><HR><A NAME="isMuted()"><!-- --></A><H3>isMuted</H3><PRE>public boolean <B>isMuted</B>()</PRE><DL><DD>Get the mute state of the signal associated with this <code>VolumeControl</code>.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The mute state.<DT><B>See Also: </B><DD><A HREF="../../../../javax/microedition/media/control/VolumeControl.html#setMute(boolean)"><CODE>setMute(boolean)</CODE></A></DL></DD></DL><HR><A NAME="setLevel(int)"><!-- --></A><H3>setLevel</H3><PRE>public int <B>setLevel</B>(int level)</PRE><DL><DD>Set the volume using a linear point scale with values between 0 and 100. <br> 0 is silence; 100 is the loudest useful level that this <code>VolumeControl</code> supports. If the given level is less than 0 or greater than 100, the level will be set to 0 or 100 respectively. <br> When <code>setLevel</code> results in a change in the volume level, a <code>VOLUME_CHANGED</code> event will be delivered through the <code>PlayerListener</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>level</CODE> - The new volume specified in the level scale.<DT><B>Returns:</B><DD>The level that was actually set.<DT><B>See Also: </B><DD><A HREF="../../../../javax/microedition/media/control/VolumeControl.html#getLevel()"><CODE>getLevel()</CODE></A></DL></DD></DL><HR><A NAME="getLevel()"><!-- --></A><H3>getLevel</H3><PRE>public int <B>getLevel</B>()</PRE><DL><DD>Get the current volume level set. <p> <code>getLevel</code> may return <code>-1</code> if and only if the <code>Player</code> is in the <i>REALIZED</i> state (the audio device has not been initialized) and <code>setLevel</code> has not yet been called.</p><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The current volume level or <code>-1</code>.<DT><B>See Also: </B><DD><A HREF="../../../../javax/microedition/media/control/VolumeControl.html#setLevel(int)"><CODE>setLevel(int)</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/VolumeControl.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-all.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><strong>MIDP 2.0</strong></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../javax/microedition/media/control/ToneControl.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="VolumeControl.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | 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="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 + -