Package quicktime.std.movies

Source Code of quicktime.std.movies.ParameterDialog

/*     */ package quicktime.std.movies;
/*     */
/*     */ import com.apple.mrj.macos.carbon.CarbonAccess;
/*     */ import com.apple.mrj.macos.carbon.CarbonEventClient;
/*     */ import java.io.PrintStream;
/*     */ import java.util.Enumeration;
/*     */ import java.util.Vector;
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTObject;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.jdirect.QTNative;
/*     */ import quicktime.qd.Pict;
/*     */ import quicktime.std.StdQTException;
/*     */ import quicktime.util.EndianOrder;
/*     */ import quicktime.util.QTUtils;
/*     */
/*     */ public final class ParameterDialog
/*     */ {
/*  32 */   private static boolean apriori = QTSession.apriori();
/*     */   private static final boolean accumulateUpdates = true;
/*  36 */   private static final int[] savedPort = { 0 };
/*  37 */   private static final int[] savedDevice = { 0 };
/*  38 */   private static int res = 0;
/*     */   private int dialog;
/*     */
/*     */   private ParameterDialog()
/*     */   {
/*     */   }
/*     */
/*     */   private ParameterDialog(EffectsList paramEffectsList, AtomContainer paramAtomContainer, int paramInt)
/*     */     throws QTException
/*     */   {
/*  44 */     int[] arrayOfInt = { 0 };
/*  45 */     EffectsList localEffectsList = paramEffectsList;
/*  46 */     AtomContainer localAtomContainer = paramAtomContainer;
/*  47 */     int i = paramInt;
/*     */
/*  50 */     if (QTSession.isCurrentOS(4)) {
/*  51 */       GetGWorld(savedPort, savedDevice);
/*  52 */       res = ((Integer)CarbonAccess.invokeCarbonEventClient(new CarbonEventClient() { private final EffectsList val$f_effectsList;
/*     */         private final AtomContainer val$f_parameters;
/*     */         private final int val$f_dialogOptions;
/*     */         private final int[] val$ar;
/*     */
/*  55 */         public Object invoke() { synchronized (QTNative.globalsLock) {
/*  56 */             ParameterDialog.access$002(ParameterDialog.QTCreateStandardParameterDialog(QTObject.ID(this.val$f_effectsList), QTObject.ID(this.val$f_parameters), this.val$f_dialogOptions, this.val$ar));
/*     */
/*  60 */             ParameterDialog.SetGWorld(ParameterDialog.savedPort[0], ParameterDialog.savedDevice[0]);
/*     */           }
/*  62 */           return new Integer(ParameterDialog.res);
/*     */         }
/*     */       })).intValue();
/*     */
/*  65 */       StdQTException.checkError(res);
/*     */     } else {
/*  67 */       synchronized (QTNative.globalsLock) {
/*  68 */         if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  69 */           GetGWorld(savedPort, savedDevice);
/*  70 */         res = QTCreateStandardParameterDialog(QTObject.ID(paramEffectsList), QTObject.ID(paramAtomContainer), paramInt, arrayOfInt);
/*     */
/*  74 */         if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  75 */           SetGWorld(savedPort[0], savedDevice[0]);
/*  76 */         if (res != 0) {
/*  77 */           if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/*  78 */             SetGWorld(savedPort[0], savedDevice[0]);
/*  79 */           StdQTException.checkError(res);
/*     */         }
/*     */       }
/*     */     }
/*  83 */     this.dialog = arrayOfInt[0];
/*     */   }
/*     */
/*     */   public static AtomContainer showParameterDialog(AtomContainer paramAtomContainer, int paramInt)
/*     */     throws QTException
/*     */   {
/*  99 */     int[] arrayOfInt = { 0 };
/* 100 */     AtomContainer localAtomContainer1 = new AtomContainer();
/*     */
/* 109 */     int j = paramInt;
/* 110 */     AtomContainer localAtomContainer2 = paramAtomContainer;
/*     */     int i;
/* 112 */     if (QTSession.isCurrentOS(4)) {
/* 113 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 114 */         GetGWorld(savedPort, savedDevice);
/* 115 */       i = ((Integer)CarbonAccess.invokeCarbonEventClient(new CarbonEventClient() { private final AtomContainer val$f_effectsList;
/*     */         private final AtomContainer val$parameters;
/*     */         private final int val$f_dialogOptions;
/*     */         private final int[] val$ar;
/*     */
/* 117 */         public Object invoke() { int i = 0;
/* 118 */           synchronized (QTNative.globalsLock) {
/* 119 */             System.err.println("QTCreateStandardParameterDialog " + ParameterDialog.res);
/* 120 */             i = ParameterDialog.QTCreateStandardParameterDialog(QTObject.ID(this.val$f_effectsList), QTObject.ID(this.val$parameters), this.val$f_dialogOptions, this.val$ar);
/*     */
/* 124 */             if (i == 0)
/*     */             {
/* 126 */               ParameterDialog.access$002(ParameterDialog.QTIsStandardParameterDialogEvent(null, this.val$ar[0]));
/* 127 */               ParameterDialog.QTDismissStandardParameterDialog(this.val$ar[0]);
/*     */             }
/*     */           }
/*     */
/* 131 */           return new Integer(i);
/*     */         }
/*     */       })).intValue();
/*     */
/* 134 */       StdQTException.checkError(i);
/* 135 */       res = i;
/*     */
/* 149 */       if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4)))
/* 150 */         SetGWorld(savedPort[0], savedDevice[0]);
/* 151 */       StdQTException.checkError(res);
/*     */     } else {
/* 153 */       synchronized (QTNative.globalsLock) {
/* 154 */         if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4))) {
/* 155 */           GetGWorld(savedPort, savedDevice);
/*     */         }
/* 157 */         i = QTCreateStandardParameterDialog(QTObject.ID(paramAtomContainer), QTObject.ID(localAtomContainer1), paramInt, arrayOfInt);
/*     */
/* 162 */         if (i == 0) {
/* 163 */           res = QTIsStandardParameterDialogEvent(null, arrayOfInt[0]);
/* 164 */           QTDismissStandardParameterDialog(arrayOfInt[0]);
/*     */         }
/*     */
/* 167 */         if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4))) {
/* 168 */           SetGWorld(savedPort[0], savedDevice[0]);
/*     */         }
/* 170 */         if (i != 0) {
/* 171 */           StdQTException.checkError(i);
/*     */         }
/*     */       }
/*     */
/*     */     }
/*     */
/* 177 */     res = res == -8986 ? 0 : res;
/* 178 */     StdQTException.checkError(res);
/*     */
/* 181 */     return localAtomContainer1;
/*     */   }
/*     */
/*     */   public static AtomContainer showParameterDialog(EffectsList paramEffectsList, int paramInt, AtomContainer paramAtomContainer, String paramString, Pict[] paramArrayOfPict)
/*     */     throws QTException
/*     */   {
/* 200 */     AtomContainer localAtomContainer = null;
/* 201 */     Pict[] arrayOfPict = paramArrayOfPict;
/* 202 */     String str = paramString;
/* 203 */     if (paramAtomContainer == null)
/* 204 */       localAtomContainer = new AtomContainer();
/*     */     else {
/* 206 */       localAtomContainer = paramAtomContainer.copyAtom(Atom.kParentIsContainer);
/*     */     }
/*     */
/* 209 */     synchronized (QTNative.globalsLock)
/*     */     {
/*     */     }
/*     */     Object localObject2;
/* 215 */     if (QTSession.isCurrentOS(4)) {
/* 216 */       ??? = localAtomContainer;
/* 217 */       localObject2 = paramEffectsList;
/* 218 */       int i = paramInt;
/* 219 */       ParameterDialog localParameterDialog = new ParameterDialog((EffectsList)localObject2, ???, i);
/*     */
/* 221 */       res = ((Integer)CarbonAccess.invokeCarbonEventClient(new CarbonEventClient() { private final ParameterDialog val$dialog;
/*     */         private final String val$f_title;
/*     */         private final Pict[] val$f_pictArray;
/*     */
/* 223 */         public Object invoke() { synchronized (QTNative.globalsLock) {
/*     */             try {
/* 225 */               this.val$dialog.setDialogTitle(this.val$f_title);
/* 226 */               this.val$dialog.setPreviewPictures(this.val$f_pictArray);
/* 227 */               ParameterDialog.access$002(this.val$dialog.runParameterDialog());
/*     */             }
/*     */             catch (QTException localQTException) {
/*     */             }
/*     */           }
/* 232 */           return new Integer(ParameterDialog.res);
/*     */         }
/*     */       })).intValue();
/*     */
/* 235 */       if (res == -8986)
/* 236 */         return ???.copyAtom(Atom.kParentIsContainer);
/*     */     } else {
/* 238 */       synchronized (QTNative.globalsLock) {
/* 239 */         localObject2 = new ParameterDialog(paramEffectsList, localAtomContainer, paramInt);
/* 240 */         ((ParameterDialog)localObject2).setDialogTitle(paramString);
/* 241 */         ((ParameterDialog)localObject2).setPreviewPictures(paramArrayOfPict);
/* 242 */         res = ((ParameterDialog)localObject2).runParameterDialog();
/* 243 */         if (res == -8986) {
/* 244 */           return localAtomContainer.copyAtom(Atom.kParentIsContainer);
/*     */         }
/*     */       }
/*     */
/*     */     }
/*     */
/* 250 */     StdQTException.checkError(res);
/* 251 */     return null;
/*     */   }
/*     */
/*     */   public static int getEffectsSpeed(AtomContainer paramAtomContainer)
/*     */     throws QTException
/*     */   {
/* 263 */     int[] arrayOfInt = { 0 };
/* 264 */     StdQTException.checkError(QTGetEffectSpeed(QTObject.ID(paramAtomContainer), arrayOfInt));
/* 265 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   private void setDialogTitle(String paramString)
/*     */   {
/* 273 */     if (paramString != null)
/* 274 */       QTStandardParameterDialogDoAction(this.dialog, 8, QTUtils.String2PString(paramString, 255));
/*     */   }
/*     */
/*     */   private void setPreviewPictures(Pict[] paramArrayOfPict)
/*     */   {
/* 283 */     if (paramArrayOfPict != null) {
/* 284 */       int[] arrayOfInt = new int[2];
/* 285 */       for (int i = 0; i < paramArrayOfPict.length; i++)
/* 286 */         if (paramArrayOfPict[i] != null) {
/* 287 */           arrayOfInt[0] = (i + 1);
/* 288 */           arrayOfInt[1] = QTObject.ID(paramArrayOfPict[i]);
/* 289 */           QTStandardParameterDialogDoAction(this.dialog, 6, arrayOfInt);
/*     */         }
/*     */     }
/*     */   }
/*     */
/*     */   private int runParameterDialog()
/*     */     throws QTException
/*     */   {
/* 309 */     int i = -128;
/*     */
/* 311 */     byte[] arrayOfByte = new byte[16];
/* 312 */     int j = 1;
/* 313 */     int k = 0;
/*     */
/* 315 */     Vector localVector = null;
/*     */     do
/*     */     {
/* 318 */       GetNextEvent((short)-1, arrayOfByte);
/* 319 */       i = QTIsStandardParameterDialogEvent(arrayOfByte, this.dialog);
/* 320 */       switch (i)
/*     */       {
/*     */       case -8986:
/* 326 */         j = 0;
/* 327 */         break;
/*     */       case -128:
/* 331 */         j = 0;
/* 332 */         break;
/*     */       case 0:
/* 335 */         break;
/*     */       case -2053:
/* 338 */         short s = (short)((arrayOfByte[0] & 0xFF) << 8 | arrayOfByte[1] & 0xFF);
/* 339 */         s = EndianOrder.flipNativeToBigEndian16(s);
/*     */
/* 342 */         if (s == 6) {
/* 343 */           int m = (arrayOfByte[2] & 0xFF) << 24 | (arrayOfByte[3] & 0xFF) << 16 | (arrayOfByte[4] & 0xFF) << 8 | arrayOfByte[5] & 0xFF;
/* 344 */           m = EndianOrder.flipNativeToBigEndian32(m);
/* 345 */           if (m != 0) {
/* 346 */             if (k == 0)
/* 347 */               k = m;
/* 348 */             if (k == m)
/*     */               continue;
/* 350 */             BeginUpdate(m);
/*     */
/* 354 */             EndUpdate(m);
/*     */
/* 357 */             if (((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(2))) &&
/* 358 */               (localVector == null)) {
/* 359 */               localVector = new Vector();
/*     */             }
/*     */
/* 362 */             if (localVector != null);
/* 365 */             Integer localInteger = new Integer(m);
/* 366 */             if (!localVector.contains(localInteger)) {
/* 367 */               localVector.addElement(localInteger);
/*     */             }
/*     */
/*     */           }
/*     */
/*     */         }
/*     */
/*     */         break;
/*     */       }
/*     */
/*     */     }
/*     */
/* 379 */     while (j != 0);
/*     */
/* 382 */     if (localVector != null)
/*     */     {
/* 384 */       for (Enumeration localEnumeration = localVector.elements(); localEnumeration.hasMoreElements(); ) {
/* 385 */         invalWindow(((Integer)localEnumeration.nextElement()).intValue());
/*     */       }
/* 387 */       localVector.removeAllElements();
/*     */     }
/*     */
/* 390 */     System.out.println("QTDismissStandardParameterDialog " + i);
/*     */
/* 392 */     QTDismissStandardParameterDialog(this.dialog);
/* 393 */     if ((QTSession.isCurrentOS(1)) || (QTSession.isCurrentOS(4))) {
/* 394 */       SetGWorld(savedPort[0], savedDevice[0]);
/*     */     }
/* 396 */     return i;
/*     */   }
/*     */
/*     */   private static void invalWindow(int paramInt) {
/* 400 */     short[] arrayOfShort = new short[4];
/*     */     int tmp9_8 = 0; arrayOfShort[1] = tmp9_8; arrayOfShort[0] = tmp9_8;
/* 402 */     arrayOfShort[3] = 4095; arrayOfShort[2] = 4095;
/* 403 */     if (QTSession.isCurrentOS(1))
/*     */     {
/* 405 */       SetPort(paramInt);
/* 406 */       InvalRect(arrayOfShort);
/* 407 */     } else if (QTSession.isCurrentOS(2))
/*     */     {
/* 409 */       MacSetPort(paramInt);
/* 410 */       InvalRect(arrayOfShort);
/*     */     }
/*     */   }
/*     */
/*     */   private static native short QTCreateStandardParameterDialog(int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt);
/*     */
/*     */   private static native short QTStandardParameterDialogDoAction(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/*     */
/*     */   private static native short QTStandardParameterDialogDoAction(int paramInt1, int paramInt2, byte[] paramArrayOfByte);
/*     */
/*     */   private static native short QTIsStandardParameterDialogEvent(byte[] paramArrayOfByte, int paramInt);
/*     */
/*     */   private static native short QTDismissStandardParameterDialog(int paramInt);
/*     */
/*     */   private static native void SetGWorld(int paramInt1, int paramInt2);
/*     */
/*     */   private static native void GetGWorld(int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*     */
/*     */   private static native short QTGetEffectSpeed(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native boolean GetNextEvent(short paramShort, byte[] paramArrayOfByte);
/*     */
/*     */   private static native void BeginUpdate(int paramInt);
/*     */
/*     */   private static native void EndUpdate(int paramInt);
/*     */
/*     */   private static native void SetPort(int paramInt);
/*     */
/*     */   private static native void MacSetPort(int paramInt);
/*     */
/*     */   private static native void InvalRect(short[] paramArrayOfShort);
/*     */ }

/* Location:           Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name:     quicktime.std.movies.ParameterDialog
* JD-Core Version:    0.6.2
*/
TOP

Related Classes of quicktime.std.movies.ParameterDialog

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.