Package quicktime.std.qtcomponents

Source Code of quicktime.std.qtcomponents.MovieImporter

/*     */ package quicktime.std.qtcomponents;
/*     */
/*     */ import com.apple.mrj.macos.carbon.CarbonAccess;
/*     */ import com.apple.mrj.macos.carbon.CarbonEventClient;
/*     */ import quicktime.QTException;
/*     */ import quicktime.QTNullPointerException;
/*     */ import quicktime.QTObject;
/*     */ import quicktime.QTSession;
/*     */ import quicktime.io.AliasHandle;
/*     */ import quicktime.io.QTFile;
/*     */ import quicktime.jdirect.QTNative;
/*     */ import quicktime.std.StdQTException;
/*     */ import quicktime.std.comp.Component;
/*     */ import quicktime.std.comp.ComponentIdentifier;
/*     */ import quicktime.std.movies.AtomContainer;
/*     */ import quicktime.std.movies.Movie;
/*     */ import quicktime.std.movies.MovieProgress;
/*     */ import quicktime.std.movies.Track;
/*     */ import quicktime.std.movies.media.DataRef;
/*     */ import quicktime.std.movies.media.SampleDescription;
/*     */ import quicktime.util.QTHandleRef;
/*     */ import quicktime.util.QTUtils;
/*     */ import quicktime.util.StringHandle;
/*     */
/*     */ public final class MovieImporter extends Component
/*     */ {
/*  36 */   private static boolean apriori = QTSession.apriori();
/*     */   private QTCompDispatcher progUPP;
/* 124 */   private static Object dontOpenComponent = new Object();
/*     */
/* 293 */   int res = 0;
/*     */
/*     */   public static MovieImporter fromTrack(Track paramTrack)
/*     */     throws StdQTException
/*     */   {
/*  45 */     int i = IsScrapMovie(QTObject.ID(paramTrack));
/*  46 */     StdQTException.checkError(GetMoviesError());
/*  47 */     return new MovieImporter(i, null);
/*     */   }
/*     */
/*     */   private MovieImporter(int paramInt, Object paramObject) throws StdQTException {
/*  51 */     super(paramInt, paramObject);
/*     */   }
/*     */
/*     */   public MovieImporter()
/*     */     throws QTException
/*     */   {
/*  59 */     this(0);
/*     */   }
/*     */
/*     */   public MovieImporter(int paramInt)
/*     */     throws QTException
/*     */   {
/*  68 */     super(1700885536, paramInt);
/*     */   }
/*     */
/*     */   public MovieImporter(ComponentIdentifier paramComponentIdentifier)
/*     */     throws QTException
/*     */   {
/*  78 */     super(paramComponentIdentifier, 1700885536);
/*     */   }
/*     */
/*     */   public MovieImporter(DataRef paramDataRef, int paramInt)
/*     */     throws QTException
/*     */   {
/*  89 */     this(allocate(paramDataRef, paramInt), dontOpenComponent);
/*     */   }
/*     */
/*     */   public MovieImporter(DataRef paramDataRef, int paramInt, String paramString)
/*     */     throws QTException
/*     */   {
/* 102 */     this(allocate(paramDataRef, paramInt, paramString), dontOpenComponent);
/*     */   }
/*     */
/*     */   private static int allocate(DataRef paramDataRef, int paramInt) throws StdQTException {
/* 106 */     int[] arrayOfInt = { 0 };
/* 107 */     StdQTException.checkError(GetMovieImporterForDataRef(paramDataRef.getType(), QTObject.ID(paramDataRef), paramInt, arrayOfInt));
/*     */
/* 110 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   private static int allocate(DataRef paramDataRef, int paramInt, String paramString) throws QTException {
/* 114 */     int[] arrayOfInt = { 0 };
/* 115 */     StringHandle localStringHandle = new StringHandle("X." + paramString, 2);
/* 116 */     paramDataRef.concatenate(localStringHandle);
/* 117 */     StdQTException.checkError(GetMovieImporterForDataRef(paramDataRef.getType(), QTObject.ID(paramDataRef), paramInt, arrayOfInt));
/*     */
/* 120 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public MovieImportInfo fromFile(QTFile paramQTFile, Movie paramMovie, Track paramTrack, int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/* 138 */     if (this.progUPP != null)
/* 139 */       this.progUPP.theCurrentMov = paramMovie;
/* 140 */     return Track.fromMovieImporterFile(this, paramQTFile, paramMovie, paramTrack, paramInt1, paramInt2);
/*     */   }
/*     */
/*     */   public MovieImportInfo fromHandle(QTHandleRef paramQTHandleRef, Movie paramMovie, Track paramTrack, int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/* 154 */     if (this.progUPP != null)
/* 155 */       this.progUPP.theCurrentMov = paramMovie;
/* 156 */     return Track.fromMovieImporterHandle(this, paramQTHandleRef, paramMovie, paramTrack, paramInt1, paramInt2);
/*     */   }
/*     */
/*     */   public MovieImportInfo fromDataRef(DataRef paramDataRef, Movie paramMovie, Track paramTrack, int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/* 172 */     if (this.progUPP != null)
/* 173 */       this.progUPP.theCurrentMov = paramMovie;
/* 174 */     return Track.fromMovieImporterDataRef(this, paramDataRef, paramMovie, paramTrack, paramInt1, paramInt2);
/*     */   }
/*     */
/*     */   public void setSampleDuration(int paramInt1, int paramInt2)
/*     */     throws StdQTException
/*     */   {
/* 184 */     int i = MovieImportSetSampleDuration(_ID(), paramInt1, paramInt2);
/* 185 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public void setSampleDescription(SampleDescription paramSampleDescription, int paramInt)
/*     */     throws StdQTException
/*     */   {
/* 195 */     int i = MovieImportSetSampleDescription(_ID(), QTObject.ID(paramSampleDescription), paramInt);
/*     */
/* 198 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public void setMediaFile(AliasHandle paramAliasHandle)
/*     */     throws QTException
/*     */   {
/* 207 */     int i = MovieImportSetMediaFile(_ID(), QTObject.ID(paramAliasHandle));
/* 208 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public void setDimensions(float paramFloat1, float paramFloat2)
/*     */     throws StdQTException
/*     */   {
/* 218 */     int i = MovieImportSetDimensions(_ID(), QTUtils.X2Fix(paramFloat1), QTUtils.X2Fix(paramFloat2));
/*     */
/* 221 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public void setChunkSize(int paramInt)
/*     */     throws StdQTException
/*     */   {
/* 230 */     int i = MovieImportSetChunkSize(_ID(), paramInt);
/* 231 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public void setProgressProc(MovieProgress paramMovieProgress)
/*     */     throws StdQTException
/*     */   {
/* 242 */     if (paramMovieProgress == null) {
/* 243 */       removeProgressProc();
/* 244 */       return;
/*     */     }
/*     */
/* 247 */     if (this.progUPP != null) {
/* 248 */       removeProgressProc();
/*     */     }
/* 250 */     this.progUPP = new QTCompDispatcher(paramMovieProgress);
/*     */
/* 252 */     int i = MovieImportSetProgressProc(_ID(), this.progUPP.ID(), 0);
/* 253 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public void removeProgressProc()
/*     */     throws StdQTException
/*     */   {
/* 262 */     int i = MovieImportSetProgressProc(_ID(), 0, 0);
/* 263 */     if (this.progUPP != null) {
/* 264 */       this.progUPP.cleanupMethodClosure();
/* 265 */       this.progUPP = null;
/*     */     }
/* 267 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public void setAuxiliaryData(QTHandleRef paramQTHandleRef, int paramInt)
/*     */     throws StdQTException
/*     */   {
/* 277 */     int i = MovieImportSetAuxiliaryData(_ID(), QTObject.ID(paramQTHandleRef), paramInt);
/*     */
/* 280 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public void setFromScrap(boolean paramBoolean)
/*     */     throws StdQTException
/*     */   {
/* 289 */     byte b = (byte)(paramBoolean ? 1 : 0);
/* 290 */     int i = MovieImportSetFromScrap(_ID(), b);
/* 291 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public boolean doUserDialog(QTFile paramQTFile)
/*     */     throws QTException
/*     */   {
/* 302 */     byte[] arrayOfByte1 = new byte[1];
/* 303 */     byte[] arrayOfByte2 = paramQTFile.getFSSpec(true, 256);
/* 304 */     int i = _ID();
/* 305 */     int j = 0;
/*     */
/* 307 */     if (QTSession.isCurrentOS(4)) {
/* 308 */       j = ((Integer)CarbonAccess.invokeCarbonEventClient(new CarbonEventClient() { private final int val$f_i;
/*     */         private final byte[] val$f_fileIn;
/*     */         private final byte[] val$canceled;
/*     */
/* 310 */         public Object invoke() { int i = 0;
/* 311 */           synchronized (QTNative.globalsLock) {
/* 312 */             i = MovieImporter.MovieImportDoUserDialog(this.val$f_i, this.val$f_fileIn, 0, this.val$canceled);
/*     */           }
/*     */
/* 317 */           return new Integer(i);
/*     */         }
/*     */       })).intValue();
/*     */
/* 320 */       StdQTException.checkError(j);
/* 321 */       return arrayOfByte1[0] != 0;
/*     */     }
/* 323 */     synchronized (QTNative.globalsLock) {
/* 324 */       j = MovieImportDoUserDialog(_ID(), paramQTFile.getFSSpec(true, 256), 0, arrayOfByte1);
/*     */
/* 328 */       StdQTException.checkError(j);
/*     */     }
/* 330 */     return arrayOfByte1[0] != 0;
/*     */   }
/*     */
/*     */   public boolean doUserDialog(QTHandleRef paramQTHandleRef)
/*     */     throws QTException
/*     */   {
/* 341 */     byte[] arrayOfByte = new byte[1];
/* 342 */     synchronized (QTNative.globalsLock) {
/* 343 */       int i = MovieImportDoUserDialog(_ID(), null, QTObject.ID(paramQTHandleRef), arrayOfByte);
/*     */
/* 347 */       StdQTException.checkError(i);
/*     */     }
/* 349 */     return arrayOfByte[0] != 0;
/*     */   }
/*     */
/*     */   public void setDuration(int paramInt)
/*     */     throws StdQTException
/*     */   {
/* 359 */     int i = MovieImportSetDuration(_ID(), paramInt);
/* 360 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public int getAuxiliaryDataType()
/*     */     throws StdQTException
/*     */   {
/* 369 */     int[] arrayOfInt = new int[1];
/* 370 */     int i = MovieImportGetAuxiliaryDataType(_ID(), arrayOfInt);
/* 371 */     StdQTException.checkError(i);
/* 372 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public boolean validate(QTFile paramQTFile)
/*     */     throws QTException
/*     */   {
/* 382 */     byte[] arrayOfByte = new byte[1];
/* 383 */     int i = MovieImportValidate(_ID(), paramQTFile.getFSSpec(true, 256), 0, arrayOfByte);
/*     */
/* 387 */     StdQTException.checkError(i);
/* 388 */     return arrayOfByte[0] != 0;
/*     */   }
/*     */
/*     */   public boolean validate(QTHandleRef paramQTHandleRef)
/*     */     throws QTException
/*     */   {
/* 398 */     byte[] arrayOfByte = new byte[1];
/* 399 */     int i = MovieImportValidate(_ID(), null, QTObject.ID(paramQTHandleRef), arrayOfByte);
/*     */
/* 403 */     StdQTException.checkError(i);
/* 404 */     return arrayOfByte[0] != 0;
/*     */   }
/*     */
/*     */   public int getFileType()
/*     */     throws StdQTException
/*     */   {
/* 413 */     int[] arrayOfInt = new int[1];
/* 414 */     int i = MovieImportGetFileType(_ID(), arrayOfInt);
/* 415 */     StdQTException.checkError(i);
/* 416 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public SampleDescription getSampleDescription()
/*     */     throws StdQTException
/*     */   {
/* 425 */     return SampleDescription.fromMovieImporter(this);
/*     */   }
/*     */
/*     */   public int getMediaType()
/*     */     throws StdQTException
/*     */   {
/* 434 */     int[] arrayOfInt1 = new int[1];
/* 435 */     int[] arrayOfInt2 = new int[1];
/* 436 */     int i = MovieImportGetSampleDescription(_ID(), arrayOfInt1, arrayOfInt2);
/* 437 */     StdQTException.checkError(i);
/* 438 */     return arrayOfInt2[0];
/*     */   }
/*     */
/*     */   public AtomContainer getMIMETypeList()
/*     */     throws StdQTException
/*     */   {
/* 447 */     return AtomContainer.fromMovieImporterMIME(this);
/*     */   }
/*     */
/*     */   public void setOffsetAndLimit(int paramInt1, int paramInt2)
/*     */     throws StdQTException
/*     */   {
/* 457 */     StdQTException.checkError(MovieImportSetOffsetAndLimit(_ID(), paramInt1, paramInt2));
/*     */   }
/*     */
/*     */   public void setImportSettingsFromAtomContainer(AtomContainer paramAtomContainer)
/*     */     throws StdQTException
/*     */   {
/* 468 */     int i = MovieImportSetSettingsFromAtomContainer(_ID(), QTObject.ID(paramAtomContainer));
/* 469 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public AtomContainer getImportSettingsFromAtomContainer()
/*     */     throws StdQTException
/*     */   {
/* 478 */     return AtomContainer.fromMovieImporterSettings(this);
/*     */   }
/*     */
/*     */   public void setNewMovieFlags(int paramInt)
/*     */     throws StdQTException
/*     */   {
/* 487 */     int i = MovieImportSetNewMovieFlags(_ID(), paramInt);
/* 488 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   protected void _dispose() throws QTException {
/*     */     try {
/* 493 */       MovieImportSetProgressProc(_ID(), 0, 0); } catch (QTNullPointerException localQTNullPointerException) {
/*     */     }
/* 495 */     if (this.progUPP != null)
/* 496 */       this.progUPP.cleanupMethodClosure();
/* 497 */     this.progUPP = null;
/*     */   }
/*     */
/*     */   private static native int IsScrapMovie(int paramInt);
/*     */
/*     */   private static native short GetMoviesError();
/*     */
/*     */   private static native short GetMovieImporterForDataRef(int paramInt1, int paramInt2, int paramInt3, int[] paramArrayOfInt);
/*     */
/*     */   private static native int MovieImportSetSampleDuration(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native int MovieImportSetSampleDescription(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native int MovieImportSetMediaFile(int paramInt1, int paramInt2);
/*     */
/*     */   private static native int MovieImportSetDimensions(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native int MovieImportSetChunkSize(int paramInt1, int paramInt2);
/*     */
/*     */   private static native int MovieImportSetProgressProc(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native int MovieImportSetAuxiliaryData(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native int MovieImportSetFromScrap(int paramInt, byte paramByte);
/*     */
/*     */   private static native int MovieImportDoUserDialog(int paramInt1, byte[] paramArrayOfByte1, int paramInt2, byte[] paramArrayOfByte2);
/*     */
/*     */   private static native int MovieImportSetDuration(int paramInt1, int paramInt2);
/*     */
/*     */   private static native int MovieImportGetAuxiliaryDataType(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native int MovieImportValidate(int paramInt1, byte[] paramArrayOfByte1, int paramInt2, byte[] paramArrayOfByte2);
/*     */
/*     */   private static native int MovieImportGetFileType(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native int MovieImportGetSampleDescription(int paramInt, int[] paramArrayOfInt1, int[] paramArrayOfInt2);
/*     */
/*     */   private static native int MovieImportSetOffsetAndLimit(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native int MovieImportSetSettingsFromAtomContainer(int paramInt1, int paramInt2);
/*     */
/*     */   private static native int MovieImportSetNewMovieFlags(int paramInt1, int paramInt2);
/*     */ }

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

Related Classes of quicktime.std.qtcomponents.MovieImporter

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.