📄 timer.html
字号:
<PRE>public <B>Timer</B>(int scale, int period) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Create a Timer.<DD><DL><DT><B>Parameters:</B><DD><CODE>scale</CODE> - the scale of the timer's tickle invocation period<DD><CODE>period</CODE> - the number of scale size ticks that elapse between each invocation of the tickle method</DL></DD></DL><HR><A NAME="Timer(int, int, quicktime.app.time.Ticklish)"><!-- --></A><H3>Timer</H3><PRE>public <B>Timer</B>(int scale, int period, <A HREF="../../../quicktime/app/time/Ticklish.html">Ticklish</A> target) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Create a Timer.<DD><DL><DT><B>Parameters:</B><DD><CODE>scale</CODE> - the scale of the timer's tickle invocation period<DD><CODE>period</CODE> - the number of scale size ticks that elapse between each invocation of the tickle method<DD><CODE>target</CODE> - the Ticklish target of the Timer - if this is not null then the target's tickle and timeChanged method will be invoked by the Timer.</DL></DD></DL><HR><A NAME="Timer(int, int, quicktime.app.time.Ticklish, quicktime.std.movies.Movie)"><!-- --></A><H3>Timer</H3><PRE>public <B>Timer</B>(int scale, int period, <A HREF="../../../quicktime/app/time/Ticklish.html">Ticklish</A> target, <A HREF="../../../quicktime/std/movies/Movie.html">Movie</A> mov) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Create a Timer.<DD><DL><DT><B>Parameters:</B><DD><CODE>scale</CODE> - the scale of the timer's tickle invocation period<DD><CODE>period</CODE> - the number of scale size ticks that elapse between each invocation of the tickle method<DD><CODE>target</CODE> - the Ticklish target of the Timer - if this is not null then the target's tickle and timeChanged method will be invoked by the Timer.<DD><CODE>mov</CODE> - the Movie from which the TimeBase of the timer will be derived.</DL></DD></DL><!-- ============ 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="isTicking()"><!-- --></A><H3>isTicking</H3><PRE>public boolean <B>isTicking</B>()</PRE><DL><DD>Returns true if the Timer's effective rate is currently non-zero<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a boolean</DL></DD></DL><HR><A NAME="isTickling()"><!-- --></A><H3>isTickling</H3><PRE>public boolean <B>isTickling</B>()</PRE><DL><DD>Returns true if the Timer, when active, will tickle or false if the Timer, when active, will not tickle. This does not indicate whether the Timer is active.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a boolean</DL></DD></DL><HR><A NAME="setTickling(boolean)"><!-- --></A><H3>setTickling</H3><PRE>public void <B>setTickling</B>(boolean flag) throws <A HREF="../../../quicktime/std/StdQTException.html">StdQTException</A></PRE><DL><DD>Sets the tickle state of the Timer. If true then the Timer when active will tickle. If false then the Timer when active will not tickle. This does not activate or deactivate a Timer.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>flag</CODE> - a boolean</DL></DD></DL><HR><A NAME="getTicklish()"><!-- --></A><H3>getTicklish</H3><PRE>public <A HREF="../../../quicktime/app/time/Ticklish.html">Ticklish</A> <B>getTicklish</B>()</PRE><DL><DD>Returns the current target of the Targetable object - this is the object that the Targetable will act upon.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current target</DL></DD></DL><HR><A NAME="getTimeBase()"><!-- --></A><H3>getTimeBase</H3><PRE>public final <A HREF="../../../quicktime/std/clocks/TimeBase.html">TimeBase</A> <B>getTimeBase</B>()</PRE><DL><DD>Returns the current time base that provides the time foundation of this object.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../quicktime/app/time/Timeable.html#getTimeBase()">getTimeBase</A></CODE> in interface <CODE><A HREF="../../../quicktime/app/time/Timeable.html">Timeable</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a TimeBase</DL></DD></DL><HR><A NAME="rescheduleTickle(int, int)"><!-- --></A><H3>rescheduleTickle</H3><PRE>public void <B>rescheduleTickle</B>(int scale, int period) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>This method will reschedule the Timer's callback mechanism to the new scale and period values. Scale cannot be zero. A zero period will disable any tickle. This will have the side-effect of resetting the isTickling state to true, so can be used to both reschedule a tickle call and ensure that a tickle will be sent.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>scale</CODE> - the new scale of the Timer's tickle notification<DD><CODE>period</CODE> - the number of scale ticks that will elapse between notifications.</DL></DD></DL><HR><A NAME="getScale()"><!-- --></A><H3>getScale</H3><PRE>public int <B>getScale</B>()</PRE><DL><DD>Returns the current scale of the Timer's tickle notification.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the scale</DL></DD></DL><HR><A NAME="getPeriod()"><!-- --></A><H3>getPeriod</H3><PRE>public int <B>getPeriod</B>()</PRE><DL><DD>Returns the current period (number of scale ticks) of the Timer's tickle notification.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the scale</DL></DD></DL><HR><A NAME="getRate()"><!-- --></A><H3>getRate</H3><PRE>public float <B>getRate</B>()</PRE><DL><DD>Returns the current rate of this Timer - this is the Timer's TimeBase rate. This may not be the actual or effective rate that the timer is ticking at if its TimeBase is slaved to another TimeBase<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../quicktime/app/time/Timeable.html#getRate()">getRate</A></CODE> in interface <CODE><A HREF="../../../quicktime/app/time/Timeable.html">Timeable</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the current rate</DL></DD></DL><HR><A NAME="setRate(float)"><!-- --></A><H3>setRate</H3><PRE>public void <B>setRate</B>(float rate)</PRE><DL><DD>Sets the Timeable's playback rate. Typically a rate of zero will mean that the player is stopped, a positive value that the player is playing forwards. If the object implements the Playable interface setting a negative value will play the player backwards. However, if the object does not have a time line then a negative value will continue to play the object in a forwards direction.<DD><DL><DT><B>Specified by: </B><DD><CODE><A HREF="../../../quicktime/app/time/Timeable.html#setRate(float)">setRate</A></CODE> in interface <CODE><A HREF="../../../quicktime/app/time/Timeable.html">Timeable</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>rate</CODE> - the new playback rate.</DL></DD></DL><HR><A NAME="setActive(boolean)"><!-- --></A><H3>setActive</H3><PRE>public void <B>setActive</B>(boolean flag) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>Sets the active state of the Timer; only an active Timer will tickle.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>flag</CODE> - fi true the Timer is active, if false it is inactive</DL></DD></DL><HR><A NAME="isActive()"><!-- --></A><H3>isActive</H3><PRE>public boolean <B>isActive</B>()</PRE><DL><DD>Returns the current active state of the Timer.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>true if the Timer is active, or false if it is not</DL></DD></DL><HR><A NAME="toString()"><!-- --></A><H3>toString</H3><PRE>public java.lang.String <B>toString</B>()</PRE><DL><DD>Return a string representation of this class.<DD><DL><DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL></DD></DL><HR><A NAME="timeChanged(int)"><!-- --></A><H3>timeChanged</H3><PRE>protected void <B>timeChanged</B>(int newTime) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>This is called by the Timer itself when the time base of the Timer has changed, through being reset to a new time or through the effective rate of the Timer changing from positive to negative or vice versa<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>newTime</CODE> - the new time of the Timer's time line expressed in the Ticklish.kScale</DL></DD></DL><HR><A NAME="tickle(float, int)"><!-- --></A><H3>tickle</H3><PRE>protected boolean <B>tickle</B>(float er, int time) throws <A HREF="../../../quicktime/QTException.html">QTException</A></PRE><DL><DD>When the time from zero (or a timeChanged time value, or the previous tickle time) that is specified by the scale and period of the Timer has elapsed the timer calls the tickle method. The Timer will only call this method if the Timer has an effective rate that is not zero.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>er</CODE> - the effective or actual rate that the timer is ticking at.<DD><CODE>time</CODE> - the current time of the time base expressed in the Ticklish.kScale<DT><B>Returns:</B><DD>true if the Timer should remain active and tickle again or false if it should become inactive.</DL></DD></DL><HR><A NAME="finalize()"><!-- --></A><H3>finalize</H3><PRE>protected void <B>finalize</B>() throws java.lang.Throwable</PRE><DL><DD>The finalize method deactivates the timer.<DD><DL><DT><B>Overrides:</B><DD><CODE>finalize</CODE> in class <CODE>java.lang.Object</CODE></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/Timer.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></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../quicktime/app/time/TaskThread.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="Timer.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -