/* */ package quicktime.std.movies.media;
/* */
/* */ import quicktime.QTException;
/* */ import quicktime.QTObject;
/* */ import quicktime.QTSession;
/* */ import quicktime.qd.QDPoint;
/* */ import quicktime.std.StdQTException;
/* */ import quicktime.std.image.GraphicsMode;
/* */ import quicktime.std.image.ImageDescription;
/* */ import quicktime.std.image.Matrix;
/* */ import quicktime.util.QTUtils;
/* */ import quicktime.util.StringHandle;
/* */
/* */ public final class SpriteMediaHandler extends VisualMediaHandler
/* */ {
/* 23 */ private static boolean apriori = QTSession.apriori();
/* */
/* */ SpriteMediaHandler(int paramInt, Object paramObject)
/* */ {
/* 27 */ super(paramInt, paramObject);
/* */ }
/* */
/* */ public void setMatrix(int paramInt, Matrix paramMatrix)
/* */ throws StdQTException
/* */ {
/* 38 */ int i = SpriteMediaSetSpriteProperty(_ID(), paramInt, 1, paramMatrix.getBytes());
/* */
/* 42 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public void setVisible(int paramInt, boolean paramBoolean)
/* */ throws StdQTException
/* */ {
/* 52 */ short s = (short)(byte)(paramBoolean ? 1 : 0);
/* 53 */ int i = SpriteMediaSetSpriteProperty(_ID(), paramInt, 4, s);
/* */
/* 57 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public void setLayer(int paramInt1, int paramInt2)
/* */ throws StdQTException
/* */ {
/* 67 */ short s = (short)paramInt2;
/* 68 */ int i = SpriteMediaSetSpriteProperty(_ID(), paramInt1, 5, s);
/* */
/* 72 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public void setGraphicsMode(int paramInt, GraphicsMode paramGraphicsMode)
/* */ throws StdQTException
/* */ {
/* 82 */ int i = SpriteMediaSetSpriteProperty(_ID(), paramInt, 6, paramGraphicsMode.getBytes());
/* */
/* 86 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public void setImageIndex(int paramInt1, int paramInt2)
/* */ throws StdQTException
/* */ {
/* 96 */ int i = SpriteMediaSetSpriteProperty(_ID(), paramInt1, 100, (short)paramInt2);
/* */
/* 100 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public Matrix getMatrix(int paramInt)
/* */ throws StdQTException
/* */ {
/* 110 */ Matrix localMatrix = new Matrix();
/* 111 */ int i = SpriteMediaGetSpriteProperty(_ID(), paramInt, 1, localMatrix.getBytes());
/* */
/* 115 */ StdQTException.checkError(i);
/* 116 */ return localMatrix;
/* */ }
/* */
/* */ public boolean getVisible(int paramInt)
/* */ throws StdQTException
/* */ {
/* 126 */ short[] arrayOfShort = new short[1];
/* 127 */ int i = SpriteMediaGetSpriteProperty(_ID(), paramInt, 4, arrayOfShort);
/* */
/* 131 */ StdQTException.checkError(i);
/* */
/* 133 */ return arrayOfShort[0] != 0;
/* */ }
/* */
/* */ public int getLayer(int paramInt)
/* */ throws StdQTException
/* */ {
/* 143 */ short[] arrayOfShort = new short[1];
/* 144 */ int i = SpriteMediaGetSpriteProperty(_ID(), paramInt, 5, arrayOfShort);
/* */
/* 148 */ StdQTException.checkError(i);
/* 149 */ return arrayOfShort[0];
/* */ }
/* */
/* */ public GraphicsMode getGraphicsMode(int paramInt)
/* */ throws StdQTException
/* */ {
/* 159 */ GraphicsMode localGraphicsMode = new GraphicsMode();
/* 160 */ int i = SpriteMediaGetSpriteProperty(_ID(), paramInt, 6, localGraphicsMode.getBytes());
/* */
/* 164 */ StdQTException.checkError(i);
/* */
/* 166 */ return localGraphicsMode;
/* */ }
/* */
/* */ public int getImageIndex(int paramInt)
/* */ throws StdQTException
/* */ {
/* 176 */ short[] arrayOfShort = new short[1];
/* 177 */ int i = SpriteMediaGetSpriteProperty(_ID(), paramInt, 100, arrayOfShort);
/* */
/* 181 */ StdQTException.checkError(i);
/* 182 */ return arrayOfShort[0];
/* */ }
/* */
/* */ public int hitTestAllSprites(int paramInt, QDPoint paramQDPoint)
/* */ throws StdQTException
/* */ {
/* 193 */ int[] arrayOfInt = new int[1];
/* 194 */ int i = SpriteMediaHitTestAllSprites(_ID(), paramInt, paramQDPoint.getPoint(), arrayOfInt);
/* */
/* 198 */ StdQTException.checkError(i);
/* */
/* 200 */ return arrayOfInt[0];
/* */ }
/* */
/* */ public boolean hitTestOneSprite(int paramInt1, int paramInt2, QDPoint paramQDPoint)
/* */ throws StdQTException
/* */ {
/* 212 */ byte[] arrayOfByte = new byte[1];
/* 213 */ int i = SpriteMediaHitTestOneSprite(_ID(), paramInt1, paramInt2, paramQDPoint.getPoint(), arrayOfByte);
/* */
/* 218 */ StdQTException.checkError(i);
/* */
/* 220 */ return arrayOfByte[0] != 0;
/* */ }
/* */
/* */ public int countSprites()
/* */ throws StdQTException
/* */ {
/* 229 */ short[] arrayOfShort = new short[1];
/* 230 */ int i = SpriteMediaCountSprites(_ID(), arrayOfShort);
/* 231 */ StdQTException.checkError(i);
/* */
/* 233 */ return arrayOfShort[0];
/* */ }
/* */
/* */ public int countImages()
/* */ throws StdQTException
/* */ {
/* 242 */ short[] arrayOfShort = new short[1];
/* 243 */ int i = SpriteMediaCountImages(_ID(), arrayOfShort);
/* 244 */ StdQTException.checkError(i);
/* 245 */ return arrayOfShort[0];
/* */ }
/* */
/* */ public ImageDescription getIndImageDescription(int paramInt)
/* */ throws QTException
/* */ {
/* 255 */ ImageDescription localImageDescription = new ImageDescription(0);
/* 256 */ int i = SpriteMediaGetIndImageDescription(_ID(), (short)paramInt, QTObject.ID(localImageDescription));
/* */
/* 259 */ StdQTException.checkError(i);
/* */
/* 261 */ return localImageDescription;
/* */ }
/* */
/* */ public int getDisplayedSampleNumber()
/* */ throws StdQTException
/* */ {
/* 270 */ int[] arrayOfInt = new int[1];
/* 271 */ int i = SpriteMediaGetDisplayedSampleNumber(_ID(), arrayOfInt);
/* 272 */ StdQTException.checkError(i);
/* */
/* 274 */ return arrayOfInt[0];
/* */ }
/* */
/* */ public String getSpriteName(int paramInt)
/* */ throws StdQTException
/* */ {
/* 284 */ byte[] arrayOfByte = new byte['ΓΏ'];
/* 285 */ int i = SpriteMediaGetSpriteName(_ID(), paramInt, arrayOfByte);
/* 286 */ StdQTException.checkError(i);
/* */
/* 288 */ return QTUtils.PString2String(arrayOfByte, 0);
/* */ }
/* */
/* */ public String getImageName(int paramInt)
/* */ throws StdQTException
/* */ {
/* 298 */ byte[] arrayOfByte = new byte[256];
/* 299 */ int i = SpriteMediaGetImageName(_ID(), (short)paramInt, arrayOfByte);
/* 300 */ StdQTException.checkError(i);
/* */
/* 302 */ return QTUtils.PString2String(arrayOfByte, 0);
/* */ }
/* */
/* */ public int spriteIndexToID(int paramInt)
/* */ throws StdQTException
/* */ {
/* 315 */ int[] arrayOfInt = new int[1];
/* 316 */ int i = SpriteMediaSpriteIndexToID(_ID(), (short)paramInt, arrayOfInt);
/* 317 */ StdQTException.checkError(i);
/* */
/* 319 */ return arrayOfInt[0];
/* */ }
/* */
/* */ public short spriteIDtoIndex(int paramInt)
/* */ throws StdQTException
/* */ {
/* 329 */ short[] arrayOfShort = new short[1];
/* */
/* 331 */ int i = SpriteMediaSpriteIDToIndex(_ID(), paramInt, arrayOfShort);
/* 332 */ StdQTException.checkError(i);
/* */
/* 334 */ return arrayOfShort[0];
/* */ }
/* */
/* */ public void setActionVariable(int paramInt, float paramFloat)
/* */ throws StdQTException
/* */ {
/* 343 */ float[] arrayOfFloat = new float[1];
/* 344 */ arrayOfFloat[0] = paramFloat;
/* 345 */ int i = SpriteMediaSetActionVariable(_ID(), paramInt, arrayOfFloat);
/* 346 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public float getActionVariable(int paramInt)
/* */ throws StdQTException
/* */ {
/* 355 */ float[] arrayOfFloat = new float[1];
/* 356 */ int i = SpriteMediaGetActionVariable(_ID(), paramInt, arrayOfFloat);
/* 357 */ StdQTException.checkError(i);
/* */
/* 359 */ return arrayOfFloat[0];
/* */ }
/* */
/* */ public void setActionVariableToString(int paramInt, String paramString)
/* */ throws StdQTException
/* */ {
/* 369 */ int i = SpriteMediaSetActionVariableToString(_ID(), paramInt, QTUtils.String2CString(paramString));
/* 370 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public String getActionVariableAsString(int paramInt)
/* */ throws StdQTException
/* */ {
/* 380 */ int[] arrayOfInt = { 0 };
/* 381 */ int i = SpriteMediaGetActionVariableAsString(_ID(), paramInt, arrayOfInt);
/* 382 */ StdQTException.checkError(i);
/* */ try {
/* 384 */ MyStringHandle localMyStringHandle = new MyStringHandle(arrayOfInt[0], this, 1);
/* 385 */ return localMyStringHandle.toJavaString();
/* */ } catch (QTException localQTException) {
/* 387 */ localQTException.printStackTrace();
/* */ }
/* 389 */ return null;
/* */ }
/* */
/* */ public int getSpriteImageGroupID(int paramInt)
/* */ throws StdQTException
/* */ {
/* 405 */ int[] arrayOfInt = new int[1];
/* */
/* 407 */ int i = SpriteMediaGetIndImageProperty(_ID(), (short)paramInt, 1001, arrayOfInt);
/* 408 */ StdQTException.checkError(i);
/* */
/* 410 */ return arrayOfInt[0];
/* */ }
/* */
/* */ public QDPoint getSpriteImageRegistrationPoint(int paramInt)
/* */ throws StdQTException
/* */ {
/* 420 */ byte[] arrayOfByte = new byte[8];
/* */
/* 422 */ int i = SpriteMediaGetIndImageProperty(_ID(), (short)paramInt, 1000, arrayOfByte);
/* 423 */ StdQTException.checkError(i);
/* */
/* 425 */ return QDPoint.fromArray(arrayOfByte, 8);
/* */ }
/* */
/* */ public void newImage(DataRef paramDataRef, int paramInt)
/* */ throws StdQTException
/* */ {
/* 440 */ int i = SpriteMediaNewImage(_ID(), QTObject.ID(paramDataRef), paramDataRef.getType(), paramInt);
/* 441 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public void disposeImage(int paramInt)
/* */ throws StdQTException
/* */ {
/* 451 */ int i = SpriteMediaDisposeImage(_ID(), (short)paramInt);
/* 452 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ private static native int SpriteMediaDisposeImage(int paramInt1, int paramInt2);
/* */
/* */ private static native int SpriteMediaNewImage(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
/* */
/* */ private static native int SpriteMediaSetSpriteProperty(int paramInt1, int paramInt2, int paramInt3, byte[] paramArrayOfByte);
/* */
/* */ private static native int SpriteMediaSetSpriteProperty(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
/* */
/* */ private static native int SpriteMediaSetSpriteProperty(int paramInt1, int paramInt2, int paramInt3, short paramShort);
/* */
/* */ private static native int SpriteMediaGetSpriteProperty(int paramInt1, int paramInt2, int paramInt3, byte[] paramArrayOfByte);
/* */
/* */ private static native int SpriteMediaGetSpriteProperty(int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt);
/* */
/* */ private static native int SpriteMediaGetSpriteProperty(int paramInt1, int paramInt2, int paramInt3, short[] paramArrayOfShort);
/* */
/* */ private static native int SpriteMediaHitTestAllSprites(int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt);
/* */
/* */ private static native int SpriteMediaHitTestOneSprite(int paramInt1, int paramInt2, int paramInt3, int paramInt4, byte[] paramArrayOfByte);
/* */
/* */ private static native int SpriteMediaCountSprites(int paramInt, short[] paramArrayOfShort);
/* */
/* */ private static native int SpriteMediaCountImages(int paramInt, short[] paramArrayOfShort);
/* */
/* */ private static native int SpriteMediaGetIndImageDescription(int paramInt1, short paramShort, int paramInt2);
/* */
/* */ private static native int SpriteMediaGetDisplayedSampleNumber(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native int SpriteMediaGetSpriteName(int paramInt1, int paramInt2, byte[] paramArrayOfByte);
/* */
/* */ private static native int SpriteMediaGetImageName(int paramInt, short paramShort, byte[] paramArrayOfByte);
/* */
/* */ private static native int SpriteMediaSpriteIndexToID(int paramInt, short paramShort, int[] paramArrayOfInt);
/* */
/* */ private static native int SpriteMediaSpriteIDToIndex(int paramInt1, int paramInt2, short[] paramArrayOfShort);
/* */
/* */ private static native int SpriteMediaSetActionVariable(int paramInt1, int paramInt2, float[] paramArrayOfFloat);
/* */
/* */ private static native int SpriteMediaGetActionVariable(int paramInt1, int paramInt2, float[] paramArrayOfFloat);
/* */
/* */ private static native int SpriteMediaGetIndImageProperty(int paramInt1, short paramShort, int paramInt2, byte[] paramArrayOfByte);
/* */
/* */ private static native int SpriteMediaGetIndImageProperty(int paramInt1, short paramShort, int paramInt2, int[] paramArrayOfInt);
/* */
/* */ private static native int SpriteMediaSetActionVariableToString(int paramInt1, int paramInt2, byte[] paramArrayOfByte);
/* */
/* */ private static native int SpriteMediaGetActionVariableAsString(int paramInt1, int paramInt2, byte[] paramArrayOfByte);
/* */
/* */ private static native int SpriteMediaGetActionVariableAsString(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/* */
/* */ class MyStringHandle extends StringHandle
/* */ {
/* */ protected MyStringHandle(int paramObject, Object paramInt1, int arg4)
/* */ {
/* 394 */ super(paramInt1, i);
/* */ }
/* */ }
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.std.movies.media.SpriteMediaHandler
* JD-Core Version: 0.6.2
*/