/* */ package quicktime.util;
/* */
/* */ import quicktime.QTException;
/* */ import quicktime.QTObject;
/* */ import quicktime.std.StdQTException;
/* */ import quicktime.std.image.GraphicsExporter;
/* */ import quicktime.std.image.GraphicsImporter;
/* */ import quicktime.std.image.ImageDescription;
/* */ import quicktime.std.movies.Track;
/* */ import quicktime.std.movies.media.SoundDescription;
/* */ import quicktime.std.qtcomponents.ImageCompressionDialog;
/* */ import quicktime.std.qtcomponents.TimeCodeDef;
/* */ import quicktime.std.qtcomponents.TimeCodeDescription;
/* */ import quicktime.std.qtcomponents.TimeCodeInfo;
/* */ import quicktime.std.qtcomponents.TimeCodeTime;
/* */ import quicktime.std.qtcomponents.TimeCoder;
/* */
/* */ public class QTHandle extends QTHandleRef
/* */ {
/* */ public static QTHandle fromGraphicsExporterText(GraphicsExporter paramGraphicsExporter)
/* */ throws QTException
/* */ {
/* 36 */ int[] arrayOfInt = { 0 };
/* 37 */ int i = GraphicsExportGetSettingsAsText(QTObject.ID(paramGraphicsExporter), arrayOfInt);
/* 38 */ StdQTException.checkError(i);
/* 39 */ return new QTHandle(arrayOfInt[0], null, false);
/* */ }
/* */
/* */ public static QTHandle fromGraphicsExporterInput(GraphicsExporter paramGraphicsExporter)
/* */ throws QTException
/* */ {
/* 49 */ int[] arrayOfInt = new int[1];
/* 50 */ int i = GraphicsExportGetInputHandle(QTObject.ID(paramGraphicsExporter), arrayOfInt);
/* 51 */ StdQTException.checkError(i);
/* 52 */ return new QTHandle(arrayOfInt[0], null, false);
/* */ }
/* */
/* */ public static QTHandle fromGraphicsExporterOutput(GraphicsExporter paramGraphicsExporter)
/* */ throws QTException
/* */ {
/* 62 */ int[] arrayOfInt = new int[1];
/* 63 */ int i = GraphicsExportGetOutputHandle(QTObject.ID(paramGraphicsExporter), arrayOfInt);
/* 64 */ StdQTException.checkError(i);
/* 65 */ return new QTHandle(arrayOfInt[0], null, false);
/* */ }
/* */
/* */ public static QTHandle fromSoundDescription(SoundDescription paramSoundDescription, int paramInt)
/* */ throws QTException
/* */ {
/* 89 */ int[] arrayOfInt = new int[1];
/* 90 */ int i = GetSoundDescriptionExtension(QTObject.ID(paramSoundDescription), arrayOfInt, paramInt);
/* 91 */ StdQTException.checkError(i);
/* 92 */ return new QTHandle(arrayOfInt[0], null, false);
/* */ }
/* */
/* */ public static QTHandle fromImageDescription(ImageDescription paramImageDescription, int paramInt1, int paramInt2)
/* */ throws StdQTException
/* */ {
/* 103 */ int[] arrayOfInt = new int[1];
/* 104 */ StdQTException.checkError(GetImageDescriptionExtension(QTObject.ID(paramImageDescription), arrayOfInt, paramInt1, paramInt2));
/* */
/* 108 */ return new QTHandle(arrayOfInt[0], null, false);
/* */ }
/* */
/* */ public static QTHandle fromGraphicsImporterData(GraphicsImporter paramGraphicsImporter)
/* */ throws QTException
/* */ {
/* 118 */ int[] arrayOfInt = new int[1];
/* 119 */ int i = GraphicsImportGetDataHandle(QTObject.ID(paramGraphicsImporter), arrayOfInt);
/* 120 */ StdQTException.checkError(i);
/* 121 */ return new QTHandle(arrayOfInt[0], null, false);
/* */ }
/* */
/* */ public static QTHandle fromGraphicsImporterAlias(GraphicsImporter paramGraphicsImporter)
/* */ throws QTException
/* */ {
/* 131 */ int[] arrayOfInt1 = new int[1];
/* 132 */ int[] arrayOfInt2 = new int[1];
/* */
/* 134 */ int i = GraphicsImportGetAliasedDataReference(QTObject.ID(paramGraphicsImporter), arrayOfInt1, arrayOfInt2);
/* 135 */ StdQTException.checkError(i);
/* 136 */ return new QTHandle(arrayOfInt1[0], null, false);
/* */ }
/* */
/* */ public static TimeCodeInfo fromTimeCoderTime(TimeCoder paramTimeCoder, int paramInt)
/* */ throws QTException
/* */ {
/* 147 */ int[] arrayOfInt1 = new int[1];
/* 148 */ TimeCodeTime localTimeCodeTime = new TimeCodeTime();
/* 149 */ int[] arrayOfInt2 = new int[1];
/* 150 */ TimeCodeInfo localTimeCodeInfo = new TimeCodeInfo();
/* 151 */ int i = TCGetTimeCodeAtTime(QTObject.ID(paramTimeCoder), paramInt, arrayOfInt1, localTimeCodeInfo.definition.getBytes(), localTimeCodeTime.getBytes(), arrayOfInt2);
/* */
/* 157 */ StdQTException.checkError(i);
/* */
/* 159 */ if (arrayOfInt2[0] != 0)
/* 160 */ localTimeCodeInfo.userData = new QTHandle(arrayOfInt2[0], null, false);
/* */ else {
/* 162 */ localTimeCodeInfo.userData = null;
/* */ }
/* 164 */ localTimeCodeInfo.counter = localTimeCodeTime.toCounter();
/* 165 */ localTimeCodeInfo.time = localTimeCodeTime;
/* 166 */ localTimeCodeInfo.frameNumber = arrayOfInt1[0];
/* */
/* 168 */ return localTimeCodeInfo;
/* */ }
/* */
/* */ public static TimeCodeInfo fromTimeCoderCurrent(TimeCoder paramTimeCoder)
/* */ throws QTException
/* */ {
/* 178 */ int[] arrayOfInt1 = new int[1];
/* 179 */ TimeCodeTime localTimeCodeTime = new TimeCodeTime();
/* 180 */ int i = 0;
/* 181 */ int[] arrayOfInt2 = new int[1];
/* 182 */ TimeCodeInfo localTimeCodeInfo = new TimeCodeInfo();
/* 183 */ int j = TCGetCurrentTimeCode(QTObject.ID(paramTimeCoder), arrayOfInt1, localTimeCodeInfo.definition.getBytes(), localTimeCodeTime.getBytes(), arrayOfInt2);
/* */
/* 188 */ StdQTException.checkError(j);
/* */
/* 190 */ if (arrayOfInt2[0] != 0)
/* 191 */ localTimeCodeInfo.userData = new QTHandle(arrayOfInt2[0], null, false);
/* */ else {
/* 193 */ localTimeCodeInfo.userData = null;
/* */ }
/* 195 */ localTimeCodeInfo.counter = localTimeCodeTime.toCounter();
/* 196 */ localTimeCodeInfo.time = localTimeCodeTime;
/* 197 */ localTimeCodeInfo.frameNumber = arrayOfInt1[0];
/* */
/* 199 */ return localTimeCodeInfo;
/* */ }
/* */
/* */ public static QTHandle fromTimeCoderSource(TimeCoder paramTimeCoder, TimeCodeDescription paramTimeCodeDescription)
/* */ throws QTException
/* */ {
/* 210 */ int[] arrayOfInt = new int[1];
/* 211 */ StdQTException.checkError(TCGetSourceRef(QTObject.ID(paramTimeCoder), QTObject.ID(paramTimeCodeDescription), arrayOfInt));
/* */
/* 216 */ return new QTHandle(arrayOfInt[0], null, false);
/* */ }
/* */
/* */ public static QTHandle fromTrack(Track paramTrack)
/* */ throws QTException
/* */ {
/* 226 */ int[] arrayOfInt = new int[1];
/* 227 */ int i = GetTrackSoundLocalizationSettings(QTObject.ID(paramTrack), arrayOfInt);
/* 228 */ StdQTException.checkError(i);
/* 229 */ return new QTHandle(arrayOfInt[0], null, false);
/* */ }
/* */
/* */ public static QTHandle fromEncodedImage(EncodedImage paramEncodedImage)
/* */ throws QTException
/* */ {
/* 237 */ if ((paramEncodedImage instanceof ByteEncodedImage))
/* 238 */ return new QTHandle(((ByteEncodedImage)paramEncodedImage).getBytes());
/* 239 */ if ((paramEncodedImage instanceof IntEncodedImage)) {
/* 240 */ QTHandle localQTHandle = new QTHandle(paramEncodedImage.getSize(), false);
/* 241 */ int[] arrayOfInt = ((IntEncodedImage)paramEncodedImage).getInts();
/* 242 */ localQTHandle.copyFromArray(0, arrayOfInt, 0, arrayOfInt.length);
/* 243 */ return localQTHandle;
/* 244 */ }if ((paramEncodedImage instanceof RawEncodedImage)) {
/* 245 */ return new QTHandle((RawEncodedImage)paramEncodedImage, 0, paramEncodedImage.getSize());
/* */ }
/* 247 */ return null;
/* */ }
/* */
/* */ public static void reserveMemory(int paramInt)
/* */ throws UtilException
/* */ {
/* 257 */ ReserveMem(paramInt);
/* 258 */ UtilException.checkError(MemError());
/* */ }
/* */
/* */ public QTHandle()
/* */ throws QTException
/* */ {
/* 267 */ this(4, true);
/* */ }
/* */
/* */ public QTHandle(int paramInt, boolean paramBoolean)
/* */ throws QTException
/* */ {
/* 278 */ super(paramInt, paramBoolean);
/* */ }
/* */
/* */ public QTHandle(byte[] paramArrayOfByte)
/* */ throws QTException
/* */ {
/* 287 */ super(paramArrayOfByte.length, false);
/* 288 */ setBytesAt(0, paramArrayOfByte.length, paramArrayOfByte, 0);
/* */ }
/* */
/* */ public QTHandle(QTPointerRef paramQTPointerRef, int paramInt1, int paramInt2)
/* */ throws QTException
/* */ {
/* 303 */ this(copyPtr(paramQTPointerRef, paramInt1, paramInt2), null, false);
/* */ }
/* */
/* */ public QTHandle(QTHandleRef paramQTHandleRef1, QTHandleRef paramQTHandleRef2)
/* */ throws QTException
/* */ {
/* 314 */ this(paramQTHandleRef1.makeAndCopyHandle(), null, false);
/* 315 */ concatenate(paramQTHandleRef2);
/* */ }
/* */
/* */ protected QTHandle(int paramInt, Object paramObject, boolean paramBoolean)
/* */ {
/* 323 */ super(paramInt, paramObject, paramBoolean);
/* */ }
/* */
/* */ private static int copyPtr(QTPointerRef paramQTPointerRef, int paramInt1, int paramInt2) throws UtilException
/* */ {
/* 328 */ QTUtils.checkQTObjectSizeAndOffset(paramQTPointerRef, paramInt1, paramInt2, null);
/* */
/* 330 */ paramInt2 = paramInt2 + paramInt1 > paramQTPointerRef.getSize() ? paramQTPointerRef.getSize() - paramInt1 : paramInt2;
/* 331 */ int[] arrayOfInt = { 0 };
/* 332 */ arrayOfInt[0] = NewHandleClear(4);
/* 333 */ UtilException.checkError(PtrToHand(QTObject.ID(paramQTPointerRef) + paramInt1, arrayOfInt, paramInt2));
/* 334 */ return arrayOfInt[0];
/* */ }
/* */
/* */ public void setSize(int paramInt)
/* */ throws UtilException
/* */ {
/* 345 */ if ((paramInt < 0) || (lockAndDeref(0) > 2147483647 - paramInt)) {
/* 346 */ throw new ArrayIndexOutOfBoundsException();
/* */ }
/* 348 */ if (!isLocked()) unlock();
/* */
/* 350 */ SetHandleSize(_ID(), paramInt);
/* 351 */ UtilException.checkError(MemError());
/* */ }
/* */
/* */ public void concatenate(QTHandleRef paramQTHandleRef)
/* */ throws UtilException
/* */ {
/* 361 */ paramQTHandleRef.doLock();
/* 362 */ int i = HandAndHand(QTObject.ID(paramQTHandleRef), _ID());
/* 363 */ if (!paramQTHandleRef.isLocked()) paramQTHandleRef.unlock();
/* 364 */ UtilException.checkError(i);
/* */ }
/* */
/* */ public static QTHandle fromImageCompressionDialog(ImageCompressionDialog paramImageCompressionDialog) throws StdQTException {
/* 368 */ int[] arrayOfInt = { 0 };
/* 369 */ StdQTException.checkError(SCGetInfo(QTObject.ID(paramImageCompressionDialog), 1667523939, arrayOfInt));
/* */
/* 373 */ return new QTHandle(arrayOfInt[0], null, false);
/* */ }
/* */
/* */ public Object clone()
/* */ {
/* 379 */ return new QTHandle(makeAndCopyHandle(), null, false);
/* */ }
/* */
/* */ private static native short GetSoundDescriptionExtension(int paramInt1, int[] paramArrayOfInt, int paramInt2);
/* */
/* */ private static native short GetImageDescriptionExtension(int paramInt1, int[] paramArrayOfInt, int paramInt2, int paramInt3);
/* */
/* */ private static native int GraphicsImportGetDataHandle(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native int GraphicsImportGetAliasedDataReference(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/* */
/* */ private static native int TCGetTimeCodeAtTime(int paramInt1, int paramInt2, int[] paramArrayOfInt1, byte[] paramArrayOfByte1, byte[] paramArrayOfByte2, int[] paramArrayOfInt2);
/* */
/* */ private static native int TCGetCurrentTimeCode(int paramInt, int[] paramArrayOfInt1, byte[] paramArrayOfByte1, byte[] paramArrayOfByte2, int[] paramArrayOfInt2);
/* */
/* */ private static native int TCGetSourceRef(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/* */
/* */ private static native short GetTrackSoundLocalizationSettings(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native void ReserveMem(int paramInt);
/* */
/* */ private static native short MemError();
/* */
/* */ private static native int NewHandleClear(int paramInt);
/* */
/* */ private static native short PtrToHand(int paramInt1, int[] paramArrayOfInt, int paramInt2);
/* */
/* */ private static native void SetHandleSize(int paramInt1, int paramInt2);
/* */
/* */ private static native short HandAndHand(int paramInt1, int paramInt2);
/* */
/* */ private static native int GraphicsExportGetInputHandle(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native int GraphicsExportGetOutputHandle(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native int GraphicsExportGetSettingsAsText(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native int SCGetInfo(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.util.QTHandle
* JD-Core Version: 0.6.2
*/