/* */ package quicktime.std.clocks;
/* */
/* */ import quicktime.QTException;
/* */ import quicktime.QTNullPointerException;
/* */ import quicktime.QTObject;
/* */ import quicktime.QTSession;
/* */ import quicktime.jdirect.QTNative;
/* */ import quicktime.std.StdQTException;
/* */
/* */ public abstract class QTCallBack extends QTObject
/* */ {
/* 68 */ private static boolean apriori = QTSession.apriori();
/* */ static final int callBackAtTime = 1;
/* */ static final int callBackAtRate = 2;
/* */ static final int callBackAtTimeJump = 3;
/* */ static final int callBackAtExtremes = 4;
/* */ static final int callBackAtInterrupt = 32768;
/* */ static final int callBackAtDeferredTask = 16384;
/* */ private TimeBase tb;
/* 149 */ public CBRunner upp = null;
/* */ public int timeWhenCalledMsecs;
/* */ public float rateWhenCalled;
/* */
/* */ QTCallBack(TimeBase paramTimeBase, int paramInt)
/* */ throws QTException
/* */ {
/* 135 */ super(allocate(paramTimeBase, paramInt));
/* 136 */ this.tb = paramTimeBase;
/* */ }
/* */
/* */ private static int allocate(TimeBase paramTimeBase, int paramInt) throws QTException {
/* 140 */ int i = 0;
/* 141 */ synchronized (QTNative.globalsLock) {
/* 142 */ i = NewCallBack(QTObject.ID(paramTimeBase), (short)(paramInt | 0x8000));
/* */ }
/* 144 */ if (i == 0) throw new StdQTException("QTCallback.<init>");
/* 145 */ return i;
/* */ }
/* */
/* */ final void callMeWhen(int paramInt1, int paramInt2, int paramInt3)
/* */ throws StdQTException
/* */ {
/* 172 */ if (this.upp == null) {
/* 173 */ this.upp = new CBRunner(this);
/* */ }
/* 175 */ int i = 0;
/* 176 */ synchronized (QTNative.globalsLock) {
/* 177 */ i = CallMeWhen(_ID(), this.upp.getClosure(), 0, paramInt1, paramInt2, paramInt3);
/* */ }
/* 179 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public abstract void callMeWhen()
/* */ throws StdQTException;
/* */
/* */ public abstract void execute();
/* */
/* */ public final void cancel()
/* */ {
/* 200 */ synchronized (QTNative.globalsLock) {
/* 201 */ CancelCallBack(_ID());
/* */ }
/* */ }
/* */
/* */ public final void cancelAndCleanup()
/* */ {
/* */ try
/* */ {
/* 216 */ synchronized (QTNative.globalsLock) {
/* 217 */ CancelCallBack(_ID());
/* */ }
/* */ } catch (QTNullPointerException localQTNullPointerException) { }
/* */
/* 220 */ if (this.upp != null) {
/* 221 */ this.upp.cleanup();
/* 222 */ this.upp = null;
/* */ }
/* */ }
/* */
/* */ public final TimeBase getTimeBase()
/* */ {
/* 233 */ return TimeBase.fromQTCallBack(this);
/* */ }
/* */
/* */ public final int getType()
/* */ {
/* 241 */ return GetCallBackType(_ID());
/* */ }
/* */ public String toString() {
/* 244 */ return getClass().getName() + "[timeWhenCalled=" + this.timeWhenCalledMsecs + ",rateWhenCalled=" + this.rateWhenCalled + "]";
/* */ }
/* */
/* */ private static native short CallMeWhen(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6);
/* */
/* */ private static native short GetCallBackType(int paramInt);
/* */
/* */ private static native void CancelCallBack(int paramInt);
/* */
/* */ private static native int NewCallBack(int paramInt, short paramShort);
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.std.clocks.QTCallBack
* JD-Core Version: 0.6.2
*/