/* */ package quicktime.std.movies.media;
/* */
/* */ import quicktime.QTException;
/* */ import quicktime.QTObject;
/* */ import quicktime.QTSession;
/* */ import quicktime.std.StdQTException;
/* */ import quicktime.std.image.GraphicsExporter;
/* */ import quicktime.std.movies.Movie;
/* */ import quicktime.std.movies.Track;
/* */ import quicktime.std.qtcomponents.TimeCodeDescription;
/* */ import quicktime.std.qtcomponents.TimeCoder;
/* */ import quicktime.std.sg.SGChannel;
/* */ import quicktime.std.sg.SequenceGrabber;
/* */ import quicktime.util.QTHandle;
/* */ import quicktime.util.QTHandleRef;
/* */ import quicktime.util.QTPointer;
/* */ import quicktime.util.QTPointerRef;
/* */
/* */ public final class UserData extends QTObject
/* */ {
/* 34 */ private static boolean apriori = QTSession.apriori();
/* */
/* */ public static UserData fromGraphicsExporter(GraphicsExporter paramGraphicsExporter)
/* */ throws StdQTException
/* */ {
/* 44 */ int[] arrayOfInt = new int[1];
/* 45 */ int i = GraphicsExportGetMetaData(QTObject.ID(paramGraphicsExporter), arrayOfInt);
/* 46 */ StdQTException.checkError(i);
/* 47 */ return new UserData(arrayOfInt[0], paramGraphicsExporter);
/* */ }
/* */
/* */ public static UserData fromMovie(Movie paramMovie)
/* */ throws StdQTException
/* */ {
/* 57 */ int i = GetMovieUserData(QTObject.ID(paramMovie));
/* 58 */ StdQTException.checkError(GetMoviesError());
/* 59 */ return new UserData(i, paramMovie);
/* */ }
/* */
/* */ public static UserData fromSequenceGrabber(SequenceGrabber paramSequenceGrabber)
/* */ throws StdQTException
/* */ {
/* 71 */ int[] arrayOfInt = new int[1];
/* 72 */ int i = SGGetSettings(QTObject.ID(paramSequenceGrabber), arrayOfInt, 0);
/* */
/* 75 */ StdQTException.checkError(i);
/* 76 */ return new UserData(arrayOfInt[0], null);
/* */ }
/* */
/* */ public static UserData fromSGChannel(SGChannel paramSGChannel)
/* */ throws StdQTException
/* */ {
/* 87 */ int[] arrayOfInt = new int[1];
/* 88 */ int i = SGGetChannelSettings(QTObject.ID(paramSGChannel.getSequenceGrabber()), QTObject.ID(paramSGChannel), arrayOfInt, 0);
/* */
/* 92 */ StdQTException.checkError(i);
/* 93 */ return new UserData(arrayOfInt[0], null);
/* */ }
/* */
/* */ public static UserData fromTrack(Track paramTrack)
/* */ throws StdQTException
/* */ {
/* 103 */ int i = GetTrackUserData(QTObject.ID(paramTrack));
/* 104 */ StdQTException.checkError(GetMoviesError());
/* 105 */ return i == 0 ? null : new UserData(i, paramTrack);
/* */ }
/* */
/* */ public static UserData fromMedia(Media paramMedia)
/* */ throws StdQTException
/* */ {
/* 115 */ int i = GetMediaUserData(QTObject.ID(paramMedia));
/* 116 */ StdQTException.checkError(GetMoviesError());
/* 117 */ return new UserData(i, paramMedia);
/* */ }
/* */
/* */ public static UserData fromTimeCoderSource(TimeCoder paramTimeCoder, TimeCodeDescription paramTimeCodeDescription)
/* */ throws StdQTException
/* */ {
/* 129 */ int[] arrayOfInt = new int[1];
/* 130 */ StdQTException.checkError(TCGetSourceRef(QTObject.ID(paramTimeCoder), QTObject.ID(paramTimeCodeDescription), arrayOfInt));
/* */
/* 132 */ return new UserData(arrayOfInt[0], null);
/* */ }
/* */
/* */ public UserData()
/* */ throws StdQTException
/* */ {
/* 140 */ this(allocate(), null);
/* */ }
/* */
/* */ public UserData(QTHandle paramQTHandle)
/* */ throws StdQTException
/* */ {
/* 149 */ this(allocate(paramQTHandle), null);
/* */ }
/* */
/* */ private UserData(int paramInt, Object paramObject)
/* */ {
/* 158 */ super(paramInt, paramObject);
/* */ }
/* */
/* */ private static int allocate() throws StdQTException {
/* 162 */ int[] arrayOfInt = new int[1];
/* 163 */ int i = NewUserData(arrayOfInt);
/* 164 */ StdQTException.checkError(i);
/* 165 */ return arrayOfInt[0];
/* */ }
/* */
/* */ private static int allocate(QTHandle paramQTHandle) throws StdQTException {
/* 169 */ int[] arrayOfInt = new int[1];
/* 170 */ int i = NewUserDataFromHandle(QTObject.ID(paramQTHandle), arrayOfInt);
/* 171 */ StdQTException.checkError(i);
/* 172 */ return arrayOfInt[0];
/* */ }
/* */
/* */ public QTHandle putIntoHandle()
/* */ throws QTException
/* */ {
/* 181 */ QTHandle localQTHandle = new QTHandle();
/* 182 */ int i = PutUserDataIntoHandle(_ID(), QTObject.ID(localQTHandle));
/* 183 */ StdQTException.checkError(i);
/* 184 */ return localQTHandle;
/* */ }
/* */
/* */ public QTHandle getData(int paramInt1, int paramInt2)
/* */ throws QTException
/* */ {
/* 195 */ QTHandle localQTHandle = new QTHandle();
/* 196 */ int i = GetUserData(_ID(), QTObject.ID(localQTHandle), paramInt1, paramInt2);
/* 197 */ StdQTException.checkError(i);
/* 198 */ return localQTHandle;
/* */ }
/* */
/* */ public void addData(QTHandleRef paramQTHandleRef, int paramInt)
/* */ throws StdQTException
/* */ {
/* 208 */ int i = AddUserData(_ID(), QTObject.ID(paramQTHandleRef), paramInt);
/* 209 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public void removeData(int paramInt1, int paramInt2)
/* */ throws StdQTException
/* */ {
/* 219 */ int i = RemoveUserData(_ID(), paramInt1, paramInt2);
/* 220 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public int countType(int paramInt)
/* */ throws StdQTException
/* */ {
/* 230 */ int i = CountUserDataType(_ID(), paramInt);
/* 231 */ StdQTException.checkError(GetMoviesError());
/* 232 */ return i;
/* */ }
/* */
/* */ public int getNextType(int paramInt)
/* */ throws StdQTException
/* */ {
/* 242 */ int i = GetNextUserDataType(_ID(), paramInt);
/* 243 */ StdQTException.checkError(GetMoviesError());
/* 244 */ return i;
/* */ }
/* */
/* */ public QTPointer getDataItem(int paramInt1, int paramInt2, int paramInt3)
/* */ throws QTException
/* */ {
/* 256 */ QTPointer localQTPointer = new QTPointer(paramInt1, true);
/* 257 */ int i = GetUserDataItem(_ID(), QTObject.ID(localQTPointer), localQTPointer.getSize(), paramInt2, paramInt3);
/* */
/* 262 */ StdQTException.checkError(i);
/* 263 */ return localQTPointer;
/* */ }
/* */
/* */ public void setDataItem(QTPointerRef paramQTPointerRef, int paramInt1, int paramInt2)
/* */ throws StdQTException
/* */ {
/* 274 */ int i = SetUserDataItem(_ID(), QTObject.ID(paramQTPointerRef), paramQTPointerRef.getSize(), paramInt1, paramInt2);
/* */
/* 278 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public void addText(QTHandleRef paramQTHandleRef, int paramInt1, int paramInt2, int paramInt3)
/* */ throws StdQTException
/* */ {
/* 290 */ int i = AddUserDataText(_ID(), QTObject.ID(paramQTHandleRef), paramInt1, paramInt2, (short)paramInt3);
/* */
/* 295 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public void addText(String paramString, int paramInt1, int paramInt2, int paramInt3)
/* */ throws StdQTException
/* */ {
/* 307 */ int i = NewHandle(paramString.length());
/* 308 */ byte[] arrayOfByte = new byte[paramString.length()];
/* 309 */ paramString.getBytes(0, paramString.length(), arrayOfByte, 0);
/* 310 */ HLock(i);
/* 311 */ int j = getIntFromPointer(i, 0);
/* 312 */ copyArrayToPointer(arrayOfByte, 0, j, 0, paramString.length());
/* 313 */ int k = AddUserDataText(_ID(), i, paramInt1, paramInt2, (short)paramInt3);
/* */
/* 318 */ DisposeHandle(i);
/* 319 */ StdQTException.checkError(k);
/* */ }
/* */
/* */ /** @deprecated */
/* */ public QTHandle getText(int paramInt1, int paramInt2, short paramShort)
/* */ throws QTException
/* */ {
/* 332 */ QTHandle localQTHandle = new QTHandle();
/* 333 */ int i = GetUserDataText(_ID(), QTObject.ID(localQTHandle), paramInt1, paramInt2, paramShort);
/* */
/* 338 */ StdQTException.checkError(i);
/* 339 */ return localQTHandle;
/* */ }
/* */
/* */ public String getTextAsString(int paramInt1, int paramInt2, int paramInt3)
/* */ throws QTException
/* */ {
/* 351 */ int i = NewHandle(4);
/* 352 */ int j = GetUserDataText(_ID(), i, paramInt1, paramInt2, (short)paramInt3);
/* */
/* 357 */ if (j == 0) {
/* 358 */ byte[] arrayOfByte = new byte[GetHandleSize(i)];
/* 359 */ HLock(i);
/* 360 */ copyPointerToArray(getIntFromPointer(i, 0), 0, arrayOfByte, 0, arrayOfByte.length);
/* 361 */ DisposeHandle(i);
/* 362 */ return new String(arrayOfByte);
/* */ }
/* 364 */ throw new StdQTException(j);
/* */ }
/* */
/* */ public void removeText(int paramInt1, int paramInt2, int paramInt3)
/* */ throws StdQTException
/* */ {
/* 375 */ int i = RemoveUserDataText(_ID(), paramInt1, paramInt2, (short)paramInt3);
/* */
/* 379 */ StdQTException.checkError(i);
/* */ }
/* */
/* */ public void copyFromUserData(UserData paramUserData, boolean paramBoolean)
/* */ throws StdQTException
/* */ {
/* 389 */ StdQTException.checkError(CopyUserData(_ID(), QTObject.ID(paramUserData), paramBoolean == true ? 1919970403 : 1835361639));
/* */ }
/* */
/* */ public void copyToUserData(UserData paramUserData, boolean paramBoolean)
/* */ throws StdQTException
/* */ {
/* 401 */ StdQTException.checkError(CopyUserData(QTObject.ID(paramUserData), _ID(), paramBoolean == true ? 1919970403 : 1835361639));
/* */ }
/* */
/* */ public static void copyUserData(UserData paramUserData1, UserData paramUserData2, int paramInt)
/* */ throws StdQTException
/* */ {
/* 415 */ StdQTException.checkError(CopyUserData(QTObject.ID(paramUserData1), QTObject.ID(paramUserData2), paramInt));
/* */ }
/* */
/* */ private static native void copyArrayToPointer(byte[] paramArrayOfByte, int paramInt1, int paramInt2, int paramInt3, int paramInt4);
/* */
/* */ private static native void copyPointerToArray(int paramInt1, int paramInt2, byte[] paramArrayOfByte, int paramInt3, int paramInt4);
/* */
/* */ private static native int NewHandle(int paramInt);
/* */
/* */ private static native int GetHandleSize(int paramInt);
/* */
/* */ private static native void DisposeHandle(int paramInt);
/* */
/* */ private static native int getIntFromPointer(int paramInt1, int paramInt2);
/* */
/* */ private static native void HLock(int paramInt);
/* */
/* */ private static native int TCGetSourceRef(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/* */
/* */ private static native int GraphicsExportGetMetaData(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native int GetMovieUserData(int paramInt);
/* */
/* */ private static native short GetMoviesError();
/* */
/* */ private static native int SGGetSettings(int paramInt1, int[] paramArrayOfInt, int paramInt2);
/* */
/* */ private static native int SGGetChannelSettings(int paramInt1, int paramInt2, int[] paramArrayOfInt, int paramInt3);
/* */
/* */ private static native int GetTrackUserData(int paramInt);
/* */
/* */ private static native int GetMediaUserData(int paramInt);
/* */
/* */ private static native short NewUserData(int[] paramArrayOfInt);
/* */
/* */ private static native short NewUserDataFromHandle(int paramInt, int[] paramArrayOfInt);
/* */
/* */ private static native short PutUserDataIntoHandle(int paramInt1, int paramInt2);
/* */
/* */ private static native short GetUserData(int paramInt1, int paramInt2, int paramInt3, int paramInt4);
/* */
/* */ private static native short AddUserData(int paramInt1, int paramInt2, int paramInt3);
/* */
/* */ private static native short RemoveUserData(int paramInt1, int paramInt2, int paramInt3);
/* */
/* */ private static native short CountUserDataType(int paramInt1, int paramInt2);
/* */
/* */ private static native int GetNextUserDataType(int paramInt1, int paramInt2);
/* */
/* */ private static native short GetUserDataItem(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5);
/* */
/* */ private static native short SetUserDataItem(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5);
/* */
/* */ private static native short AddUserDataText(int paramInt1, int paramInt2, int paramInt3, int paramInt4, short paramShort);
/* */
/* */ private static native short GetUserDataText(int paramInt1, int paramInt2, int paramInt3, int paramInt4, short paramShort);
/* */
/* */ private static native short RemoveUserDataText(int paramInt1, int paramInt2, int paramInt3, short paramShort);
/* */
/* */ private static native int MediaSetGraphicsMode(int paramInt1, int paramInt2, byte[] paramArrayOfByte);
/* */
/* */ private static native int MediaGetGraphicsMode(int paramInt, int[] paramArrayOfInt, byte[] paramArrayOfByte);
/* */
/* */ private static native int MediaGetTrackOpaque(int paramInt, byte[] paramArrayOfByte);
/* */
/* */ private static native short CopyUserData(int paramInt1, int paramInt2, int paramInt3);
/* */ }
/* Location: Z:\System\Library\Java\Extensions\QTJava.zip
* Qualified Name: quicktime.std.movies.media.UserData
* JD-Core Version: 0.6.2
*/