Package quicktime.std.qtcomponents

Source Code of quicktime.std.qtcomponents.MovieExporter

/*     */ 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.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.QTHandle;
/*     */ import quicktime.util.QTUtils;
/*     */
/*     */ public final class MovieExporter extends Component
/*     */ {
/*  36 */   private static boolean apriori = QTSession.apriori();
/*     */   private QTCompDispatcher progUPP;
/*     */
/*     */   public MovieExporter(int paramInt)
/*     */     throws QTException
/*     */   {
/*  46 */     super(1936746868, paramInt);
/*  47 */     setProgressProc(null);
/*     */   }
/*     */
/*     */   public MovieExporter(ComponentIdentifier paramComponentIdentifier)
/*     */     throws QTException
/*     */   {
/*  59 */     super(paramComponentIdentifier, 1936746868);
/*  60 */     setProgressProc(null);
/*     */   }
/*     */
/*     */   public void setProgressProc(MovieProgress paramMovieProgress)
/*     */     throws StdQTException
/*     */   {
/*  74 */     int i = 0;
/*  75 */     if (this.progUPP != null)
/*  76 */       this.progUPP.cleanupMethodClosure();
/*  77 */     if (paramMovieProgress != null)
/*     */     {
/*  79 */       this.progUPP = new QTCompDispatcher(paramMovieProgress);
/*     */     }
/*     */     else
/*     */     {
/*  83 */       this.progUPP = new QTCompDispatcher(this);
/*     */     }
/*  85 */     synchronized (QTNative.globalsLock) {
/*  86 */       i = MovieExportSetProgressProc(_ID(), this.progUPP.ID(), 0);
/*     */     }
/*  88 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public void toFile(QTFile paramQTFile, Movie paramMovie, Track paramTrack, int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/* 102 */     int i = 0;
/* 103 */     if (this.progUPP != null) {
/* 104 */       this.progUPP.theCurrentMov = paramMovie;
/*     */     }
/*     */
/* 107 */     synchronized (QTNative.globalsLock) {
/* 108 */       i = MovieExportToFile(_ID(), paramQTFile.getFSSpec(true, 512), QTObject.ID(paramMovie), QTObject.ID(paramTrack), paramInt1, paramInt2);
/*     */     }
/*     */
/* 115 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public QTHandle toHandle(Movie paramMovie, Track paramTrack, int paramInt1, int paramInt2)
/*     */     throws QTException
/*     */   {
/* 128 */     if (this.progUPP != null)
/* 129 */       this.progUPP.theCurrentMov = paramMovie;
/* 130 */     QTHandle localQTHandle = new QTHandle();
/* 131 */     int i = MovieExportToHandle(_ID(), QTObject.ID(localQTHandle), QTObject.ID(paramMovie), QTObject.ID(paramTrack), paramInt1, paramInt2);
/*     */
/* 137 */     StdQTException.checkError(i);
/* 138 */     return localQTHandle;
/*     */   }
/*     */
/*     */   public void toDataRef(DataRef paramDataRef, Movie paramMovie, Track paramTrack, int paramInt1, int paramInt2)
/*     */     throws StdQTException
/*     */   {
/* 152 */     if (this.progUPP != null)
/* 153 */       this.progUPP.theCurrentMov = paramMovie;
/* 154 */     StdQTException.checkError(MovieExportToDataRef(_ID(), QTObject.ID(paramDataRef), paramDataRef.getType(), QTObject.ID(paramMovie), QTObject.ID(paramTrack), paramInt1, paramInt2));
/*     */   }
/*     */
/*     */   public int getAuxiliaryData(QTHandle paramQTHandle)
/*     */     throws StdQTException
/*     */   {
/* 172 */     int[] arrayOfInt = new int[1];
/* 173 */     int i = MovieExportGetAuxiliaryData(_ID(), QTObject.ID(paramQTHandle), arrayOfInt);
/* 174 */     StdQTException.checkError(i);
/* 175 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public void setSampleDescription(SampleDescription paramSampleDescription, int paramInt)
/*     */     throws StdQTException
/*     */   {
/* 185 */     int i = MovieExportSetSampleDescription(_ID(), QTObject.ID(paramSampleDescription), paramInt);
/* 186 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public boolean doUserDialog(Movie paramMovie, Track paramTrack, int paramInt1, int paramInt2)
/*     */     throws StdQTException
/*     */   {
/* 199 */     byte[] arrayOfByte = new byte[1];
/* 200 */     Movie localMovie = paramMovie;
/* 201 */     Track localTrack = paramTrack;
/* 202 */     int i = paramInt1;
/* 203 */     int j = paramInt2;
/* 204 */     int k = _ID();
/*     */
/* 206 */     int m = 0;
/*     */
/* 208 */     if (QTSession.isCurrentOS(4)) {
/* 209 */       m = ((Integer)CarbonAccess.invokeCarbonEventClient(new CarbonEventClient() { private final int val$f_i;
/*     */         private final Movie val$f_theMovie;
/*     */         private final Track val$f_onlyThisTrack;
/*     */         private final int val$f_startTime;
/*     */         private final int val$f_duration;
/*     */         private final byte[] val$canceled;
/*     */
/* 211 */         public Object invoke() { int i = 0;
/* 212 */           synchronized (QTNative.globalsLock) {
/* 213 */             i = MovieExporter.MovieExportDoUserDialog(this.val$f_i, QTObject.ID(this.val$f_theMovie), QTObject.ID(this.val$f_onlyThisTrack), this.val$f_startTime, this.val$f_duration, this.val$canceled);
/*     */           }
/*     */
/* 221 */           return new Integer(i);
/*     */         }
/*     */       })).intValue();
/*     */
/* 224 */       StdQTException.checkError(m);
/*     */     } else {
/* 226 */       synchronized (QTNative.globalsLock) {
/* 227 */         m = MovieExportDoUserDialog(_ID(), QTObject.ID(paramMovie), QTObject.ID(paramTrack), paramInt1, paramInt2, arrayOfByte);
/*     */
/* 233 */         StdQTException.checkError(m);
/*     */       }
/*     */     }
/* 236 */     return arrayOfByte[0] != 0;
/*     */   }
/*     */
/*     */   public int getCreatorType()
/*     */     throws StdQTException
/*     */   {
/* 247 */     int[] arrayOfInt = new int[1];
/* 248 */     int i = MovieExportGetCreatorType(_ID(), arrayOfInt);
/* 249 */     StdQTException.checkError(i);
/* 250 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public boolean validate(Movie paramMovie, Track paramTrack)
/*     */     throws StdQTException
/*     */   {
/* 288 */     if (this.progUPP != null)
/* 289 */       this.progUPP.theCurrentMov = paramMovie;
/* 290 */     byte[] arrayOfByte = { 0 };
/* 291 */     StdQTException.checkError(MovieExportValidate(_ID(), QTObject.ID(paramMovie), QTObject.ID(paramTrack), arrayOfByte));
/*     */
/* 297 */     return arrayOfByte[0] != 0;
/*     */   }
/*     */
/*     */   public AtomContainer getExportSettingsFromAtomContainer()
/*     */     throws StdQTException
/*     */   {
/* 306 */     return AtomContainer.fromMovieExporter(this);
/*     */   }
/*     */
/*     */   public void setExportSettingsFromAtomContainer(AtomContainer paramAtomContainer)
/*     */     throws StdQTException
/*     */   {
/* 315 */     int i = MovieExportSetSettingsFromAtomContainer(_ID(), QTObject.ID(paramAtomContainer));
/* 316 */     StdQTException.checkError(i);
/*     */   }
/*     */
/*     */   public final int getExportFileNameExtension()
/*     */     throws StdQTException
/*     */   {
/* 326 */     int[] arrayOfInt = new int[1];
/* 327 */     int i = MovieExportGetFileNameExtension(_ID(), arrayOfInt);
/* 328 */     StdQTException.checkError(i);
/* 329 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   public final String getExportShortFileTypeString()
/*     */     throws StdQTException
/*     */   {
/* 338 */     byte[] arrayOfByte = new byte[256];
/* 339 */     int i = MovieExportGetShortFileTypeString(_ID(), arrayOfByte);
/* 340 */     StdQTException.checkError(i);
/* 341 */     return QTUtils.PString2String(arrayOfByte, 0);
/*     */   }
/*     */
/*     */   public final int getExportSourceMediaType()
/*     */     throws StdQTException
/*     */   {
/* 354 */     int[] arrayOfInt = new int[1];
/* 355 */     int i = MovieExportGetSourceMediaType(_ID(), arrayOfInt);
/* 356 */     StdQTException.checkError(i);
/* 357 */     return arrayOfInt[0];
/*     */   }
/*     */
/*     */   protected void _dispose() throws QTException {
/*     */     try {
/* 362 */       synchronized (QTNative.globalsLock) {
/* 363 */         MovieExportSetProgressProc(_ID(), 0, 0);
/*     */       }
/*     */     } catch (QTNullPointerException localQTNullPointerException) {  }
/*     */
/* 366 */     if (this.progUPP != null)
/* 367 */       this.progUPP.cleanupMethodClosure();
/* 368 */     this.progUPP = null;
/*     */   }
/*     */
/*     */   private static native int MovieExportToHandle(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6);
/*     */
/*     */   private static native int MovieExportToDataRef(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7);
/*     */
/*     */   private static native int MovieExportGetAuxiliaryData(int paramInt1, int paramInt2, int[] paramArrayOfInt);
/*     */
/*     */   private static native int MovieExportSetProgressProc(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native int MovieExportSetSampleDescription(int paramInt1, int paramInt2, int paramInt3);
/*     */
/*     */   private static native int MovieExportDoUserDialog(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, byte[] paramArrayOfByte);
/*     */
/*     */   private static native int MovieExportGetCreatorType(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native int MovieExportValidate(int paramInt1, int paramInt2, int paramInt3, byte[] paramArrayOfByte);
/*     */
/*     */   private static native int MovieExportSetSettingsFromAtomContainer(int paramInt1, int paramInt2);
/*     */
/*     */   private static native int MovieExportGetFileNameExtension(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native int MovieExportGetShortFileTypeString(int paramInt, byte[] paramArrayOfByte);
/*     */
/*     */   private static native int MovieExportGetSourceMediaType(int paramInt, int[] paramArrayOfInt);
/*     */
/*     */   private static native int MovieExportToFile(int paramInt1, byte[] paramArrayOfByte, int paramInt2, int paramInt3, int paramInt4, int paramInt5);
/*     */ }

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

Related Classes of quicktime.std.qtcomponents.MovieExporter

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.